This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<cstdio>
int main()
{
long long t1,t2,t3;
long long a,b,c,d,e;
scanf("%lld%lld%lld%lld%lld",&a,&b,&c,&d,&e);
if((b+a-1)/a==(c+a-1)/a)t1=(b+a-1)/a;
else if((b+a-1)/a>(c+a-1)/a)t1=(c+a-1)/a+(b-(c+a-1)/a*a+2*a-1)/(2*a);
else t1=(b+a-1)/a+(c-(b+a-1)/a*a+2*a-1)/(2*a);
t2=(b+2*a-1)/(2*a)+(c+(b+2*a-1)/(2*a)*e+2*a-1)/(2*a);
t3=(c+2*a-1)/(2*a)+(b+(c+2*a-1)/(2*a)*d+2*a-1)/(2*a);
if(t1>t2)t1=t2;
if(t1>t3)t1=t3;
printf("%lld",t1);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |