Submit | All submissions | Best solutions | Back to list |
PROBLEM1 - MODULUS |
Given an integer n print all the possibilities of a % n.
Input
The first line consists of an integer t, the number of test cases followed by t lines containing an integer n.
Output
For each test case print all the possibilities of a%n in descending order separated by a single space. After each test case print a new line character. If there are no possibilities print "NOT POSSIBLE".
Constraints
0 < t <= 100
0 <= N <= 100
Example
Input: 2 1 2 Output: 0 1 0
Added by: | cegprakash |
Date: | 2011-03-01 |
Time limit: | 1s |
Source limit: | 250B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All |
hide comments
2013-05-17 22:01:14 Julian Leyh
code didn't get submitted, tells me it's more than 250B, but it is exactly 250B. cegprakash: when you copy and paste your code a '\n' might have been added. check that before submitting Last edit: 2012-05-10 02:44:37 |
|
2013-05-17 22:01:14 YatsukoYin
why Python - yes, but ruby or perl - no? wtf...? unfair. |
|
2013-05-17 22:01:14 hendrik
What about Brainfuck as only allowed language? |
|
2013-05-17 22:01:14 Karl-Aksel Puulmann
As others have said, this should be in tutorial. |
|
2013-05-17 22:01:14 :(){ :|: & };:
Tutorial problem with score as the length of the source. |
|
2013-05-17 22:01:14 Michael T
Should be tutorial. Last edit: 2011-03-07 13:01:33 |