akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
????????????????????????????????? ??§?????§  
??????????????? ??§?????§ ???????´<_??? ?????? Welcome to My Coding Space!
???????????? ??? ?´_???`??????/??? ???i     
?????????????????????????????? ???  |???|     
????????? /?????? /??£??£??£??£/??????|  
??? ???_(__??????/???    ???/ .| .|????????????  
??? ????????????/????????????/??????u??????  
---------------------------------------------------------------------------------------------------*/



int N, C;
int dp[2][201][20101];
//--------------------------------------------------------------------------------------------------
void _main() {
    cin >> N >> C;
    rep(i, 0, 2) rep(j, 0, C + 1) rep(k, 0, 10101) dp[i][j][k] = -1;
    dp[0][0][0] = 0;
    
    rep(_i, 0, N) {
        int a, b, c; cin >> a >> b >> c;

        int i = _i % 2;
        int ii = (_i + 1) % 2;
        rep(j, 0, C + 1) rep(k, 0, 10101) dp[ii][j][k] = -1;

        rep(j, 0, C + 1) rep(k, 0, 10101) if(0 <= dp[i][j][k]) {
            dp[ii][j][k] = max(dp[ii][j][k], dp[i][j][k]);
            dp[ii][j + c][k + a] = max(dp[ii][j + c][k + a], dp[i][j][k] + b);
            dp[ii][j + c][k + b] = max(dp[ii][j + c][k + b], dp[i][j][k] + a);
        }

        //rep(j, 0, C + 1) rep(k, 0, 10101) if (0 <= dp[i][j][k]) if (dp[ii][j][k]) printf("dp[%d][%d][%d] = %d\n", _i + 1, j, k, dp[ii][j][k]);
    }

    int ans = 0;
    rep(j, 0, C + 1) rep(k, 0, 10101) ans = max(ans, min(k, dp[N % 2][j][k]));
    cout << ans << endl;
}

Measured memory_bytes: 13968
#include <bits/stdc++.h>
  using namespace std;
#define ll long long
#define fw(p) for(int w=0;w<(p);w++)
#define fx(p) for(int x=0;x<(p);x++)
#define fy(p) for(int y=0;y<(p);y++)
#define fz(p) for(int z=0;z<(p);z++)
#define fyg(p,g) for(int y=(g);y<(p);y++)
#define fzg(p,g) for(int z=(g);z<(p);z++)
#define ce(d) cout<<d<<endl;
#define vecp(p) int aa;cin>>aa;(p).push_back(aa);
#define vecpl(p) long long aa;cin>>aa;(p).push_back(aa);
#define vecps(p) string aa;cin>>aa;(p).push_back(aa);
#define vecp2(p) cin>>aa;(p).push_back(aa);
#define vecpl2(p) long long a	b;cin>>ab;(p).push_back(ab);
#define vecps2(p) string ab;cin>>ab;(p).push_back(ab);
#define set0(k,n) for(int nn=0;nn<(n);nn++){ (k).push_back(0); }
#define sorts(c) sort((c).begin(),(c).end());
#define reverses(c) reverse((c).begin(),(c).end());
#define vec(b) vector<int> (b);
#define vecl(b) vector<long long> (b);
#define vecs(b) vector<string> (b);
#define vecsize(b,size) vector<int> (b)((size));
#define pb(b,a) (b).push_back((a));
#define doublece(a,b) cout<<(a)<<' '<<(b)<<endl;
#define pairs(s) vector<pair<int,int>> (s);
#define pairsl(s) vector<pair<ll,ll>> (s);
#define pairss(s) vector<pair<string,string>> (s);
#define pairsp(s) int aa,bb;cin>>aa>>bb;(s).push_back(make_pair(aa,bb));
#define pairspl(s) ll aa,bb;cin>>aa>>bb;(s).push_back(make_pair(aa,bb));
#define pairsps(s) string aa,bb;cin>>aa>>bb;(s).push_back(make_pair(aa,bb));
#define pairsREV(s) (s).push_back(make_pair(bb,aa));
#define pairslREV(s) (s).push_back(make_pair(bb,aa));
#define pairssREV(s) (s).push_back(make_pair(bb,aa));
#define MOD 1000000007


int main() {
	
	int N;
	string S1,S2;
	cin>>N>>S1>>S2;
	
	if(N==1){
		ce(3)
	}else{
		ll dp[3][N+1]={{0,},};
      fx(3){
        fy(N+1){
         dp[x][y]=0; 
        }
      }
		dp[0][0]=1;
		int start=2;
		if(S1.at(0)==S2.at(0)){
				dp[1][1]=3;
			}else{
				dp[2][1]=6;
				start++;
          dp[2][2]=dp[2][1];
		}
		for(int x=start;x<=N;x++){
			if(S1.at(x-1)==S2.at(x-1)){
				dp[1][x]=dp[1][x-1]*2+dp[2][x-1];
				dp[1][x]%=MOD;
			}else{
				dp[2][x]=dp[1][x-1]*2+dp[2][x-1]*3;
				dp[2][x]%=MOD;
				x++;
              dp[2][x]=dp[2][x-1];
			}
			
		}
      	ce(dp[1][N]+dp[2][N])
	}

}

Measured memory_bytes: 256
#include <algorithm>
#include <cassert>
#include <cstdio>
#include <tuple>
#include <vector>
#define repeat(i, n) for (int i = 0; (i) < int(n); ++(i))
#define whole(f, x, ...) ([&](decltype((x)) whole) { return (f)(begin(whole), end(whole), ## __VA_ARGS__); })(x)
using namespace std;

pair<pair<int, int>, pair<int, int> > split(int h, int w, int s) {
    s %= h + w;
    if (0 < s and s < w) {
        int w1 = s;
        int w2 = w - w1;
        tie(w1, w2) = minmax({ w1, w2 });
        return { { h, w1 }, { h, w2 } };
    } else if (w < s) {
        int h1 = s - w;
        int h2 = h - h1;
        tie(h1, h2) = minmax({ h1, h2 });
        return { { h1, w }, { h2, w } };
    } else {
        assert (false);
    }
}

int main() {
    while (true) {
        int n, initial_w, initial_h; scanf("%d%d%d", &n, &initial_w, &initial_h);
        if (n == 0 and initial_w == 0 and initial_h == 0) break;
        vector<pair<int, int> > piece;
        piece.emplace_back(initial_h, initial_w);
        while (n --) {
            int i, s; scanf("%d%d", &i, &s); -- i;
            int h, w; tie(h, w) = piece[i];
            piece.erase(piece.begin() + i);
            pair<int, int> p1, p2; tie(p1, p2) = split(h, w, s);
            piece.push_back(p1);
            piece.push_back(p2);
        }
        vector<int> area;
        for (auto piece_i : piece) {
            int h, w; tie(h, w) = piece_i;
            area.push_back(h * w);
        }
        whole(sort, area);
        repeat (i, area.size()) {
            printf("%d%c", area[i], i + 1 == area.size() ? '\n' : ' ');
        }
    }
    return 0;
}

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

using namespace std;

#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define REV(i,n) for(ll (i) = (n) - 1;(i) >= 0;--i)
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {REP(WW,n)cerr << v[WW] << ' ';cerr << endl << endl;}
#define SHOW2d(v,WW,HH) {REP(W_,WW){REP(H_,HH)cerr << v[W_][H_] << ' ';cerr << endl;}cerr << endl;}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL
#define MOD 1000000007
#define fastcin() cin.tie(0);ios::sync_with_stdio(false)

typedef long long ll;
typedef pair<ll,ll> P;

ll dp[55][55][2555];

int main(){
	
	int n, a;cin >> n >> a;
	dp[0][0][0] = 1;
	
	REP(i, n){
		int now;cin >> now;
		REP(j, 55){
			REP(k, 2555)if(dp[i][j][k]){
				dp[i+1][j][k] += dp[i][j][k];
				dp[i+1][j+1][k+now] += dp[i][j][k];
			}
		}
	}
	
	ll ans = 0;
	REP(i, 55){
		REP(j, 2555)if(dp[n][i][j]){
			if(i != 0 && (double)j / i == a) {
				ans += dp[n][i][j];
			}
		}
	}
	
	cout << ans << endl;
	
	return 0;
}


Measured memory_bytes: 55552
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  vector<int> l(3);
  for(int i = 0; i < 3; i++){
    cin >> l.at(i);
  }
  sort(l.begin(), l.end());
  if(l.at(1) - l.at(0) == l.at(2) - l.at(1)) cout << "YES" << endl;
  else cout << "NO" << endl;
}

Measured memory_bytes: 256
N = int(input())
s = input()

need_left = 0
cnt = 0
for i in range(N):
    if s[i] == "(":
        cnt += 1
    else:
        if cnt == 0:
            need_left += 1
        else:
            cnt -=1
need_right = cnt
ans =""
for i in range(need_left):
    ans +="("
ans += s
for i in range(need_right):
    ans += ")"
print(ans)

Measured memory_bytes: 38256
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define rrep(ri,n) for(int ri = (int)(n-1); ri >= 0; ri--)
#define rep2(i,x,n) for(int i = (int)(x); i < (int)(n); i++)
#define rrep2(ri,x,n) for(int ri = (int)(n-1); ri >= (int)(x); ri--)
#define repit(itr,x) for(auto itr = x.begin(); itr != x.end(); itr++)
#define rrepit(ritr,x) for(auto ritr = x.rbegin(); ritr != x.rend(); ritr++)
#define ALL(x) x.begin(), x.end()
using ll = long long;
using namespace std;

int main(){
  int n, k;
  cin >> n >> k;
  int ans = n - k + 1;
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3576
#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int N,a,b;
  cin >> N;
  int i = 0;
  int c = 0;
  while (i < N){
    cin >> a >> b;
    c += b - a + 1;
    i++;
  }
  cout << c << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
 
/* attention
    long longのシフト演算には気をつけよう
    タイポした時のデバッグが死ぬほどきつくなるので変数名は最低3字くらい使った方がいいかも
    sizeは(int)とキャストしよう
    ごちゃごちゃ場合分けを考える前に全探索は考えましたか？
*/

const ll inf = 1LL<<59;

ll digitsum(ll b, ll n, ll p){
    
    ll res = 0;
    while(n != 0){
        res += n%b;
        n /= b;
        //cout << b << endl;
    }

    return res;
}

int main(){
    ll n, s; cin >> n >> s;
    if(n < s){
        cout << -1 << endl;
        return 0;
    }

    if(n == s){
        cout << n+1 << endl;
        return 0;
    }

    for(ll b=2; b*b<=n; b++){
        if(digitsum(b, n, 555) == s){
            cout << b << endl;
            return 0;
        }
    }

    ll ans = inf;
    for(ll p=1; p*p<n; p++){
        if((n-s)%p == 0){
            ll b = (n-s)/p+1;
            if(digitsum(b, n, 4) == s) ans = min(ans, b);
        }
    }
    if(ans != inf){
        cout << ans << endl;
        return 0;
    }

    cout << -1 << endl;
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <cstring>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <math.h>
#include <string>
#include <iostream>
#include <algorithm>
#include <unordered_map>
#include <stdlib.h>
#include <time.h> 
#include <assert.h>

#define nmax 500010
#define eps 1e-8
#define MOD 998244353

#define P1 25671
#define P2 191
#define MOD1 666013
#define MOD2 1000000007
#define B_SIZE 315

#define SZ(x) ((int)(x.size()))

#define fst first
#define snd second
#define pb push_back
#define mp make_pair

using namespace std;

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

typedef long long int ll;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;

int n, m;
int dp[3010][3010];
char s[3010], t[3010], answer[3010];

int main()
{
	scanf("%s", s + 1); n = strlen(s + 1);
	scanf("%s", t + 1); m = strlen(t + 1);

	for (int i = 1; i <= n; i++)
		for (int j = 1; j <= m; j++)
			if (s[i] == t[j]) dp[i][j] = dp[i - 1][j - 1] + 1; else
				dp[i][j] = max(dp[i - 1][j], dp[i][j - 1]);

	int x = n;
	int y = m;
	int nr = 0;

	while (x > 0 && y > 0) {

		while (x >= 1 && dp[x - 1][y] == dp[x][y]) x--;
		while (y >= 1 && dp[x][y - 1] == dp[x][y]) y--;

		if (x == 0 && y == 0) break;

		answer[++nr] = s[x];

		x--; y--;
	}

	reverse(answer + 1, answer + nr + 1);

	printf("%s", answer + 1);

	return 0;
}

Measured memory_bytes: 35584
n,k=map(int,input().split())
hashmap=dict()
for _ in range(k):
  d=int(input())
  arr=[int(p) for p in input().split()]
  for key in arr:
    hashmap[key]=d
count=0
for i in range(1,n+1):
  if hashmap.get(i)==None:
    count+=1
print(count)

Measured memory_bytes: 9188
using System;
using System.Collections.Generic;
class Program
    {
        static void Main(string[] args)
        {
            int[] a = new int[5];
            for (int i=0; i<5; i++) a[i] = int.Parse(Console.ReadLine());

            int modmin = 9;
            int time = 0;
            for (int i=0; i<5; i++)
            {
                time += (a[i] - 1) / 10 + 1;
                modmin = Math.Min(modmin, (a[i] - 1) % 10);
            }
            Console.WriteLine(time * 10 + modmin - 9);

            
            


            
        }
    }
    //mcs Main.cs
    //mono Main.exe

Measured memory_bytes: 11092
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>

using namespace std;

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

    int n;
    cin >> n;
    cout << 2 * n / __gcd(2, n) << endl;
    return 0;
}

Measured memory_bytes: 256
def era(n)
    $primes = Array.new(n, true)
    $primes[0], $primes[1] = false, false
    (2..Math.sqrt(n)).each do |i|
        if $primes[i]
            (i * i).step(n, i).each do |j|
                $primes[j] = false
            end
        end
    end
end

era(1e6.to_i)

while n = gets
    n = n.to_i
    puts $primes.slice(0..n).count(true)
end

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


int main(){
    mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
	cout.tie(NULL);
    ll t,i,q,j,x,y,k,temp,temp2,z,l,tt,n,m,sum=0;
    cin >> n >> k;
    for(i=0;i<n;i++){
        cin >> x >> y;
        if(x*x + y*y <= k*k) sum++;
    }
    cout << sum;
}

Measured memory_bytes: 3652
import java.util.*;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int cnt = 0;
		for(int i=0; i<s.length(); i++) {
			if(s.charAt(i)=='1') {
				cnt++;
			}
		}
		System.out.println(cnt);
	}
	static long lcm(long a, long b) {
		return a*(b/gcd(a, b));
	}
	
	static long gcd(long a, long b) {
		long ta = Math.max(a, b);
		long tb = Math.min(a, b);
		long tmp;
		while((tmp = ta%tb) != 0) {
			ta = tb;
			tb = tmp;
		}
		return tb;
	}
	
	static long modcomb(long n, long k, long mod) {
		if(k==1) {
			return n;
		}
		
		long ans = 1;
		for(long i=n; i>=n-k+1; i--) {
			ans = (ans * i)%mod;
		}
		for(long i=k; 0<i; i--) {
			ans = (ans * modpow(i, mod-2, mod)) % mod;
		}
		return ans;
	}
	
	static long modpow(long a, long b, long mod) {
		if(b==0) return 1;
		if(b%2==0) {
			long d = modpow(a, b/2, mod);
			return (d*d)%mod;
		} else {
			return (a*modpow(a, b-1, mod))%mod;
		}
	}
	
	static int disit(long a, long d) {
		int count = 0;
		while(a!=0) {
			a = a/d;
			count++;
		}
		return count;
	}
}


Measured memory_bytes: 23380
//#include<bits/stdc++.h>
#include<iostream>
#include<cstdio>
#include<ctime>
#include<cctype>
#include<queue>
#include<deque>
#include<stack>
#include<iostream>
#include<iomanip>
#include<cstdio>
#include<cstring>
#include<string>
#include<ctime>
#include<cmath>
#include<cctype>
#include<cstdlib>
#include<queue>
#include<deque>
#include<stack>
#include<vector>
#include<algorithm>
#include<utility>
#include<bitset>
#include<set>
#include<map>
#define ll long long
#define db double
#define INF 10000000000000000ll
#define inf 1000000000
#define ldb long double
#define pb push_back
#define put_(x) printf("%d ",x);
#define get(x) x=read()
#define gt(x) scanf("%d",&x)
#define gi(x) scanf("%lf",&x)
#define put(x) printf("%d\n",x)
#define putl(x) printf("%lld\n",x)
#define rep(p,n,i) for(RE int i=p;i<=n;++i)
#define go(x) for(int i=lin[x],tn=ver[i];i;tn=ver[i=nex[i]])
#define fep(n,p,i) for(RE int i=n;i>=p;--i)
#define vep(p,n,i) for(RE int i=p;i<n;++i)
#define pii pair<int,int>
#define mk make_pair
#define RE register
#define gf(x) scanf("%lf",&x)
#define pf(x) ((x)*(x))
#define uint unsigned long long
#define ui unsigned
#define EPS 1e-4
#define sq sqrt
#define S second
#define F first
#define mod 1000000007
using namespace std;
char *fs,*ft,buf[1<<15];
inline char gc()
{
	return (fs==ft&&(ft=(fs=buf)+fread(buf,1,1<<15,stdin),fs==ft))?0:*fs++;
}
inline int read()
{
	RE int x=0,f=1;RE char ch=gc();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=gc();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=gc();}
	return x*f;

}
const int MAXN=18,maxn=1<<MAXN;
int n,m,maxx;
int a[MAXN],f[MAXN][maxn],g[maxn];
int c[maxn],fac[maxn],inv[maxn];
inline int ksm(int b,int p)
{
	int cnt=1;
	while(p)
	{
		if(p&1)cnt=(ll)cnt*b%mod;
		b=(ll)b*b%mod;p=p>>1;
	}
	return cnt;
}
inline int C(int a,int b){return a<b?0:fac[a]*(ll)inv[b]%mod*inv[a-b]%mod;}
int main()
{
	//freopen("1.in","r",stdin);
	get(n);get(m);
	rep(1,m,i)get(a[i])-1;
	sort(a+1,a+1+m);
	reverse(a+1,a+1+m);
	maxx=1<<n;--maxx;
	fac[0]=1;
	rep(1,maxx,i)fac[i]=(ll)fac[i-1]*i%mod;
	inv[maxx]=ksm(fac[maxx],mod-2);
	fep(maxx-1,0,i)inv[i]=(ll)inv[i+1]*(i+1)%mod;
	f[0][0]=1;
	rep(1,m,i)
	{
		fep(maxx,0,j)
		{
			f[i][j]=f[i-1][j];
			if(!f[i-1][j])continue;
			rep(1,n,k)
			{
				if(1<<(k-1)&j)continue;
				f[i][j|1<<(k-1)]=(f[i][j|1<<(k-1)]+(ll)f[i-1][j]*C(maxx-a[i]-j,(1<<(k-1))-1)%mod*fac[(1<<(k-1))])%mod;
			}
		}
	}
	int ans=0;
	rep(0,maxx,i)
	{
		g[i]=g[i>>1]+(i&1);
		ans=(ans+(g[i]&1?-1:1)*(ll)f[m][i]*fac[maxx-i])%mod;
	}
	ans=(ll)ans*(maxx+1)%mod;
	ans=(ans+mod)%mod;put(ans);
	return 0;
}


Measured memory_bytes: 8588
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n)for(int i=0;i<(n);i++)
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define pb push_back
using ll = long long;
using P = pair<int, int>;
#define int long long

signed main(){
    int N; cin >> N;
    for(int n = 1; n <= N; n++){
        int cnt = 0;
        for(int x = 1; x * x <= n; x++){
            for(int y = 1; y * y + x * x + x * y <= n; y++){
                int b = x + y;
                int c = x * x + y * y + x * y - n;
                int tmp = sqrt(b * b - 4 * c);
                int z = (-b + tmp) / 2;
                if(z < 1) break;
                ll sum = x * x + y * y + z * z + x * y + y * z + z * x;
                if(sum == n) cnt++;
            }
        }
        cout << cnt << endl;
    }
}

Measured memory_bytes: 3536
N, M = map(int, input().split())
AList=list(map(int, input().split()))
ALists=sorted(AList,reverse=True)
tot=sum(AList)
for i in range(M):
    if(ALists[i]*1.0/tot<1.0/(4.0*M)):
        print('No')
        i-=1
        break
if(i==M-1):
    print('Yes')

Measured memory_bytes: 3060
package main

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

var sc = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriter(os.Stdout)

func main() {
	buf := make([]byte, 1024*1024)
	sc.Buffer(buf, bufio.MaxScanTokenSize)
	sc.Split(bufio.ScanWords)
	defer out.Flush() // !!!!caution!!!! you must use Fprint(out, ) not Print()
	/* --- code --- */
	x := nextInt()
	a, b := 0, -1
	for {
		a5 := a * a * a * a * a
		b5 := b * b * b * b * b
		if a5-b5 == x {
			fmt.Fprintln(out, a, b)
			break
		}
		if a5+b5 == x {
			fmt.Fprintln(out, a, -b)
			break
		}
		if -a5-b5 == x {
			fmt.Fprintln(out, -a, b)
			break
		}
		if -a5+b5 == x {
			fmt.Fprintln(out, -a, -b)
			break
		}
		b++
		if a == b-1 {
			a++
			b = 0
		}
	}
	//	fmt.Fprintln(out, a, b)
}

// -*-*-*-*-*-*-*-*-
// * I/O utilities *
// -*-*-*-*-*-*-*-*-

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	a, _ := strconv.Atoi(next())
	return a
}

func nextFloat64() float64 {
	a, _ := strconv.ParseFloat(next(), 64)
	return a
}

func nextInts(n int) []int {
	ret := make([]int, n)
	for i := 0; i < n; i++ {
		ret[i] = nextInt()
	}
	return ret
}
func nextFloats(n int) []float64 {
	ret := make([]float64, n)
	for i := 0; i < n; i++ {
		ret[i] = nextFloat64()
	}
	return ret
}
func nextStrings(n int) []string {
	ret := make([]string, n)
	for i := 0; i < n; i++ {
		ret[i] = next()
	}
	return ret
}

func chars(s string) []string {
	ret := make([]string, len([]rune(s)))
	for i, v := range []rune(s) {
		ret[i] = string(v)
	}
	return ret
}

// PrintOut with util device
func PrintOut(src interface{}, joinner string) {
	switch reflect.TypeOf(src).Kind() {
	case reflect.Slice:
		s := reflect.ValueOf(src)
		for idx := 0; idx < s.Len(); idx++ {
			fmt.Fprintf(out, "%v", s.Index(idx))
			if idx < s.Len()-1 {
				fmt.Fprintf(out, "%s", joinner)
			} else {
				fmt.Fprintln(out)
			}
		}
	default:
		fmt.Fprintln(out, "fuck")
	}
}


Measured memory_bytes: 1788
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int D = sc.nextInt();
        int T = sc.nextInt();
        int S = sc.nextInt();
        float t = (float)D/S;
        System.out.println(t<=T?"Yes":"No");
    }
}

Measured memory_bytes: 35668
import sys
input = sys.stdin.readline
N,M,Q=map(int,input().split())
lst=[[0 for e in range(N+1)] for f in range(N+1)]
for i in range(M):
 L,R=map(int,input().split())
 for j in range(1,L+1):
  lst[j][R]+=1
for j in range(N):
 for i in range(N+1):
  lst[i][j+1]+=lst[i][j]
for i in range(Q):
 p,q=map(int,input().split())
 print(lst[p][q])


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

int findSumDigits(int n) {
    int sum = 0;
    while (n > 0) {
        sum += n % 10;
        n /= 10;
    }
    return sum;
}

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

    int sum = findSumDigits(N);
    if (N  % sum == 0) {
        cout << "Yes";
    } else {
        cout << "No";
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#ifdef ONLINE_JUDGE
#define LLD "%I64d"
#else
#define LLD "%lld"
#endif
#define fu(a,b,c) for(int a=b;a<=(int)c;++a)
#define fd(a,b,c) for(int a=b;a>=(int)c;--a)
#define cu(a,b,c) for(int a=b;a<(int)c;++a)
#define cd(a,b,c) for(int a=(b)-1;a>=(int)c;--a)
#define gcd(a,b) __gcd(a,b) 
#define pii pair<int,int>
#define pll pair<long long,long long>
#define all(a) a.begin(),a.end()
#define F first
#define S second
#define pb push_back
#define pf push_front
#define MOD 1000000007 
#define MAXN 52
#define MAXH 20
#define MAXM 52
#define INF 100000000
#define ll long long
#define ull unsigned long long
#define RNG rng mt19937(time(NULL))
#define udist(a,b) uniform_int_distribution<uint32_t> distribution(a,b)
#define max3(a,b,c) max(a, max(b, c))
#define min3(a,b,c) min(a, min(b, c))
#define gmax(a,b) a = max(a, b)
#define gmin(a,b) a = min(a, b)
#define whatis(x) cerr << #x << " is " << x << endl;
#define fast_io() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define PI 3.1415926535897932384626433
using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

int main(){
	int n;
	int p = 1;
	cin >> n;
	set<int> s;
	while(true){
		if(s.find(n) != s.end()){
			cout << p << endl;
			return 0;
		}
		s.insert(n);
		if(n&1)n = 3 * n + 1;
		else n/=2;
		++p;
	}
}


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

int ar[200005];
map<ll,ll>cnt;

int main()
{
    ll n, q, r, x=0 , i, sum=0, nw=0;

    cin>>n;

    for(i=0; i<n; i++)
    {
        cin>>ar[i];
        x=(x^ar[i]);
    }
    //cout<<x<<endl;
    for(i=0; i<n; i++)
    {
        if(i!=0)
        {
            printf(" ");
        }
        cout<<(x^ar[i]);
    }
    cout<<endl;
}

Measured memory_bytes: 4348
#include <bits/stdc++.h>
 
#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)
 
#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=(int)(a)-1;i>=(int)(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)
 
#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define bit(n) (1LL<<(n))
 
// #define DEBUG
 
#ifdef DEBUG
    #define dump(...) fprintf(stderr, __VA_ARGS__)
#else
    #define dump(...)
#endif
 
template<class T>bool chmax(T &a, const T &b) { return (a<b)?(a=b,1):0;}
template<class T>bool chmin(T &a, const T &b) { return (b<a)?(a=b,1):0;}
 
using namespace std;
using ll=long long;
using vi=vector<int>;
using vll=vector<ll>;
 
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int inf = INT_MAX;
const ll INF = LLONG_MAX;
const ll MOD = 1000000007LL;
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
 
ll extgcd(ll a,ll b,ll& x,ll& y){x=1,y=0;ll g=a;if(b!=0) g=extgcd(b,a%b,y,x),y-=a/b*x;return g;}
ll ADD(const ll &a, const ll &b, const ll mod=MOD) { return (a+b)%mod;}
ll SUB(const ll &a, const ll &b, const ll mod=MOD) { return (a-b+mod)%mod;}
ll MUL(const ll &a, const ll &b, const ll mod=MOD) { return (1LL*a*b)%mod;}
ll DIV(const ll &a, const ll &b, const ll mod=MOD) {ll x,y; extgcd(b,mod,x,y);return MUL(a,(x+mod)%mod,mod);}
 
int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);

    int n; cin >> n;
    vi a(n); for(auto& e : a) cin >> e;

    int minv = 10000000;
    int sum = 0;
    for(auto& e : a){
        sum += e;
        if(e % 10){
            chmin(minv, e);
        }
    }

    int res = sum;
    if(sum % 10 == 0){
        if(minv % 10){
            res -= minv;
        }
        else {
            res = 0;
        }
    }

    cout << res << endl;

    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
//ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
//clock_t start=clock();clock_t end=clock();cout<<(double)(end-start)/CLOCKS_PER_SEC<<endl;
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int ui;
typedef pair<int,int> pii;
typedef pair<pii,int> ppii;
typedef pair<int,pii> pipi;
typedef pair<ll,ll> pll;
typedef pair<pll,ll> ppll;
typedef pair<ll,pll> plpl;
typedef pair<pii,pii> P;
typedef tuple<ll,ll,ll> tl;
typedef pair<double,double> pdd;
typedef vector<vector<ll>> mat;
ll mod=1000000007;
ll mod2=998244353;
ll mod3=1000003;
ll mod4=998244853;
ll mod5=1000000009;
ll inf=1LL<<62;
double pi=3.141592653589793238462643383279L;
double eps=1e-14;
#define rep(i,m,n) for(int i=m;i<n;i++)
#define rrep(i,n,m) for(ll i=n;i>=m;i--)
#define srep(itr,st) for(auto itr=st.begin();itr!=st.end();itr++)
#define mrep(itr,mp) for(auto& itr:mp)
#define Max(a,b) a=max(a,b)
#define Min(a,b) a=min(a,b)
int dh[4]={1,-1,0,0};
int dw[4]={0,0,1,-1};
int ddh[8]={-1,-1,-1,0,0,1,1,1};
int ddw[8]={-1,0,1,-1,1,-1,0,1};
struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};
#define umh unordered_map<ll,ll,custom_hash>
ll gcd(ll a,ll b){
    if(a<b)swap(a,b);
    if(b==0)return a;
    if(a%b==0)return b;
    return gcd(b,a%b);
}
ll lcm(ll a,ll b){
    ll c=gcd(a,b);
    return a*b/c;
}
ll Pow(ll n,ll k){
    ll ret=1;
    ll now=n;
    while(k>0){
        if(k&1)ret*=now;
        now*=now;
        k/=2;
    }
    return ret;
}
ll beki(ll n,ll k,ll md){
  ll ret=1;
  ll now=n;
    now%=md;
  while(k>0){
    if(k%2==1){
      ret*=now;
      ret%=md;
    }
    now*=now;
    now%=md;
    k/=2;
  }
  return ret;
}
ll gyaku(ll n,ll md){
  return beki(n,md-2,md);
}
ll popcount(ll n){
    ll ret=0;
    ll u=n;
    while(u>0){
        ret+=u%2;
        u/=2;
        
    }
    return ret;
}

int main(){
    ios::sync_with_stdio(false);cin.tie(0);
    int n,m;cin>>n>>m;
    int h[n];
    rep(i,0,n)cin>>h[i];
    vector<int> v[n];
    rep(i,0,m){
        int a,b;cin>>a>>b;
        a--;
        b--;
        v[a].push_back(b);
        v[b].push_back(a);
    }
    int ans=0;
    rep(i,0,n){
        bool up=true;
        rep(j,0,v[i].size()){
            int ne=v[i][j];
            if(h[ne]>=h[i]){
                up=false;
                break;
            }
        }
        if(up)ans++;
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 9132
#include <stdio.h>
int main()
{
	int a, b;

	scanf("%d%d", &a, &b);

	if (a<b){
		printf("a < b\n", a, b);
	}

	else if (a>b){
		printf("a > b\n", a, b);
	}

	else{
		printf("a == b\n", a, b);
	}

	return 0;
}

Measured memory_bytes: 2740
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cmath>
#include <iomanip>
#include <cassert>
#include <bitset>
using namespace std;

typedef pair<int, int> P;
#define rep(i, n) for (int i=0; i<(n); i++)
#define all(c) (c).begin(), (c).end()
#define uniq(c) c.erase(unique(all(c)), (c).end())
#define index(xs, x) (int)(lower_bound(all(xs), x) - xs.begin())
#define _1 first
#define _2 second
#define pb push_back
#define INF 1145141919
#define MOD 1000000007

int N, A, B;
signed main() {
  ios::sync_with_stdio(false); cin.tie(0);
  cin >> N >> A >> B;
  if ((B-A)%2==0) cout << "Alice\n";
  else cout << "Borys\n";
  return 0;
}


Measured memory_bytes: 256
// https://atcoder.jp/contests/abc144/tasks/abc144_b
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define REP(i, n) FOR(i, 0, n)
#define FOR(i, s, n) for (int i = (s), i##_len = (n); i < i##_len; ++i)
#define ALL(obj) (obj).begin(), (obj).end()
#define ALLR(obj) (obj).rbegin(), (obj).rend()
#define CEIL(a, b) ((a - 1) / b + 1)

void solve() {
    int N;
    cin >> N;
    FOR(i, 1, 10) {
        int t = N / i;
        if (N % i == 0 && t >= 1 && t <= 9) {
            cout << "Yes\n";
            return;
        }
    }
    cout << "No\n";
}
signed main() {
    cin.tie(nullptr)->sync_with_stdio(false);
    solve();
}


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

using namespace std;
#pragma GCC optimize("O3")

typedef long long ll;
typedef long double ld;
int n;
const int maxN = 5005;
vector < int > g[maxN];
const int mod = (int)1e9 + 7;
int mult(int a, int b) {
    return (1LL * a * b) % mod;
}
int sum(int a, int b) {
    int s = a + b;
    if (s >= mod) s -= mod;
    return s;
}
int sub(int a, int b) {
    int s = a - b;
    if (s < 0) s += mod;
    return s;
}
int dp[maxN][maxN];
int f[maxN];
int sz[maxN];
int ndp[maxN];
void dfs(int v, int p) {
    sz[v] = 1;
    dp[v][1] = 1;
    for (int to : g[v]) {
        if (to == p) continue;
        dfs(to, v);
        for (int a = 0; a <= sz[v]; a++) {
            for (int b = 0; b <= sz[to]; b++) {
                //don't del
                ndp[a + b] = sum(ndp[a + b], mult(dp[v][a], dp[to][b]));
                //del
                ndp[a] = sum(ndp[a], mult(dp[v][a], sub(0, mult(dp[to][b], f[b]))));
            }
        }
        sz[v] += sz[to];
        for (int a = 0; a <= sz[v]; a++) {
            dp[v][a] = ndp[a];
            ndp[a] = 0;
        }
    }
}
int main() {
  //  freopen("input.txt", "r", stdin);
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cin >> n;
    for (int i = 1; i < n; i++) {
        int a, b;
        cin >> a >> b;
        g[a].emplace_back(b);
        g[b].emplace_back(a);
    }
    f[0] = 1;
    for (int i = 1; i <= n; i++) {
        if (i % 2) f[i] = 0;
        else f[i] = mult(f[i - 2], i - 1);
    }
    dfs(1, -1);
    int ways = 0;
    for (int i = 0; i <= n; i++) {
        ways = sum(ways, mult(dp[1][i], f[i]));
    }
    cout << ways;
    return 0;
}


Measured memory_bytes: 97408
#include<iostream>
using namespace std;
int a[6][6];
int main(){
    int h,w,k;
    cin>>h>>w>>k;
    for(int i=0;i<h;i++){
        string s;
        cin>>s;
        for(int j=0;j<w;j++){
            if(s[j]=='.') a[i][j]=0;
            else a[i][j]=1;
        }
    }
    int sum=0,s=0;
    for(int i=0;i<(1<<h);i++){
        for(int j=0;j<(1<<w);j++){
            s=0;
            for(int ii=0;ii<h;ii++){
                if(i&(1<<ii)) continue;
                for(int jj=0;jj<w;jj++){
                    if(j&(1<<jj)) continue;
                    s+=a[ii][jj];
                }
            }
            if(s==k) sum++;
        }
    }
    cout<<sum<<endl;
}


Measured memory_bytes: 3620
#include <iostream>
#include <vector>
using namespace std;
using llong = long long;

//===
// call build() before other query (except add_edge)
// 0-indexed
// climb(u, d): climb d steps towards root
// fold(u, v):
struct DoublingTree {
    vector<vector<int> > G;
    vector<vector<int> > parent;
    vector<int> depth;
    int logn;

    DoublingTree(int n) {
        logn = 1;
        while ((1 << logn) < n) logn++;

        G.resize(n);
        parent.assign(logn, vector<int>(n, -1));
        depth.assign(n, -1);
    };

    template<class Graph>
    DoublingTree(Graph &g) {
        DoublingTree(g.size());
        for (int i = 0; i < g.size(); i++) {
            G[i].resize(g[i].size());
            for (int j = 0; j < g[i].size(); j++) {
                G[i][j] = g[i][j];
            }
        }
    };

    void calc_depth(int u, int d, int par) {
        depth[u] = d++;
        parent[0][u] = par;
        for (int v:G[u]) {
            if (v == par) continue;
            calc_depth(v, d, u);
        }
    };
    
    void build(vector<int> root = {0}) {
        for (int i = 0; i < root.size(); i++) {
            calc_depth(root[i], 0, -1);
        }
        for (int k = 1; k < logn; k++) {
            for (int u = 0; u < size(); u++) {
                if (parent[k - 1][u] == -1) continue;
                parent[k][u] = parent[k - 1][parent[k - 1][u]];
            }
        }
    };
    
    void add_edge(int u, int v) {
        G[u].push_back(v);
        G[v].push_back(u);
    };
    int climb(int u, int d) {
        int cnt = 0;
        while (d) {
            if (d & 1) u = parent[cnt][u];
            d >>= 1;
            cnt++;
        }
        return u;
    };
    // LowestCommonAncestor
    int lca(int u, int v) {
        if (depth[u] > depth[v]) swap(u, v);
        v = climb(v, depth[v] - depth[u]);

        if (u == v) return u;
        for (int k = logn - 1; k >= 0; k--) {
            if (parent[k][u] != parent[k][v]) {
                u = parent[k][u];
                v = parent[k][v];
            }
        }
        return parent[0][u];
    };
    inline int distance(int u, int v) {
        return depth[u] + depth[v] - depth[lca(u, v)] * 2;
    };
    inline int size() {
        return G.size();
    };
};
//===

// verify lca()
int AOJ_GRL_5_C() {
    int n;
    int k, c;
    int q;
    int u, v;

    cin >> n;
    DoublingTree t(n);

    for (int i = 0; i < n; i++) {
        cin >> k;
        for (int j = 0; j < k; j++) {
            cin >> c;
            t.add_edge(i, c);
        }
    }

    t.build();
    cin >> q;
    for (int i = 0; i < q; i++) {
        cin >> u >> v;
        cout << t.lca(u, v) << endl;
    }

    return 0;
};

int main() {
    return AOJ_GRL_5_C();
};



Measured memory_bytes: 18264
import java.util.*;
import java.math.*;
     
class Main{
    public static void main(String[] args) {
        
        try(Scanner sc = new Scanner(System.in)){

            long x = sc.nextLong();
            double yokin = 100;

            int ans = 0;
            while((double)x > yokin){
                yokin *= 1.01;
                yokin = Math.floor(yokin);
                ans++;
            }

            System.out.println(ans);

        }catch(Exception e){
            e.printStackTrace();
        }        
    }
}

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

int abs_x(int x) {
	if (x < 0) {
		x = -x;
	}
	return x;
}

int main() {
	int N;
	int ct,cx,cy, nt, nx, ny, dd, dt;
	bool ans = true;
	cin >> N;
	ct = cx = cy = 0;
	for (int i = 0; i < N; i++) {
		cin >> nt >> nx >> ny;
		dd = abs_x(nx - cx) + abs_x(ny - cy);
		dt = nt - ct;
		if (dt < dd || (dd-dt)%2!=0) {
			ans = false;
			break;
		}
		else {
			ct = nt;
			cx = nx;
			cy = ny;
		}
	}
	if (ans) cout << "Yes" << endl;
	else cout << "No" << endl;
	return 0;
}

Measured memory_bytes: 256
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author tatsumack
 */

#include <iostream>
#include <fstream>

#include <bits/stdc++.h>

#define int long long
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define FOR(i, a, b) for (int i = (a), i##_len = (b); i <= i##_len; ++i)
#define REV(i, a, b) for (int i = (a); i >= (b); --i)
#define CLR(a, b) memset((a), (b), sizeof(a))
#define DUMP(x) cout << #x << " = " << (x) << endl;
#define INF 1001001001001001001ll
#define fcout cout << fixed << setprecision(12)

using namespace std;

typedef pair<int, int> P;

class BTrickOrTreat {
public:
    void solve(std::istream& cin, std::ostream& cout) {
        int N, K;
        cin >> N >> K;
        map<int, int> cnt;
        REP(i, K) {
            int d;
            cin >> d;
            REP(j, d) {
                int a;
                cin >> a;
                a--;
                cnt[a]++;
            }
        }
        int res = 0;
        REP(i, N) {
            if (cnt[i] == 0) {
                res++;
            }
        }
        cout << res << endl;
    }
};


signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    std::istream& in(std::cin);
    std::ostream& out(std::cout);

    BTrickOrTreat solver;
    solver.solve(in, out);
    return 0;
}


Measured memory_bytes: 3644
# encoding utf 8

n, k = map(int, input().split())

sum = 0
for i in range(1,n+1):
    if 2*i%k == 0:
        # print(sum)
        sum += 1

        max = int((n-i)/k)
        # print("i",i,"max",max)
        if max == 1:
            sum += 6
        elif max>1:
            sum += max*(1+max)/2*6

print(int(sum))


Measured memory_bytes: 2940
#include <iostream>

using namespace std;

int main()
{
    string s;
    
    cin>>s;
    
    if(s[0]=='S')
    cout<<"Cloudy"<<endl;
    else if(s[0]=='C')
    cout<<"Rainy"<<endl;
    else if(s[0]=='R')
    cout<<"Sunny"<<endl;
    return 0;
}


Measured memory_bytes: 256
N = int(input())
H = [int(i) for i in input().split()]
for i in range(N-1,0,-1):
    if(H[i] < H[i-1]):
        H[i-1] -= 1
for i in range(N-1):
    if(H[i] > H[i+1]):
        print("No")
        exit()
print("Yes")

Measured memory_bytes: 20520
import numpy as np

N, K = map(int, input().split(" "))
S = np.array([int(i) for i in input()])
pos1 = np.linspace(0,N-1,N)[S == 1]
lst = []
if len(pos1) == 0:
    print(N)
else:    
    st =[pos1[0]]
    if len(pos1) != 1:
        for i in pos1[1:]:
            if st[-1] + 1 == i:
                st.append(i)
            else:
                lst.append(st)
                st = [i]
            if i == pos1[-1]:
                lst.append(st)
    else:
        lst.append(st)
    lst = [[0]] + lst + [[N-1]]
    time = len(lst) - K
    if time <= 0:
        print(N)
    else:
        print(int(max([max(lst[i+K]) - min(lst[i])+1 for i in range(time)])))

Measured memory_bytes: 21952
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
    int n,k,r,s,p;
    string t;
    cin >> n >> k >> r >> s >> p >> t;
    int nyan = 0,i=0;
    vector<char> u(n);
    for(;i<k;i++){
        if(t[i] == 'r'){
            nyan += p;
            u[i] = 'p';
        }else if(t[i] == 's'){
            nyan += r;
            u[i] = 'r';
        }else if(t[i] == 'p'){
            nyan += s;
            u[i] = 's';
        }
    }
    for(;i<n;i++){
        if(t[i] == t[i-k] && t[i-k] != u[i-k]){
            u[i] = t[i];
        }else{
            if(t[i] == 'r'){
                nyan += p;
                u[i] = 'p';
            }else if(t[i] == 's'){
                nyan += r;
                u[i] = 'r';
            }else if(t[i] == 'p'){
                nyan += s;
                u[i] = 's';
            }
        }
    }
    cout << nyan << endl;
}

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

using namespace std;
typedef long long ll;
typedef pair<int,int> P;

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

	while(true){
		int n,m,s;
		cin >> n >> m >> s;
		if(n == 0) break;
		int ans = 0;
		int dp[2][50][3005];
		memset(dp,0,sizeof(dp));
		dp[0][0][0] = 1;
		for (int i = 1;i <= m ;i++){
			for (int j = 0;j <= n*n;j++){
				for (int k = 0;k <= s;k++){
					if(k-i>= 0) dp[i%2][j][k] = dp[(i-1)%2][j][k] + dp[(i-1)%2][j-1][k-i];
					else dp[i%2][j][k] = dp[(i-1)%2][j][k];
					dp[i%2][j][k] %= 100000;
				}
			}
		}
		cout << dp[m%2][n*n][s] << endl;
	}

	return 0;

}


Measured memory_bytes: 4236
#include <algorithm>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for(int(i) = 0; (i) < (n); (i)++)
#define FOR(i, m, n) for(int(i) = (m); (i) < (n); (i)++)
#define All(v) (v).begin(), (v).end()
#define pb push_back
#define MP(a, b) make_pair((a), (b))
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
const int INF = 1 << 30;
const ll LINF = 1LL << 60;
const int MOD = 1e9 + 7;

vector<bool> sieve(int x) { // range...[0,x]
    vector<bool> flags(x + 1, true);
    flags[0] = false, flags[1] = false;
    for(int i = 2; i * i <= x; i++) {
        if(!flags[i])
            continue;
        for(int mult = i * i; mult < x; mult += i)
            flags[mult] = false;
    }
    return flags;
}

int main() {
    int N;
    cin >> N;
    vector<int> A(N);
    rep(i, N) cin >> A[i];
    sort(All(A));
    vector<bool> siev(1100000, 1);
    rep(i, N) {
        if(i > 0 && A[i] == A[i - 1]) {
            siev[A[i]] = false;
            continue;
        }
        if(siev[A[i]] == false)
            continue;
        for(int mult = A[i] * 2; mult < siev.size(); mult += A[i]) {
            siev[mult] = false;
        }
    }
    int res = 0;
    rep(i, N) {
        if(siev[A[i]] == true)
            res++;
    }
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 4260
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#include <set>
#include <map>
#include <stack>
#include <functional>
#include <iostream>
#include <numeric>
#define SIZE 10005
 
using namespace std;
typedef long long int ll;
// typedef pair <int,int> P;
 
int pair[SIZE];
 
int main()
{
	int n;
    long long int A,B = 0;
    int count = 0;
    std::cin >> A >> B;
    long long int value[count];
    if (A-B > 1) {
        std::cout << 2*A - 1 << "\n";
    }else if (B-A > 1)
    {
        std::cout << 2*B - 1 << "\n";
    } else
    {
        std::cout << A + B << "\n";
    }

    return 0;
    
}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <cstring>
#include <map>
#include <set>
#include <algorithm>

using namespace std;

int main()
{
  long long A,B;
  cin >> A >> B;
  long long c = 0;
  if (A>0) {
    A--;
    c = ((A+1)/2) % 2;
    if (A % 2 == 0)
      c ^= A;
  }
  long long d = ((B+1)/2) % 2;
  if (B % 2 == 0)
    d ^= B;
  long long ans = c ^ d;
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n;
  cin >> n;
  if(n<1200){
    cout << "ABC" << endl;
  }
  else if(n<2800){
    cout << "ARC" << endl;

  }
  else cout << "AGC" << endl;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <cmath>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <iostream>
#include <random>
#include <map>
#include <iomanip>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include <fstream>
#include <unordered_map>
#include <cstdlib>
#include <complex>
#include <cctype>
#include <bitset>
using namespace std;

using ll = long long;
using vll = vector<long long>;
using pll = pair<long long, long long>;
#define rep(i,n) for(long long i(0);(i)<(n);(i)++)
ll INF = 1LL << 60;

void solve(long long A, long long B, long long C, long long X, long long Y){
    ll ans = INF;
    ll money, minXY = min(X, Y), maxXY = max(X, Y);
    //* method 1
    money = minXY * 2 * C + (X-minXY)*A + (Y-minXY)*B;
    ans = min(ans, money);
    //* method 2
    money = X * A+ Y * B;
    ans = min(ans, money);
    //* method 3
    money = maxXY * 2 * C;
    ans = min(ans, money);

    cout << ans << endl;
}

int main(){
    long long A;
    scanf("%lld",&A);
    long long B;
    scanf("%lld",&B);
    long long C;
    scanf("%lld",&C);
    long long X;
    scanf("%lld",&X);
    long long Y;
    scanf("%lld",&Y);
    solve(A, B, C, X, Y);
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define Rep(i, n,m) for (int i = (int)(n); i < (int)(m); i++)

#define ALL(V) (V).begin(),(V).end()
#define SORT(V) sort(ALL(V))

typedef long long ll;

vector<string> split(string,string);

//template<typename T>
//void swap(T*,T*);
//char ToUpper (char cX) { return toupper(cX); }

bool isR(string s);

int main()
{
    int N,A,B;
    cin >> N >> A >> B;
    cout << min(N*A,B);
}

Measured memory_bytes: 256
import std.algorithm;
import std.bigint;
import std.concurrency;
import std.container;
import std.conv;
import std.functional;
import std.format;
import std.math;
import std.meta;
import std.numeric;
import std.random;
import std.range;
import std.stdio;
import std.string;
import std.traits;
import std.typecons;


immutable string YES = "Yes";
immutable string NO = "No";


auto solve(long N, long K, long Q, long[] A) {
    auto scores = new long[](N);
    foreach (a; A) {
        scores[a - 1]++;
    }
    foreach (i; 0 .. N) {
        writeln(K - (Q - scores[i]) <= 0 ? NO : YES);
    }
}


void main() {
    auto input = stdin.byLine.map!split.joiner;

    long N;
    N = input.front.to!long;
    input.popFront;

    long K;
    K = input.front.to!long;
    input.popFront;

    long Q;
    Q = input.front.to!long;
    input.popFront;

    long[] A = new long[](cast(size_t) (Q));
    foreach (i; 0 .. cast(size_t) (Q)) {
        A[i] = input.front.to!long;
        input.popFront;
    }

    static if (is(ReturnType!solve == void))
        solve(N, K, Q, A);
    else
        solve(N, K, Q, A).writeln;
}


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

bool cmp(char a,char b){
	return a>b;
}

int main(){
	string s,t;
	
	cin>>s;
	cin>>t;
	
	sort(s.begin(),s.end());
	sort(t.begin(),t.end(),cmp);
	
	if(s<t)
	   cout<<"Yes"<<endl;
	else
	   cout<<"No"<<endl;
	   
	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int issearch(int [],int,int);
int issearch(int x[],int y,int m){
    int t=0;
    while(x[t]!=y){
        t++;
    }
    return t!=m;
}
int main(void){
    int i,j,n,S[10000],q,T[500],sum=0;
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%d",&S[i]);
    }
    scanf("%d",&q);
    for(j=0;j<q;j++){
        scanf("%d",&T[j]);
        S[i]=T[j];
        sum+=issearch(S,T[j],i);
    }
    printf("%d\n",sum);
    return 0;
}


Measured memory_bytes: 2100
#![allow(non_snake_case)]

use std::io;

fn print_rect(h: u32, w: u32) {
    for _i in 0..h {
        for _j in 0..w {
            print!("#");
        }
        println!("");
    }
}

fn main() {
    let sin = io::stdin();
    loop {
        let mut buf = String::new();
        sin.read_line(&mut buf).ok();
        let mut ws = buf.split_whitespace();
        let h: u32 = ws.next().unwrap().parse().unwrap();
        let w: u32 = ws.next().unwrap().parse().unwrap();
        if h == 0 && w == 0 {
            break;
        }
        print_rect(h, w);
        println!("");
    }
}



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

int main()
{
    int n, m;
    cin >> n >> m;
    int A[n][m];
    int B[m];
    int Ans[n];
    
    // Initialize
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < m; j++)
        {
            cin >> A[i][j];
        }
        Ans[i] = 0;
    }
    
    for (int i = 0; i < m; i++)
    {
        cin >> B[i];
    }
    
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < m; j++)
        {
            Ans[i] += A[i][j] * B[j];
        }
        cout << Ans[i] << endl;
    }
    
    return 0;
}

Measured memory_bytes: 3144