P21424 [HackerEarth] Today is external viva of computer science subject and Bosky is not at all prepared for it. Adding to his problems, he hasn't reached college yet. Luckily the external examiner was late
普及
题目描述

Today is external viva of computer science subject and Bosky is not at all prepared for it. Adding to his problems, he hasn't reached college yet. Luckily the external examiner was late too. Bosky somehow managed to reach the college before the external examiner arrived but he was still worried because he didn't want to get insulted by external examiner.

The procedure for the conducting of viva is that each student has to sign the attendance register regardless of their given roll number before entering the viva room. Then they will be called individually or in groups of equal students exactly in the same order as they signed in the attendance register. It should be ensured by the internal invigilator that signing in the attendance register by the students has to be done before the external examiner arrives. The viva exam will start immediately only after the arrival of the external examiner.
Students were informed that external examiner will arrive exactly after 30 mins.
Bosky got some extra time to think how he can save himself from being insulted in front of the external examiner. He looked around and found that there were few students who were in worse condition than he himself was. With his past experience he concluded that on being called in groups the external picks up the most vulnerable student among the group and keeps on insulting and cursing the same student, ignoring the rest. Bosky knew that if he could manage to be in group with a student who is more vulnerable than him then he might get ignored by the external.

When everybody started signing the attendance register, Bosky quickly looked around and spotted such a student and signed after him in the attendance register. He is quite certain now that if he has to give viva in a group in which both of them are present he might save himself from being insulted.

There are "N" students in his class and Bosky knows that external examiner will call everyone in group of "X" students at once,where X can be any number between [1,N] (both ends inclusive). Now he wonders what is the probability that he and his "prey" would be in the same group.

Given total number of students and Bosky's position in the attendance register, your task is to tell what is the probability that Bosky's plan will succeed i.e. he and his [so called] "prey" will be in same group.

More formally you are given two integers N and R ,where 2 ≤ N ≤ 10^9 and 2 ≤ R ≤ N . You have to find the probability that R and (R-1) will be in the same group if the sequence [1,2,3...N] is divided into group of "X" numbers sequentially i.e [1...N] is divided into groups [1...X],[(X+1)...2X], [(2X+1)...3X] ... [ (Xfloor((N-1)/X)+1)...N] , where 1 ≤ X ≤ N and last group can have less than X numbers.

Input:

Input will contain a number T denoting the number of test cases.

Then T test cases follow, each one consisting 2 integers N and R where N is the total strength of the class and R is Bosky's position in the attendance register.

Output

For each test case, output the probability as rational number of form p/q.The greatest common divisor of p and q should be 1.

Constrains

1 ≤ T ≤500

1< N ≤10^9

1< R ≤N

SAMPLE INPUT
2
5 5
6 5

SAMPLE OUTPUT
2/5
1/2

Explanation

Case 1: N=5 and R=5
i.e. Total Students=5 and Bosky's has signed at 5th position
his pray signed before him hence he signed at 4th position
Suppose students are called in group of "X",where 1 ≤ X ≤ N
For different values of "X" groups formed are as follow
For, X=1
[ {1},{2},{3},{4},{5} ]
X=2
[ {1,2} , {3,4} , {5} ]
X=3
[ {1,2,3} , {4,5} ]
X=4
[ {1,2,3,4} , {5} ]
X=5
[ {1,2,3,4,5} ]
We can clearly see that for X=3 and X=5 Bosky's plan will succeed i.e. he and his pray will be in same group. Hence the output is "2/5"

Case 2: Similar to Case 1 where N=6 and R=5
For, X=1
[ {1},{2},{3},{4},{5},{6} ]
X=2
[ {1,2} , {3,4} , {5,6} ]
X=3
[ {1,2,3} , {4,5,6} ]
X=4
[ {1,2,3,4} , {5,6} ]
X=5
[ {1,2,3,4,5}, {6} ]
X=6
[ {1,2,3,4,5,6} ]

Here Bosky's plan succeeds for X=3,X=5 and X=6.
Hence the output is "3/6" ==> "1/2" [Note: Output must be irreducible rational number]

输入格式

见题面

输出格式

见题面

样例输入
10 981756253 222214880 657750962 441987370 420253542 134811149 383766767 285392712 860925640 57251957 280092191 192232945 326601984 158670005 904352022 417098579 511597444 208285363 844871521 635543166
样例输出
349556339/349556347 387552709/387552721 329873507/329873515 248134339/248134343 14232809/14232821 297914677/297914805 12193849/12193850 81679937/81679938 293434593/293434597 9245119/9245127 74312159/74312161 96739947/96739955 145857695/145857696 249949529/249949531 107270937/107270941 24840369/24840370 154370977/154370993 61920747/61920751 61339909/61339910 112828981/112828997 95769301/95769305 163087005/163087007 750426617/750426629 41563277/41563285 499060739/499060747 39979017/39979033 727824025/727824033 381747339/381747379 427140933/427140937 195912125/195912189 10757183/10757187 89175178/89175179 116107580/116107581 64392219/64392221 69605325/69605329 973146607/973146611 224157769/224157771 405274589/405274591 292747659/292747723 211733411/211733419 68389937/68389941 31149219/31149227 109234975/109234977 336481683/336481687 28236995/28237003 6058653/6058661 82390111/82390135 289319911/289319929 14509087/14509091 207591707/207591708 20600171/20600173 98575303/98575319 21886429/21886453 288624307/288624309 37509037/37509041 730869469/730869485 67504019/67504023 37653893/37653901 17389151/17389152 200520087/200520088 559110479/559110511 752337887/752337959 19961747/19961751 850506971/850507003 751858351/751858361 532180967/532180971 66669597/66669605 655486541/655486545 170808509/170808515 821160353/821160385 411098971/411098987 25999897/25999905 59345947/59345951 852483025/852483073 29636951/29636969 20673597/20673613 692290431/692290447 492034335/492034336 1168153/1168155 628178289/628178293 936333405/936333413 88888931/88888935 16777533/16777535 124842703/124842711 53431825/53431829 845880251/845880255 92773067/92773073 17094500/17094501 247462534/247462535 263114456/263114459 260151053/260151055 43178429/43178445 110957177/110957179 235149901/235149905 26218524/26218525 516791975/516792023 752777025/752777029 694323285/694323289 483772787/483772790 107989085/107989101 357316619/357316623 39418246/39418249 2765303/2765315 788903011/788903027 17280435/17280499 441955721/441955753 445486399/445486415 35552563/35552569 31617763/31617771 258935449/258935473 92766929/92766937 102570341/102570389 121067473/121067505 174609415/174609429 481736545/481736557 150819939/150819955 13743277/13743289 25801649/25801653 53454923/53454959 322351773/322351781 118120778/118120779 309019023/309019031 492138811/492138835 516349067/516349083 77180881/77180897 46509185/46509187 232555975/232555999 624638837/624638857 95821881/95821885 802154849/802154851 477512793/477512809 184923463/184923479 68737546/68737549 139262633/139262649 165031521/165031525 862095119/862095143 36815681/36815693 43555955/43555956 4557385/4557389 271921495/271921503 640858459/640858471 632674809/632674817 66457730/66457731 33028967/33028999 940982505/940982513 238779491/238779499 459046419/459046435 17993106/17993107 160879067/160879069 194451195/194451227 138515522/138515525 429575881/429575889 257519973/257519977 49675417/49675465 66669539/66669543 355106185/355106189 34542891/34542895 496111021/496111057 482967691/482967693 7862499/7862503 33613891/33613895 83066297/83066299 43308808/43308809 152627389/152627395 55041541/55041573 348715923/348715939 1762102/1762107 579588187/579588191 203579145/203579149 454052843/454052855 33179313/33179315 251302457/251302473 201718689/201718691 978772823/978772827 687037619/687037627 527777667/527777675 85238371/85238375 53961263/53961265 100482433/100482449 177518905/177518908 25656351/25656352 187709937/187709941 76149651/76149655 50235490/50235491 979579823/979579827 60232799/60232800 985545399/985545407 16713221/16713225 128385036/128385037 85991619/85991623 484440271/484440274 1058738/1058741 40294433/40294434 22039705/22039707 398795321/398795337 476936541/476936543 295292105/295292129 176439898/176439899 390370275/390370291 522348767/522348783 120273449/120273457 176331485/176331489 8059903/8059911 29100789/29100790 6831047/6831051 16163732/16163733 316290551/316290559 217320269/217320271 652993035/652993051 50987407/50987410 110396210/110396211 871453869/871453877 309543608/309543609 750281397/750281477 311112891/311112893 186594895/186594959 224808741/224808781 9861646/9861647 235452043/235452045 556540985/556541009 184028429/184028445 146739727/146739735 918181607/918181615 94891271/94891275 737837253/737837261 90453859/90453907 482130463/482130469 493223213/493223285 50172867/50172875 364620959/364620975 115209597/115209599 127090714/127090723 553277897/553277961 595925893/595925925 544379669/544379749 450420341/450420345 391349511/391349527 254187659/254187675 27142152/27142153 67531847/67531851 674457619/674457667 142173037/142173053 9618229/9618233 309052241/309052289 4703984/4703987 158815282/158815283 417431163/417431165 310155109/310155149 74083922/74083923 200927726/200927727 281757403/281757406 369250989/369251021 141246441/141246445 200273049/200273065 913524497/913524513 477808325/477808333 127058141/127058143 52348843/52348987 610562199/610562207 75704379/75704381 54736673/54736681 740082751/740082753 70317763/70317779 13544979/13544995 324169471/324169475 733764395/733764399 455413751/455413757 690752543/690752591 420704303/420704327 180672343/180672383 137595141/137595149 865446473/865446489 101636435/101636439 77407721/77407724 54145929/54145937 433444783/433444795 926686653/926686655 427165065/427165069 471941989/471941993 416910973/416910975 953820451/953820515 631824781/631824789 136615641/136615645 48180557/48180565 818656409/818656413 41600565/41600566 843043193/843043205 191688157/191688173 62841/62843 41179071/41179072 101309925/101309941 906672861/906672863 496435109/496435189 19677819/19677821 176096749/176096753 99871937/99871945 399002211/399002243 167855088/167855089 10529063/10529071 750713393/750713397 378762431/378762463 641417093/641417101 237117682/237117683 41859335/41859368 716160969/716160971 30940039/30940043 10912835/10912899 19237131/19237135 126829107/126829111 449884061/449884093 787851351/787851383 415458983/415458987 148611286/148611291 995512121/995512125 188296333/188296349 449916375/449916383 408484705/408484709 260520248/260520251 130888011/130888013 77478401/77478402 589306919/589306937 95614731/95614735 176024551/176024561 160226717/160226877 205942105/205942109 303563927/303563935 233240928/233240929 356595355/356595359 881730523/881730635 187580474/187580475 262089857/262089873 24934955/24934967 119769485/119769493 981472871/981472879 116835815/116835817 354799947/354799963 14762435/14762447 997243825/997243829 317791815/317791847 95458571/95458595 546081797/546081813 234489615/234489647 246755789/246755797 886351379/886351383 40891599/40891603 948461857/948461861 164456259/164456263 976478073/976478093 885632883/885632885 251210937/251210945 8076267/8076269 554324033/554324065 838190411/838190419 3657223/3657231 906622021/906622045 883206835/883206963 374768445/374768477 214109321/214109337 905836077/905836093 223935017/223935021 26959103/26959111 605591765/605591797 588113879/588113887 89763101/89763103 577917277/577917285 586639761/586639769 200481612/200481613 815292839/815292855 2678209/2678211 338669549/338669561 506828133/506828137 116731521/116731522 99211513/99211517 900660563/900660579 488449441/488449445 461619223/461619225 655356495/655356511 206494653/206494661 121548561/121548565 148846729/148846733 716130491/716130499 317985347/317985361 721874699/721874715 183627349/183627351 162712885/162712889 128523767/128523771 202365863/202365867 4339407/4339408 513088645/513088653 973575171/973575175 99137407/99137435 300558285/300558289 131101779/131101787 913487815/913487823 841242179/841242275 129579971/129580003 51331571/51331573 82980945/82980949 756321341/756321345 866676743/866676747 782908503/782908519 383936691/383936719 41245849/41245850 238086559/238086563 75830325/75830327 593111603/593111747 227313643/227313651 961599783/961599787 53997228/53997229 59306477/59306479 291746729/291746737 446535328/446535329 69928669/69928670 883068421/883068469 476349567/476349583 524774861/524774885 52772883/52772884 900091793/900091825 162911213/162911217 162732661/162732677 612690879/612690899 74532811/74532847 107821801/107821803 424857253/424857257 221313979/221313980 550094401/550094405 257629159/257629175 8806327/8806333 47758523/47758535 255372430/255372437 273501121/273501153 309321489/309321497 989237695/989237703 50542067/50542069 815356435/815356483 237296483/237296492 333354163/333354171 166363613/166363615 384828157/384828169 132831112/132831113 75464487/75464519 139490571/139490575 79841769/79841777 751718177/751718193 33623296/33623299 461844785/461844833 27432763/27432765 435368935/435368939 389708355/389708371 10646263/10646271 819665793/819665797 799175799/799175803 30059331/30059333 175785955/175785963 429320527/429320533 124663992/124663993 625838147/625838211 29348161/29348177 20844497/20844501 528031859/528031863 31871935/31871944 409669663/409669671 379172285/379172293 170086577/170086673 717327809/717327817 216664121/216664157 151673319/151673320 618181155/618181211