BALLSUM  Ball sum
You have a bag filled with N balls.Each Ball has a distinct number from 1 to N printed on it.All the numbers are distinct. You withdraw two balls from the bag and take their sum. You need to calculate the probability that the sum is not greater than the given number K(<=N). The Answer should be displayed in the form of p/q.(except when the answer is 0 or 1)
Input
Input consists of various test cases. Each test case consist of two integer inputs,N and K. (0<=K<=N<=1000000000) The program stops taking input when N and K equals 1
Output
Output the result in the form of p/q.(Except when the answer is 0 or 1)
Example
Input: 3 2 100 5 10 6 1 1 Output: 0 2/2475 2/15
hide comments
candide:
20160507 16:31:57
Simple formula. p/q must be an irreductible fraction. Input size probably supposes N>1 and K>0. Input has a trailing newline (can be a source of bug in Python). long long are needed. In Python 2, fractions module works but is slower than handcrafted code. Last edit: 20170410 11:57:50 

darkhire21:
20160423 20:25:18
may be n>=2 always . 

lalit_nit:
20160419 16:27:47
First solved by brute force then > Simply AC Last edit: 20160422 06:14:46 

prince_gayatri:
20160217 20:55:16
AC in one go....... 

abhishekrahul:
20160125 15:32:59
sorov_0 tum itna tez kaise h..... 

sorov_0:
20160125 15:32:21
ac in one go..... 

sorov_0:
20160125 13:37:00
abhishek tum itna tez kase ho.....


abhishekrahul:
20160125 13:34:43
ac in one go...


rahul2907:
20160119 20:45:42
Nice one!!!! easy :)


prakash_reddy:
20160115 20:47:06
Easy one, little mathematical analysis is required.... 
Added by:  Prateek Agarwal 
Date:  20151215 
Time limit:  1s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ASM64 GOSU JSMONKEY 