Cakes and Donuts

Problem Link

Solution by TheRealFertos100 pts

Code / Notes

#include <bits/stdc++.h>
using namespace std;

int main () {
    int n;
    cin >> n;
    if (n%4==0) {
        cout << "Yes";
    } 
    else if (n%4==1 & n>=21) {
        cout << "Yes";
    }
    else if (n%4==2 & n>=14) {
        cout << "Yes";
    }
    else if (n%4==3 & n>=7) {
        cout << "Yes";
    }
    else {
        cout << "No";
    }
}

Last updated 3 weeks, 3 days ago


« Back to problem