COFO::1425H Huge Boxes of Animal Toys

Problem

Point

Design

Big O(time)

Code

// https://beenpow.github.io/
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define r_rep(i,a,b) for(int i=(a);i>(b);i--)
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
typedef long long ll;
using namespace std;

bool beMinus(int a, int b, int c, int d){return (a+b)%2 == 1;}
bool bePlus (int a, int b, int c, int d){return (a+b)%2 == 0;}
bool beSmall(int a, int b, int c, int d){return (b+c) >= 1;}
bool beLarge(int a, int b, int c, int d){return (a+d) >= 1;}

void solve(){
    int ans[4] = {0, 0, 0, 0};
    int q, w, e, r;
    cin >> q >> w >> e >> r;
    // box 1
    if(beMinus(q, w, e, r) && beLarge(q, w, e, r)) ans[0] = 1;
    
    // box 2
    if(beMinus(q, w, e, r) && beSmall(q, w, e, r)) ans[1] = 1;
    
    // box 3
    if(bePlus(q, w, e, r) && beSmall(q, w, e, r)) ans[2] = 1;
    
    // box 4
    if(bePlus(q, w, e, r) && beLarge(q, w, e, r)) ans[3] = 1;
    
    rep(i, 0, 4){
        if(ans[i] == 1) cout << "Ya ";
        else cout << "Tidak ";
    }cout << '\n';
}
int main(){
    //freopen("input.txt", "r", stdin);
    int tc; cin >> tc;
    while(tc--)
        solve();
    return 0;
}