Submit | All submissions | Best solutions | Back to list |
GOV02 - Good |
The problem is very easy.
You are given n terms ( the terms can be integer as well as floating ). Let S = sum of all the n terms. A number k (x<=k<=y) is said to be good if S is divisible by it.
Input
Input begins with an integer t.
Then t test cases follow.
For each test case, three numbers n,x,y are given. Then n terms of the sequence follow.
(REMEMBER: all the input is on a single line)
Output
For each test case,
You have to output a single integer m.
where, m = (sum of all even good numbers) - ( number of all odd good numbers)
(REMEMBER: all the output should be on a single line)
The numbers should be separated by spaces.
Example
Input: 2 3 1 2 1 2 3 4 1 10.5 -1 4.5 4.5 4 Output:
1 10
Scoring:
Your task is to minimise the source code length.
The less your fingers work, more you gain.
Remember:
Only python 2.7 is permitted. Sorry in advance, I will not allow any other language.
Source limit is tight. So be careful.
Constraints:
1<=t<=10
1<=n<=100
-100<=any term of sequence<=100
0<x<=y<=100
Added by: | Govind Lahoti |
Date: | 2013-01-07 |
Time limit: | 0.5s |
Source limit: | 200B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | PYTHON |
Resource: | self |
hide comments
|
|||||
2015-02-16 14:49:29 Mitch Schwartz
@]V[AgN3To: I think the given cases are sufficient. If your code is mostly correct but fails for some tricky cases, I don't know what they would be; my initial approach (once I understood what the author wanted) was straightforward and passed. |
|||||
2015-02-16 14:49:29 Aditya Pande
NZEC after running(2)...? shouldn't raw_input() and split() work ? Last edit: 2013-01-16 02:14:54 |
|||||
2015-02-16 14:49:29 Tushar Makkar (Retired)
Can somebody explain me How the answer of 2nd case is 10 ? @Mitch and @Govind : Can u give an example which satisfies all the constraints ? |
|||||
2015-02-16 14:49:29 Aditya Pande
why am i getting NZEC....?? please help.... i hope to have done it right... please help. it has been hard enough to get it into 200 bytes EDIT: >>>NZEC again and again...? Last edit: 2013-01-11 11:42:17 |