1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include<iostream>
#include<math.h>
#include<bits/stdc++.h>
using namespace std;
int main()
{
int p,q,i;
int m,s,n;
cin>>p>>q>>s;
m=s-int(s/pow(10,q-p+1));
n=(pow(10,q)-pow(10,p-1));
cout<<m/__gcd(m,n)<<" "<<n/__gcd(m,n);
return 0;
}
//例
//1 6
//142857
//输出 1 7