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
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, rl < 200 ).
Output
For the ith 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.
Example
Input 2 1 10 2 8 Output case 1 0 case 2 0
hide comments
Sushovan Sen:
20170706 09:47:47
why 2,9 cannot be a solution for first test case. 

Walrus:
20120905 12:49:27
What range does "between 1 and 5000" refer to ? [1,5000), or (1,5000], or (1,5000) or [1,5000] ? 

jhantu:
20120826 01:27:13
http://filecopter.net/files/xtwQD31345895741.html 

tld:
20100608 13:21:33
Admin,coule you give out an example?


Jonathan SchmidtDominé:
20100511 14:32:37
Why is 1,6 not a solution when l = 1 and r = 10? 

[Trichromatic] XilinX:
20090415 05:55:43
0.00 running time in the ranklist is a very useful hint. 

Lox:
20090415 04:32:04
Any nontrivial cases? 

[Trichromatic] XilinX:
20090217 01:18:47
Both Plato & Socrates know the range (l,r). 

Paul Draper:
20090216 20:06:31
Are l and r limits on OUR output or one the numbers Plato and Socrates consider? 
Added by:  Bogusław K. Osuch 
Date:  20050414 
Time limit:  15s 
Source limit:  50000B 
Memory limit:  1536MB 
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 PASGPC PASFPC PERL PHP PIKE PRLGswi PYTHON RUBY SCM qobi SCM guile ST WHITESPACE 
Resource:  :P 