-
Notifications
You must be signed in to change notification settings - Fork 0
/
Light-oj-1069.cpp
158 lines (136 loc) · 7.12 KB
/
Light-oj-1069.cpp
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
/***************************************************DarkdreamOFmy**********************************************************/
#include <string>
#include <vector>
#include <map>
#include <list>
#include <iterator>
#include <set>
#include <queue>
#include <iostream>
#include <sstream>
#include <stack>
#include <deque>
#include <cmath>
#include <memory.h>
#include <cstdlib>
#include <cstdio>
#include <cctype>
#include <algorithm>
#include <utility>
#include <assert.h>
#include <time.h>
#include <fstream>
#include <sys/stat.h>
#include <stdlib.h>
#include <stdio.h>
using namespace std;
typedef long int li;
typedef long long int lli;
typedef unsigned long long int ull;
typedef signed long long int sll;
typedef long double lld;
typedef vector<int>vi;
typedef vector<long>vl;
typedef vector<long long int>vll;
typedef vector<double>vd;
typedef vector<long double>vld;
typedef vector<char>vc;
typedef vector<string>vs;
typedef pair<int,int>pii;
typedef pair<long long,long long>pll;
typedef pair<double,double>pdd;
typedef pair<char,char>pcc;
typedef pair<string,string>pss;
typedef map<int,int>mii;
typedef map<long long,long long>mll;
typedef map<char,char>mcc;
typedef map<string,string>mss;
typedef map<string,int>msi;
typedef map< int,vector<int> >miv;
typedef map<vector<int>,vector<int> >mvvi;
typedef map<string,vector<int> >msv;
typedef set<int>si;
typedef set<string>ss;
typedef set<vector<int> >sv;
typedef queue<int>qi;
typedef queue<long long>qll;
typedef queue<string>qs;
typedef stack<int>stki;
typedef stack<long long>stkll;
/**-------------------END OF typedef------------------------------**/
const int INF = 1000000000;
const int MAX = 4007;
const int MAX2 = 1000000;
const int MAXD = 20;
const int BASE = 1000000007;
const int MOD = 1000000007;
const int psz = 2000006;
/**-------------------Constant int--------------------------------**/
#define scanI(a) scanf("%d",&a)
#define scanI2(a,b) scanI(a) , scanI(b)
#define scanI3(a,b,c) scanI(a), scanI(b), scanI(c)
#define scanI4(a,b,c,d) scanI(a), scanI(b), scanI(c), scanI(d)
#define scanL(a) scanf("%lld",&a)
#define scanL2(a,b) scanL(a) , scanL(b)
#define scanL3(a,b,c) scanL(a), scanL(b), scanL(c)
#define scanL4(a,b,c,d) scanL(a), scanL(b), scanL(c), scanL(d)
#define printI(a) printf("%d",a)
#define printI2(a,b) printI(a) , printI(b)
#define printI3(a,b,c) printI(a),printI(b),printI(c)
#define printI4(a,b,c,d) printI(a),printI(b),printI(c),printI(d)
#define printL(a) printf("%lld",a)
#define printL2(a,b) printL(a) , printL(b)
#define printL3(a,b,c) printL(a),printL(b),printL(c)
#define printL4(a,b,c,d) printL(a),printL(b),printL(c),printL(d)
/**----------------------Scan and print end--------------------------**/
#define min3(a,b,c) min(a,min(b,c))
#define max3(a,b,c) max(a,max(b,c))
#define min4(a,b,c,d) min(min(a,b),min(c,d))
#define max4(a,b,c,d) max(max(a,b),max(c,d))
#define max5(a,b,c,d,e) max(max3(a,b,c),max(d,e))
#define min5(a,b,c,d,e) min(min3(a,b,c),min(d,e))
/**----------------------MAX and MIN end-----------------------------**/
#define fst first
#define snd second
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define SQR(a) ((a)*(a))
#define Unique(a) sort(all(a)),a.erase(unique(all(a)),a.end())
#define Iterator(a) __typeof__(a.begin())
#define rIterator(a) __typeof__(a.rbegin())
#define FORI(a,it) for(Iterator(a) it = a.begin();it != a.end(); it++)
#define RFORI(a,it) for(rIterator(a) it = a.rbegin();it != a.rend(); it++)
#define FOR(i, a, b) for(int i=(a);i<(b);i++)
#define RFOR(i, b, a) for(int i=(b)-1;i>=(a);--i)
#define FILL(A,value) memset(A,value,sizeof(A))
#define SZ(V) (int)V.size()
#define PB push_back
#define MP make_pair
#define Pi 3.14159265358979
#define read(x) freopen(x, "r", stdin)
#define write(x) freopen(x, "w", stdout)
/**---------------------End of define of all----------------------**/
int fx[]={+0,+0,+1,-1,-1,+1,-1,+1};
int fy[]={-1,+1,+0,+0,+1,+1,-1,-1};
int dx[]={1,-1,0,0};
int dy[]={0,0,1,-1};
/**-----------------------Directional------------------------------**/
int chToIn(char a) {int b;b = a-'0';return b;}
int stToIn(string a) {int b;b=atoi(a.c_str());return b;}
string appendChar(string s,char a) {s.append(1,a);return s;}
int gcd(int a, int b) {return (b == 0 ? a : gcd(b, a % b)); }
int lcm(int a, int b) {return (a * (b / gcd(a, b))); }
string rev(string a) {int siz=SZ(a);string res="";RFOR(i,siz,0){res+=a[i];}return res;}
/**---------------------End of functions--------------------------**/
int main(){
int t;
int c=1;
scanI(t);
while(t--){
int my,lift;
scanI2(my,lift);
int res=(abs(lift-my)+my)*4+8+8+3;
printf("Case %d: %d\n",c++,res);
}
return 0;
}