Chef at Job
Chef is new to job. At his new job, there are few instructions one has to follow :-
- An employee is given N works at once and asked to finish the job within N days.
- To ensure the quality of work, the employees are warned not to complete N works in a single day.
- Since every work is given equal importance, they want every employee to perform equal number of work everyday.
An employee is given extra payment if he/she is able to complete N works before N days(atmost one can take N-1 days).
Being a disciplined Chef, he will not disobey any of the instructions at his new job. At the same time, our Chef is determined not to lose any extra payment. Our Chef, being quite reputed, has options at hand to join other jobs. He leaves the job and joins a new job if he loses extra payment.
Help find Chef the number of ways available to Chef to accomplish the N given works with extra payment.
- The first line of the input contains single integer T, denoting the number of test cases. Then T test cases follow.
- The only line of each test case contains N, the number of works given to Chef.
For each test, output the number of ways available to Chef to accomplish the N given works in a single line. If our Chef leaves the job output -1.
- 1 ≤ T ≤ 1000000
- 2 ≤ N ≤ 10000
ExampleInput 2 2 4 Output -1 1 Explanation
Test case 1: N = 2 By the instructions given at his new job, Chef has to finsh work within 2 days, but cannot finish work in 1 day. Chef is determined not to lose any extra payment. So, he want to do the job, atmost in 1 day. But, he is restricted from finishing the job in 1 day by the instructions. So, he leaves the job. :(
Test case 2: N = 4 Chef does 4 works in 2 days(2 works per day). For completing the 4 works before 4 days, Chef gets extra payment :).
|Tags||aparup_ghosh, encoding, horsbug98, horsbug98, primes|
|Time Limit:||1 - 2 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, kotlin, PERL6, TEXT, SCM chicken, CLOJ, COB, FS|
Fetching successful submissions