-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlOJ1069.txt
63 lines (58 loc) · 1.08 KB
/
lOJ1069.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#include<iostream>
#include<stdio.h>
#include<string.h>
#include<string>
#include<stdlib.h>
#include<math.h>
#include<algorithm>
#include<map>
#define pi acos(0.0)
using namespace std;
int main()
{
int t,i,j,k,l,time;
scanf("%d", &t);
for(j=1;j<=t;j++)
{
time=0;
scanf("%d %d", &i,&l);
if(l>=i&&i>0)
{
while(l!=i)
{
l--;
time=time+4;
//printf("current time %d\n", time);
}
time=time+11;
while(i!=0)
{
i--;
time=time+4;
//printf("current time %d\n", time);
}
time=time+8;
}
else if(l<i&&i>0)
{
while(l!=i)
{
l++;
time=time+4;
}
time=time+11;
while(i!=0)
{
i--;
time=time+4;
}
time=time+8;
}
else if(i==0&&l==0)
{
time=0;
}
printf("Case %d: %d\n", j,time);
}
return 0;
}