akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef tuple<int,int,int> T;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
typedef vector<T> vt;
 
 
 
 
int main() {
    int a,b;
    cin>>a>>b;

    int kuti=1;
    int kosuu=0;


    while(kuti<b){
        kuti=kuti+a-1;
        kosuu++;
    }
    cout<<kosuu<<endl;
}


Measured memory_bytes: 256
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var: ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        a: i64,
        b: i64,
    }
    let ans;
    if a < 6 {
        ans = 0;
    } else if 6 <= a && a <= 12 {
        ans = b / 2;
    } else {
        ans = b;
    }
    println!("{}", ans);
}

Measured memory_bytes: 4352
#include<stdio.h>
#include<string>
#include<stdlib.h>
#include<math.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<numeric>
#include<string.h>
#include<map>
#include<queue>

using namespace std;

typedef pair<int,int> pii;

#define rep(i,j) for(int i=0;i<(j);i++)
#define reps(i,j,k) for(int i=j;i<=k;i++)
#define in(i,j,k) ((i)>=(j)&&(i)<=(k))


int main(){
	int x,h;
	double s;
	for(;;){
		scanf("%d%d",&x,&h);
		if(!x&&!h)break;
		s=x*x;
		s+=2*x*sqrt(x*x/4.0+h*h);
		printf("%f\n",s);
	}
	return 0;
}

Measured memory_bytes: 1216
import java.util.Scanner;

public class Main {

  public static void main(String[] args) {
    // TODO 自動生成されたメソッド・スタブ
    Scanner scanner = new Scanner(System.in);
    int n = scanner.nextInt();
    int seats = 0;

    for (int i = 0; i < n; i++) {
      int s = scanner.nextInt();
      int e = scanner.nextInt();
      seats = seats + e + 1 - s;
    }

    System.out.println(seats);

  }

}


Measured memory_bytes: 24148
mod = 1000000007

N = int(input())

dic = {}
for i in range(1,N+1):
  tmp = i
  k = 2
  while tmp != 1:
    if tmp%k == 0:
      if k in dic:
        dic[k] += 1
      else:
        dic[k] = 1
      tmp //= k
      k = 2
    else:
      k += 1

ans = 1
for i in dic.values():
  ans = ans*(i+1) %mod
  #print(i, ans)
#print(dic)
print(ans)

Measured memory_bytes: 39408
#include <bits/stdc++.h>
using namespace std;
#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define YES() printf("YES\n")
#define NO() printf("NO\n")
#define Yes() printf("Yes\n")
#define No() printf("No\n")
#define in(x,y,h,w) x >= 0 && x < h && y >= 0 && y < w

#define int long long
//typedef    long long          ll;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      P;

template <typename T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template <typename T> T &chmax(T &a, const T &b) { return a = max(a, b); }
 
const int INF=1e+18;
const double EPS=1e-9;
const int MOD=1000000007;

const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};

signed main(){
	int n;
	cin >> n;
	for(int i = 0;i * 4 <= n;i++){
		if((n - i * 4) % 7 == 0){
			Yes();
			return 0;
		}
	}
	No();
	return 0;
}

Measured memory_bytes: 256
n = int(input())

a = list(map(int, input().split()))

import collections


s = [0]

for i in range(n):
    s.append(a[i] + s[i])

s = collections.Counter(sorted(s))

count = 0

for i in s.values():
    count += i * (i - 1) //2

print(count)


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

const int INF = 1001001001;

int main(){
  int n, m, x;
  cin >> n >> m >> x;
  int c[n],a[n][m];
  rep(i,0,n){
    cin >> c[i];
    rep(j,0,m){
      cin >> a[i][j];
    }
  }

  ll min = INF;

  for(int bit = 0; bit < (1<<n); ++bit){
    vector<int> s;
    rep(i,0,n){
      if(bit & (1<<i)){
        s.push_back(i);
      }
    }

    ll cost = 0;
    int skill[m] = {0};
    rep(i,0,s.size()){
      cost += c[s[i]];
      rep(j,0,m) skill[j] += a[s[i]][j];
    }

    int flag = 0;
    rep(j,0,m){
      if(skill[j]<x){
        flag = 1;
        break;
      }
    }
    if(flag == 0 && cost < min){
      min = cost;
    }
  }

  if(min==INF) cout << -1 << endl;
  else cout << min << endl;
  return 0;
}

Measured memory_bytes: 3632
#include <stdio.h>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <list>
#include <iterator>
#include <assert.h>
#pragma warning(disable:4996) 

typedef long long ll;
#define MIN(a, b) ((a)>(b)? (b): (a))
#define MAX(a, b) ((a)<(b)? (b): (a))
#define LINF 9223300000000000000
#define INF 2140000000
const long long MOD = 1000000007;
using namespace std;

int main(int argc, char* argv[])
{
    int n,m;
    scanf("%d%d", &n, &m);

    vector<vector<int> > g(n);
    int i;
    for(i=0; i<m; i++) {
        int u,v;
        scanf("%d%d", &u, &v);
        g[u-1].push_back(v-1);
    }
    int s,t;
    scanf("%d%d", &s, &t); s--; t--;

    vector<int> dists(3*n,-1);

    queue<pair<int,int> > que;   // to,dist
    que.push( make_pair(s,0) );
    dists[3*s]=0;
    while( !que.empty() ) {
        auto tmp=que.front();
        que.pop();
        int curr=tmp.first;
        int curr_dist=tmp.second;        

        for(i=0; i<(int)g[curr].size(); i++) {
            int next=g[curr][i];
            int next_dist=curr_dist+1;
            if(dists[3*next+(next_dist%3)]<0) {
                que.push(make_pair(next, next_dist));
                dists[3*next+(next_dist%3)]=next_dist;
            }
        }
    }
    printf("%d\n", (dists[3*t]>=0? dists[3*t]/3: -1));
    return 0;
}


Measured memory_bytes: 6912
#include <cstdio>
using namespace std;

int main() {
  int a, b;
  while (~scanf("%d %d", &a, &b)) {
    int sum, ans = 0;
    sum = a + b;
    while (sum) {
      sum /= 10;
      ++ans;
    }
    printf("%d\n", ans);
  }
}


Measured memory_bytes: 2616
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;

class Main{
	public static void main(String[] args)throws NumberFormatException, IOException{
	    InputStreamReader input = new InputStreamReader (System. in);
	    BufferedReader buffer = new BufferedReader(input);
	    String read = buffer.readLine();
	    int amount = Integer.parseInt(read);
	    int[][] scanInt = new int[amount][100];	//N?????°???100????¶??????????
	    for(int i=0; i<amount; i++){
	    	read = buffer.readLine();
	    	String[] scan = read.split(" ");
	    	for(int j=0; j<scan.length; j++){
	    		scanInt[i][j] = Integer.parseInt(scan[j]);
	    	}
	    }

    	int nowDepth = 0;
    	int[] foundPosition = new int[amount];
    	boolean visitBranch[] = new boolean[amount];
    	visitBranch[0] = true;
	    ArrayList<Integer> tempList = new ArrayList<Integer>();
	    tempList.add(1);

    	while(true){
    		boolean existBranch = false;
    		ArrayList<Integer> list = new ArrayList<Integer> (tempList);
    		tempList.clear();

    		for(int i=0; i<list.size(); i++){
    			foundPosition[list.get(i) -1 ] = nowDepth;
    			for(int j=0; j<scanInt[list.get(i)-1][1]; j++){
    				if(visitBranch[ scanInt[list.get(i)-1][j+2] -1] == false){
    					visitBranch[ scanInt[list.get(i)-1][j+2] -1] = true;
    					existBranch = true;
    					tempList.add(scanInt[list.get(i)-1][j+2]);
    				}
    			}
    		}
    		if(existBranch == false){
    			for(int i=0; i<amount; i++){
    				if(visitBranch[i] == false){
    					foundPosition[i] = -1;
    				}
    			}
    			break;
    		}
    		nowDepth += 1;
	    }

    	for(int i=0; i<amount; i++){
    		System.out.println((i+1)+" "+foundPosition[i]);
    	}
	}
}

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

typedef long long ll;
const double PI = 3.1415926535897932384626433;
const int MOD = 1e9+7;
const int INF = 1e9;
#define rep(i, n) for(int i=0;i<(n);++i)

//prototype declaration

//gloval variable

typedef struct{
  int x;
  int y;
}point;

void shift(point * p , point * q, int dx, int dy){
  (p->x) = (q->x) + dx;
  (p->y) = (q->y) + dy;
}

int main(void){
  point p1, p2;
  scanf("%d %d %d %d", &p1.x, &p1.y, &p2.x, &p2.y);
  point p3, p4;
  shift(&p3, &p2, -(p2.y-p1.y), p2.x-p1.x);
  shift(&p4, &p3, -(p3.y-p2.y), p3.x-p2.x);
  printf("%d %d %d %d\n", p3.x, p3.y, p4.x, p4.y);
  return 0;
}


Measured memory_bytes: 1696
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.StringTokenizer;

public class Main {
	static long X;
	
	public static void main(String[] args) throws IOException {
		MyScanner sc = new MyScanner();
		PrintWriter out = new PrintWriter(System.out);
		int N = sc.nextInt();
		X = sc.nextInt();
		List<Exam> all = new ArrayList<>(N);
		long target = 0;
		for (int i = 0; i < N; i++) {
			long tmpb = sc.nextInt();
			long tmpl = sc.nextInt();
			long tmpu = sc.nextInt();
			all.add(new Exam(tmpb, tmpl, tmpu));
			target += tmpb * tmpl;
		}
		Collections.sort(all);
		long[] acums = new long[N+1];
		for (int i = 1; i <= N; i++) {
			acums[i] = acums[i-1] + all.get(i-1).tot;
		}
		long left = -1, right = X * N;
		while (left + 1 < right) {
			long med = (left + right) / 2;
			long complete = med / X;
			long got = acums[(int)complete];
			long rem = med % X;
			long best = got;
			if (rem > 0) {
				long extra = all.get((int)complete).tot;
				long real;
				for (int i = 0; i < N; i++) {
					Exam cur = all.get(i);
					real = got + cur.getVal(rem);
					if (i < complete) real += extra - cur.tot;
					best = Math.max(best, real);
				}
			}
			if (best >= target) right = med;
			else left = med;
		}
		out.println(right);
		
		out.flush();
	}
	
	static class Exam implements Comparable<Exam> {
		long b, l, u, tot;
		
		public Exam(long b, long l, long u) {
			this.b = b;
			this.l = l;
			this.u = u;
			tot = b * l + (X - b) * u;
		}
		
		public long getVal(long hours) {
			long ret = hours * l;
			if (hours > b) {
				ret += (hours - b) * (u - l);
			}
			return ret;
		}
		
		@Override
		public int compareTo(Exam o) {
			return Long.compare(o.tot, tot);
		}
	}
	
	static class MyScanner {
		private BufferedReader br;
		private StringTokenizer tokenizer;
		
		public MyScanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}
		
		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}
		
		public int nextInt() {
			return Integer.parseInt(next());
		}
		
		public long nextLong() {
			return Long.parseLong(next());
		}
	}
}


Measured memory_bytes: 50240
#include <vector>
#include <sstream>
#include <algorithm>
#include <fstream>
#include <list>
#include <map>
#include <istream>
#include <bitset>
#include <sstream>
#include <unordered_map>
#include <stack>
#include <set>
#include <cmath>
#include <random>
#include <iostream>
#include <bitset>
#include <iomanip>
#include <queue>
#include <string>

#define int long long
#define endl "\n"
#define all(x) x.begin(),x.end()
#define rr return 0
#define xx first
#define yy second
#define pii pair<int,int>

using namespace std;

typedef long long ll;
typedef long double ld;

signed main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n, m;
    cin >> n >> m;
    vector<int> a(n);
    multiset<int, greater<int>> st;
    int ans = 0;
    for(int i = 0;i < n;i++){
        cin >> a[i];
        ans += a[i];
        st.insert(a[i]);
    }
    while(!st.empty() && m--){
        int p = *st.begin();
        st.erase(st.begin());
        int x = p - (p / 2);
        int y = p / 2;
        ans -= x;
        st.insert(y);
    }
    cout << ans;
    rr;
}


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

int main() {
  string s;
  cin >> s;
  for(int i = 0; i < 3; i++) {
    if(s[i] == s[i+1]){
      cout << "Bad";
      exit(0);
    }
  }
  cout << "Good";
}

Measured memory_bytes: 256
class Priority_que
  def initialize(max)
    @h = 0
    @a = Array.new(max+1)
    @INF = 1<<30
  end
  
  def max_heapify(i)
    l = 2*i
    r = 2*i+1
    
    if l<=@h && @a[l]>@a[i]
      largest = l
    else
      largest = i
    end
    
    if r<=@h && @a[r] > @a[largest]
      largest = r
    end
    
    if largest != i
      @a[i], @a[largest] = @a[largest], @a[i]
      max_heapify(largest)
    end
  end
  
  def extract
    if @h <1
      return -@INF
    end
    
    maxv = @a[1]
    @a[1] = @a[@h]
    @h-=1
    max_heapify(1)
    return maxv
  end
  
  def increase_key(i, key)
    if key < @a[i]
      return
    end
    
    @a[i] = key
    
    while i>1 && @a[i/2] < @a[i]
      @a[i], @a[i/2] = @a[i/2], @a[i]
      i = i/2
    end
  end
  
  def insert(key)
    @h+=1
    @a[@h] = -@INF
    increase_key(@h, key)
  end
end

q = Priority_que.new(2000000)

while command = gets.chomp.split
  case command[0]
  when "end"
    break
  when "insert"
    q.insert(command[1].to_i)
  when "extract"
    puts q.extract
  end
end



Measured memory_bytes: 22504
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <math.h>
#include <assert.h>
#include <vector>
#include <queue>
#include <string>
#include <map>
#include <set>

using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
static const double EPS = 1e-9;
static const double PI = acos(-1.0);

#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, s, n) for (int i = (s); i < (int)(n); i++)
#define FOREQ(i, s, n) for (int i = (s); i <= (int)(n); i++)
#define FORIT(it, c) for (__typeof((c).begin())it = (c).begin(); it != (c).end(); it++)
#define MEMSET(v, h) memset((v), h, sizeof(v))

typedef vector<int> Edges;
typedef vector<Edges> Graph;

int n;
Graph g;
int stone[2000];
int grundy[2000];
int nim[2000];

int calc(int node) {
  if (grundy[node] != -1) { return grundy[node]; }
  vector<bool> exist(n, false);
  FORIT(it, g[node]) {
    exist[calc(*it)] = true;
  }
  int g = -1;
  REP(i, n) {
    if (!exist[i]) {
      g = i;
      break;
    }
  }
  assert(g != -1);
  nim[g] ^= stone[node];
  return grundy[node] = g;
}

int main() {
  int m;
  while (scanf("%d %d", &n, &m) > 0) {
    g = Graph(n);
    MEMSET(nim, 0);
    MEMSET(grundy, -1);
    REP(i, n) { scanf("%d", &stone[i]); }
    REP(i, m) {
      int f, t;
      scanf("%d %d", &f, &t);
      f--; t--;
      g[f].push_back(t);
    }
    REP(i, n) { calc(i); }
    int ans = 2;
    REP(i, n) {
      if (nim[i] != 0) {
        ans = 1;
      }
    }
    printf("%d\n", ans);
  }
}

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

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

	vector<int> v_wa(100001);
	vector<int> v_ac(100001);
	int p, ac = 0, wa = 0;
	string s;
	rep(i, M)
	{
		cin >> p >> s;
		if (v_ac[p]) continue;
		if (s == "AC") {
			v_ac[p] = 1;
			ac++;
			wa += v_wa[p];
		}
		else
			v_wa[p]++;
	}

	cout << ac << " " << wa << endl;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define MAX 100005
#define MOD 1e9
#define pb push_back
#define pairs pair<int, int>
#define vi vector<int>
#define vb vector<bool>
#define vii vector<pairs>
#define lb lower_bound
#define ub upper_bound
#define ll long long
#define endl '\n'
using namespace std;
/* ----------------------------------------------------------------------------------- */

#define fastInput ios_base::sync_with_stdio(false), cin.tie(NULL);
#define all(x) x.begin(), x.end()
#define scan(a) scanf("%d", &a)
#define scanll(a) scanf("%lld", &a)
#define scanD(a) scanf("%lf", &a)
#define print(a) printf("%d\n", a)
#define printll(a) printf("%lld\n", a)
#define printD(a) printf("%lf\n", a)
#define printTwo(a) printf("%.2lf\n", a);
#define read(x) freopen(x, "r", stdin)
#define write(x) freopen(x, "w", stdout)
#define rep(i, a, n) for (int i = a; i < n; i++)
#define REP(i, a, n) for (int i = a; i <= n; i++)
#define inputArray(a,n) rep(i, 0, n) cin >> a[i];
#define copyArray(a,temp,n) rep(i, 0, n) temp[i]=a[i];
#define printArray(a,n) rep(i, 0, n) cout << a[i] << " "; cout << endl;

/* ----------------------------------------------------------------------------------- */

#define Cases  cout << "Case " << ++Case << ": ";
#define __test int tt; int Case=0; cin >> tt; while(tt--)
#define showTime cerr << "time = " << (clock() / CLOCKS_PER_SEC) << " sec" << '\n';

#define dbgA2(A, n, m) {cout<<"--> "<<#A<<" = \n";rep(i, 0, n){rep(j, 0, n){cout<<A[i][j]<<" ";}cout<<"\n";}cout<<"\n";}
#define dbgA(A, n) {cout<<" --> "<<#A<<" = (";rep(i, 0, n)cout<<A[i]<<" ";cout<<")\n";}
#define dbg(args...) {string sss(#args);sss+=',';cout<<" --> ";debugger::call(all(sss), args);cout<<"\n";}

/* ----------------------------------------------------------------------------------- */

ll gcd(ll n, ll m) { return m ? gcd(m, n % m) : n; }
ll lcm(ll n, ll m) { return n / gcd(n, m) * m; }

struct debugger {
	typedef string::iterator si;
	static void call(si it, si ed) {}
	template<typename T, typename ... aT>
	static void call(si it, si ed, T a, aT... rest) {
		string b;
		for(; *it!=','; ++it)
			if(*it!=' ')
				b+=*it;
		cout << b << "=" << a << " ";
		call(++it, ed, rest...);
	}
};

/* ----------------------------------------------------------------------------------- */


void solve() {
	int n;
	scan(n);
	int result = n + n * n + n * n * n;
	print(result);
}

int main() {
#ifdef Niloy
	read("input.txt");
	write("output.txt");
#endif

	solve();

	// __test {
	// 	solve();
	// }

	showTime;
	return 0;
}




Measured memory_bytes: 3812
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <stack>
#include <set> 
#include <map>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstring>
#include <iomanip>
#define REP(i,n) for(int i=0; i<(n); ++i)
#define FOR(i,a,b) for(int i=(a); i<(b); ++i)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int INF = 100100100;
const ll INFLL = 1001001001001001001;  // > 10^18
const int MOD = (int)1e9 + 7;
const ll MODLL = (ll)1e9 + 7;
const double EPS = 1e-9;

int main () {
    
    int x,t; cin >>x>>t;
    cout << max(x - t, 0) << endl;
    
    return 0;
}



Measured memory_bytes: 256
#include<iostream>
#include<stdio.h>
#include<vector>//s1.erase(n)=文字列s1の、n文字目以降削除
#include<algorithm>//辞書順=next_permutation
#include<set>
#include<string>//char 小文字のほうが32大きい
#include<sstream>
#include<string.h>
#include<complex>
#include<time.h>
#include<random>
#include<cmath>
#include<math.h>
#include<queue>
#include<time.h>
#include<iomanip>
#include<locale>
#include<utility>//swap=数値交換
#define rt "\n"
#define rep(i,n) for(int i=0;i<n;i++)
#define rop(i,n) for(int i=1;i<=n;i++)
#define drep(i,n) for(int i=n-1;0<=i;i--)
#define drop(i,n) for(int i=n;0<i;i--)
#define yes(ans) if(ans)cout<<"yes"<<rt;else cout<<"no"<<rt;
#define Yes(ans) if(ans)cout<<"Yes"<<rt;else cout<<"No"<<rt;
#define YES(ans) if(ans)cout<<"YES"<<rt;else cout<<"NO"<<rt;
#define sec(a,b,ans) if(ans)cout<<a<<rt;else cout<<b<<rt;
#define vcin(s,n) rep(i,n)cin>>s[i];//vcin(配列名),(繰り返し回数)
#define sort(s) sort(s.begin(),s.end())//標準=昇順
#define reve(s) reverse(s.begin(),s.end())
#define asas int ans=0
#define llcncn llint cnt=0
#define llasas llint ans=0
#define str string
#define please return
#define AC 0
#define ic_a int a;cin>>a;
#define ic_b int b;cin>>b;
#define ic_s string s;cin>>s;
#define Rapid_pleaseAC_fast cin.tie(0);ios::sync_with_stdio(false)
#define Pi 3.1415926535897932384626
#define nine 1000000000
using ll = long long;
using namespace std;
typedef vector<int> vint;
typedef vector<string> vstr;
typedef vector<char> vchar;
typedef vector<double> vdou;
typedef long long int llint;
typedef pair<int, int> pint;
typedef pair<llint, llint> pllint;
typedef vector<llint> vllint;
typedef vector<pint> vpint;
typedef vector<pair<llint, llint>> vpllint;
typedef vector<vector<int>> vvint;
typedef vector<vector<char>> vvchar;
typedef vector<vector<llint>> vvllint;
typedef vector<vector<string>> vvstr;
typedef vector<vector<bool>> vvbool;
typedef vector<vector<pint>> vvpint;
typedef vector<bool> vbool;
typedef long double ld;
const ld eps = 1.0e-10; // 許容される誤差
long long GCD(long long a, long long b) {
	if (b == 0) return a;
	else return GCD(b, a % b);
}

long long LCM(long long a, long long b) {
	return a * b / GCD(a, b);
}

unsigned GetDigit(unsigned num) {
	return std::to_string(num).length();
}

int tow(int n) {//2のn乗
	if (n == 0)return 1;
	int x = tow(n / 2);
	x *= x;
	if (n % 2 == 1)x *= 2;
	return x;//@domino
}

int keta(int n) {
	int sum = 0;
	while (n != 0) {
		sum += n % 10; n /= 10;
	}
	return sum;//Nanashi,tRue,wai
}

/*

 (char)toupper(a[n])=文字列のn文字目を大文字で出力

  pow(a,b)=aのb乗

  */
ld mysqrtl(ld x)
{
	ld a = sqrtl((double)x); // 近似値
	do {
		a = (a + x / a) / 2.0L;
	} while (fabsl(x - a * a) > eps);
	return a;
}
ll gcd(ll a, ll b) {
	if (b == 0) return a;
	return gcd(b, a % b);

}

ll lcm(ll a, ll b) {
	ll g = gcd(a, b);
	return a / g * b;
}

//平方根を求める。sqrtより精度が高い。
//epsを変えて誤差を調整する。
int main(void) {
	Rapid_pleaseAC_fast;
	llint ans = 0, n = 0, m = 0, count = 0, sum = 0, ch = 0;
	llint a, b, c, d;
	bool check = false;
	string s;
	vector<llint> array;
	
	cin >> a >> b >> c >> d;
	n = a / d;
	m = c / b;
	if (a % d == 0)n--;
	if (c % b == 0)m--;
	if (n >= m)cout << "Yes" << endl;
	else cout << "No" << endl;

	please AC;
}


Measured memory_bytes: 3640
import java.util.Scanner;

// ABC173-A
public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();

		int n = N % 1000;
		int result = 1000 - n;

		if (result == 1000) {
			result = 0;
		}

		System.out.println(result);
		sc.close();
	}

}


Measured memory_bytes: 35768
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#include <map>
#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 ALL(v) v.begin(), v.end()
typedef long long ll;


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;
}

int main() {
    int n, k;
    cin >> n >> k;
    vector <int> x(n, 0);
    REP(i, k){
        int d;
        cin >> d;
        REP(j, d) {
            int a;
            cin >> a;
            x[a-1] = 1;
        }
    }
    int sum = 0;
    REP(i, n) {
        sum += x[i];
    }
    cout << n - sum << endl;
}


Measured memory_bytes: 3632
#include <cstdio>
#include <vector>
#include <climits>
using namespace std;

inline int MIN(int a,int b){
	return ((a)<(b)?(a):(b));
}

int minimumProduct(int left, int right, vector<pair<int,int> >& mat, vector<vector<int> >& product) {
	if(left==right) return 0;
	if(product[left][right]!=-1) {
		return product[left][right];
	}
	int i,min=INT_MAX;
	for(i=left; i<right; ++i) {
		min=MIN(min,minimumProduct(left,i,mat,product)
				+minimumProduct(i+1,right,mat,product)
				+mat[left].first*mat[right].second*((i==right-1)?mat[right].first:mat[i].second));
	}
	return product[left][right]=min;
}

int main() {
	int n;
	int i,j;
	vector<pair<int,int> > mat;
	vector<vector<int> > product;

	scanf("%d",&n);
	mat.resize(n);
	product.resize(n);
	for(i=0; i<n; ++i) {
		product[i].resize(n);
		scanf("%d%d",&mat[i].first,&mat[i].second);
		for(j=0; j<n; ++j) {
			product[i][j]=-1;
		}
	}
	printf("%d\n",minimumProduct(0,n-1,mat,product));
	return 0;
}

Measured memory_bytes: 2720
#include <iostream>
    #include <cstdio>
    #include <algorithm>
    #include <vector>
    #include <string>
    #include <string.h>
     
    typedef long long ll;
    using namespace std;
    const ll INF = 1000000000000000000ll;
    const ll MOD = 1000000007ll;
     
    const double EPS = 1e-8;
     
    int main()
    {
   		char c;

		cin >> c;

		if(c=='a' || c=='i' ||c=='u' ||c=='e' ||c=='o' ){
			cout << "vowel" << endl;
		}else{
			cout << "consonant" << endl;
		}

		
		return 0;
    }

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

int main(void) {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int n;
	string s, ans;
	cin >> n >> s;
	int cnt = 0;
	for (int i = 0; i < n; ++i) {
		if (s[i] == '(') ++cnt;
		else if (cnt == 0) ans = "(" + ans;
		else --cnt;
		ans.push_back(s[i]);
	}
	while (cnt--) {
		ans.push_back(')');
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
S = input()
T = input()

get = []
for i in range(len(S)-len(T)+1):
    for s, t in zip(S[i:], T):
        if s != '?' and s != t:
            break
    else:
        get.append(i)
if not get:
    print('UNRESTORABLE')
    exit()

result = 'z' * 51
for i in get:
    x = S[:i] + T + S[i+len(T):]
    result = min(result, x.replace('?', 'a'))
print(result)

Measured memory_bytes: 3064
module.exports=function(r){var e={};function t(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return r[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=r,t.c=e,t.d=function(r,e,n){t.o(r,e)||Object.defineProperty(r,e,{enumerable:!0,get:n})},t.r=function(r){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},t.t=function(r,e){if(1&e&&(r=t(r)),8&e)return r;if(4&e&&"object"==typeof r&&r&&r.__esModule)return r;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:r}),2&e&&"string"!=typeof r)for(var o in r)t.d(n,o,function(e){return r[e]}.bind(null,o));return n},t.n=function(r){var e=r&&r.__esModule?function(){return r.default}:function(){return r};return t.d(e,"a",e),e},t.o=function(r,e){return Object.prototype.hasOwnProperty.call(r,e)},t.p="",t(t.s=0)}([function(r,e,t){t(1)(t(2).readFileSync("/dev/stdin","UTF-8").split("\n"))},function(r,e){function t(r,e){return function(r){if(Array.isArray(r))return r}(r)||function(r,e){var t=[],n=!0,o=!1,u=void 0;try{for(var i,f=r[Symbol.iterator]();!(n=(i=f.next()).done)&&(t.push(i.value),!e||t.length!==e);n=!0);}catch(r){o=!0,u=r}finally{try{n||null==f.return||f.return()}finally{if(o)throw u}}return t}(r,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}r.exports=function(r){var e=t(r[0].split(" ").map(function(r){return Number(r)}),4),n=e[0],o=e[1],u=e[2]-n,i=e[3]-o,f=l("R",u)+l("U",i)+l("L",u)+l("D",i)+"L"+l("U",i+1)+l("R",u+1)+"DR"+l("D",i+1)+l("L",u+1)+"U";function l(r,e){for(var t="",n=0;n<e;n++)t+=r;return t}console.log(f)}},function(r,e){r.exports=require("fs")}]);

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

// to:どこの頂点に向かっているのか
// id:色の番号
struct Edge {
  int to, id;
};

vector<vector<Edge>> graph;
vector<int> answer;

// v:頂点の番号、c:1つ上の親の色、p:1つ前に見ていた親の番号
void dfs (int v, int c = -1, int p = -1) {

  // 色を1から考える
  int k = 1;
  
  for (int i = 0; i < graph[v].size(); i++) {

    int u = graph[v][i].to;
    int ei = graph[v][i].id;
    
    // 調査済みの頂点の場合は次の辺を見る
    if (u == p) {
      continue;
    }

    // 親へ繋がっている線の色と同じ場合は色を変える
    if (k == c) {
      ++k;
    }
    
    // 色決定
    answer[ei] = k;

    // 色を変える
    ++k;

    // 再帰でチェック
    dfs(u, answer[ei], v);
  
  } 
}

int main() {

  int N;
  cin >> N;

  graph.resize(N);
  answer.resize(N-1);

  for (int i = 0; i < N - 1; ++i) {
    int a, b;
    cin >> a >> b;
    // 配列では0から数えるため-1する
    --a;
    --b;
    graph[a].push_back(Edge{b,i});
    graph[b].push_back(Edge{a,i});

  }

  // 探索
  dfs(0);

  // 色数＝最大次数を探して、出力
  int mx = 0;
  for (int i = 0; i < N; i++) {
    mx = max(mx, int(graph[i].size()));
  }
  cout << mx << endl;
  
  // 塗り分け例を出力
  for (int i = 0; i < N - 1; i++) {
    cout << answer[i] << endl;
  }

  return 0;

}

Measured memory_bytes: 8320
#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define in insert
#define sz(x) (int)x.size()
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define speed ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
const int INF = 1e9 + 5;
const int mod = 1e9 + 7;
const int  N = 2e5 + 314;
const long double pi = 3.1415926535897932384626433832795;
int bp(int pow, int n){
    int d = 1;
    while(n)
    {
        if(n%2==1)d=(d*pow)%mod;
        pow=(pow*pow)%mod;
        n/=2;
    }
    return d;
}
void solve(){
    int n;
    cin>>n;
    cout<<fixed<<setprecision(10)<<2*n*pi;   
}
signed main(){
    speed;
    int t=1;
    //cin>>t;
    while(t--)solve();
}

Measured memory_bytes: 3800
#include <bits/stdc++.h>
#define pi 3.14159
using namespace std;

int main()
 {
 	int n,l,i,j;
 	cin>>n>>l;
 	string s[n],s2,s1;
 	s2.clear();
 	for(i=0;i<n;i++)
 		cin>>s[i];
 	for(i=0;i<n-1;i++)
 		{
 			for(j=i+1;j<n;j++)
 				{
 					if(s[i]>s[j])
 						{
 							 s1=s[i];
 							s[i]=s[j];
 							s[j]=s1;
						 }
				 }
		 }
		for(i=0;i<n;i++)
		{
			s2=s2+s[i];
		}
		cout<<s2<<endl;
 	}

Measured memory_bytes: 3684
import java.util.*;  

public class Main {
	public static Long ln(Long x){
        if(x<=1) return x;                                                          
        return 1+2*ln(x/2);                                                                                                                                                                                                                
    }
    public static Long gcd(Long x,Long y){
        if(x < y) return gcd(y, x);
        if(y == 0) return x;
        return gcd(y, x % y);
    }
    public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		Long a = sc.nextLong();
        Long b = ln(a);
		System.out.println(b);   
	}   
}



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

using namespace std;
using ll=long long;
int main(void){
    // Your code here!
    ll n,ma,mb;
    cin>>n>>ma>>mb;
    vector<tuple<ll,ll,ll>> abc(n);
    for(int i=0;i<n;++i){
        ll a,b,c;
        cin>>a>>b>>c;
        abc[i] = make_tuple(a,b,c);
    }
    constexpr ll inf = 100000;
    vector<vector<ll>> from(550,vector<ll>(550,inf));
    vector<vector<ll>> to(550,vector<ll>(550,inf));
    from[0][0] = 0;
    for(int i=0;i<n;++i){
        ll a,b,c;
        a = get<0>(abc[i]);
        b = get<1>(abc[i]);
        c = get<2>(abc[i]);
        for(int j=0;j<=500;++j){
            for(int k=0;k<=500;++k){
                if(j+a <500 && k+b <500) to[j+a][k+b]  = min(to[j+a][k+b],from[j][k]+c);
                to[j][k] = min(to[j][k],from[j][k]);
            }
        }
        swap(from,to);
    }
    
    ll ret = inf;
    for(int j=1;j<500;++j){
        for(int k=1;k<500;++k){
            if(j*mb == k*ma) ret = min(from[j][k],ret);
        }
    }
    if(ret == inf) cout << -1 <<endl;
    else cout << ret << endl;
    return 0;
}


Measured memory_bytes: 4992
#include<map>
#include<set>
#include<queue>
#include<cmath>
#include<cstdio>
#include<vector>
#include<string>
#include<cstring>
#include<iostream>
#include<algorithm>
#define lc (x<<1)
#define rc (x<<1|1)
#define gc getchar()//(p1==p2&&(p2=(p1=buf)+fread(buf,1,size,stdin),p1==p2)?EOF:*p1++)
#define mk make_pair
#define pi pair<int,int>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int N=2e5+10,size=1<<20;

//char buf[size],*p1=buf,*p2=buf;
template<class o> void qr(o &x) {
	char c=gc; x=0; int f=1;
	while(!isdigit(c)){if(c=='-')f=-1; c=gc;}
	while(isdigit(c)) x=x*10+c-'0',c=gc;
	x*=f;
}
template<class o> void qw(o x) {
	if(x/10) qw(x/10);
	putchar(x%10+'0');
}
template<class o> void pr1(o x) {
	if(x<0)x=-x,putchar('-');
	qw(x); putchar(' ');
}
template<class o> void pr2(o x) {
	if(x<0)x=-x,putchar('-');
	qw(x); puts("");
}

int n,m;

int main() {
	qr(n); qr(m); 
	int t=m+(m&1),tt=t+1;
	for(int i=1;i<t;i++) pr1(i),pr2(t--);
	t=2*m+1;
	for(int i=tt;i<t;i++) pr1(i),pr2(t--);
	return 0;
}



Measured memory_bytes: 3620
#include "bits/stdc++.h"
using namespace std;
#include "string"
#define int long long
#define pi pair <int, int>
#define ff first
#define ss second
#define boost ios::sync_with_stdio(false);cin.tie(nullptr)
#define endl '\n'

string s = "ACL";
int32_t main() {
	boost;
	int k;
	cin >> k;
	string ans = "";
	while(k > 0) {
		ans += s;
		k--;
	}
	cout << ans << endl;
}

Measured memory_bytes: 3612
#include <iostream>
#include <stdio.h>
using namespace std;
 
int main(){
  int a,b,c,d,n,count = 0;
  while(scanf("%d",&n)!=EOF){
     
    count=0;
    for(a = 0;a <= 9;a++){
    for(b = 0;b <= 9;b++){
      for(c = 0;c <= 9;c++){
    for(d = 0;d <= 9;d++){
      if((a+b+c+d) == n)count++;
    }
      }
    }
    }
    cout << count <<endl;
  }
  return 0;
}


Measured memory_bytes: 3064
#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <stack>
#include <vector>
#include <math.h>

using namespace std;


void func(int N,int M){
    vector<int> First,Second;

    First.push_back(0);
    int tmp,max;

    for(int i = 0; i < N; i++){
        scanf("%d",&tmp);
      	First.push_back(tmp);
    }

    sort(First.begin(),First.end());

    for(int i = 0; i <= N;i++){
    	for(int k = i; k <= N;k++){
    		if(First[i]+First[k] <= M){
    			Second.push_back(First[i]+First[k]);
    		}else{
    			break;
    		}
    	}
    }

    sort(Second.begin(),Second.end());

    int limit = Second.size()-1,div,left,right,max_min,m;

    max = 0;
    for(int i = limit; i >= 0;i--){
    	div = M - Second[i];
    	max_min = 0;
    	left = 0,right = limit;
    	m = (left+right)/2;
    	while(left <= right){
    		if(Second[m] > div){
    			right = m-1;
    		}else{
    			max_min = (max_min >= Second[m])?max_min:Second[m];
    			left = m + 1;
    		}
    		m = (left+right)/2;
    	}
    	max = (max >= Second[i]+max_min)?max:Second[i]+max_min;
    }

    printf("%d\n",max);

}

int main(){

    int N,M;

    while(true){
        scanf("%d %d",&N,&M);
        if(N == 0 && M == 0)break;

        func(N,M);
    }

    return 0;
}

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

using vi = vector<int>;
using vvi = vector<vector<int>>;
using vvvi = vector<vector<vector<int>>>;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using vvvll = vector<vector<vector<ll>>>;
using vd = vector<double>;
using vvd = vector<vector<double>>;
using vvvd = vector<vector<vector<double>>>;
using vb = vector<bool>;
using vvb = vector<vector<bool>>;
using vs = vector<string>;
using pint = pair<int, int>;
using Graph = vvi;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()

const ll MOD = 1e9 + 7;

//二項係数 nCk mod p
//aのp乗を求める
ll modpow(ll a, ll p) {
   if(p == 0) return 1;
   if(p % 2 == 0) {
      int halfP = p / 2;
      ll half = modpow(a, halfP);
      //a^(p/2)をhalfとして、half*halfを計算
      return half * half % MOD;
   } else {
      //pが奇数のときは偶数にするために1減らす
      return a * modpow(a, p-1) % MOD;
   }
}
//二項係数の計算
//10C3 (10*9*8) / (3*2*1)
//(10*9*8):ansMul (3*2*1):ansDiv
ll calcComb(ll a, ll b) {
   if(b > a - b) return calcComb(a, a - b);

   ll ansMul = 1;
   ll ansDiv = 1;
   rep(i, b) {
       ansMul *= (a - i);
       ansDiv *= (i + 1);
       ansMul %= MOD;
       ansDiv %= MOD;
   }
   //ansMul / ansDiv をしたい
   //ansDivの逆元を求める
   ll ans = ansMul * modpow(ansDiv, MOD - 2) % MOD;

   return ans;
}

int main() {
    ll x, y;
    cin >> x >> y;

    if(((2 * x - y) % 3 != 0) || ((2 * y - x) % 3 != 0)) {
        cout << 0 << endl;
        return 0;
    }
    ll a = (2 * x - y) / 3;
    ll b = (2 * y - x) / 3;
    if(a < 0 || b < 0) {
        cout << 0 << endl;
        return 0;
    }

    cout << calcComb(a+b, a) << endl;

    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
 
int G[100][100];
 
int main(){
  int n,m,l,i,j,k;
 
  scanf("%d",&n);
   
  for(i=0;i<n;i++){
    for(j=0;j<n;j++){
      G[i][j]=0;
    }
  }
  for(i=0;i<n;i++){
    scanf("%d%d",&m,&l);
    for(j=0;j<l;j++){
      scanf("%d",&k);
      G[i][k-1]=1;
    }
  }
   
  for(i=0;i<n;i++){
    for(j=0;j<n-1;j++){
      printf("%d ",G[i][j]);
    }
      printf("%d\n",G[i][j]);
 
  }
  return 0;
}

Measured memory_bytes: 632
import java.io.IOException;
import java.io.InputStream;
import java.util.NoSuchElementException;

public class Main {
	private static FastScanner sc = new FastScanner();

	public static void main(String[] args) {
		int n = sc.nextInt();
		
		int[][] A = new int[n][n];
		for(int i=0; i<n; i++) {
			sc.nextInt();
			int k = sc.nextInt();
			
			for(int j=1; j<=k; j++) {
				int v = sc.nextInt();
				A[i][v-1] = 1;
			}
		}
		
		StringBuilder ans = new StringBuilder();
		for(int i=0; i<n; i++) {
			for(int j=0; j<n; j++) {
				ans.append(A[i][j]);
				if(j != n-1) {
					ans.append(" ");
				}
			}
			ans.append("\n");
		}
		System.out.print(ans);
	}

	static class FastScanner {
	    private final InputStream in = System.in;
	    private final byte[] buffer = new byte[1024];
	    private int ptr = 0;
	    private int buflen = 0;
	    private boolean hasNextByte() {
	        if (ptr < buflen) {
	            return true;
	        }else{
	            ptr = 0;
	            try {
	                buflen = in.read(buffer);
	            } catch (IOException e) {
	                e.printStackTrace();
	            }
	            if (buflen <= 0) {
	                return false;
	            }
	        }
	        return true;
	    }
	    private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
	    private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
	    private void skipUnprintable() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;}
	    public boolean hasNext() { skipUnprintable(); return hasNextByte();}
	    public String next() {
	        if (!hasNext()) throw new NoSuchElementException();
	        StringBuilder sb = new StringBuilder();
	        int b = readByte();
	        while(isPrintableChar(b)) {
	            sb.appendCodePoint(b);
	            b = readByte();
	        }
	        return sb.toString();
	    }
	    public long nextLong() {
	        return Long.parseLong(next());
	    }
	    public int nextInt(){
	    	return Integer.parseInt(next());
	    }
	}
}

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

using namespace std;

int board[105][105];

int main(){
	
	int H,W,N;
	while(scanf("%d %d %d",&H,&W,&N) == 3){
		memset(board,0,sizeof board);
		int x = 1,y = 1;
		for(int i=1 ; i<=N ; ++i){
			int t;
			scanf("%d",&t);
			while(t){
				board[x][y] = i;
				--t;
				if(y<W && !board[x][y+1])++y;
				else if(x<H && !board[x+1][y])++x;
				else if(y>1 && !board[x][y-1])--y;
				else if(x>1 && !board[x-1][y])--x;
			}
		}
		for(int i=1 ; i<=H ; ++i){
			printf("%d",board[i][1]);
			for(int j=2 ; j<=W ; ++j)printf(" %d",board[i][j]);
			printf("\n");
		}
	}
	
	return 0;
} 

Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD=1000000007;
#define INF 1LL<<30
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(x) (x).begin(),(x).end()

int main(){
    ll a;
    string b;
    cin>>a>>b;
    ll B=100*(b[0]-'0')+10*(b[2]-'0')+b[3]-'0';
    ll ans=a*B;
    ans/=100;

    cout<<ans<<endl;
}


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

#define      ll     long long int

int main()
{
    ll x, y, c = 0;
    cin >> x >> y;
    while (x <= y) {
        c++;
        x = x * 2;
    }
    cout << c << '\n';
    return 0;
}



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

#define select(_1, _2, x, ...) x

#define repn(i, n) for (int i = 0; i < (n); i++)
#define repr(i, a, b) for (int i = (a); i < (b); i++)
#define rep(i, ...) select(__VA_ARGS__, repr, repn)(i, __VA_ARGS__)

#define rrepn(i, n) for (int i = (n - 1); i >= 0; i--)
#define rrepr(i, a, b) for (int i = (b - 1); i >= (a); i--)
#define rrep(i, ...) select(__VA_ARGS__, rrepr, rrepn)(i, __VA_ARGS__)

#define umax(m, x) (m = max(m, x));
#define umin(m, x) (m = min(m, x));

#define rng(v) v.begin(), v.end()
#define rrng(v) v.rbegin(), v.rend()

#define debug(x) cerr << #x << " = " << x << endl

using namespace std;

using ll = long long int;

using vi = vector<int>;
using vl = vector<ll>;
using vb = vector<bool>;
using vc = vector<char>;
using vs = vector<string>;

using vvi = vector<vector<int>>;
using vvl = vector<vector<ll>>;
using vvb = vector<vector<bool>>;
using vvc = vector<vector<char>>;
using vvs = vector<vector<string>>;

const int INF = 1e9;
const ll LINF = 1e18;

inline void yn(bool f) { cout << (f ? "Yes" : "No") << endl; }


int main() {
    while (true) {
        int n, x;
        cin >> n >> x;
        if (n == 0 && x == 0)
            break;

        int cnt = 0;
        rep(i, 1, n - 1) {
            rep(j, i + 1, n) {
                rep(k, j + 1, n + 1) {
                    if (i + j + k == x) cnt++;
                }
            }
        }
        cout << cnt << endl;
    }

    return 0;
}



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

result = 0

while True:
    temp_a = []
    for num in a:
        if num%2 == 0:
            temp_a.append(num//2)
    if len(temp_a) != n:
        break
    a = temp_a
    result += 1

print(result)

Measured memory_bytes: 3060
colors=[0]*8
n=int(input())
a=list(map(int,input().split()))
wild=0
for i in range(n):
  index=a[i]//400
  if a[i]>=3200:
    wild+=1
  else:
    colors[index]=1
ans1=sum(colors)
ans2=sum(colors)
ans1+=wild
if ans2==0 and wild>0:
  ans2=1
print(ans2,' ',ans1)

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

#define rep(i, n) for(int i=0; i < (int)n; i++)

using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<long long, long long>;

void toS(int *d) {
  int dt[6];
  rep(i, 6) dt[i] = d[i];
  d[0] = dt[4];
  d[1] = dt[0];
  d[2] = dt[2];
  d[3] = dt[3];
  d[4] = dt[5];
  d[5] = dt[1];
}

void toN(int *d) {
  int dt[6];
  rep(i, 6) dt[i] = d[i];
  d[0] = dt[1];
  d[1] = dt[5];
  d[2] = dt[2];
  d[3] = dt[3];
  d[4] = dt[0];
  d[5] = dt[4];
}

void toW(int *d) {
  int dt[6];
  rep(i, 6) dt[i] = d[i];
  d[0] = dt[2];
  d[1] = dt[1];
  d[2] = dt[5];
  d[3] = dt[0];
  d[4] = dt[4];
  d[5] = dt[3];
}

void toE(int *d) {
  int dt[6];
  rep(i, 6) dt[i] = d[i];
  d[0] = dt[3];
  d[1] = dt[1];
  d[2] = dt[0];
  d[3] = dt[5];
  d[4] = dt[4];
  d[5] = dt[2];
}

void turnR(int *d) {
  int dt[6];
  rep(i, 6) dt[i] = d[i];
  d[0] = dt[0];
  d[1] = dt[3];
  d[2] = dt[1];
  d[3] = dt[4];
  d[4] = dt[2];
  d[5] = dt[5];
}

int main(void) {
  int d1[6]={0};
  rep(i, 6) cin >> d1[i];

  int d2[6]={0};
  rep(i, 6) cin >> d2[i];

  string result = "No";
  if(d2[2] == d1[0]) toW(d2);
  if(d2[3] == d1[0]) toE(d2);
  rep(i, 6) {
    if(d2[0] != d1[0]) toS(d2);
  }
  if(d2[5] == d1[5]) {
    rep(i, 6) {
      if(d2[1] == d1[1] && d2[2] == d1[2] && d2[3] == d1[3] && d2[4] == d1[4]) {
        result = "Yes";
      } else {
        turnR(d2);
      }
    }
  }

  set<int> s1(d1, d1+6), s2(d2, d2+6);
  if(s1.size() <= 2 && s2.size() <= 2) result = "Yes";

  cout << result << endl;
}



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

int main() {
    int N, M;
    cin >> N >> M;
    vector<int> s(M), c(M);
    rep(i, M){
        cin >> s.at(i) >> c.at(i);
        s.at(i)--;
    }
    rep(i, 1000){
        vector<int> d(1, i % 10);
        int ni = i / 10;
        while(ni){
            d.push_back(ni % 10);
            ni /= 10;
        }
        reverse(d.begin(), d.end());
        if (d.size() != N) continue;
        bool flag = true;
        rep(j, M){
            if(d.at(s.at(j)) != c.at(j)){
                flag = false;
            }
        }
        if (flag){
            cout << i << endl;
            return 0;
        }
    }
    cout << -1 << endl;

    return 0;
}


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

int main() {
  int n; ll k;
  cin >> n >> k;
  vector<int> a(n);
  for (int i=0;i<n;i++){
      cin >> a.at(i);
  }

  vector<int> s;
  vector<int> ord(n+1,-1);
  int c = 1;
  int l = 0;
  {
    int v = 1;
    while (ord[v] == -1) {
      ord[v] = s.size();
      s.push_back(v);
      v = a[v-1];
    }
    c = s.size() - ord[v];
    l = ord[v];
  }

  if (k < l) 
    cout << s[k] << endl;
  else {
    k -= l;
    k %= c;
    cout << s[l+k] << endl;
  }
  return 0;
}


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

int main() {
	int A, B, C;
	cin >> A >> B >> C;
	
	int D = 3 * max(A, max(B, C)) - (A + B + C);
	if (D % 2 != 0) D += 3;
	D /= 2;
	cout << D << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <algorithm>

using namespace std;

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

int main() {
	int n;
	cin >> n;
	while (n--) {
		int s,d;
		scanf("%d %d", &s, &d);
		
		int ans = 0;
		if (s < 0 && d < 0) { s = -s; d = -d; swap(s, d);}
		
		if (s < 0) {
			s = -s;
			while (s > 0) {
				if (s & 1) ans++;
				s >>= 1;
			}
			s = 0;
		}
		
		if (s != d) {
			
			if (s == 0) {
				s = d;
				while (s > 0) {
					if (s & 1) ans++;
					s >>= 1;
				}
			}
			else {
				while (s + (s & -s) < d) {
					s += s & -s;
					ans++;
				}
				s = d - s;
				while (s > 0) {
					if (s & 1) ans++;
					s >>= 1;
				}
			}
		}
		cout << ans << endl;
	}
	return 0;
}

Measured memory_bytes: 3144