MODULUS2 - BF_MODULUS
See also http://www.spoj.com/problems/PROBLEM1/
Problem
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".
Input specifications:
0<t<=100
0<=N<=100
Time limit: 1 second
Example
Sample Input
2
1
2
Sample Output
0
1 0
hide comments
Mitch Schwartz:
2013-05-27 03:59:39
@Jitesh: Look for -1. |
|
Jitesh:
2013-05-27 03:59:39
Can someone tell me how to check for EOF.
|
|
Mostafa 36a2:
2013-05-27 03:59:39
@Mitch Schwartz thanks Man :))
|
|
Mitch Schwartz:
2013-05-27 03:59:39
@Mostafa: Yes that's right. It's made clear in the comments but not in the problem statement. |
|
Mostafa 36a2:
2013-05-27 03:59:39
TLE!!!
|
|
(Tjandra Satria Gunawan)(曾毅昆):
2013-05-27 03:59:39
@cegprakash: can you tell me why my code getting Wrong Answer (ID: 7366784)? Last edit: 2012-07-24 14:10:34 |
|
cegprakash:
2013-05-27 03:59:39
@Jitesh: there are no other characters after the last test case |
|
Jitesh:
2013-05-27 03:59:39
Is there any extra character at the end of line......Getting a TLE again and again......And its just because of input....Otherwise logic wise I don't think it'll give me a TLE.......Please help........
|
|
Jitesh:
2013-05-27 03:59:39
I'm assuming two '\n's after every test case and only one for the last case and its running fine on my PC but getting a TLE here......
|
|
cegprakash:
2013-05-27 03:59:39
The input specifications are clearly explained. Which part u can't get in it? |
Added by: | cegprakash |
Date: | 2011-03-18 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | BF |