#include<stdio.h>
//FILE *input=freopen("input.txt","r",stdin);
long long int swap(long long int &a,long long int &b){
long long int c;
c=a;
a=b;
b=c;
}
int main(){
long long int lh,s,e,l,b;
long long int cnt=0;
long long int k;
scanf("%lld%lld%lld%lld%lld",&lh,&s,&e,&l,&b);
if(l<b){
swap(l,b);
swap(s,e);
}
//l>=b
k=lh*2-l;
if(s>lh*2)
{
cnt=(s-lh*2)/k;
s-=cnt*k;
}
else{
cnt=0;
}
if(s==0){
}
else if(s<=lh){
s=0;
e-=b;
cnt++;
}
else{
s=0;
cnt++;
}
k=lh*2-b;
if(e>lh*2){
cnt+=(e-lh*2)/k;
e=(e-lh*2);
}
else{
}
if(e<=0){
}
else {
cnt++;
}
printf("%lld",cnt);
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
1088 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
1088 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
1088 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
1088 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
1088 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |