-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathAkankshaAndEndOfSemester.cpp
84 lines (76 loc) · 1.56 KB
/
AkankshaAndEndOfSemester.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
#include <bits/stdc++.h>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<ll> vl;
typedef vector<vl> vvl;
#define F0(i,n) for (ll i = 0; i < n; i++)
#define F1(i,n) for (ll i = 1; i <= n; i++)
#define CL(a,x) memset(x, a, sizeof(x));
#define SZ(x) ((int)x.size())
void read(ll &x){
cin >> x;
}
void read(ll &x,ll &y){
cin >> x >> y;
}
void read(ll &x,ll &y,ll &z){
cin >> x >> y >> z;
}
void read(ll &x,ll &y,ll &z,ll &w){
cin >> x >> y >> z >> w;
}
clock_t t_start,t_end;
void start_clock(){
t_start = clock();
}
void end_clock(){
t_end = clock();
ld timeis = t_end - t_start;
printf("\n\nTime taken : %f s", ((float)timeis)/CLOCKS_PER_SEC);
}
bool IsOdd(ll n){ return n % 2 == 1; }
int main()
{
freopen("input.txt", "r", stdin); //Comment
freopen("output.txt", "w", stdout); //this
start_clock(); //out.
ios::sync_with_stdio(false); //Not
cin.tie(NULL); //this.
cout.tie(0); //or this.
ll t;
read(t);
while(t--){
ll k, i;
read(k);
ll a[7];
F0(i, 7) read(a[i]);
ll sum=0;
F0(i, 7) sum += a[i];
string s[] = {"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"};
ll z;
if(k > sum)
z = k % sum;
else
z = k;
//cout << z << "\n";
if(z == 0){
cout << "Sunday\n";
continue;
}
F1(i, 6) a[i] = a[i-1] + a[i];
//F0(i, 7) cout << a[i] << " ";
//cout << "\n";
F0(i, 7)
if(a[i] >= z){
cout << s[i] << "\n";
break;
}
}
end_clock(); //This too.
return 0;
}