CF 16C. Monitor

题目链接

水题依旧无法1Y。

 #include <cstdio>
#include <iostream>
#include <cmath>
using namespace std ;
#define LL __int64
LL gcd(LL a,LL b)
{
return b == ?a:gcd(b,a%b);
} int main()
{
LL a,b,x,y,t;
LL str,end,mid;
scanf("%I64d%I64d%I64d%I64d",&a,&b,&x,&y);
t = gcd(x,y);
x = x/t;
y = y/t;
if(x > a||y > b)
{
printf("0 0\n");
return ;
}
str = ;
end = a/x;
while(str < end)
{
mid = (str+end + )/;
if(mid*x > a||mid*y > b)
end = mid - ;
else
str = mid;
}
printf("%I64d %I64d\n",end*x,end*y);
return ;
}
上一篇:阿里jstorm和storm区别


下一篇:Storm介绍&实际开发注意事项