PLATON - Platon and Socrates
Platon and Socrates one day decided to play a new game. They asked their friend to think of two numbers between 1 and 5000, not equal. Then they asked him to tell the product to Platon and the sum to Socrates. After that they tried to figure out what these numbers are. They played a lot of times but none of them could guess these numbers. Finally they made it!! Here is the dialogue:
- [P] : I don't know the answer.
- [S] : I knew you wouldn't know, I don't know it either.
- [P] : Now I know it.
- [S] : I know it too.
Input starts with a single integer t, the number of test cases (t<=2000). t test cases follow. Each test case consists of one line containing two integers l r seperated by a single space, denoting the range of numbers ( 1<= l < r <=5000, r-l < 200 ).
For the i-th test case output a line with the text case i. In the next line print n - number of pairs from range (l,r). Then exactly n lines follow with two numbers seperated by single space. The first number is not greater than the second. Pairs are printed in increasing sum order.
Input 2 1 10 2 8 Output case 1 0 case 2 0
why 2,9 cannot be a solution for first test case.
What range does "between 1 and 5000" refer to ? [1,5000), or (1,5000], or (1,5000) or [1,5000] ?
Admin,coule you give out an example?
Why is 1,6 not a solution when l = 1 and r = 10?
0.00 running time in the ranklist is a very useful hint.
Any non-trivial cases?
Both Plato & Socrates know the range (l,r).
Are l and r limits on OUR output or one the numbers Plato and Socrates consider?
|Added by:||Bogusław K. Osuch|
|Cluster:||Cube (Intel G860)|
|Languages:||ADA95 ASM32 BASH BF C CSHARP CPP CLPS LISP sbcl LISP clisp D FORTRAN HASK ICON ICK JAVA LUA NEM NICE OCAML PAS-GPC PAS-FPC PERL PHP PIKE PRLG-swi PYTHON RUBY SCM qobi SCM guile ST WHITESPACE|