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<stdio.h>
int dap=2147483640;
int lh, s, d, l, b;
void test(int p, int q, int r, int s, int t){
int i;
for(i=0; q>0 || r>0; i++){
if(q<=0)r-=2*p;
else if(q<=p)q-=p, r-=p;
else q-=2*p;
if(q>0)q+=s;
if(r>0)r+=t;
}
if(dap>i)dap=i;
}
int main(){
scanf("%d%d%d%d%d", &lh, &s, &d, &l, &b);
test(lh, s, d, l, b);
test(lh, d, s, b, l);
printf("%d", dap);
return 0;
}
# | 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... |