Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <map>
- #include <cmath>
- #include <math.h>
- #include <set>
- #include <vector>
- #include <sstream>
- #include <string>
- #include <cstring>
- #include <cstdio>
- #include <algorithm>
- #include <cstring>
- #include <queue>
- #include <cstdlib>
- #include <iomanip>
- #include <ctime>
- #include <time.h>
- #include <random>
- int solve() {
- int n, k;
- cin >> n >> k;
- vector <vector <int>> year(12);
- vector <int> shit = {
- 31,
- 28 + ((n % 4 == 0 && n % 100 != 0) || (n % 400 == 0)),
- 31,
- 30,
- 31,
- 30,
- 31,
- 31,
- 30,
- 31,
- 30,
- 31
- };
- for (int i=0; i<12; ++i) {
- year[i].resize(shit[i]);
- }
- int kek=0, tmp=0, lol=0;
- for (int i=0; i<12; ++i) {
- for (int j=0; j<sz(year[i]); ++j) {
- lol++;
- if (j % 7 > 4) {
- continue;
- } else {
- tmp++;
- }
- if (tmp == 4) {
- kek++;
- tmp = 0;
- }
- if (k == kek) {
- cout << i + 1 << " " << j + 1 << endl;
- return 0;
- }
- }
- }
- cout << "0 0" << endl;
- return 0;
- }
- signed main() {
- solve();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement