-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMarathon.cpp
More file actions
45 lines (45 loc) · 760 Bytes
/
Copy pathMarathon.cpp
File metadata and controls
45 lines (45 loc) · 760 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
#include <iostream>
#include <cmath>
#include <algorithm>
#include <limits>
#include <vector>
#include <bitset>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <time.h>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <cctype>
#include <list>
#include <iterator>
#include<string.h>
#include<iomanip>
#include<limits>
using namespace std;
int main()
{
ios_base :: sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
int t;
cin>>t;
while(t--)
{
int D,d,a,b,c,ans;
cin>>D>>d>>a>>b>>c;
int td=D*d;
if(td>=10 && td<21)
ans=a;
else if(td>=21 && td<42)
ans=b;
else if(td>=42)
ans=c;
else
ans=0;
cout<<ans<<"\n";
}
return 0;
}