# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
4993 | lingxiang | 분수 (KPI13_fractions) | C++98 | 0 ms | 1088 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
/*
construct with farey sequence
*/
#include<stdio.h>
#include<string.h>
long long int a,b,c,d;
long long int fn1=0,fd1=1,fn2=1,fd2=1;
long long int numeric;
int T;
void input(){
scanf("%d",&T);
}
void solve(){
for(int i=0;i<T;i++){
fn1=0,fn2=1,fd1=1,fd2=1;
scanf("%lld %lld %lld %lld",&a,&b,&c,&d);
if(a/b==c/d){
numeric=a/b;
a=a-b*numeric;
c=c-d*numeric;
}
else{
printf("%lld 1\n",a/b+1);
continue;
}
while(1){
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |