主页 讨论版 问题 名次 状态 统计
欢迎加入西电微软俱乐部招新群 588166170,做出福利题,免技术部第一次面试且赠送“福利”海报或小礼品~~~~
问题 G: Orz God Huang

问题 G: Orz God Huang

时间限制: 2 Sec  内存限制: 128 MB
提交: 104  解决: 25
[提交][状态][讨论版]

题目描述

God Huang is good at study, and he is very likely to get better grades than his poor roomate cyt. In a singe test, God Huang has equal probability to get grades betweeen 1 and A, while poor cyt has equal probability to get grades between 1 and B. God Huang will get some pleasure points if he's score is a multiple of cyt's, and the pleasure points he will get is the square of cyt's points. For example if God Huang got 100 grades and cyt got 50 than he will get pleasure points of 50 × 50. Your task now is to calculate the expect pleasure points God Huang will get.

输入

The input contains multiple test cases(About 10000 test cases). Each case contains two integers A and B (1 <= B < = A <= 1 000 000) in a line.
The input is terminated by n = m = 0.

输出

For each test case, output the expect pleasure point God Huang will get as a reduced fraction (i.e., the greatest common divisor of the numerator and denominator is 1). If the answer is zero (one), you should output 0/1 (1/1) instead)

样例输入

1 1
2 2
8 4
0 0

样例输出

1/1
3/2
37/16

提示

Notice that if cyt and God Huang get same score, God Huang will still get pleasure points.

[提交][状态][讨论版]