#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using ll = long long; using namespace atcoder; int solve() { ll N,M,K; cin >> N >> M >> K; if (2 *min(N,M) - 1 + (N != M) < K || (K == 0 && N > 0 && M > 0)){ cout << -1 << endl; }else{ vector> runlength; if (K < 2 *min(N,M) - 1 + (N != M) || N >= M){ runlength.push_back({'0',1}); N--; for(int i = 0;i < K;i++){ if (i % 2 == 0){ runlength.push_back({'1',1}); M--; }else{ runlength.push_back({'0',1}); N--; } } runlength[0].second += N; if (runlength[runlength.size()-1].first == '1'){ runlength[runlength.size()-1].second += M; }else{ runlength[runlength.size()-2].second += M; } }else{ runlength.push_back({'1',1}); M--; for(int i = 0;i < K;i++){ if (i % 2 == 1){ runlength.push_back({'1',1}); M--; }else{ runlength.push_back({'0',1}); N--; } } if (runlength[runlength.size()-1].first == '1'){ runlength[runlength.size()-1].second += M; }else{ runlength[runlength.size()-2].second += M; } runlength[1].second += N; } for(auto p:runlength){ for(int i = 0;i < p.second;i++){ cout << p.first; } } cout << endl; } return 0; } int main() { // ll T; // cin >> T; // while (T--) // { solve(); // } // cout << flush; return 0; }