Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _CRT_SECURE_NO_WARNINGS
- #include <iostream>
- #include <algorithm>
- #include <vector>
- #include <cmath>
- #include<iomanip>
- using namespace std;
- const int INF = 1e9;
- int n, t, I, totalsum;
- string s;
- long long t1, t2;
- int cnt[30], ans = INF, l, r, a,b,c;
- int main()
- {
- ios::sync_with_stdio(false);
- cin.tie(0);
- cin >> t;
- for (I = 0; I < t; I++) {
- cin >> a >> b >> c;
- t1 = 0; t2 = 0;
- if (c % 2 == 0) {
- }
- else {
- t1 += 3;
- if (b >= 1) {
- t2 += 2;
- b--;
- }
- if (a >= 1) {
- t2++;
- a--;
- }
- if (a >= 1 && t2 < t1) {
- t2++;
- a--;
- }
- if (a >= 1 && t2 < t1) {
- t2++;
- a--;
- }
- }
- if (t2 < t1) {
- swap(t1, t2);
- }
- if (b % 2 == 0) {
- }
- else {
- t1 += 2;
- if (a >= 1 && t2 < t1) {
- t2++;
- a--;
- }
- if (a >= 1 && t2 < t1) {
- t2++;
- a--;
- }
- }
- if (a % 2 == 1) {
- t2++;
- }
- cout << abs(t1 - t2) << "\n";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement