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.
问题 G: Orz God Huang
时间限制:2000 ms 内存限制:128 MB提交:116 解决:28
[ 提交][ 状态][ 讨论版]
题目描述
输入
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.
한국어中文فارسیEnglishไทย
Anything about the Problems, Please Contact Admin:admin
All Copyright Reserved 2010-2024Xidian Programming Contest Online JudgeTEAM
GPL2.02003-2014HUSTOJ ProjectTEAM
Anything about the Problems, Please Contact Admin:admin
All Copyright Reserved 2010-2024Xidian Programming Contest Online JudgeTEAM
GPL2.02003-2014HUSTOJ ProjectTEAM