IOPC_14A - Fun with flooring factorial

no tags 

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
Dushyant Singh: 2015-07-16 09:19:56

Comments comments everywhere! :-o

devu: 2014-05-08 19:30:55

@Editorial_Board_Members : what was the outcome for the discussion ?
--ans(Francky)--> Information is provided in the forum ; see the link below.

Last edit: 2014-05-08 20:36:31
Francky: 2014-03-03 12:48:38

I've open a thread in the forum. Thanks for your answers.

Mitch Schwartz: 2014-03-03 07:29:47

@praveen123, thanks for your understanding. I sent an email to Devendra and Rachit, but wasn't able to include you because I don't see a valid email address listed on your account. As for not being able to make an account on the SPOJ forum, you could report the bug to contact@spoj.com .

praveen123: 2014-03-03 07:14:30

^Mitch, thank you for replying, We are not asking immediate replies, We really respect your time and work for the community. I think this policy of spoj is going to effect a lot of new upcoming problems and setters, I would recommend having a discussion on public forum(preferably spoj forum itself) before reaching to any final conclusion.

PS. I am unable to create an account on spoj forums :(

Last edit: 2014-03-03 07:18:08
Mitch Schwartz: 2014-03-03 06:50:28

@praveen123 @Devendra @Rachit: Thank you for bringing up good points. Of highest priority is making a decision that is as fair as possible to everyone, including solvers and problem setters. We want to preserve the wealth of problems in the SPOJ archive while also ensuring the integrity of the problem set as much as possible. It is not an easy task. The point of policy that has been brought up here is important, and one that I am not an expert in. With regard to timing, please keep in mind that (1) EB member is not a paid job; we have other obligations and need to sleep sometimes, and (2) moving a problem to tutorial or hiding a problem can be less "disruptive" if it is done when a problem is newly published, because then there are fewer solvers who could feel that their time was wasted by solving or attempting the problem, if they would no longer be getting the same amount of points/recognition/opportunity to compete as a result of the EB member action. Again, it is a tricky task, and there could be inconveniences or bad feelings caused, and I'm sorry for that. We are working on it. Please allow some time. More than that I don't know what to say. I'm sending you an email if you want to discuss things privately. It is also possible to open a thread on the forum where any user can discuss his or her opinion on the matter.

praveen123: 2014-03-03 04:35:48

I would really like to have a clear stand from SPOJ editorial side regarding putting up the problems of contests having their solution visible on web, in tutorial section rather than classical section. This decision is really important for problem setters on spoj, as it might happen they wish to add some interesting problems from their own college contests (whose solution might be visible on web) and they dont think that their problems deserve tutorial section (as really less number of people attempt there).

This decision is really important for me to decide whether to put up IOPC problems on spoj or not. If spoj insists on using the tutorial policy, then I have to unfortunately hide most of my problems due to this implementation of this policy as I dont want to do something against the rules, So please guys decide the required policy in these cases. I also wont ask spoj to scan through other already added problems and move them to tutorial due to this policy. They can implement the policy the way they desire. But In ideal situation, I would like spoj to be fair to each problem-writer and to move the problems added by lot of people to its tutorial section. Their are LOT of such problem. If they want I can also help them in this initiative by pointing out such problems in future.

Last edit: 2014-03-03 06:17:24
praveen123: 2014-03-02 23:53:18

@Francky: Problem setters have hidden the problems except this one because they feel that moving to tutorial is not justice for their problems. They are not at all responsible for why it is showing "hidden by Francky", this might be feature of spoj I guess. I have written some other problems, which are also showing hidden by Francky as far as I know they were moved to tutorial section by editorial board and I later hide that problem. http://www.spoj.com/problems/SQAMOD. Even if I publish the problem again and hide again, it still shows hidden by Francky and the date does not change too.
Also note the timing of when it is hidden, it is probably the time when you moved the problems to tutorial, Problems were hidden by us a lot later than that.

Last edit: 2014-03-02 23:59:14
Francky: 2014-03-02 23:32:30

I didn't hide other OIPC problems, only move them to tutorial section. I don't know why they are labeled 'hidden by Francky'. Are the setter responsible ?

praveen123: 2014-03-02 23:02:46

^Francky: I second your argument of spoj being best place for problem setting indeed. I give entire credit for pushing me into problem writing and I really respect spoj for that. It is also a great place for problem solving.

Last edit: 2014-03-03 00:13:02

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