Solution 1
Time Complexity:
C++
#include <bits/stdc++.h>using namespace std;void fail() {cout << "No\n";exit(0);}int main() {ios::sync_with_stdio(false);
Join the USACO Forum!
Stuck on a problem, or don't understand a module? Join the USACO Forum and get help from other competitive programmers!