#C. A*B Problem, 但你忘开long long了

    Type: Default 1000ms 256MiB

A*B Problem, 但你忘开long long了

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

A*B Problem, 但你忘开long long了

题目描述

hulean同学发现签到题是A*B Problem后马上提交了以下代码

#include<bits/stdc++.h>
using namespace std;
int main(){
    int a,b;
    cin>>a>>b;
    cout<<a*b;
    return 0;
}

但他忘了#define int long long了。那么他通过随机点的概率是多少呢?

严格地说:若AA[1,n][1,n]中均匀随机抽取的一个整数,BB[1,m][1,m]中均匀随机抽取的一个整数,则AB2311AB \leq 2^{31}-1的概率是多少?

输入格式

一行两个整数n,mn,m

输出格式

一行两个整数p,qp,q满足gcd(p,q)=1gcd(p,q)=1,表示通过的概率为最简分数pq\frac{p}{q}

输入输出样例

10000 10000
1 1
1000000 1000000
3834865679 250000000000

数据规模与约定

1n,m1091 \leq n,m \leq 10^9

2025 SAST Algorithm Group SOC

Not Attended
Status
Done
Rule
ACM/ICPC
Problem
9
Start at
2025-8-30 0:00
End at
2025-9-1 0:00
Duration
48 hour(s)
Host
Partic.
7