akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#define pb           push_back
#define pf           push_front
#define in           insert
#define ff           first
#define ss           second
#define int          long long
#define rep(i,x,m)   for(int i=x;i<m;i++)
#define repr(i,x,m)  for(int i=x;i>=m;i--)
#define MOD          1000000007
#define endl         "\n"
#define all(v)       v.begin(),v.end()
#define rall(v)      v.rbegin(),v.rend()
#define vi           vector<int>
#define pi           pair<int,int>
#define sz(x)       (int)x.size()
#define pq           priority_queue<int>
#define pqs          priority_queue<int,vi,greater<int> >
#define fix(y)       fixed<<setprecision(y)
#define print(v)     for(int i=0;i<v.size();i++) cout<<v[i]<<" ";cout<<endl
#define FIO         ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;

int fac[2000005]={0};
void factorial(){ fac[0]=1; fac[1]=1; for(int i=2;i<200005;i++) fac[i]=((i%MOD)*(fac[i-1]%MOD))%MOD;}
int power(int n,int m)
{int p=1;if(m==0)return 1;p=(power(n,m/2)%MOD);p=(p%MOD*p%MOD)%MOD;
return(m&1?((p%MOD*n%MOD)%MOD):(p%MOD));}
int ncr(int n,int r){return ((fac[n]*power(fac[r],MOD-2))%MOD*power(fac[n-r],MOD-2))%MOD;}

void ram5564()
{
     int n,d;
     cin>>n>>d;
     
     long double d1=d*1.0;
     long double dis;
     int cnt=0;
     while(n--)
     {
        int a,b;
        cin>>a>>b;
        dis=sqrt(a*a*1.0+b*b*1.0);
        if(dis<=d1)
            ++cnt;
     }
     cout<<cnt;

}

signed main()
{
        FIO
        // #ifndef ONLINE_JUDGE
        //   freopen("input.txt","r",stdin);
        //   freopen("output.txt","w",stdout);
        // #endif   
        
        int t=1;
        //cin>>t;
        while(t--)
        ram5564();
        cerr<<"\n"<<(float)clock()/CLOCKS_PER_SEC*1000<<" ms"<<endl;

        return 0;
}

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

using namespace std;

typedef long long int ll;
typedef long long int lli;
typedef unsigned long long int ull;
typedef long double ld;
typedef string str;

typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<ld> vd;
typedef vector<str> vs;
typedef vector<ll> vll;
typedef vector<pair<ll, ll>> vpll;
typedef vector<vector<ll>> vvll;
typedef vector<vector<char>> vvc;
typedef vector<vector<str>> vvs;

#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define rrep(i, n) for (ll i = 1; i <= (n); ++i)
#define fin(ans) cout << (ans) << endl;
#define mp(p, q) make_pair(p, q)
//３つ以上の値をセットに(3より多いときはカッコ内を増やす)\
sort -> p -> q -> r
#define mt(p, q, r) make_tuple(p, q, r)
#define all(a) a.begin(), a.end()

template <typename T>
void V(T &n)
{
  for (ll i = 0; i < n.size(); i++)
  {
    cin >> n[i];
  }
}

template <typename T, typename U>
void V2(T &n, U &m)
{
  for (ll i = 0; i < n.size(); i++)
  {
    cin >> n[i] >> m[i];
  }
}

template <typename T>
void Sort(T &n, ll a = 0, ll b = 0)
{
  if (b == 0)
  {
    return (sort(n.begin() + a, n.end()));
  }
  else
  {
    return (sort(n.begin() + a, n.begin() + b));
  }
}

//配列を反転
template <typename T>
void Reve(T &n, ll a = 0, ll b = 0)
{
  if (b == 0)
  {
    return (reverse(n.begin() + a, n.end()));
  }
  else
  {
    return (reverse(n.begin() + a, n.begin() + b));
  }
}

template <typename T>
void Down(T &n, ll a = 0, ll b = 0)
{
  if (b == 0)
  {
    return (sort(n.begin() + a, n.end(), greater<ll>()));
  }
  else
  {
    return (sort(n.begin() + a, n.begin() + b, greater<ll>()));
  }
}

  void Main()
  {
    ll H, W, h , w; cin >> H >> W >> h >> w;
    fin(H * W - (h * W + w * H) + h * w)
  }

  int main()
  {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(20); //高精度少数表示
    Main();
    return 0;
  }

Measured memory_bytes: 256
#include <iostream>
#include <cstring>
#include <string>    
#include <vector>
#include <queue>
#include <algorithm>
#include <cmath>
using namespace std;
typedef long long ll;
ll n, rec[101][101], rec_const[101][101], x, y, h;

int main(){
	cin >> n;
	memset(rec, 0, sizeof(rec));
	for(int xi = 0; xi <= 100; xi++){for(int yi = 0; yi <= 100; yi++){rec_const[xi][yi] = 1e9+108;}}
	
	for(ll info = 1; info <= n; info++){
		cin >> x >> y >> h;
		for(int xi = 0; xi <= 100; xi++){
			for(int yi = 0; yi <= 100; yi++){
				ll h_buf = h+abs(xi-x)+abs(yi-y);
				if(h > 0){
					if(rec[xi][yi] == 0){rec[xi][yi] = h_buf;}
					else{if(rec[xi][yi] != h_buf){rec[xi][yi] = -1;}}
				}
				else{
					rec_const[xi][yi] = min(h_buf, rec_const[xi][yi]);
				}
			}
		}
	}
	
	for(int xi = 0; xi <= 100; xi++){
		for(int yi = 0; yi <= 100; yi++){
			if(rec[xi][yi] > 0 && rec[xi][yi] <= rec_const[xi][yi]){cout << xi << " " << yi << " " << rec[xi][yi] << endl;}
		}
	}
	return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF (2e9)
#define EPS (1e-7)
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;

int main() {
    string n;
    cin >> n;
    
    REP(i, n.length()) {
        if (n[i] == '1') cout << "9";
        else if (n[i] == '9') cout << "1";
        else cout << n[i];
    }
    cout << endl;
}

Measured memory_bytes: 256
import java.io.*;
import java.util.*;

public class Main {
	
	public static void main(String[] args) throws IOException {
		
		BufferedReader br = 
			new BufferedReader(new InputStreamReader(System.in));
		
		ArrayList<String> list = new ArrayList<String>();
		ArrayList<String> ans = new ArrayList<String>();
		
		while (true) {
			
			String s = br.readLine();
			if (s == null) break;
			
			if (s.equals("0")) {
				ans.add(list.get(list.size() - 1));
				list.remove(list.size() - 1);
				continue;
			} else {
				list.add(s);
			}
			
		}
		
		for (String a : ans)
			System.out.println(a);
		
	}
	
}

Measured memory_bytes: 9168
def main():
    import sys
    input=sys.stdin.readline

    n=int(input())
    if n==0 or n==1:
      print(1)
      return 
      
    dp=[0]*(1+n)
    dp[0]=1
    dp[1]=1
    for i in range(n-1):
        dp[i+2]=dp[i+1]+dp[i]
    
    print(dp[-1])   
 
if __name__=='__main__':
    main()


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

int main() {
  int A, B, C, X;
  cin >> A >> B >> C >> X;

  int c = 0;
  for (int i=0; i <= A && i*500 <= X; i++) {
    for (int j=0; j <= B && i*500+j*100 <= X; j++) {
      for (int k=0; k <= C && i*500+j*100+k*50 <= X; k++) {
        if(i*500+j*100+k*50 == X) {
		  c++;
        }
      }
    }
  }
  
  cout << c << endl;
}

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

typedef long long ll;
typedef long double ld;
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;

#define f first
#define s second
#define sz(x) (int)x.size()
#define all(x) begin(x), end(x)
#define rall(x) rbegin(x), rend(x)
#define pb push_back

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define F0R(i, a) FOR(i, 0, a)
#define ROF(i, a, b) for (int i = (b); i >= (a); --i)
#define R0F(i, a) ROF(i, 0, a-1)
#define trav(x, a) for (auto& x: a)

const int MX  = 2e5+5;
const int MOD = 1e9+7;
const ll  INF = 1061109567; // 4557430888798830399LL
const ld  EPS = 1e-9;
const ld  PI  = acos(-1);

int N, M;
vi g[MX], rg[MX];
ll d[2][MX], ass[MX];
bool vis[MX];

void bfs(int nod) {
    queue<int> q;
    q.push(nod); d[0][nod] = 1;
    while(sz(q)) {
        int u = q.front(); q.pop();

        trav(v, g[u]) if (d[0][v] == 0) {
            d[0][v] = d[0][u]+1;
            q.push(v);
        }
    }
}

void construct(int nod) {
    queue<int> q; q.push(nod); ass[nod] = 1;
    while(sz(q)) {
        int u = q.front(); q.pop();

        trav(v, g[u]) if (!ass[v]) {
            ass[v] = u;
            q.push(v);
        }
    }

    FOR(i, 2, N+1) {
        rg[ass[i]].pb(i);
    }

    q.push(nod); d[1][nod] = 1;
    while(sz(q)) {
        int u = q.front(); q.pop();

        trav(v, rg[u]) if (d[1][v] == 0) {
            d[1][v] = d[1][u]+1;
            q.push(v);
        }
    }
}

int main() {

    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);

    cin >> N >> M;

    FOR(i, 1, M+1) {
        int u, v; cin >> u >> v;

        g[u].pb(v); g[v].pb(u);
    }

    bfs(1); construct(1);

    bool ok = true;
    FOR(i, 1, N+1) ok &= (d[0][i]==d[1][i]);
    FOR(i, 1, N+1) ok &= (d[0][i] != 0 && d[1][i] != 0);

    if (!ok) {
        cout << "No\n";
    } else {
        cout << "Yes\n";
        FOR(i, 2, N+1) {
            cout << ass[i] << "\n";
        }
    }
}


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

using namespace std;

typedef unsigned long long ull;

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

    int a, b, c;
    cin >> a >> b >> c;
    string s = "No";
    if (a == b && a != c){
        s = "Yes";
    } else if (a == c && a != b) {
        s = "Yes";
    } else if (b == c && c != a) {
        s = "Yes";
    }
    cout << s;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <regex>
#include <numeric>

using namespace std;


/*--- Macro ---*/
#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 mp make_pair
#define pb push_back


/*---  Type ---*/
typedef long long ll;


/*--- Constants ---*/
template <typename T> const T INF = numeric_limits<T>::max() / 10;
const int MOD = (int)1e9 + 7;

// 4-direction
int dy4[] = {0,  1, -1,  0};
int dx4[] = {1,  0,  0, -1};

// 8-direction
int dy8[] = {0,  1,  1,  1,  0, -1, -1, -1};
int dx8[] = {1,  1,  0, -1, -1, -1,  0,  1};

// Floating
const double EPS = 1e-11;
#define EQ0(x) (abs(x) < EPS)
#define EQ(x, y) (abs(a-b) < EPS)

int main() {
  int n;
  cin >> n;
  cout << (800 * n) - (200 * (n / 15)) << endl;
  return 0;
}

Measured memory_bytes: 256
#ifdef BUILT_LOCAL

#include "niklib.h"

#endif

#include <iostream>
#include <utility>
#include <vector>
#include <stack>
#include <queue>
#include <algorithm>
#include <string>
#include <cstdio>
#include <map>
#include <set>
#include <list>

using namespace std;

int main() {
    long long n, m, x[100000], y[100000], r = 0, sx = 0, sy = 0, mod = 1000000007;
    cin >> n >> m;
    for (int i = 0; i < n; i++) cin >> x[i];
    for (int i = 0; i < m; i++) cin >> y[i];
    for (int i = 1; i < n; i++) sx = (sx + (n - i) * i * (x[i] - x[i - 1])) % mod;
    for (int i = 1; i < m; i++) sy = (sy + (m - i) * i * (y[i] - y[i - 1])) % mod;
    r = (sx * sy) % mod;
    cout << r << endl;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;cin>>N;
  int m=0;
  int t=0;
  for(int i=0;i<N;i++){
    int D1,D2;cin>>D1>>D2;
    if(D1==D2)t++;
    else t=0;
    m=max(m,t);
  }
  cout<<(m>=3?"Yes":"No")<<endl;
}


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

int main(){
	ll n, m, i, w, v, j, k;
	cin >> n >> w;
	
	ll dp[n*1000+1];
	
	memset(dp, INF, sizeof(dp));
	dp[0] = 0;
	ll sum_value = 0;
	
	for(i=0; i<n; i++){
		ll weight, value;
		cin >> weight >> value;
		
		sum_value += value;
 
		for(int v = n * 1000; v >= value; --v) {
			dp[v] = min(dp[v], dp[v - value] + weight);
		}
	}
	
	for(i = sum_value; i>=0; i--){
		if(dp[i] <= w){
			cout << i;
			break;
		}
	}
}

Measured memory_bytes: 1024
#include <iostream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <algorithm>
#include <stack>
#include <cstring>
#include <queue>
#include <set>
#include <map>
#include <assert.h>
#include <unordered_map>

using namespace std;

const int maxN = 1e5 + 10;

#define FORU(i, l, r) for (int i = l; i <= r; ++i)
#define FORD(i, r, l) for (int i = r; i >= l; --i)
#define REPU(i, r) for (int i = 0; i < r; ++i)
#define F first
#define S second
#define PB push_back
#define LL long long
#define BIT(x, i) ((x >> i) & 1)
#define PINT pair < int, int >
#define MP make_pair

int n, a[maxN], res;

int main() {
    cin >> n;
    FORU(i, 1, n) cin >> a[i];
    sort(a + 1, a + n + 1);
    int j = 1;
    FORU(i, 1, n) {
        while (a[i] - a[j] > 2) ++j;
        res = max(res, i - j + 1);
    }
    cout << res;
}


Measured memory_bytes: 640
#include <stdio.h>

const char* str_list[9]={
	".,!? ",
	"abc",
	"def",
	"ghi",
	"jkl",
	"mno",
	"pqrs",
	"tuv",
	"wxyz"
};

char input[1028];

int main(void) {
	int data_num,cur_data;
	char* pos;
	int count;
	int mozi;
	scanf("%d",&data_num);
	for(cur_data=0;cur_data<data_num;cur_data++) {
		scanf("%s",input);
		count=-1;
		mozi=0;
		for(pos=input;*pos!=0 && *pos!='\n';pos++) {
			if(*pos=='0') {
				if(count>=0)putchar(str_list[mozi][count]);
				count=-1;
				mozi=0;
			} else {
				if(*pos-'1'==mozi) {
					count++;
					if(str_list[mozi][count]==0)count=0;
				} else {
					count=0;
					mozi=*pos-'1';
				}
			}
		}
		putchar('\n');
	}
	return 0;
}

Measured memory_bytes: 0
#define _USE_MATH_DEFINES
#include<iostream>
#include<string>
#include<queue>
#include<cmath>
#include<map>
#include<set>
#include<list>
#include<iomanip>
#include<vector>
#include<random>
#include<functional>
#include<algorithm>
#include<stack>
#include<cstdio>
#include<bitset>
#include<unordered_map>
#include<climits>
#include<fstream>
using namespace std;
///////////////////library zone!!!!!!!!!!!!!!!!!!!!!!!!!!!!
typedef long long ll;
typedef long double ld;
#define all(a) (a).begin(),(a).end()
const ll Mod = 1000000007;
const ll mod = 998244353;
struct H {
	ll x, y;
	bool operator<(const H &b) const {
		if (x != b.x) return x < b.x;
		return y < b.y;
	}
	bool operator>(const H &b) const {
		if (x != b.x) return x > b.x;
		return y > b.y;
	}
	bool operator==(const H &b) const { return x == b.x&&y == b.y; }
	bool operator!=(const H &b) const { return (*this) != b; }
};
struct P {
	ll pos, cost;
	bool operator<(const P &b) const { return cost < b.cost; }
	bool operator>(const P &b) const { return cost > b.cost; }
};
struct B {
	ll to, cost;
};
struct E {
	ll from, to, cost;
	bool operator<(const E &b) const { return cost < b.cost; }
	bool operator>(const E &b) const { return cost > b.cost; }
};
template<typename T, typename U>
void chmin(T &a, U b) {
	if (a > b) a = b;
}
template<typename T, typename U>
void chmax(T &a, U b) {
	if (a < b) a = b;
}
template<typename T>
T max_0(T a) {
	if (a < 0) return 0;
	return a;
}
template<typename T>
T min_0(T a) {
	if (a > 0) return 0;
	return a;
}
ll read() {
	ll u;
	ll k = scanf("%lld", &u);
	return u;
}
ll gcd(ll i, ll j) {
	if (i > j) swap(i, j);
	if (i == 0) return j;
	return gcd(j%i, i);
}
ll mod_pow(ll x, ll n, ll p) {
	ll res = 1;
	while (n > 0) {
		if (n & 1) res = res * x % p;
		x = x * x % p;
		n >>= 1;
	}
	return res;
}//x^n%p
const ll Inf = 3023372036854775807;
const int inf = 1500000000;
#define int long long
//----------------------------------------------------

signed main() {
	int h, w;
	while (cin >> h >> w && h + w) {
		for (int i = 0; i < h; i++) {
			for (int j = 0; j < w; j++) {
				cout << "#";
			}
			cout << endl;
		}
		cout << endl;
	}
}


Measured memory_bytes: 3108
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){
string in[1000];
int max=0;
string ml_str;
int tmp;
string ans;
int i=0;
for(i=0;cin>>in[i];i++){
if(in[i].size()>max){
max=in[i].size();
ml_str=in[i];
}
}
sort(in,in+i);
tmp=1;
max=0;
for(int j=1;j<i;j++){
if(in[j]==in[j-1]){
tmp++;
}else{
if(max<tmp){
max=tmp;
ans=in[j-1];
tmp=1;
}
}
}
cout<<ans<<" "<<ml_str<<endl;
}

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

int main() {
  int N, Y;
  cin >> N >> Y;
  string ans = "-1 -1 -1";
  for (int i = 0; i <= N; i++) {
    for (int j = N; j >= 0; j--) {
      int k = N - j - i;
      if (0 <= k && k <= N && 10000 * i + 5000 * j + 1000 * k == Y) {
        ans = to_string(i) + " " + to_string(j) + " " + to_string(k);
        break;
      }
    }
    if (ans != "-1 -1 -1") break;
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
import java.util.*;

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

        var X = scanner.nextInt();
        var N = scanner.nextInt();

        var ps = new int[N];
        for(int i=0; i<ps.length; i++)
            ps[i] = scanner.nextInt();

        Arrays.sort(ps);
        if(isContain(ps, X)) {
            System.out.println(X); return;
        }

        var ans = X;
        for(int i=1; ; i++) {
            ans = X-i;
            if(isContain(ps, ans))
                break;
            ans = X+i;
            if(isContain(ps, ans))
                break;
        }

        System.out.println(ans);
    }
    
    static boolean isContain(int[] array, int key) {
        return Arrays.binarySearch(array, key) < 0;
    }
}

Measured memory_bytes: 35980
#include<bits/stdc++.h>
#define F first
#define S second
#define ll long long
#define MOD 1000000007

#define fast ios_base::sync_with_stdio(false)
#define itt cin.tie(0)
#define now cout.tie(0)

using namespace std;

ll x;
ll a,b;

int main()
{
	cin>>x;
	bool isok=false;
	for(ll i=-118;i<=119;i++)
	{
		a=i*i*i*i*i;
		for(ll j=-119;j<i;j++)
		{
			b=j*j*j*j*j;
			if(a-b==x)
			{
				isok=true;
				cout<<i<<" "<<j<<endl;
				break;
			}
		}
		if(isok)
			break;
	}
	return 0;
}


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

use proconio::input;
use proconio::fastout;

#[fastout]
fn main() {
    input! {
        N: usize,
        mut a: [i32; 3 * N],
    }
    a.sort_by(|a, b| b.cmp(a));
    let result: i64 = (0..N).map(|i| a[2 * i + 1] as i64).sum();
    println!("{}", result);
}


Measured memory_bytes: 6576
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
//It is so troublesome that I include bits/stdc++.h !
using namespace std;

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; }
const int INF = 1001001000;
const int MOD = 1000000007;
bool E[2005][2005];
typedef pair<int,int> P;
//NのM乗を求める(繰り返し二乗法)
long long mod_pow(long long N, long long M) {
    if (M == 0) return 1;
    long long res = mod_pow((N * N) % MOD, M / 2);
    //最下位ビット(*N)が1の時は単独でNをかける
    if (M & 1) res = (res * N) % MOD;

    return res %= MOD;
}
long long nCr(long long n, long long r) {
    long long A = 1, B = 1;
    //Aが分子Bが1/r!
    for (long long i = n - r + 1; i <= n; i++) {
        A = A * i % MOD;
    }
    for (long long i = 1; i <= r; i++) {
        B = B * i % MOD;
    }
    B = mod_pow(B, MOD - 2);
    B %= MOD;
    //Bは割るのではなく掛ける
    return (A * B) % MOD;
}

int main() {
  int D,N;cin >> D >> N;
  if(D == 0 && N != 100) cout << N << endl;
  if(D == 1 && N != 100) cout << N*100 << endl;
  if(D == 2 && N != 100) cout << N*10000 << endl;
  if(N == 100 && D == 0) cout << 101 << endl;
  if(N == 100 && D == 1) cout << 10100 << endl;
  if(N == 100 && D == 2) cout << 1010000 << endl;
  /*
  g++ abc.cpp
  ./a.out
  */
 return 0;
}

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

using namespace std;

int main(){
    int64_t n,k;
    cin >> n >> k;
    vector<int> sum(n,0);
    for (int64_t i = 0; i < k; i++)
    {
        int d;
        cin >> d;
        for (size_t j = 0; j < d; j++)
        {
            int buf;
            cin >> buf;
            sum[buf - 1]++;
        }
    }

    int cnt = 0;
    for(auto s: sum)
    {
        if(s == 0)
            cnt++;
    }
    cout << cnt << endl;
}

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

int main(){
    int a,b,c;
    cin >> a >> b >> c;

    for(int i=1;i<b;i++){
        if(a*i%b==c){
            cout << "YES";
            return 0;
        }
    }
    cout << "NO";
    return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using static MyIO;
using static BinarySearch;


public class E
{
	public static void Main()
	{
		int N = GetInt();
		int[] A = new int[N];
		for(int i = 0; i < N; i++)
			A[i] = GetInt();
		Array.Reverse(A);

		List<int> dp = Enumerable.Repeat(int.MaxValue, N).ToList();
		for(int i = 0; i < N; i++)
		{
			int ub = UpperBound(dp, A[i], (x, y) => x - y);
			dp[ub] = A[i];
		}

		Console.WriteLine(dp.Count(x => x < int.MaxValue));
	}
}


public static class BinarySearch
{
	public static int LowerBound<T>(List<T> list, T key, Comparison<T> comp)
	{
		int len = list.Count;
		if(comp(list[len - 1], key) < 0)
			return -1;

		int left = 0;
		int right = len - 1;
		while(right > left)
		{
			int mid = (left + right) / 2;
			if(comp(list[mid], key) >= 0)
				right = mid;
			else
				left = mid + 1;
		}

		return left;
	}

	public static int UpperBound<T>(List<T> list, T key, Comparison<T> comp)
	{
		int len = list.Count;
		if(comp(list[len - 1], key) < 0)
			return len;

		int left = 0;
		int right = len - 1;
		while(right > left)
		{
			int mid = (left + right) / 2;
			if(comp(list[mid], key) > 0)						
				right = mid;
			else			
				left = mid + 1;	
		}

		return left;
	}
}


public static class MyIO
{
	private static string[] args = null;
	private static int num = -1;
	private static int used = -1;

	private static string getArg()
	{
		if(used == num)
		{
			args = Console.ReadLine().Split(' ');
			num = args.Length;
			used = 0;
		}
		return args[used++];
	}

	public static int GetInt(){ return int.Parse(getArg()); }
	public static long GetLong(){ return long.Parse(getArg()); }
	public static double GetDouble(){ return double.Parse(getArg()); }
	public static string GetString(){ return getArg(); }
}





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

int main(){
  int s, c = 0;
  cin >> s;
  c += (s / 100) % 2;
  c += (s / 10) % 2;
  c += s % 2;
  
  cout << c << endl;
  
  return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void) {
	char c;
	int slr[26]= {0},i,j;
	
	while(scanf("%c", &c) != EOF){
		for (j=0; j<26; j++){
			if(c == 'a'+j || c == 'A'+j){
				slr[j]++;
			}
		}
	}
	for(i=0; i<26; i++){
		printf("%c : %d\n", 'a'+i, slr[i]);
	}
	
	return 0;
}

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

using P = pair<int,int>;

const int INF = 1e9;

int main(){
  int N, K;
  cin >> N >> K;
  
  vector<int> vec(N);
  vector<int> par(N);
  vector<int> dist(N,INF);
  vector<vector<int>> G(N,vector<int>(0));
  
  
  for(int i=0; i<N; i++){
    cin >> vec[i];
    vec[i]--;
  }
  
  if(K == 1){
    int cnt = 0;
    for(int i=0; i<N; i++){
      if(vec[i] != 0){
        cnt++;
      }
    }
    cout << cnt << endl;
    return 0;
  }
  
  int ans = 0;
  if(vec[0] != 0){
    ans++;
    vec[0] = 0;
  }
  
  for(int i=1; i<N; i++){
    G[vec[i]].push_back(i);
    G[i].push_back(vec[i]);
  }
  
  
  
  queue<int> Q;
  dist[0] = 0;
  Q.push(0);
  while(Q.size()){
    int x = Q.front();
    Q.pop();
    for(int i=0; i<G[x].size(); i++){
      if(dist[G[x][i]] > dist[x] + 1){
        dist[G[x][i]] = dist[x] + 1;
        Q.push(G[x][i]);
        par[G[x][i]] = x;
      }
    }
  }
  
  vector<P> D(N);
  for(int i=0; i<N; i++){
    P add = {dist[i], i};
    D[i] = add;
  }
  sort(D.rbegin(),D.rend());
  
  for(int i=0; i<N; i++){
    int x = D[i].first;
    int y = D[i].second;
    Q.push(y);
  }
  
  while(Q.size()){
    int x = Q.front();
    Q.pop();
    int pos = x;
    int cnt = 0;
    while(pos != 0){
      cnt++;
      int p = pos;
      pos = par[pos];
      par[p] = 0;
      if(cnt == K && pos != 0){
        ans++;
        Q.push(pos);
        break;
      }
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 11744
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

int descending_compare(const void *a, const void *b){
    if (*(int*)a > *(int*)b){
        return -1;
    }else if (*(int*)a == *(int*)b){
        return 0;
    }else{
        return 1;
    }
}

int ascending_compare(const void *a, const void *b){
    if (*(int*)a < *(int*)b){
        return -1;
    }else if (*(int*)a == *(int*)b){
        return 0;
    }else{
        return 1;
    }
}


int lower_bound(int *a, int n, int key){
    int left, mid, right;
    left = 0, right = n;
    mid = (left + right)/2;
    while ((left+1 != mid || mid+1 != right) && mid != left){
        if (key > a[mid]){
            left = mid;
        }else{
            right = mid+1;
        }
        mid = (left + right)/2;
    }
    if (a[left] >= key)return left;
    if (a[mid] >= key)return mid;
    if (a[right] >= key)return right;
    return n;
}

//greatest common divisor
unsigned long  gcd(unsigned long x, unsigned long y){
    if (y == 0){ 
        return x;
    }else if (x > y){
        return gcd(y, x % y);
    }else{
        return gcd(x, y % x);
    }
}



long long factorial(int x){
    long long rtn = 1;
    int i;
    for (i = x; i > 1; i--){
        rtn = (rtn*i);
    }
    return rtn;
}


int main(void){
    int n;
    scanf("%d", &n);

    printf("%d\n", 800*n-(n/15*200));



    return 0;
}


Measured memory_bytes: 128
def main():
    import sys
    input = sys.stdin.readline

    S = input().rstrip('\n')
    N = len(S)
    if N&1:
        print('No')
        exit()
    for i in range(N):
        if i&1:
            if S[i] != 'i':
                print('No')
                exit()
        else:
            if S[i] != 'h':
                print('No')
                exit()
    print('Yes')


if __name__ == '__main__':
    main()


Measured memory_bytes: 38384
#include <cstdio>
#include <string>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <iterator>
#include <cassert>
#include <numeric>
#include <functional>
#include <cassert>
//#include <numeric>
#pragma warning(disable:4996) 
 
typedef long long ll;
typedef unsigned long long ull;
#define MIN(a, b) ((a)>(b)? (b): (a))
#define MAX(a, b) ((a)<(b)? (b): (a))
#define LINF  9223300000000000000
#define LINF2 1223300000000000000
#define INF 2140000000
const long long MOD = 1000000007;
//const long long MOD = 998244353;

using namespace std;

char str[100005];
ll dp[4][100005];

void solve()
{
    scanf("%s", str);
    int n = strlen(str);
    dp[0][0] = 1;
    int i;
    for (i = 0; i < n; i++) {
        int mult = (str[i] == '?' ? 3 : 1);
        dp[0][i + 1] = dp[0][i]*mult%MOD;
        dp[1][i + 1] = dp[1][i]*mult%MOD;
        dp[2][i + 1] = dp[2][i]*mult%MOD;
        dp[3][i + 1] = dp[3][i]*mult%MOD;
        if (str[i] == 'A' || str[i] == '?') {
            dp[1][i + 1] = (dp[1][i + 1] + dp[0][i]) % MOD;
        }
        if (str[i] == 'B' || str[i] == '?') {
            dp[2][i + 1] = (dp[2][i + 1] + dp[1][i]) % MOD;
        }
        if (str[i] == 'C' || str[i] == '?') {
            dp[3][i + 1] = (dp[3][i + 1] + dp[2][i]) % MOD;
        }
    }
    printf("%lld\n", dp[3][n]);

    return;
}

int main(int argc, char* argv[])
{
#if 1
    solve();
#else
    int T;
    scanf("%d", &T);
    int t;
    for(t=0; t<T; t++) {
        //printf("Case #%d: ", t+1);
        solve();
    }
#endif
    return 0;
}



Measured memory_bytes: 3328
//
// Created by kashi on 27-07-2020.
//
#include<bits/stdc++.h>
using namespace std;
#define mp make_pair
#define pb push_back
#define ll long long
#define ff first
#define ss second
#define Endl endl
#define int long long
int gcd(int a,int b){
    return b?gcd(b,a%b):a;
}
bool cmps(pair<int,int>p1,pair<int,int>p2) {
    return p1.ss<p2.ss;
}

int32_t  main(){
    string str1,str2;
    cin>>str1>>str2;
    int n1,n2;
    cin>>n1>>n2;
    string str3;
    cin>>str3;
    if(str3==str1)
        n1--;
    else
        n2--;
    cout<<n1<<" "<<n2<<endl;
    return 0;
}

Measured memory_bytes: 3572
n = str(input())

if int(n[-1]) == 2 or int(n[-1]) == 4 or int(n[-1]) == 5 or int(n[-1]) == 7 or int(n[-1]) == 9:
    print("hon")
elif int(n[-1]) == 0 or int(n[-1]) == 1 or int(n[-1]) == 6 or int(n[-1]) == 8:
    print("pon")
else:
    print("bon")

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


int r, D, x;

int main() {  
  cin >> r >> D >> x;

  int ans;
  for (int i = 0; i < 10; i++) {
    ans = r*x - D;
    cout << ans << endl;
    x = ans;
  }
  return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;
public class Main {
	
	static char[] k = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
	

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		String s = stdIn.next();
		String p = stdIn.next();
		
		boolean ans = false;
		
		IN:for(int i = 0; i < s.length(); i++) {
			for(int j = 0; j < p.length(); j++) {
				if(s.charAt((i + j) % s.length()) != p.charAt(j)) {
					continue IN;
				}
			}
			ans = true;
			break;
		}
		
		System.out.println((ans)?"Yes":"No");
		
	}
}

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

#define fastIO ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
typedef long long ll ;
typedef long double ld ;

const ll MOD = 1E9 + 7, INF = 2E18 + 5 ;
const double PI = 2 * acos(0.0) ;
const long double EPS = 1.0E-14 ;

int main()
{
    ll n, ans = 0, left, right ;
    string s ;
    cin >> n ;
    cin >> s ;
    left = 0, right = n - 1 ;
    while (left < right) {
        if (s[right] == 'R' and s[left] == 'W') {
            ans++ ;
            left++, right-- ;
        }
        else if (s[right] == 'W')   right-- ;
        else if (s[left] == 'R')    left++ ;
    }
    cout << ans ;

    return 0 ;
}


Measured memory_bytes: 3768
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define all(x)(x).begin(), (x).end() // 昇順ソート
#define rall(v)(v).rbegin(), (v).rend() // 降順ソート
#define INF 1 LL << 60
typedef long long int LL;
typedef long long int ll;
#define pll pair < ll, ll >
#define F first
#define S second
const int MOD = 1000000007;
template < class T > bool chmax(T & a,const T & b) { if (a < b) { a = b; return true; } return false; }
template < class T > bool chmin(T & a,const T & b) { if (a > b) { a = b; return true; } return false; }
// 任意のlogは　対数の底の変換を使う    log(N) / log(任意の底)

int main() {
    string S;cin >> S;
    int N = S.size();
    int Pnum = 0;
    
    rep(i,N){
        if(S[i] == 'p')Pnum--;
    }

    int ans = Pnum + N/2;

    cout << ans << endl;

}

Measured memory_bytes: 512
n = int(input())
a = list(map(int, input().split()))

flag1 = True
flag2 = True

for i in range(n):
    if a[i] != 0:
        flag1 = False
        break

if not flag1:
    if n % 3 != 0:
        flag2 = False
    if flag2:
        a.sort()
        a11 = a[0: n // 3]
        a12 = a[n // 3: 2 * n // 3]
        a13 = a[2 * n // 3:]
        if not (a11.count(a11[0]) == a12.count(a12[0]) == a13.count(a13[0])):
            flag2 = False
    if flag2:
        a1, a2, a3 = a[0], a[n // 3], a[2 * n // 3]
        aa = [[], [], []]
        for i in range(30):

            aa[0].append(a1 % 2)
            aa[1].append(a2 % 2)
            aa[2].append(a3 % 2)
            a1 = a1 // 2
            a2 = a2 // 2
            a3 = a3 // 2

        for i in range(30):
            if aa[0][i] == 0 and aa[1][i] == 0 and aa[2][i] == 1:
                flag2 = False
                break
            if aa[0][i] == 0 and aa[1][i] == 1 and aa[2][i] == 0:
                flag2 = False
                break
            if aa[0][i] == 1 and aa[1][i] == 0 and aa[2][i] == 0:
                flag2 = False
                break
            if aa[0][i] == 1 and aa[1][i] == 1 and aa[2][i] == 1:
                flag2 = False
                break


if flag1 or flag2:
    print("Yes")
else:
    print("No")


Measured memory_bytes: 14116
//code by lynmisakura.wish to be accepted!
/****************************/
#include<iostream>
#include<iomanip>
#include<math.h>
#include<vector>
#include<string>
#include<stack>
#include<queue>
#include<map>
#include<algorithm>
#include<bitset>
#include <climits>
#include<set>
#include<bitset>
using namespace std;
/***************************/
typedef long long ll;
typedef vector<int> vi;
typedef vector<long long> vl;
typedef pair<ll, ll> pi;
typedef vector<pair<ll, ll>> vpi;

//const long long INF = 1LL << 55;

#define itn ll
#define endl '\n'
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ss second
#define ff first
#define dup(x,y) ((x) + (y) - 1)/(y)
#define mins(x,y) x = min(x,y)
#define maxs(x,y) x = max(x,y)
#define all(x) (x).begin(),(x).end()
#define Rep(n) for(ll i = 0;i < n;i++)
#define rep(i,n) for(ll i = 0;i < n;i++)
#define flush fflush(stdout)
#define rrep(i,n) for(ll i = n - 1;i >= 0;i--)
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() )
#define ioboost cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(20)
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
ll qp(ll a, ll b) { ll ans = 1; do { if (b & 1)ans = 1ll * ans*a; a = 1ll * a*a; } while (b >>= 1); return ans; }
ll qp(ll a, ll b, ll mo) { ll ans = 1; do { if (b & 1)ans = 1ll * ans*a%mo; a = 1ll * a*a%mo; } while (b >>= 1); return ans; }

#define _GLIBCXX_DEBUG
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl

inline void ain(vector<int>& a,int n){
   for(int i = 0;i < n;i++)scanf("%d",&a[i]);
}
inline void ainl(vector<ll>&a,int n){
   for(int i = 0;i < n;i++)scanf("%lld",&a[i]);
}
template<class T>inline void aout(vector<T> a){
   int sz = a.size();
   cout << "[ ";
   for(int i = 0;i < sz;i++){
      if(i != sz-1)cout << a[i] << ", ";
      else cout << a[i];
   }
   cout << " ]" << endl;
}

int main(){
    ll n;cin >> n;
    ll i = 1;
    int mx = 0;
    ll ans = LONG_MAX;
    for(ll j = 1;j*j <= n;j++){
        if(n % j == 0)mins(ans,(ll)(j + n/j));
    }
    cout << ans - 2 << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main()
{
  int Number[5];
  for (int i = 1; i <= 5; i++){
    cin >> Number[i];
    if (Number[i] == 0){
      cout << i << endl;
      break;
    }
  }
  return 0;
}

Measured memory_bytes: 3620
#define _CRT_SECURE_NO_WARNINGS
#include<cstdio>
#include<cmath>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<utility>
#include<iomanip>
#include<vector>
#include<string>
#include<queue>
#include<stack>
#include<map>
#include<list>
#include<set>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define repp(i,k,n) for(int i=k;i<(int)n;i++)
using namespace std;
const int dx[4] = { 0, 1, 0, -1 }, dy[4] = { 1, 0, -1, 0 };
const int dX[8] = { 0, 1, 1, 1, 0, -1, -1, -1 }, dY[8] = { 1, 1, 0, -1, -1, -1, 0, 1 };
struct XY
{
	int x;
	int y;
};
int in()
{
	int x;
	cin >> x;
	return x;
}
/*
(char)'1' - (int)48 = (int)1;
???1111181
*/
////////////////////////////////////////////////////



int main()
{
	int n;
	while (cin>>n&&n)
	{
		vector<int>  m[120];
		int k[120] = {};
		rep(i, n)
		{
			int nn = in();
			rep(l,nn)
			{
				m[i].push_back(in());
			}
			sort(m[i].begin(), m[i].end());
		}
		int nn = in();
		rep(i, nn)
		{
			int x = in();
			rep(l, n)
			{
				if (!binary_search(m[l].begin(), m[l].end(), x))
				{
					k[l] = 1;
				}
			}
		}
		if (count(k, k + n, 0) != 1)
		{
			cout << -1 << endl;
		}
		else
		{
			int ans = 0;
			rep(i, n)if (k[i] == 0)ans = i + 1;
			cout << ans << endl;
		}
	}
}

Measured memory_bytes: 1268
#include<iostream>
#include<algorithm>
#include<map>
#include<string>
#include<stack>
#include<queue>
#include<string>
using namespace std;

void insertionSort(int N, int A[]){
	for (int i = 1; i < N; i++){
		int v = A[i];
		int j = i - 1;
		while (j >= 0 && A[j]>v){
			A[j + 1] = A[j];
			j--;
			A[j + 1] = v;
		}
		for (int l = 0; l < N - 1; l++) cout << A[l] << " ";
		cout << A[N - 1] << endl;
	}
}


int main(){
	int N;
	int A[1000];
	cin >> N;
	for (int i = 0; i < N; i++){
		cin >> A[i]; //????????????????????\???
	}
	for (int i = 0; i < N - 1; i++)cout << A[i] << " ";
	cout << A[N - 1] << endl;
	insertionSort(N,A);

	return 0;
}

Measured memory_bytes: 1164
#include <stdlib.h>
#include <stdio.h>
#include <math.h>

int main()
{
    int a,b,k,n,x,i,j;
    scanf("%d",&a);
    if(a==1)printf("Hello World");
    else{
    scanf("%d%d",&n,&k);
    printf("%d",n+k);
}
    return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
using ll = long long;

int p[100001];

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

    int x[1000];
    int k = 0;
    x[k++] = 1;
    for (int i = 6; i <= n; i *= 6) {
        x[k++] = i;
    }
    for (int i = 9; i <= n; i *= 9) {
        x[k++] = i;
    }

    for (int i = 0; i <= n; i++) {
        p[i] = 1 << 30;
    }

    p[0] = 0;
    for (int i = 0; i <= n; i++) {
        for (int j = 0; j < k; j++) {
            int t = i + x[j];
            if (t > n) continue;
            p[t] = min(p[t], p[i] + 1);
        }
    }

    cout << p[n] << endl;

    return 0;
}

Measured memory_bytes: 640
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define cinf(n,x) for(int i=0;i<(n);i++)cin>>x[i];
#define ft first
#define sc second
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define all(v) (v).begin(),(v).end()
#define LB(a,x) lb(all(a),x)-a.begin()
#define UB(a,x) ub(all(a),x)-a.begin()
#define mod 1000000007
//#define mod 998244353
#define FS fixed<<setprecision(15)
using namespace std;
typedef long long ll;
const double pi=3.141592653589793;
template<class T> using V=vector<T>;
using Graph = vector<vector<int>>;
using P=pair<ll,ll>;
typedef unsigned long long ull;
typedef long double ldouble;
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; }
template<class T> inline void out(T a){ cout << a << '\n'; }
void YN(bool ok){if(ok) cout << "Yes" << endl; else cout << "No" << endl;}
//void YN(bool ok){if(ok) cout << "YES" << endl; else cout << "NO" << endl;}


const ll INF=1e18;
const int mx=200005;

ll dp[105][100005];

int main(){
    cin.tie(0);ios::sync_with_stdio(false);
    ll n,W;
    cin>>n>>W;
    V<ll> w(n),v(n);
    rep(i,n) cin>>w[i]>>v[i];
    for(int i=0;i<=n;i++){
        for(int j=0;j<=100000;j++) dp[i][j]=INF;
    }
    dp[0][0]=0;
    rep(i,n){
        for(int j=0;j<=100000;j++){
            chmin(dp[i+1][j],dp[i][j]);
            if(j-v[i]>=0) chmin(dp[i+1][j],dp[i][j-v[i]]+w[i]);
        }
    }
    int ans=0;
    for(int j=0;j<=100000;j++) if(dp[n][j]<=W) chmax(ans,j);
    out(ans);
}

Measured memory_bytes: 82556
N = gets.to_i
as = Array.new(N)
N.times do |i|
    as[i] = gets.to_i
end

min = 1
ans = 0
pt = 0
while pt < N
    if as[pt] <= min
        min = as[pt]+1 if min < as[pt]+1
        pt += 1
    elsif as[pt] - min <= min
        min = 2 if min == 1
        ans += 1
        pt += 1
    else
        n = (as[pt]-1)/min - 1
        ans += n
        as[pt] -= n*min
    end
end
puts ans

Measured memory_bytes: 2812
'use strict'

const main = input => {
	const args = input.split('\n').map(arg => arg.split(' '))
	const S = args[0][0]

	const weeks = {
		'SUN': 7,
		'MON': 6,
		'TUE': 5,
		'WED': 4,
		'THU': 3,
		'FRI': 2,
		'SAT': 1
	}

	console.log(weeks[S])
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'))


Measured memory_bytes: 22080
#include <cstdio>

using namespace std;

int main(){
  int a;
  for(int i=0; i<10000; i++) {
    scanf("%d", &a);
    if(a == 0) break;
    printf("Case %d: %d\n", i+1, a);
  }
  
  return 0;
}



Measured memory_bytes: 2572
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <tuple>
#include <utility>
#include <vector>
#define ll long long
#define itn int
#define endl '\n'
#define co(ans) cout<<ans<<endl
#define COYE cout<<"YES"<<endl
#define COYe cout<<"Yes"<<endl
#define COye cout<<"yes"<<endl
#define CONO cout<<"NO"<<endl
#define CONo cout<<"No"<<endl
#define COno cout<<"no"<<endl
#define FORE(i,a) for(auto &i:a)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n)  FFOR(i,1,n)
#define PB push_back
#define MP make_pair
#define ALL(V) (V).begin(),(V).end()
#define SORT(V) sort((V).begin(),(V).end())
#define REVERSE(V) reverse((V).begin(),(V).end())
#define EACH(V,i) for(typeof((V).begin()) i=(V).begin();i!=(V).end();++i)
#define equals(a,b) (fabs((a)-(b))<EPS)
#define INF ((1LL<<62)-(1LL<<31))
#define EPS 1e-10
#define PI 3.141592653589793238
#define MOD 1000000007
#define MAX 5100000
using namespace std;
using Edge=pair<int,int>;
using Graph=vector<vector<int>>;
inline int toInt(string s){int v;istringstream sin(s);sin>>v;return v;}
template<class T>inline string toString(T x){ostringstream sout;sout<<x;return sout.str();}
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;}
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
const int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

int main(){
  int H,W,ans=0;
  cin>>H>>W;
  char S[H][W];
  int L[H][W],R[H][W],U[H][W],D[H][W];
  REP(i,H){
    REP(j,W){
      cin>>S[i][j];
      L[i][j]=0;
      R[i][j]=0;
      U[i][j]=0;
      D[i][j]=0;
    }
  }
  
  REP(i,H){
    ll cnt=1;
    REP(j,W){
      if(S[i][j]=='#') cnt=0;
      else L[i][j]=cnt;
      cnt++;
    }
  }
  
  REP(i,H){
    ll cnt=1;
    for(int j=W-1; j>=0; --j){
      if(S[i][j]=='#') cnt=0;
      else R[i][j]=cnt;
      cnt++;
    }
  }
  
  REP(j,W){
    ll cnt=1;
    REP(i,H){
      if(S[i][j]=='#') cnt=0;
      else U[i][j]=cnt;
      cnt++;
    }
  }
  
  REP(j,W){
    ll cnt=1;
    for(int i=H-1; i>=0; --i){
      if(S[i][j]=='#') cnt=0;
      else D[i][j]=cnt;
      cnt++;
    }
  }
  
  REP(i,H){
    REP(j,W){
      chmax(ans,L[i][j]+R[i][j]+U[i][j]+D[i][j]-3);
    }
  }
  
  co(ans);
  return 0;
}

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

using namespace std;

typedef long long ll;

const int INF = 1000000000;


int main()
{
  int A, B; scanf("%d %d", &A, &B);
  vector<string> ans(100);
  for (int i = 0; i < 50; ++i) {
    ans[i] = string(100, '.');
    ans[i + 50] = string(100, '#');
  }
  --B;
  int r = 0, c = 0;
  for (int i = 0; i < B; ++i, c += 2) {
    if (c == 100) {
      r += 2;
      c = 0;
    }
    ans[r][c] = '#';
  }

  r = 99, c = 0;
  --A;
  for (int i = 0; i < A; ++i, c += 2) {
    if (c == 100) {
      r -= 2;
      c = 0;
    }
    ans[r][c] = '.';
  }


  printf("100 100\n");
  for (int i = 0; i < 100; ++i) {
    printf("%s\n", ans[i].c_str());
  }
  return 0;
}


Measured memory_bytes: 256
from itertools import accumulate
N = 100000
prime = [True for _ in range(N+1)]
prime[0] = False
prime[1] = False
i = 2
for i in range(N+1):
    if prime[i]:
        for j in range(2*i, N+1, i):
            prime[j] = False
prime2 = [0 for _ in range(N+1)]
for i in range(N+1):
    if prime[i] and prime[(i+1)//2]:
        prime2[i] = 1
acc = list(accumulate(prime2))

Q = int(input())
for _ in range(Q):
    l, r = map(int, input().split())
    print(acc[r]-acc[l-1])

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

using namespace std;

typedef long long ll;

int main(){
  ll a[3];
  for(int i=0;i<3;i++){
    cin>>a[i];
  }
  sort(a,a+3);
  
  if(a[0]+a[1]!=a[2]){
    cout<<"No"<<endl;
  }else{
    cout<<"Yes"<<endl;
  }
  
  return 0;
}

Measured memory_bytes: 3596
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <map>
#include <queue>
#include <iomanip>
#define MOD 1000000007
typedef long long ll;
using namespace std;

int main(){
  int n,k;
  cin>>n>>k;
  vector<pair<ll,int>> vec;
  for(int i=0;i<n;i++){
      int t,d;
      cin>>t>>d;
      vec.push_back(make_pair(d,t));
  }

  sort(vec.begin(),vec.end());
  reverse(vec.begin(),vec.end());
  bool used[n+1]={};
  ll sum=0,x=0;
  priority_queue<int> PQ;
  for(int i=0;i<k;i++){
      sum+=vec[i].first;
      if(used[vec[i].second]){
          PQ.push(-vec[i].first);
      }else{
          used[vec[i].second]=true;
          x++;
      }
  }
  sum=sum+x*x;

  ll ans=sum;
  for(int i=k;i<n;i++){
      if(PQ.size()==0) break;
      if(used[vec[i].second]) continue;

      used[vec[i].second]=true;
      ll z=PQ.top();
      PQ.pop();
      sum=sum-(-z);
      sum=sum+vec[i].first;
      x++;
      sum=sum+2*x-1;
      ans=max(ans,sum);
  }
  cout<<ans<<endl;

  return 0;
}


Measured memory_bytes: 2420
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define Would
#define you
#define please


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


	int N;
	cin >> N;
	int D[100001] = {};
	rep(i, N) {
		int d;
		cin >> d;
		D[d]++;
	}
	int S[100002] = {};
	S[100000] = D[100000];
	rep(i, 99999) S[99999 - i] = S[100000 - i] + D[99999 - i];

	int kotae = 0;
	for (int i = 100000; i > 0; i--) {
		if (S[i] == N / 2) kotae++;
	}
	co(kotae);


	Would you please return 0;
}

Measured memory_bytes: 1024
import math
a, b, x = [int(i) for i in input().split()]
if a**2 * b / 2 <= x:
  y = 2 * x / a**2 - b
  tntheta = (b - y) / a
else:
  y = a - 2 * x / (a * b)
  tntheta = b / (a - y)
print(math.degrees(math.atan(tntheta)))

Measured memory_bytes: 9312
#include <iostream>
#include <algorithm>
#include <functional>
#include<vector>
#include<math.h>
#include<bitset>
#include<string>
#include <deque>
#include<queue>
#include<map>
using namespace std;

int main() {
	int N;
	cin >> N;
	if (N <= 999) {
		cout << "ABC";
	}
	else {
		cout << "ABD";
	}

	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <bits/stdc++.h>
#include <vector>
#include <utility>
#include <string>
#include <math.h>
#include <algorithm>
#include <cstring>
#include <cctype>

using namespace std;

int main() {
 
   long long int X;
   int flag=0;
   cin >> X;
   for(int i=X;i<2*X;i++){
      flag=0;
      for(int j=2;j<=pow(X,0.5);j++){
         if(i%j==0){
            flag=1;
            break;
         }
      }
      if(flag==0){
         cout << i << endl;
         break;
      }
   } 

}

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

int main(){
  int n,k,A=(2e9+3);
  cin>>n>>k;
  int a[n];
  for(int i=0;i<n;i++) cin>>a[i];
  for(int i=k-1;i<n;i++){
    A=min(A,a[i]-a[i-k+1]+min(abs(a[i]),abs(a[i-k+1])));
  }
  cout<<A<<endl;
}

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

int main() {
  int S; 
  string K;
  cin >> S;
  cin >> K;
  if (K.size() <= S)
    cout << K << endl;
  else {
    for (int i = 0; i < S; i++) 
      cout << K.at(i);
    cout <<  "..." << endl;
  }
}


Measured memory_bytes: 3600
#include <bits/stdc++.h>
#define rep(i,x,n) for(int i=x; i<(int)(n); i++)
#define rep_eq(i,x,n) for(int i=x; i<=(int)(n); i++)
using namespace std;

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

  int Ans = 0;
  rep( i, 0, N-2 ) {
    if ( S[i] == 'A' && S[i+1] == 'B' && S[i+2] == 'C' ) Ans++;
  }
  cout << Ans << endl;
}


Measured memory_bytes: 256