akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
constexpr long double EPS = 1e-15;
const long double PI = acos(-1);
constexpr int inf = 2e9;
constexpr ll INF = 2e18;
constexpr ll MOD = 1e9+7;
constexpr ll MOD1 = 998244353;
typedef pair<ll,ll> P;
//#define all(v) (v).begin(), (v).end()
#define rep(i,a,b) for (int i = (a); i < (b); i++)
#define REP(i,n) rep(i,0,n)
#define sz(s) (s).size()
#define pb push_back
#define fi first
#define se second
//#define mp make_pair

ll d[200010][30];

void solve() {
    string s,t;
    cin >> s >> t;
    int sz = s.size();
    REP(i,200010) {
        REP(j,30) {
            d[i][j] = inf;
        }
    }
    s += s;
    for (int i = sz(s) - 1; i >= 0; i--) {
        for (int j = 0; j < 26; j++) {
            char c = j + 'a';
            if (s[i] == c) {
                d[i][j] = 0;
            } else {
                d[i][j] = d[i+1][j] + 1;
            }
        }
    }
    // REP(i,26) {
    //     cout << (char)(i + 'a') << endl;
    //     REP(j,sz(s)) {
    //         cout << d[j][i] << " ";
    //     }
    //     cout << endl;
    // }

    ll ans = 0;
    int pos = 0;
    for (int i = 0; i < sz(t); i++) {
        if (d[pos][t[i] - 'a'] >= inf) {
            cout << -1 << endl;
            return;
        }
        if (i == 0 && s[pos] == t[i]) continue;
        ll go;
        if (d[pos][t[i] - 'a'] == 0) {
            go = d[(pos + 1) % sz][t[i] - 'a'] + 1;
        } else {
            go = d[pos][t[i] - 'a'];
        }
        pos += go;
        pos %= sz;
        ans += go;
    }
    cout << ans + 1 << endl;
}

int main(int argc, char *argv[]){
    // /* Regular */
    // int case_num = 1;
    // if (argc > 1 && stoi(argv[1])) cin >> case_num;
    // REP(case_no, case_num) {
    //   cerr << endl << "case " << case_no + 1 << endl;
    //   solve();
    // }
    /* AOJ */
    solve();
    return 0;
}

Measured memory_bytes: 47744
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <cmath>
#include <climits>
#include <iomanip>
#include <set>
#include <map>
using namespace std;
typedef long long ll;
int main(){
  ll a,b,c;
  cin >> a >> b >> c;
  if((a*100 + b*10 + c) % 4 == 0)cout << "YES" << endl;
  else cout << "NO" << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
int main() {
    string S;
    cin >> S;
    int A = 0,B = 0,C = 0;
    for(int i=0; i<3; i++){
        if(S[i] == 'a'){
            A +=1;
        }
        else if(S[i] == 'b'){
            B +=1;
        }
        else if(S[i] == 'c'){
            C +=1;
        }
    }
    if(A == 1 && B == 1 && C == 1){
        cout << "Yes" << endl;
    }
    else{
        cout << "No" << endl;
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll=long long int;
#define np basic_string::npos
int main(void){
    string s;
    cin>>s;
    bool sw=true;
    reverse(s.begin(),s.end());
    string ss[]={"esare","resare","remaerd","maerd"};
    while(sw){
        sw=false;
        for(int i=0;i<4;i++){
            if(s.substr(0,ss[i].size())==ss[i]){
                s=s.substr(ss[i].size(),s.size()-ss[i].size());
                sw=true;
            }
        }
    }
    cout<<(s.size()?"NO":"YES")<<endl;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
//#include <tr1/unordered_map>
//#include"Bignum/bignum.h"
//#define big bignum
#define lowbit(x) (x & -x)
#define debug(x) (cout << "#x = " << (x) << endl)
#define Set(x, i) memset (x, i, sizeof(x))
#define R register
#define For(i, j, k) for(R int i = (j), ED = (k); i <= ED; ++i)
#define Rep(i, j, k) for(R int i = (j), ED = (k); i >= ED; --i)
#define Cross(i, j, k) for(R int i = (j); i; i = (k))
using namespace std;
typedef long long ll;
const ll N = 100011;
const ll INF = 5e16;

namespace IO {

	inline char gc() {
		static char buf[100000], *p1 = buf, *p2 = buf;
		return (p1 == p2) && (p2 = (p1 = buf) +
			fread (buf, 1, 100000, stdin), p1 == p2)? EOF: *p1++;
	}

	#define dd ch = getchar()
	inline ll read() {
		R ll x = 0; R int f = 0; R char dd;
		for (; !isdigit (ch); dd) f ^= (ch == '-');
		for (; isdigit (ch); dd)  x = x * 10 + (ch ^ 48);
		return f? -x: x;
	}
	#undef dd

	inline void write( ll x ) {
		if (x < 0) putchar ('-'), x = -x;
		if (x > 9) write (x / 10); putchar (x % 10 | 48);
	}

	inline void wrn ( ll x ) { write (x); putchar (' '); }

	inline void wln ( ll x ) { write (x); putchar ('\n'); }

	inline void wlnn ( ll x, ll y ) { wrn (x), wln (y); }

}

using IO::wln;
using IO::read;

namespace Cesare {
	
	ll n, res, a[N];
	
	int main() {
		n = read();
		For ( i, 1, n ) a[i] = read();
		For ( i, 1, n ) res ^= a[i];
		return puts (!res? "Yes": "No"), 0;
	}
	
}

int main()
{
	return Cesare::main();
}

/*

*/






Measured memory_bytes: 1024
#pragma comment(linker,"/STACK:1000000000")
#include<iostream>
#include<algorithm>
#include<vector>
#include<set>
using namespace std;

#define sz(x) (int)(x.size())
#define fi(a,b) for(int i=a;i<b;++i)
#define fj(a,b) for(int j=a;j<b;++j)
#define fo(a,b) for(int o=a;o<b;++o)
#define pb push_back
#define mp make_pair
typedef pair<int, int> pii;
////////////////////

int const N = 1e5 + 41;
int const H = 241;

int n, h, a[N], b[N], c[N], d[N];
int d0[H][2], d1[H][2];

vector<pii> e[H][2];
vector<pii> st;

pii getfrom(int a, int c){
	if(c > 0) return mp(c, 0);
	else return mp(a, 1);
}

pii getto(int b, int d){
	if(d > 0) return mp(d, 1);
	else return mp(b, 0);
}

bool dfs(pii x){
	st.pb(x);
	bool res;
	if(sz(e[x.first][x.second])){
		pii y = e[x.first][x.second].back();
		e[x.first][x.second].pop_back();
		--d0[x.first][x.second];
		--d1[y.first][y.second];
		res = dfs(y);
	}else{
		if(x.second == 0){
			res = (x.second == 0 ? 1 : 0);
		}
	}

	return res;
}

void dfs1(pii x){
	st.pb(x);
	while(sz(e[x.first][x.second])){
		pii y = e[x.first][x.second].back();
		--d0[x.first][x.second];
		--d1[y.first][y.second];
		e[x.first][x.second].pop_back();
		dfs1(y);
	}
}

void solve(){
	fi(0, n){
		pii x = getfrom(a[i], c[i]);
		pii y = getto(b[i], d[i]);
		e[x.first][x.second].pb(y);
		++d0[x.first][x.second];
		++d1[y.first][y.second];
	}
	bool ok = true;
	fi(1, h+1){
		int k = d0[i][1] - d1[i][1];
		if(k < 0) ok = false;
		fj(0, k){
			ok &= dfs(mp(i, 1));
		}
	}
	set<pii> t;
	while(sz(st)){
		t.insert(st.back());
		st.pop_back();
	}
	fi(1, h+1) fj(0, 2){
		ok &= (d0[i][j] == d1[i][j]);
	}
	fi(1, h+1) fj(0, 2){
		if(d0[i][j] == 0) continue;
		st.clear();
		dfs1(mp(i, j));
		bool f = false;
		fo(0, sz(st)){
			if(t.find(st[o]) != t.end()) f = true;
		}
		ok &= f;
	}
	
	if(ok) printf("YES\n");
	else printf("NO\n");
}

int main(){
#ifdef _DEBUG
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
#endif
	
	scanf("%d %d",&n,&h);
	fi(0, n) scanf("%d %d %d %d",&a[i],&b[i],&c[i],&d[i]);

	solve();

	return 0;
}

Measured memory_bytes: 7292
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define FOR(i,start,end) for(int i=start;i<=end;i++)
const int INF = 1001001001;
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define Sort(a) sort(a.begin(), a.end())
#define Rort(a) sort(a.rbegin(), a.rend())
typedef long long ll;
const ll MOD=1000000007;
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T>auto MAX(const T& a) { return *max_element(a.begin(),a.end()); }
template<class T>auto MIN(const T& a) { return *min_element(a.begin(),a.end()); }
template<class T, class U>U SUM(const T& a, const U& v) { return accumulate(a.begin(),a.end(), v); }
template<class T, class U>U COUNT(const T& a, const U& v) { return count(a.begin(),a.end(), v); }
template<class T, class U>int LOWER(const T& a, const U& v) { return lower_bound(a.begin(),a.end(), v) - a.begin(); }
template<class T, class U>int UPPER(const T& a, const U& v) { return upper_bound(a.begin(),a.end(), v) - a.begin(); }
int GCD(int a, int b) { return b ? GCD(b, a%b) : a; }
int LCM(int a, int b) { int g = GCD(a, b); return a / g * b; }
//---------------------------------------------------------------------------------------------------
typedef pair<int,int> P;

int main(void){
    // Your code here!
    int n; cin >> n;
    vector<int> a(n);
    rep(i,n) cin >> a[i];
    int su = a[0];
    FOR(i,1,n-1) {
        su = su ^ a[i];
    }
    rep(i,n) {
        int ans = su ^ a[i];
        cout << ans << " ";
    }
}


Measured memory_bytes: 3884
A,B,C = list(map(int,input().split()))
K = int(input())


def dp(a,b,c,k):
    if k == 0:
        return a+b+c
    elif k == 1:
        return max(a,b,c) + a+b+c
    else:
        if max(a,b,c) == a:
            return dp(2*a, b, c, k-1)
        elif max(a, b, c) == b:
            return dp(a, 2*b, c, k - 1)
        else:
            return dp(a, b, 2*c, k - 1)


print(dp(A,B,C,K))

Measured memory_bytes: 3064
#include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<string>
#include <cmath> 
using namespace std;
const int p=31;
const int m=1e9+9;
typedef long long ll;

//return res.empty() ? "0" : res;
/* istringstream ss(text);
    string s;
    while(ss>>s)*/
static auto speedup = []() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    return nullptr;
}();

int main (){

    #ifndef ONLINE_JUDGE					
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
        int k;
    cin>>k;
    string s;
    cin>>s;
    if((int)s.length()<=k) {
    	cout<<s;
    }
    else
    	cout<<s.substr(0,k)<<"...";


}


Measured memory_bytes: 3660
#include<stdio.h>
#include<stdlib.h>
#include<stdbool.h>
#include<iostream>
#include<vector>
#include<string>
#include<queue>
#include<set>
typedef long long ll;
using namespace std;


char diff(char** w,int i, int j,int H,int W) {
	int x = 0, y = 0, res = 0;
	for (int a = -1;a <= 1;a++) {
		for (int b = -1;b <= 1;b++) {
			x = i + a, y = j + b;
			if (0 <= x&&x < H && 0 <= y&&y < W&& w[x][y] == '#') {
				res++;
			}
		}
	}
	char a = res + '0';
	return a;
}

int main(void) {
	int h, w, ans = 0;
	cin >> h >> w;
	char** a = (char**)malloc(sizeof(char*)*h);
	for (int i = 0;i < h;i++)a[i] = (char*)malloc(sizeof(char)*(w + 1));
	for (int i = 0;i < h;i++) {
		for (int j = 0;j < w;j++) {
			cin >> a[i][j];
			ans++;
		}
	}
	for (int i = 0;i < h;i++) {
		for (int j = 0;j < w;j++) {
			if (a[i][j] == '.') {
				a[i][j] = diff(a,i, j, h, w);
			}
		}
	}
	for (int i = 0;i < h;i++) {
		for (int j = 0;j < w;j++) {
			cout << a[i][j];
		}
		cout << endl;
	}
	//数学複素数平面
	/*
	int x[2],y[2];
	cin >> x[0] >> y[0] >> x[1] >> y[1];
	cout << x[1]+y[0]-y[1] << " " << -x[0] + x[1] + y[1] << " " << x[0] + y[0] - y[1] << " " << -x[0] + x[1] + y[0] << endl;
	return 0;*/
	//数学的に考える
	/*ll n, k, res = 0;
	cin >> n >> k;
	res = (n / k)*(n / k)*(n / k);
	if (k % 2 == 1) {
		cout << res << endl;
	}
	else {
		ll x = k / 2;
		ll num = 0;
		if (x > n) {
			cout << res << endl;
			return 0;
		}
		else {
			num = 1;
			for (ll i = 0;i < n;i++) {
				if (x + k <= n) {
					x += k;
					num++;
				}
				else break;
			}
			res += num*num*num;
			cout << res << endl;
		}
	}*/
	return 0;
}

Measured memory_bytes: 256
//#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>

#define IOS ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define endl '\n'
#define ll long long int
#define vec vector
#define forn(a) for(ll a=0; a<n; a++)
#define all(x) x.begin(), x.end()
#define deb(x) cerr<<#x<<" = "<<x<<endl

using namespace std;

int main() {
    IOS;

    int n; cin>>n;
    vec<int> a(n); forn(i)cin>>a[i],a[i]--;
    vec<int> b(n); forn(i)cin>>b[i];
    vec<int> c(n-1); for(int i=0; i<n-1; i++)cin>>c[i];

    int ans = b[ a[0] ];
    for(int i=1; i<n; i++){
        //como el a[i];
        ans += b[ a[i] ];
        //si el anterior es el a[i]-1 tambien agrego c
        if( (a[i-1]+1)==a[i] ){
            ans += c[ a[i-1] ];
        }
    }

    cout<<ans<<endl;

    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ff              first
#define ss              second
#define int             long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define uii             unordered_map<int,int>
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define w(x)            int x; cin>>x; while(x--)
void S_K_S()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
}


int32_t main()
{
	S_K_S();
	string s,t;
	cin>>s>>t;
	int ls=s.size(),ans=INT_MAX;
	int lt=t.size();
	for(int i=0;i<=ls-lt;i++)
	{
	    string s2= s.substr(i,lt);
	    int cnt=lt;
	    for(int j=0;j<lt;j++)
	    {
	        if(s2[j]==t[j])
	            cnt--;
	    }
	    ans=min(cnt,ans);
	}
	cout<<ans;
}

Measured memory_bytes: 3664
#if !defined(__clang__) && defined(__GNUC__)
#include <bits/stdc++.h>
#else
#include <cstdlib>
#include <climits>
#include <iostream>
#include <cstdint>
#include <vector>
#include <string>
#include <complex>
#include <bitset>
#include <queue>
#include <deque>
#include <stack>
#include <utility>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <regex>
#endif //  !defined(__clang__) && defined(__GNUG__)
#include <boost/lexical_cast.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/multi_array.hpp>
#include <boost/optional.hpp>
#include <boost/math/common_factor_rt.hpp>  // https://boostjp.github.io/tips/math.html
#include <boost/dynamic_bitset.hpp>  // https://boostjp.github.io/tips/dynamic_bitset.html

constexpr int64_t DIV1097 = 1000000007LL;

using namespace std;

int main()
{
    int64_t N, M;
    std::cin >> N >> M;

    struct City {
        int64_t pref;
        int64_t year;
    };

    std::vector<City> C;
    for (decltype(M) i = 0; i < M; ++i) {
        int64_t p, y;
        std::cin >> p >> y;
        p--;
        C.push_back({p, y});
    }

    std::vector<std::vector<int64_t>> P(N);

    for (auto& c: C) {
        P[c.pref].push_back(c.year);
    }

    for (auto& p: P) {
        std::sort(std::begin(p), std::end(p));
    }

    for (int64_t i = 0; i < M; ++i) {
        std::cout << std::setfill('0') << std::setw(6) << C[i].pref + 1;
        auto& pv = P[C[i].pref];
        auto idx = std::distance(pv.begin(), std::lower_bound(pv.begin(), pv.end(), C[i].year)) + 1;
        std::cout << std::setfill('0') << std::setw(6) << idx << std::endl;
    }

    return 0;
}


Measured memory_bytes: 8560
import java.util.Scanner;

public class Main {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();

		int lcm = sc.nextInt();
		for (int i = 0; i < n - 1; i++) {
			int a = sc.nextInt();
			lcm = lcm(lcm, a);
		}

		System.out.println(lcm);

		sc.close();
	}

	private static int lcm(int n, int m) {
		return n * m / gcd(n, m);
	}

	private static int gcd(int n, int m) {
		if (m == 0) {
			return n;
		} else {
			return gcd(m, n % m);
		}
	}
}

Measured memory_bytes: 17172
s= input()
if len(s)%2!=0:
    print('No')
else:
    no= False
    while(len(s)>0 and not no):
        if s[:2]!='hi':
            no=True
            break
        s=s[2:]
    if no:
        print('No')
    else:
        print('Yes')


Measured memory_bytes: 2940
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep2(i,s,n) for(int i=(int)(s);i<(int)(n);i++)
typedef long long ll;

int main(){
    int N,M;
    cin >> N >> M;
    vector<pair<int,int>> AB(N);
    rep(i,N) cin >> AB[i].first >> AB[i].second;

    sort(AB.begin(),AB.end());
    priority_queue<int> que;
    int cnt=0;
    ll ans=0;
    rep2(i,1,M+1){
        while(AB[cnt].first<=i){
            que.push(AB[cnt].second);
            cnt++;
        }
        if(!que.empty()){
            ans+=que.top();
            que.pop();
        }
        
    }
    cout << ans << endl;
}

Measured memory_bytes: 1660
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < n; i++)
#define ll long long
using namespace std;

int main() {
    int n;
    cin>>n;
    int sum=0;
    vector<int> x(n);
    rep(i,n) {
        cin>>x[i];
        sum+=x[i];
    }
    int p=sum/n;
    int q=p+1;
    int ap=0,aq=0;
    rep(i,n){
        ap+=(x[i]-p)*(x[i]-p);
        aq+=(x[i]-q)*(x[i]-q);
    }
    cout<<min(ap,aq)<<endl;
}


Measured memory_bytes: 256
N = int(input())
S = sorted([int(input()) for _ in range(N)])

non_10s = None
for s in S:
    if s % 10 != 0:
        non_10s = s
        break

answer = sum(S)

if answer % 10 == 0 and non_10s != None:
  answer -= non_10s
elif answer % 10 == 0:
  answer = 0
else:
  answer = answer
print(answer)

Measured memory_bytes: 9128
#include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>

using namespace std;

int field[21][21];
int dp[2][1<<20];
int h,w;

int main(){

	int t;
	cin>>t;
	int cnt=0;
	while(cnt<t){
		cnt++;
		cin>>w>>h;
		for(int i=0;i<h;i++)for(int j=0;j<w;j++)cin>>field[i][j];
		if(w>h){
			int tf[21][21];
			for(int i=0;i<h;i++)for(int j=0;j<w;j++)tf[w-1-j][i]=field[i][j];
			swap(h,w);
			for(int i=0;i<h;i++)for(int j=0;j<w;j++)field[i][j]=tf[i][j];
		}
		memset(dp,0,sizeof(dp));
		for(int i=h*w-1;i>=0;i--){
			for(int j=0;j<(1<<w);j++){
				int s=j;
				int nxt=i%2;
				int cur=(i+1)%2;
				int curh=i/w;
				int curw=i%w;
				dp[nxt][s]=0;
				// ツ置ツつゥツづ按つ「
				{
					int ns=s;
					ns&=~(1<<curw);
					dp[nxt][s]=max(dp[nxt][s],dp[cur][ns]);
				}
				// ツ置ツつッツづゥツづ按づァツ置ツつュ
				if((curw==0||!((s>>(curw-1))&1))&&(curh==0||!((s>>(curw))&1))){
					int ns=s;
					ns|=(1<<curw);
					dp[nxt][s]=max(dp[nxt][s],dp[cur][ns]+field[curh][curw]);
				}
			}
		}
		int res=dp[0][0];
		cout<<"Case "<<cnt<<": "<<res<<endl;
	}

	return 0;
}

Measured memory_bytes: 9060
s = input()
t = input()
n = len(s)
m = len(t)
def check(s, t):
    count = 0
    for i, j in zip(s, t):
        if i == j:
            count += 1
    return count
ans = -1
for i in range(n - m + 1):
    tmp = s[i:i + m]
    count = check(tmp, t)
    ans = max(ans, count)
print(m-ans)

Measured memory_bytes: 9092
#include <bits/stdc++.h>
using namespace std;

struct Benri { Benri() { std::cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(12);}} benri;

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int, int>;
using vll = vector<long long>;
using vvll = vector<vll>;
using pll = pair<ll, ll>;
using ull = unsigned long long;

template <typename T> using PQ = priority_queue<T>;
template <typename T> using minPQ = priority_queue<T, vector<T>, greater<T>>;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define mp make_pair
#define F first
#define S second

template<class T>bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; }

constexpr long long MOD = 1000000007;
//constexpr long long MOD = 998244353;
//constexpr int INF = 1001001001;
constexpr ll INF = 1001001001001001001ll;
constexpr double EPS = 1e-10;
using number = long long;

int main() {
    int a, b; cin >> a >> b;
    cout << (a & b & 1 ? "Yes" : "No" ) << endl;

}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;

#define int long long
#define fi first
#define se second
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define rep1(i,n) for(int i=1;i<=(int)(n);++i)
#define rep11(i,n) for(int i=1;i<(int)(n);++i)
#define repo(i,o,n) for(int i=o;i<(int)(n);++i)
#define repm(i,n) for(int i=(int)(n)-1;i>=0;--i)
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define pb(n) push_back(n)
#define mp make_pair
#define MOD 1000000007
#define INF LONG_LONG_MAX

int a,b,k;

signed main() {
    cin >> a >> b >> k;
    cout << max(0LL, a-k) << " " << max(0LL, b-max(0LL,k-a)) << endl;
}



Measured memory_bytes: 256
import java.util.*;
import java.io.*;
public class Main {

	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine().trim());
		int N = (int)Math.pow(2, n);
		int[] arr = new int[N];
		StringTokenizer st = new StringTokenizer(br.readLine());
		for(int i = 0; i < N; i++) {
			arr[i] = Integer.parseInt(st.nextToken());
		}
		Arrays.sort(arr);
		if(arr[N-1] == arr[N-2]) {
			System.out.println("No");
			return;
		}
		PriorityQueue<Integer> q = new PriorityQueue<>();
		q.add(-n);
		ArrayList<Integer> newpairs = new ArrayList<Integer>();
		int last = arr[N-2];
		for(int i = N-2; i >= 0; i--) {
			if(arr[i] != last) {
				q.addAll(newpairs);
				newpairs = new ArrayList<Integer>();
			}
			if(q.isEmpty()) {
				System.out.println("No");
				return;
			}
			int c = -q.poll();
			if(c > 1) {
				newpairs.add(-(c-1));
			}
			c--;
			if(c > 0) {
				q.add(-c);
			}
			
			last = arr[i];
		}
		System.out.println("Yes");
	}
	static class Pair implements Comparable<Pair>{
		int pos, count;
		public Pair(int pos, int count) {
			this.pos = pos; this.count = count;
		}
		public String toString() {
			return pos+", "+count;
		}
		@Override
		public int compareTo(Pair p) {
			return p.count - count;
		}
	}

}


Measured memory_bytes: 62668
#include<iostream>
using namespace std;
 
int main(){
int n;
cin>>n;
int a[n];
for(int i=0;i<n;i++){
cin>>a[i];
}
long long sum=0;
for(int i=0;i<n;i++){
sum=sum+a[i];
}
int max=a[0];
for(int i=1;i<n;i++){
if(max<a[i]) max=a[i];
}
int min=a[0];
for(int i=1;i<n;i++){
if(min>a[i]) min=a[i];
}

cout<<min<<" "<<max<<" "<<sum<<endl;
}

Measured memory_bytes: 3112
N, L = map(int, input().split())

t = [L + i - 1 for i in range(1, N + 1)]
s = sum(t)

if t[0] > 0 :
    print(s - t[0])
elif t[-1] < 0 :
    print(s - t[-1])
else :
    print(s)

Measured memory_bytes: 38384
def resolve():
    def make_divisors(n):
        divisors = []
        for i in range(1, int(n ** 0.5) + 1):
            if n % i == 0:
                divisors.append(i)
                if i != n // i:
                    divisors.append(n // i)

        divisors.sort()
        return divisors

    N = int(input())

    # N //m = k,  N%m = k  kは同じ値
    # N = k*m + k : 商と余りを計算したらNになる
    # N = k(m+1)より、m = (N//k)-1 -> m = 約数 - 1

    div = make_divisors(N)
    ans = 0
    for k in div[1:]:  # 1より大きい値からスタート
        m = k - 1
        if m <= 0:
            continue
        if N // m == N % m:
            ans += m

    print(ans)


if __name__ == "__main__":
    resolve()

Measured memory_bytes: 9660
//Edson
#include <iostream>
#include <vector>

using namespace std;

int solve(int N, const vector<int>& hs)
{
    int ans = 0, m = hs[0];

    for (int i = 1; i < N; ++i)
    {
        // Verifica se é possível ver o horizonte a partir deste ponto
        if (hs[i] >= m)
            ++ans;

        // Atualiza a altura a ser comparada
        m = max(m, hs[i]);
    }

    return ans + 1;
}

int main()
{
    int N;
    cin >> N;

    vector<int> hs(N);

    for (int i = 0; i < N; ++i)
        cin >> hs[i];

    cout << solve(N, hs) << '\n';

    return 0;
}

Measured memory_bytes: 256
import fractions
a, b, c, d = map(int, input().split())
lcm = (c * d) // fractions.gcd(c, d)
a_c_d, a_c_m = divmod(a, c)
a_d_d, a_d_m = divmod(a, d)
a_lcm_d, a_lcm_m = divmod(a, lcm)
lt_a = (a_c_d + (-1 if a_c_m == 0 else 0)) + (a_d_d + (-1 if a_d_m == 0 else 0)) - (a_lcm_d + (-1 if a_lcm_m == 0 else 0))
b_c_d, b_c_m = divmod(b, c)
b_d_d, b_d_m = divmod(b, d)
b_lcm_d, b_lcm_m = divmod(b, lcm)
lte_b = b_c_d + b_d_d - b_lcm_d
print((b - a + 1) - (lte_b - lt_a))

Measured memory_bytes: 5244
#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  cin >> n;
  vector<int> p(n);
  for (int i = 0; i < n; i++){
    cin >> p[i];
  }
  int ans = 0;
  for (int i = 0; i < n - 2; i++){
    if((p[i] > p[i + 1] && p[i + 1] > p[i + 2]) || (p[i] < p[i + 1] && p[i + 1] < p[i + 2]))
    ans++;
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
typedef long long int ll;
using namespace std;

string s;
int n;
const ll MODP = 1000000007;
ll dp[100001][13];

int main(){
  cin >> s;
  n = s.size();
  ll base = 1;
  dp[0][0] = 1;
  for(int i=0;i<n;i++){
    for(int j=0;j<13;j++){
      if (s[n-1-i]!='?'){
        ll val = base * (ll)(s[n-1-i] - '0') % 13;
        dp[i+1][(j+val)%13] += dp[i][j];
        dp[i+1][(j+val)%13] %= MODP;
      }else{
        for(int k=0;k<10;k++){
          ll val = base * k % 13;
          dp[i+1][(j+val)%13] += dp[i][j];
          dp[i+1][(j+val)%13] %= MODP;
        }
      }
    }
    base = (base * 10) % 13;
  }
  cout << dp[n][5] << endl;
  return 0;
}
  

Measured memory_bytes: 10624
#include<iostream>
#include<iomanip>
#include<string.h>
using namespace std;

int main()
{
    int n;

    cin>>n;
    string str[n], temp,str1[n];
    int k,a[n],i,j,temp1,temp2,a1[n],arr[n],ind,count;
    for(k=0;k<n;k++)
    {
        cin>>str[k];
        cin>>a[k];
    }
    for(k=0;k<n;k++)
    {
        str1[k]=str[k];
        a1[k]=a[k];
    }

    for(i = 0; i < n-1; i++)
      {
        for( j = i+1; j < n; j++)
        {
          if(str[i] > str[j])
          {
            temp = str[i];
            str[i] = str[j];
            str[j] = temp;
            temp1=a[i];
            a[i]=a[j];
            a[j]=temp1;
          }
        }
      }
      for(i=0;i<n-1;i++)
      {
          for(j=i+1;j<n;j++)
          {
              if(str[i]==str[j])
              {
                  if(a[i]<a[j])
                  {
                      temp2=a[i];
                      a[i]=a[j];
                      a[j]=temp2;
                  }
              }
          }
      }
      cout<<endl;
      cout<<endl;
      for(i=0;i<n;i++)
      {
          for(j=0;j<n;j++)
          {
              if(str[i]==str1[j] && a[i] == a1[j])
              {
                  cout<<j+1<<endl;
              }
          }
      }

}




Measured memory_bytes: 256
#include <cassert>
#include <cstdio>
#include <cmath>

typedef long long i64;

const i64 MOD = 1e9 + 7;
const i64 ZERO = 2000 + 5;
const i64 MAXM = 4500;
const i64 MAXFACT = 8000 + 10;
const i64 MAXN = 200000 + 5;

int N;
int factorial[MAXFACT], inverse[MAXFACT];
int a[MAXN], b[MAXN];
int dp[MAXM][MAXM];

i64 modularExp(i64 base, i64 exp)
{
	i64 ret = 1;
	while(exp)
	{
		if(exp & 1)
			ret = ret * base % MOD;
		base = base * base % MOD;
		exp = exp >> 1;
	}
	return ret;
}

void preprocess()
{
	factorial[0] = 1;
	for(int i = 1; i < MAXFACT; i++)
		factorial[i] = 1LL * factorial[i-1] * i % MOD ;

	inverse[MAXFACT - 1] = modularExp(factorial[MAXFACT - 1], MOD - 2);
	for(int i = MAXFACT - 2; i >= 0; i--)
		inverse[i] = 1LL * inverse[i + 1] * (i + 1) % MOD;
	assert(inverse[1] == 1);
}

inline int getBinomial(int n, int m)
{
	return 1LL * factorial[n] * inverse[m] % MOD * inverse[n - m] % MOD;
}

int main()
{
	i64 ans = 0;
	preprocess();

	scanf("%d", &N);
	for(int i = 1; i <= N; i++)
		scanf("%d%d", &a[i], &b[i]),
		dp[ZERO - a[i]][ZERO - b[i]] += 1;

	for(int i = 1; i < MAXM; i++)
		for(int j = 1; j < MAXM; j++)
			dp[i][j] = (dp[i][j] + dp[i-1][j] + dp[i][j-1]) % MOD;

	for(int i = 1; i <= N; i++)
		ans = (ans + dp[ZERO + a[i]][ZERO + b[i]]) % MOD;
	for(int i = 1; i <= N; i++)
		ans = ((ans - getBinomial((a[i] + b[i]) * 2, b[i] * 2)) % MOD + MOD) % MOD;
	
	printf("%lld\n", (1LL * inverse[2]*ans)%MOD);
}


Measured memory_bytes: 80896
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
#include<map>
#include <limits>
#include <numeric>
#include <type_traits>
using namespace std;


int main()
{
	string t, s;
	cin >> t >> s;
	cout << s + t << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstring>

#include <string>
#include <vector>
#include <algorithm>

using namespace std;

#define SZ(a) int((a).size())
#define REP(i,n) for(int i=0,_n=(n);i<_n;++i)
#define FOR(i,a,b) for(int i=(a),_b=(b);i<=_b;++i)

typedef long long llong;
typedef vector<int> VI;
typedef vector<VI> VVI;

#define MAXN 16
int N, K;
llong H[MAXN];

llong solve() {
   llong res = 1000000000000000000LL;
   REP(mask, 1<<N) {
      llong maxh = 0;
      llong cost = 0;
      int nseen = 0;
      REP(i, N) {
         if (H[i] > maxh) {
            maxh = H[i];
            ++nseen;
         }
         else if (mask & (1<<i)) {
            cost += maxh - H[i] + 1;
            maxh++;
            ++nseen;
         }
      }
   // cerr << mask << ' ' << nseen << ' ' << cost << endl;
      if (nseen >= K)
         res = min(res, cost);
   }
   return res;
}

int main(int argc, char* argv[]) {
   ios_base::sync_with_stdio(false); 
   cin.tie(NULL);

   cin >> N >> K;
   REP(i, N)
      cin >> H[i];

   llong res = solve();
   cout << res << endl;

   return 0;
}


Measured memory_bytes: 256
from sys import stdin
N = int(stdin.readline().rstrip())
A = [int(x) for x in stdin.readline().rstrip().split()]
S = sum(A)
X1 = S -2*sum(A[1::2])
X = [0]*N
X[0] = X1
for i in range(0,N-1):
    X[i+1] = 2*A[i] - X[i]
for j in X:
  print(j,end=" ")

Measured memory_bytes: 14024
import java.util.*;
import java.util.Arrays;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        Integer L[]  =new Integer[N];
        for(int i=0;i<N;i++){
            L[i]=sc.nextInt();
        }
        Arrays.sort(L,Collections.reverseOrder());
        
        int a,b,c;
        int count=0;
        //a+b>c かつ b+c>a かつ  c+a>b
        for(int i=0;i<=N-3;i++){
            a=L[i];
            for(int j=i+1;j<=N-2;j++){
                b=L[j];
                for(int k=j+1;k<=N-1;k++){
                    c=L[k];
                    if(b+c>a&&a!=b&&b!=c&&a!=c){
                        count+=1;
                    }
                    
                }
            }

        }
        System.out.println(count);
    }
}


Measured memory_bytes: 35972
#include <bits/stdc++.h>

using namespace std;
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)

typedef long long ll;
typedef pair<ll, ll> P;
const ll INF = 1LL<<60;

ll gcd(ll a, ll b) {
  if(b == 0) return a;
  return gcd(b, a % b);
}

template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }

ll modpow(ll a, ll n, ll mod) {
  ll res = 1;
  while (n > 0) {
    if (n & 1) res = res * a % mod;
    a = a * a % mod;
    n >>= 1;
  }
  return res;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);

  int N;
  cin >> N;

  vector<ll> a(N);
  rep(i, N) cin >> a[i];

  int cnt = 0;
  rep(i, N){
    if(a[i]%2==0){
      cnt++;
    }
  }

  if(cnt == N){
    cout << "second" << endl;
  }else{
    cout << "first" << endl;
  }

  return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  cout << setprecision(20);

  ll n;
  cin >> n;
  ll ans = 1e13;
  for (ll i = 1; i * i <= n; ++i) {
    if (n % i == 0) {
      ans = min(ans, i - 1 + (n/i) - 1);
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
# Your code here!

n = gets.chomp.to_i
ps = gets.chomp.split(" ").map(&:to_i)
count = 0
for i in 0..(n-3)
    if (ps[i] < ps[i+1] && ps[i+1] < ps[i+2]) || (ps[i] > ps[i+1] && ps[i+1] > ps[i+2])
        count +=1
    end
end

puts count

Measured memory_bytes: 1788
#include <cstdlib>
#include <iostream>
#include <string>
#include <vector>
typedef long long LL;

int main() {
  int N; std::cin >> N;
  std::string S; std::cin >> S;
  for (char& c : S) {
    c += N;
    if ((int)c > (int)'Z') c -= 26;
    std::cout << c;
  }
  std::cout << std::endl;
}


Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
	"strconv"
)

func main() {
	N := readInt()
	L := make([]int, N)
	for i := 0; i < N; i++ {
		L[i] = readInt()
	}

	sort.Sort(sort.IntSlice(L))
	result := 0
	for i := 0; i < N-2; i++ {
		for j := i + 1; j < N-1; j++ {
			result += sort.SearchInts(L, L[i]+L[j]) - j - 1
		}
	}
	fmt.Println(result)
}

const (
	ioBufferSize = 1 * 1024 * 1024 // 1 MB
)

var stdinScanner = func() *bufio.Scanner {
	result := bufio.NewScanner(os.Stdin)
	result.Buffer(make([]byte, ioBufferSize), ioBufferSize)
	result.Split(bufio.ScanWords)
	return result
}()

func readString() string {
	stdinScanner.Scan()
	return stdinScanner.Text()
}

func readInt() int {
	result, err := strconv.Atoi(readString())
	if err != nil {
		panic(err)
	}
	return result
}


Measured memory_bytes: 640
#include <stdio.h>

int main(){
    
    int a[30] = {0};
    int i,j,c;
    int r = 2;
    
    for(i = 0; i <= r; i++){
        scanf("%d",&a[i]);
    }
    
    for(i = 0; i <= r; i++){
        for(j = i + 1; j <= r; j++){
            if(a[j] < a[i]){
                c = a[i];
                a[i] = a[j];
                a[j] = c;
            }
        }
    }

    printf("%d\n",(a[1] - a[0]) + (a[2] - a[1]));
    
    return 0;
}


Measured memory_bytes: 128
use std::io::Read;

fn main() {
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();

    let answer = solve(&buf);

    println!("{}", answer);
}

fn solve(input: &str) -> String {
    let mut iterator = input.split_whitespace();

    let n: usize = iterator.next().unwrap().parse().unwrap();

    let mut ans: usize = 1;
    let mut increasing: bool = false;
    let mut decreasing: bool = false;

    let mut prev: usize = 0;
    for _ in 0..n {
        let a: usize = iterator.next().unwrap().parse().unwrap();

        // println!("prev = {}, a = {}, inc = {}, dec = {}", prev, a, increasing, decreasing);

        if prev == 0 {
            // do nothing
        } else if !increasing && !decreasing {
            if a < prev {
                decreasing = true;
            } else if a > prev {
                increasing = true;
            }
        } else if increasing && a < prev {
            ans += 1;
            increasing = false;
        } else if decreasing && a > prev {
            ans += 1;
            decreasing = false;
        }

        prev = a;

        // println!("ans = {}", ans);
    }

    return ans.to_string();
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
#include <iomanip>

using namespace std;

typedef long long LL;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
typedef long double LD;
typedef pair<LD, LD> PLDLD;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define CLR(a) memset((a), 0 ,sizeof(a))
#define ALL(a) a.begin(),a.end()

const double eps=1e-5;
const int INF=1e9;


int main()
{
    int n,m;
    cin>>n>>m;
    vector<vector<int>> g(n);
    vector<vector<char>> used(n);
    vector<char> reach(n);

    REP(i,m)
    {
        int a,b;
        cin>>a>>b;
        a--;b--;
        g[b].push_back(a);
        g[a].push_back(b);
        used[a].push_back(0);
        used[b].push_back(0);
    }

    vector<int> path;
    int v=0,pv=0;
    path.push_back(v);
    reach[v]=1;
    while(1)
    {
        for(int i=0;i<g[v].size();i++)
        {
            if(used[v][i]) continue;
            if(reach[g[v][i]]) continue;

            used[v][i]=1;
            v=g[v][i];
            break;
        }
        if(v==pv)
        {
            break;
        }
        pv=v;

        reach[v]=1;
        path.push_back(v);
    }
    reverse(ALL(path));

    pv=0;
    v=0;
    while(1)
    {
        for(int i=0;i<g[v].size();i++)
        {
            if(used[v][i]) continue;
            if(reach[g[v][i]]) continue;
            
            used[v][i]=1;
            v=g[v][i];
            break;
        }
        if(v==pv)
        {
            break;
        }
        pv=v;

        reach[v]=1;
        path.push_back(v);
    }

    cout<<path.size()<<endl;
    REP(i,path.size())
        cout<<path[i]+1<<" \n"[i==path.size()-1];
}



Measured memory_bytes: 12412
import java.util.*

fun main(args : Array<String>) {
    val sc = Scanner(System.`in`)
    val n = sc.nextLong()
    val m = sc.nextLong()
    println(problem55c(n, m))
}

fun problem55c(s: Long, c: Long): Long {
    var sTmp = s
    var cTmp = c
    var count = Math.min(cTmp / 2, sTmp)
    sTmp -= count
    cTmp -= count * 2
    if (sTmp == 0L && cTmp >= 2) {
        cTmp -= 2
        sTmp++
    }
    while ((sTmp >= 1 && cTmp >= 2) || cTmp >= 3) {
        count++
        sTmp--
        cTmp -= 2
        if (sTmp == 0L && cTmp >= 2) {
            if (cTmp > 100000) {
                count += 20000
                cTmp -= 80000
            }
            cTmp -= 2
            sTmp++
        }
    }
    return count
}

Measured memory_bytes: 31268
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) REP(i,0,n)
#define REP(i,s,e) for(int i=(s); i<(int)(e); i++)
#define repr(i, n) REPR(i, n, 0)
#define REPR(i, s, e) for(int i=(int)(s-1); i>=(int)(e); i--)
#define pb push_back
#define all(r) r.begin(),r.end()
#define rall(r) r.rbegin(),r.rend()
#define fi first
#define se second

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const ll INF = 1e18;
const ll MOD = 1e9 + 7;
const double EPS = 1e-8;

template<typename T> T chmax(T& a, const T& b){return a = (a > b ? a : b);}
template<typename T> T chmin(T& a, const T& b){return a = (a < b ? a : b);}

ll lcm(ll a, ll b) {
    return a / __gcd(a, b) * b;
}

int main(){
    ll n, m;
    cin >> n >> m;
    vl a(n);
    rep(i, n) cin >> a[i];
    rep(i, n) a[i] /= 2;
    ll l = 1LL;
    rep(i, n) {
        l = lcm(l, a[i]);
        if(l > m) {
            cout << 0 << '\n';
            return 0;
        }
    }
    rep(i, n) if(l / a[i] % 2 == 0) {
        cout << 0 << '\n';
        return 0;
    }
    ll cnt = m / l;
    cout << (cnt+1) / 2 << '\n';
    return 0;
}

Measured memory_bytes: 1024
#include <iostream>
using namespace std;

char grade(int m,int f,int r);

int main(void){
        int m,f,r;
        while(1) {
                cin>>m>>f>>r;
                if(m==-1 and f==-1 and r==-1) {
                        return 0;
                }
                cout<<grade(m,f,r)<<endl;
        }
}


char grade(int m,int f,int r){
    if(m==-1 or f==-1){
        return 'F';
    }
    if(m+f>=80){
        return 'A';
    }
    else if(m+f>=65){
        return 'B';
    }
    else if(m+f>=50){
        return 'C';
    }
    else if(m+f>=30){
        if(r>=50){
            return 'C';
        }
        else{
            return 'D';
        }
    }
    else{
        return 'F';
    }
}



Measured memory_bytes: 3088
#include <stdio.h>
int main(void){
int n,k,ans=0,count,count2,max=0,maxcount=0;
int suuretu[100];
scanf("%d",&n);
  scanf("%d",&k);
  for(count=0;count<=n-1;count++){
    scanf("%d",&suuretu[count]);
  }
  for(count2=0;count2<=k-1;count2++){
    max=0;
    for(count=0;count<=n-1;count++){
      if(suuretu[count]>max){
        max=suuretu[count];
        maxcount=count;
      }
  }
  ans=ans+max;
  suuretu[maxcount]=0;
  }
  printf("%d",ans);
  return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>

using namespace std;
using ll = long long;

//container util
#define SORT(c) sort((c).begin(),(c).end())

//repetition
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)


int main(void){

	int A, B; cin >> A >> B;

	vector<int> v(3, 0);
	v[A]++;
	v[B]++;

	FOR(i,1,4){
		if(v[i] == 0) cout << i << endl;
	}

	return 0;

}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const int INF=1e9;
const int MOD=1e9+7;
template<typename A,size_t N,typename T>
void Fill(A (&array)[N],const T &val)
{
    std::fill( (T*)array,(T*)(array+N),val );
}
int main(void)
{
    int a,b,c;
    cin >> a >> b >> c;
    if(a+b+c>21) cout << "bust" << endl;
    else cout << "win" << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <queue>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
typedef pair<pair<int,int>,int> NODE;
#define X first.second
#define Y first.first
#define depth second

/*ï*/
int ox[] = {-1, 1, 0, 0, 1,1};
int oy[] = { 0, 0,-1, 1,-1,1};

/*ô*/
int ex[] = {-1, 1, 0, 0,-1,-1};
int ey[] = { 0, 0,-1, 1,-1, 1};

int main(){
	int point[100][100];
	int h,w,a,b,t,x,y,s;
	while(cin >> w  && w){
		int ret = 0;
		cin >> h;
		rep(i,100)rep(j,100)point[i][j] = 0;
		cin >> t;
		rep(i,t){
			cin >> a >> b;
			a--;b--;
			point[b][a] = i+1;
		}
		cin >> s;
		rep(P,s){
			cin >> a >> b;
			a--;b--;
			point[b][a] = 50;
			
		//rep(i,h){rep(j,w)cout << point[i][j];cout << endl;}
		int pt[100] = {0};
		rep(i,h)rep(j,w){
			x = j,y = i;
			queue<NODE> Q;
			pair<int,int> dp[100];
			bool done[100][100]={0};
			Q.push( make_pair(make_pair(y,x),0	) );
			while( Q.size() ){
				NODE q = Q.front(); Q.pop();
				if(point[q.Y][q.X]){
					dp[q.depth].first++;
					dp[q.depth].second = point[q.Y][q.X];
			  }
				if( q.Y % 2 == 1){
					rep(L,6){
						if( q.X+ox[L] >=0 && q.X+ox[L] < w && q.Y+oy[L] < h && q.Y+oy[L]>=0 ){
								if( !done[q.Y+oy[L]][q.X+ox[L]] )Q.push( make_pair(make_pair(q.Y+oy[L],q.X+ox[L]),q.depth+1) );
							  	done[q.Y+oy[L]][q.X+ox[L]] = true;
						}
					}
				}else{
					rep(L,6){
						if( q.X+ex[L] >=0 && q.X+ex[L] < w && q.Y+ey[L] < h && q.Y+ey[L]>=0 ){
									if( !done[q.Y+ey[L]][q.X+ex[L]] )Q.push( make_pair(make_pair(q.Y+ey[L],q.X+ex[L]),q.depth+1) );
							  	done[q.Y+ey[L]][q.X+ex[L]] = true;
						}
					}
				}
			}
			rep(I,100){
				if(dp[I].first){
					if(dp[I].first==1)
						pt[dp[I].second-1]++;
					break;
				}
			}
		}
			ret = max(pt[49],ret);
			point[b][a] = 0;
		}
		cout << ret << endl;
	}
	
}

Measured memory_bytes: 960
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define i_7 (ll)(1E9+7)
//#define i_7 998244353
#define i_5 i_7-2
ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    else return c+i_7;
}
typedef pair<ll,ll> l_l;
ll inf=(ll)1E17;
#define rep(i,l,r) for(ll i=l;i<=r;i++)
#define pb push_back
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}
void Max(ll &pos,ll val){pos=max(pos,val);}//Max(dp[n],dp[n-1]);
void Min(ll &pos,ll val){pos=min(pos,val);}
void Add(ll &pos,ll val){pos=mod(pos+val);}
long double EPS=1E-9;
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
////////////////////////////////////////
void No(){
    cout<<"Impossible"<<endl;
}
#define no {No();return 0;}

multiset<ll>s;
bool era(ll n){
    auto itr=s.find(n);
    bool f=itr==s.end();
    if(f)return f;
    s.erase(itr);
    return f;
}

int main(){fastio;
    ll m;cin>>m;
    rep(i,1,m){
        ll c;cin>>c;s.insert(c);
    }
    ll mi=*s.begin();
    ll mx=*(--s.end());
    //cout<<mi<<" "<<mx<<endl;
    if(mx%2==0){
        ll n=mx/2;
        if(mi<n)no
        if(era(n))no
        rep(i,n+1,2*n){
            rep(j,1,2){
                if(era(i))no
            }
        }
    }else{
        ll n=mx/2;
        if(mi<n+1)no;
        rep(i,n+1,2*n+1){
            rep(j,1,2){
                if(era(i))no
            }
        }
    }
    if(s.find(mi)!=s.end())no
    cout<<"Possible"<<endl;
    return 0;
}





Measured memory_bytes: 256
n = int(input())
s = []
ans = 0

for i in range(n):
  s.append(''.join(sorted(input())))
s.sort()

cnt = 1
for j in range(0, n-1):
  if s[j] == s[j+1]:
    cnt += 1
    if j == n-2:
      ans += cnt*(cnt-1)/2
  else:
    ans += cnt*(cnt-1)/2
    cnt = 1
    
print(int(ans))

Measured memory_bytes: 10640
#include <bits/stdc++.h>

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int N;
  cin >> N;
  int b = 0;
  vector<int> C(8);
  for (int i = 0; i < N; i++) {
    int a;
    cin >> a;
    a /= 400;
    if (a < 8) {
      C[a]++;
    } else {
      b++;
    }
  }
  int cnt = 0;
  for (int i = 0; i < 8; i++) {
    cnt += C[i] > 0 ? 1 : 0;
  }
  cout << (cnt != 0 ? cnt : 1) << " ";
  cout << cnt + b << '\n';
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;

int main() {
	ios_base::sync_with_stdio( false );

	double v;
	while( cin >> v ) {
		double t = v / 9.8;
		double y = 4.9 * t*t;

		cout << (int)ceil(y / 5) + 1 << endl;
	}
}



Measured memory_bytes: 3224
data = [
    [[0 for r in range(10)] for f in range(3)] for b in range(4)
]
 
count =int(input())
for c in range(count):
    b, f, r, v = [int(i) for i in input().split()]
    data[b-1][f-1][r-1] += v
 
for bi, b in enumerate(data):
    for f in b:
        for r in f:
            print(' {0}'.format(r), end='')
 
        print()
    if bi < 3:
        print('#' * 20)

Measured memory_bytes: 7736
#include<iostream>
#include<algorithm>
#include<string>
using namespace std;

int a[200001];

int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n;
	cin >> n;
	a[0] = 0;
	char c;
	for (int i = 0; i < n; ++i) {
		cin >> c;
		a[i + 1] = a[i];
		if (c == '#') {
			++a[i + 1];
		}
	}
	int ans = 200002;
	for (int i = 0; i <= n; ++i) {
		ans = min(ans, a[i]+n-i-(a[n]-a[i]));
	}


	
	cout << ans << endl;


	return 0;
}

Measured memory_bytes: 1024
package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
	"strconv"
)

var nextString func() string

func init() {
	nextString = newReadString(os.Stdin)
}

func main() {
	var (
		n   = nextInt()
		m   = pow(10, 9) + 7
		ans = 1
	)
	for i := 1; i <= n; i++ {
		ans = (ans * i) % m
	}
	fmt.Print(ans)
}

func nextInt() (result int) {
	result, _ = strconv.Atoi(nextString())
	return
}

func pow(a, b int) (result int) {
	result = 1
	for i := 0; i < b; i++ {
		result *= a
	}
	return
}

func newReadString(ior io.Reader) func() string {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+11))
	r.Split(bufio.ScanWords)

	return func() string {
		if !r.Scan() {
		}
		return r.Text()
	}
}


Measured memory_bytes: 640
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
using ll = long long;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;

ll dp[2010][2010];
int main(){
    int n,m;
    cin>>n>>m;
    int a[n],b[m];
    rep(i,n)cin>>a[i];
    rep(i,m)cin>>b[i];
    dp[0][0]=1;
    rep(i,n+1)rep(j,m+1){
        if(i>0)dp[i][j]+=dp[i-1][j];
        if(j>0)dp[i][j]+=dp[i][j-1];
        if(i>0&&j>0&&a[i-1]!=b[j-1])dp[i][j]+=mod-dp[i-1][j-1];
        dp[i][j]%=mod;
    }
    cout<<dp[n][m]<<endl;
    return 0;
}

Measured memory_bytes: 31616
#include<bits/stdc++.h>
using namespace std;
int main(){
  string S;cin>>S;
  int N=S.size(),count=0,ans=0;
  vector<int> a(N);
  for(int i=0;i<N;i++)
    if(S.at(i)=='A' or S.at(i)=='T' or S.at(i)=='G' or S.at(i)=='C')
    a.at(i)=1;
  for(int i=0;i<N;i++){
    count=0;
    if(a.at(i)==0)continue;
    for(int j=i;j<N;j++){
      if(a.at(j)==1)count++;
      else break;
      ans=max(ans,count);
    }
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <math.h>
#include <iomanip>
using namespace std;
int main(void){
    // Your code here!
    double a,b,c,d,h,w,l;
    
    cin >> a >> b >> c >> d;
    
    w = a - c;
    h = b - d;
    
    /*
    cout << "w：" << w <<  endl;
    cout << "h：" << h <<  endl;
    */
    l = sqrt(pow(w, 2.0) + pow(h, 2.0));
    cout << fixed << setprecision(8) << l << endl;
}



Measured memory_bytes: 3272
using System;
using System.Linq;

namespace ABC153A
{
    class Program
    {
        static void Main(string[] args)
        {
            var HA = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();
            var H = HA[0];
            var A = HA[1];

            Console.WriteLine(H % A == 0 ? H / A : H / A + 1);
        }
    }
}

Measured memory_bytes: 13268
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;

int main()
{
  string s;
  cin >> s;

  rep(i,s.size()){
    if(s.at(i) == '7'){
      cout << "Yes";
      return 0;
    }
  }
  cout << "No";

}


Measured memory_bytes: 3564