IOPC_14A - Fun with flooring factorial
In a class of B students, the teacher wishes to distribute N! [Factorial(N)] oranges, such that each one of them gets equal number of oranges.
The teacher, being a lazy person, wants to give away oranges such that she has to take minimum number of them back with her.
Your job is to help the teacher to determine, given N and B, whether the number of oranges received by each student is even or odd.
Input
First line contains T, the number of test cases. Next T lines follow, each line containing two space separated integers N and B.
Output
The output should contain T lines, one for each test case. If the output of a test case is even print "Even" (without quotes), otherwise print "Odd".
Constraints
- N ≤ 105
- 0 < B ≤ 1018
- 0 < T ≤ 100
Example
Input: 2 3 6 2 1 Output: Odd Even
hide comments
praveen123:
2014-03-02 22:49:58
@Francky, I agree with your idea of having a different sections on spoj for problems which have their solutions available online.
|
|
Francky:
2014-03-02 22:30:43
Please see the forum. Thanks for your answers.
|
|
Blasters:
2014-03-02 21:50:57
I really dont understand why this problem has been put in the tutorial section . This is really a very good problem and really second rachit's comment
|
|
praveen123:
2014-03-02 21:49:15
^ Mitch About the particular issue of asking test case, I would say that Francky should have waited for some time for asking test data for the problem, as it might be possible that he might be making an error in his logic and problem writer did not want to point out him the error.
|
|
praveen123:
2014-03-02 21:42:15
Hi Mitch!!
|
|
રચિત (Rachit):
2014-03-02 21:37:00
I didn't upload this problem on SPOJ, but while creating it, we made a thorough checking of our solution by brute force and are very confident about the test files. We also took views of several people (all problem setters of IOPC 2014) regarding the interpretation. Also, on codechef, where it was hosted, many teams got it correct in their first attempt.
|
|
Mitch Schwartz:
2014-03-02 21:22:26
When an experienced solver questions the correctness of test data, please consider a response such as "I double checked a case where your code gave a different answer from my sample solution, and" either "it turns out there was an error in the test data, and it is being fixed" or "it seems you have a bug in your program, please check again" or something similar. (The two alternatives are listed in no particular order.) I agree with the philosophy of "if you cannot solve the problem , move ahead" but in fact that response didn't match the context here; there's a difference between asking for spoilers and questioning correctness of test data. (Mistaking the one for the other might be the result of people having different native languages.) And let's not forget POWPOW -- same user questioning same problem setter ... remember who turned out to be right that time? Of course it could be different this time, everyone makes mistakes, but still, I am amazed by the condescending and dismissive language being used against Francky. The issue of problems on SPOJ that have public solutions posted elsewhere is separate and I have no comment on that at this time. Know also that hiding problems by changing placement in main problemset to "none" deletes all comments and can hinder communication in this way. Your protest also seems overly extreme to me, but I understand how things can feel very personal and uncomfortable in cases like this. As a general "fortune cookie" statement, also try to remember that we all have our own viewpoints; the way other people see things could matter as much as the way you see things.
|
|
praveen123:
2014-03-02 21:13:50
Contest organisers have taken a decision to hide all the problems until SPOJ editorial board (specially francky) clarifies its stands on the issue of moving the problems of this contest due to having its solution publicly accessible on web.
|
|
praveen123:
2014-03-02 20:21:33
^ Hi Francky: I can not really understand the reason of putting them into tutorial section, Tutorial section is to problems which have repeated idea or kind of duped problems. As you are saying that classical section can not have problems which solutions are available on the internet. I can even show you a LOT of problems on spoj which have solutions online available. Please re-assert your decision of making the problems of putting them in tutorial. A lot of ACM contests, codechef and codeforces contests problems are there on spoj. Lot of users have made their submission online, Then according to your logic, problem should be removed from classical section. Even spoj contests have public solutions, yet the problems being in classical section. Currently there are not many contests which dont have public solutions, So if work by this logic, number of problems in the upcoming contest will be reduced. If you insist on pushing this philospohy, please move all of them to tutorial.
|
Added by: | devu |
Date: | 2014-03-02 |
Time limit: | 3s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 |
Resource: | Setter: Rachit Nimavat| Tester: Devendra Agarwal, Praveen Dhinwa| Writter : Vijay Keswani |