forked from omonimus1/competitive-programming
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSDICE.cpp
More file actions
56 lines (50 loc) · 589 Bytes
/
SDICE.cpp
File metadata and controls
56 lines (50 loc) · 589 Bytes
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
#include <iostream>
using namespace std;
long long dice()
{
long long n,x,sum=0;
cin>>x;
n=x/4;
int mod=x%4;
if(n>=1)
{
if(mod==0)
{
sum=(44*(n-1))+(4*15);
}
if(mod==1)
{
sum=44*(n-1)+11+45+20;
}
if(mod==2)
{
sum=44*(n-1)+22+30+36;
}
if(mod==3)
{
sum=44*(n-1)+33+30+36;
}
}
else
{if(x==0)
return 0;
if(x==1)
return 20;
if(x==2)
return 36;
if(x==3)
return 51;
}
return sum;
}
int main() {
int t;
cin>>t;
while(t>0)
{
cout<<dice()<<endl;
t--;
}
// your code goes here
return 0;
}