-
Notifications
You must be signed in to change notification settings - Fork 4
/
seat.cpp
38 lines (30 loc) · 908 Bytes
/
seat.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
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
// https://www.hackerearth.com/practice/basic-programming/input-output/basics-of-input-output/practice-problems/algorithm/seating-arrangement-1/
const int N = 2e5 + 11;
void solve() {
int number;
cin >> number;
int segmented = ((number % 12) ? number % 12 : 12);
int padded = 13 - segmented;
unordered_map<int, string> seat;
seat[1] = seat[6] = seat[7] = seat[12] = "WS";
seat[2] = seat[5] = seat[8] = seat[11] = "MS";
seat[3] = seat[4] = seat[9] = seat[10] = "AS";
cout << number + padded - segmented << " " << seat[segmented] << endl;
}
int main() {
freopen("input.txt", "r", stdin);
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int no_of_test_cases = 1;
cin >> no_of_test_cases;
while (no_of_test_cases--)solve();
return 0;
}