よじろめ覚書

私の理解度重視のソースコードです。

ABC105B - Cakes and Donuts

問題:B - Cakes and Donuts

#include <iostream>
using namespace std;

#define REP(i, n) for (int i = 0; i < (n); ++i)

int main(void) {
    int n;
    bool flg = false;

    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> n;
    REP(i, n / 4 + 1) {
        REP(j, n / 7 + 1) {
            if (4 * i + 7 * j == n) {
                flg = true;
            }
        }
    }

    cout << (flg? "Yes" : "No") << "\n";
    return 0;
}