akhauriyash/Code-Regression huggingface dataset:
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>
#include <iostream>
#include <sstream>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <numeric>
#include <algorithm>
#include <bitset>
#include <complex>
#include <array>
#include <list>
#include <stack>
#include <valarray>

using namespace std;

typedef unsigned uint;
typedef long long Int;
typedef unsigned long long UInt;

const int INF = 1001001001;
const Int INFLL = 1001001001001001001LL;

template<typename T> void pv(T a, T b) { for (T i = a; i != b; ++i) cout << *i << " "; cout << endl; }
template<typename T> void chmin(T& a, T b) { if (a > b) a = b; }
template<typename T> void chmax(T& a, T b) { if (a < b) a = b; }
int in() { int x; scanf("%d", &x); return x; }
double fin() { double x; scanf("%lf", &x); return x; }
Int lin() { Int x; scanf("%lld", &x); return x; }

deque<Int> as[100050];

int U[100050];
void init(int n) {
  for (int i = 0; i < n; ++i) {
    U[i] = i;
  }
}
int find(int x) {
  return x == U[x] ? x : U[x] = find(U[x]);
}
void unite(int x, int y) {
  x = find(x);
  y = find(y);
  if (x == y) {
    return;
  }
  if (as[x].size() < as[y].size()) {
    swap(x, y);
  }
  U[y] = x;
  for (Int v : as[y]) {
    as[x].push_back(v);
  }
}

int main() {
  int N = in();
  int M = in();
  init(N);
  for (int i = 0; i < N; ++i) {
    as[i].push_back(in());
  }
  for (int i = 0; i < M; ++i) {
    int x = in();
    int y = in();
    unite(x, y);
  }

  int cnt = 0;
  for (int i = 0; i < N; ++i) {
    if (find(i) == i) {
      sort(as[i].begin(), as[i].end());
      ++cnt;
    }
  }
  if (cnt == 1) {
    puts("0");
    return 0;
  }

  int es = 2 * cnt - 2;
  if (es > N) {
    puts("Impossible");
    return 0;
  }

  Int res = 0;
  vector<Int> ps;
  for (int i = 0; i < N; ++i) {
    if (find(i) == i) {
      res += as[i][0];
      for (int j = 1; j < as[i].size(); ++j) {
        ps.push_back(as[i][j]);
      }
    }
  }
  sort(ps.begin(), ps.end());
  for (int i = 0; i < es - cnt; ++i) {
    res += ps[i];
  }

  printf("%lld\n", res);

  return 0;
}


Measured memory_bytes: 70012
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <map>
#include <unordered_map>
#include <utility>
#include <algorithm>
#include <cmath>
#include <array>
#include <bitset>
using namespace std;

typedef long long ll;
const ll mod=1000000007;
#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,n) for(int i=1;i<n+1;i++)

void sol(vector<int> vec,int num, ll B){
    ll val=0;
    cout<<vec[(num+1)/2-1]<<" ";
    rep(i,num){
        if(i<(num+1)/2) val+=vec[(num+1)/2-1]-vec[i];
        else val+=vec[i]-vec[(num+1)/2-1];
    }
    cout<<val+B<<endl;
}

int main(){
    int Q;
    int q,a,b;
    ll B=0;
    vector<int> vec;
    int num=0,hoge;
    cin>>Q;
    ll val=0;
    rep(i,Q){
        cin>>q;
        if(q==2){
            cout<<vec[(num+1)/2-1]<<" "<<val+B<<endl;
        }else{
            cin>>a>>b;
            auto itr=upper_bound(vec.begin(),vec.end(),a);
            hoge=itr-vec.begin();
            if(num%2==0){
                if(hoge==num/2);
                else if(hoge<num/2){
                    val+=vec[num/2-1]-a;
                }else{
                    val+=a-vec[num/2];
                }
            }else{
                if(hoge<=num/2){
                    val+=vec[num/2]-a;
                }else{
                    val+=a-vec[num/2];
                }
            }
            vec.insert(itr,a);
            num++;
            B+=b;
        }
    }
    return 0;
}

Measured memory_bytes: 3320
#include<bits/stdc++.h>
using namespace std;
#define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++)
#define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++)
#define MOD 1000000007
#define int long long
#define ALL(a) (a).begin(),(a).end()
#define vi vector<int>
#define vii vector<vi>
#define pii pair<int,int>
#define priq priority_queue<int>
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(int)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(int)(key)))
#define tii tuple<int,int,int>
signed main(){
  string S; cin>>S;
  vi A(26);
  rep(i,0,S.size()){
    A[S[i]-'a']++;
  }
  string ans="Yes";
  rep(i,0,26){
    if(A[i]%2==1){
      ans="No";
      break;
    }
  }
  cout<<ans<<endl;
  }


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


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

    vector<int> h(n);

    rep(i,n)cin >> h[i];

    int count = 0;
    int higtest = h[0];

    for (int i = 0; i < n; ++i) {
        if(h[i] >= higtest){
                higtest = h[i];
                count++;
            }
        }
    print(count);
}

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

long long ggd(long long number1,long long number2){
	long long m = number1;
	long long n = number2;

	if(number2 > number1){
		m = number2;
		n = number1;
	}
    long long r = n % m;
	while(r != 0){
        n = m;
        m = r;
        r = n % m;
	}

	return m;
}

long long lcm(long long number1,long long number2){
	return number1 * number2 / ggd(number1,number2);	
}

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

    long long num_c, num_d, num_cd;
    long long lcm_cd = lcm(C, D);
    num_c  = B / C - (A - 1) / C;
    num_d  = B / D - (A - 1) / D;

    num_cd = B / lcm_cd - (A - 1) / lcm_cd;
    long long ans = B - A - (num_c + num_d - num_cd) + 1;

    cout << ans << endl;
    return 0;  

}

Measured memory_bytes: 256
import java.util.*;public class Main{public static void main(String[] args){Scanner c=new Scanner(System.in);int n=c.nextInt();String s=c.next();long[] q=new long[3];for(int i=0;i<n;i++){if(s.charAt(i)=='R')q[0]++;else if(s.charAt(i)=='G')q[1]++;else q[2]++;}long y=q[0]*q[1]*q[2];for(int i=0;i<n-2;i++){for(int j=i+1;j<n-1;j++){if(2*j-i<n&&s.charAt(i)!=s.charAt(j)&&s.charAt(j)!=s.charAt(2*j-i)&&s.charAt(2*j-i)!=s.charAt(i))y--;}}System.out.println(y);}}

Measured memory_bytes: 37132
#include<iostream>
#include<vector>
#include<map>
#include<algorithm>
#include<cmath>
#include<string>
#include<cstdlib>

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

using namespace std;

typedef long long int ll;

const ll INF=(ll)1e18;

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

  string S;
  cin >> S;
  S[K-1] = tolower(S[K-1]);
  cout << S << endl;
}


Measured memory_bytes: 3628
import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

int readint() {
    return readln.chomp.to!int;
}

int[] readints() {
    return readln.split.map!(to!int).array;
}

void main() {
    auto xab = readints();
    int x = xab[0], a = xab[1], b = xab[2];

    if (abs(x - a) < abs(x - b))
        writeln("A");
    else
        writeln("B");
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
ios_base::sync_with_stdio(false);
  cin.tie(NULL);
#ifndef ONLINE_JUDGE
  //freopen("input.txt","r",stdin);
#endif

  char a;
  cin>>a;
  if(a>='A' && a<='Z')
    cout<<'A'<<endl;
  else
    cout<<'a'<<endl;
  return 0;
}

Measured memory_bytes: 3648
#include<iostream>
#include<vector>
#include<string>

using namespace std;

int main() {
	int n;
	cin >> n;
	string a, b;
	cin >> a;
	cin >> b;
	for (int i = 0; i < n; i++) {
		cout << a[i] << b[i];
	}
}

Measured memory_bytes: 3604
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        AtCoder solver = new AtCoder();
        solver.solve(1, in, out);
        out.close();
    }

    static class AtCoder {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            long[] lucas = new long[87];
            lucas[0] = 2;
            lucas[1] = 1;

            if (n == 1) {
                out.println(lucas[1]);
            } else if (n == 2) {
                out.println(lucas[0] + lucas[1]);
            } else {
                for (int i = 2; i < n + 1; i++) {
                    lucas[i] = lucas[i - 1] + lucas[i - 2];
                }
                out.println(lucas[n]);
            }
        }

    }
}



Measured memory_bytes: 21716
use std::io::*;
use std::str::*;
use std::collections::HashSet;

fn read<T: FromStr>() -> Option<T> {
    let stdin = stdin();
    let s = stdin
        .bytes()
        .map(|c| c.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect::<String>();
    s.parse::<T>().ok()
}

fn main() {
    let n: usize = read().unwrap();
    let mut set: HashSet<String> = HashSet::new();

    for _ in 0..n {
        set.insert(read().unwrap());
    }
    println!("{}", set.len());
}


Measured memory_bytes: 15236
#include<map>
#include<algorithm>
#include<iostream>
#include<string>
#include<cstdlib>
#include<cstring>
#include<cmath>
using namespace std;
int main(){
  int i;
  int n,m;
  while(cin>>n>>m&&(n||m)){
    map<int,pair<int,int> > a;
    for(i=0;i<m;i++){
      int p,q,r;
      cin>>p>>q>>r;
      q--;
      r--;
      a[p]=make_pair(q,r);
    }
    bool b[20000];
    memset(b,0,20000);
    b[0]=1;
    map<int,pair<int,int> >::iterator it;
    for(it=a.begin();it!=a.end();it++){
      if(b[(*it).second.first])
	b[(*it).second.second]=1;
    }
    int ct=0;
    for(i=0;i<n;i++)
      ct+=b[i];
    cout<<ct<<endl;
  }
  return 0;
}

Measured memory_bytes: 1556
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;

int main() {
    string s;
    cin >> s;
    int ans = 0;
    rep(i, 4) {
        if(s[i] == '+') {
            ans++;
        }
        else {
            ans--;
        }
    }

    cout << ans;
    
    cout << endl;
    return 0;
}

Measured memory_bytes: 764
S = [int(a) for a in list(input())]
L = len(S)

ok = True
if S[L-1] == 1 or S[0] == 0 or S[L-2] == 0:
    ok = False
for i in range(L-1):
    if S[i] != S[L-2-i]:
        ok = False

if not ok:
    print(-1)
else:
    graph = []
    p = 1
    go = True
    for i in range(1, L):
        if i <= L//2:
            graph.append((p, i+1))
            if go:
                p = i+1
            if S[i] == 1:            
                go = True
            else:
                go = False
        else:
            graph.append((p, i+1))
    
    for a, b in graph:
        print(a, b)
        


Measured memory_bytes: 17304
import std.conv, std.functional, std.stdio, std.string;
import std.algorithm, std.array, std.bigint, std.container, std.math, std.numeric, std.range, std.regex, std.typecons;
import core.bitop;

class EOFException : Throwable { this() { super("EOF"); } }
string[] tokens;
string readToken() { for (; tokens.empty; ) { if (stdin.eof) { throw new EOFException; } tokens = readln.split; } auto token = tokens.front; tokens.popFront; return token; }
int readInt() { return readToken.to!int; }
long readLong() { return readToken.to!long; }
real readReal() { return readToken.to!real; }

bool chmin(T)(ref T t, in T f) { if (t > f) { t = f; return true; } else { return false; } }
bool chmax(T)(ref T t, in T f) { if (t < f) { t = f; return true; } else { return false; } }

int binarySearch(alias pred, T)(in T[] as) { int lo = -1, hi = cast(int)(as.length); for (; lo + 1 < hi; ) { const mid = (lo + hi) >> 1; (unaryFun!pred(as[mid]) ? hi : lo) = mid; } return hi; }
int lowerBound(T)(in T[] as, T val) { return as.binarySearch!(a => (a >= val)); }
int upperBound(T)(in T[] as, T val) { return as.binarySearch!(a => (a > val)); }


int root(int[] uf, int u) {
  return (uf[u] < 0) ? u : (uf[u] = uf.root(uf[u]));
}
bool connect(int[] uf, int u, int v) {
  u = uf.root(u);
  v = uf.root(v);
  if (u == v) return false;
  if (uf[u] > uf[v]) swap(u, v);
  uf[u] += uf[v];
  uf[v] = u;
  return true;
}


int N, M;
long[] X;
Tuple!(long, "y", int, "a", int, "b")[] E;

int V;
int[][] G;
long[] xs;
int[][] edges;

int dfs(int u) {
  int ret;
  bool ok;
  foreach (i; edges[u]) {
    if (xs[u] >= E[i].y) {
      ok = true;
    } else {
      ++ret;
    }
  }
  if (!ok) {
    foreach (v; G[u]) {
      ret += dfs(v);
    }
  }
  return ret;
}

void main() {
  try {
    for (; ; ) {
      N = readInt();
      M = readInt();
      X = new long[N];
      foreach (u; 0 .. N) {
        X[u] = readLong();
      }
      E.length = M;
      foreach (i; 0 .. M) {
        E[i].a = readInt() - 1;
        E[i].b = readInt() - 1;
        E[i].y = readLong();
      }
      E.sort();
      
      auto uf = new int[N];
      uf[] = -1;
      V = N;
      G = new int[][N];
      auto ids = iota(N).array;
      auto us = new int[M];
      foreach (i; 0 .. M) {
        const ra = uf.root(E[i].a);
        const rb = uf.root(E[i].b);
        if (uf.connect(ra, rb)) {
          const r = uf.root(ra);
          G ~= [ids[ra], ids[rb]];
          ids[r] = V;
          ++V;
        }
        us[i] = ids[uf.root(ra)];
      }
      
      xs = new long[V];
      xs[0 .. N] = X[];
      foreach (u; N .. V) {
        xs[u] = xs[G[u][0]] + xs[G[u][1]];
      }
      edges = new int[][V];
      foreach (i; 0 .. M) {
        edges[us[i]] ~= i;
      }
      debug {
        writeln("G = ", G);
        writeln("xs = ", xs);
        writeln("edges = ", edges);
      }
      const ans = dfs(V - 1);
      writeln(ans);
    }
  } catch (EOFException e) {
  }
}


Measured memory_bytes: 34424
// in the name of Allah

#include<bits/stdc++.h>
#define ll long long
#define F first
#define S second
#define MP make_pair
#define pii pair<int, int>
#define p push_back

using namespace std;

const ll mx=2e5+5;

ll n;
int main(){
	ios::sync_with_stdio(false);
	cin>>n;
	if(n==25) cout<<"Christmas";
	if(n==24) cout<<"Christmas Eve";
	if(n==23) cout<<"Christmas Eve Eve";
	if(n==22) cout<<"Christmas Eve Eve Eve";
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
bool isprime(ll n)
{
    if(n==1)
        return false;
    else if(n>=2)
    {
        for(int i=2;i*i<=n;i++)
        {
            if(n%i==0)
                return false;
        }
    }
       return true;
}
int main()
{
    int n,a[10000],count1=0;
    cin>>n;
    int i,j;
    for(i=0;i<n;i++)
    {
        cin>>a[i];
    }
    for(i=0;i<n;i++)
    {
    if(isprime(a[i]))
        count1++;
    }
    cout<<count1<<endl;
    return 0;
}



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

using namespace std;

int main() {
    int a;
  	string s;
  
  	cin >> a >> s;
  
  	if(a >= 3200){
      cout << s << endl;
    } else {
      cout << "red" <<endl;
    }
    
    return 0;
}


Measured memory_bytes: 256
fun main(args : Array<String>) {
    val (N, K) = readLine()!!.split(" ").map { it.toInt() }
    val h = mutableListOf<Long>()
    (1..N).forEach {
        val num = readLine()!!.toLong()
        h.add(num)
    }

    val lastIndex = N - 1
    h.sort()
    val ans = (0..(lastIndex - K + 1)).map {
        val max = h[it + K - 1]
        val min = h[it]
        max - min
    }.min()

    println(ans)
}

Measured memory_bytes: 46016
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools
import random

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)
def pe(s): return print(str(s), file=sys.stderr)


def main():
    n,k = LI()
    k -= 1
    s = S()

    return s[:k] + chr(ord(s[k]) - ord('A') + ord('a')) + s[k+1:]


print(main())




Measured memory_bytes: 7756
using System;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using static System.Math;
using Debug = System.Diagnostics.Debug;
using MethodImplOptions = System.Runtime.CompilerServices.MethodImplOptions;
using MethodImplAttribute = System.Runtime.CompilerServices.MethodImplAttribute;


static class P
{
    static void Main()
    {
        var hw = Console.ReadLine().Split().Select(int.Parse).ToArray();
        var map = Enumerable.Repeat(0, hw[0]).Select(_ => Console.ReadLine().Split().Select(int.Parse).ToArray()).ToArray();
        List<Tuple<Tuple<int, int>, Tuple<int, int>>> ops = new List<Tuple<Tuple<int, int>, Tuple<int, int>>>();
        for (int i = 0; i < hw[0]; i++)
        {
            for (int j = 0; j < hw[1] - 1; j++)
            {
                if (map[i][j] % 2 == 1)
                {
                    map[i][j]--;
                    map[i][j + 1]++;
                    ops.Add(new Tuple<Tuple<int, int>, Tuple<int, int>>(new Tuple<int, int>(i + 1, j + 1), new Tuple<int, int>(i + 1, j + 2)));
                }
            }
        }
        for (int i = 0; i < hw[0] - 1; i++)
        {
            int j = hw[1] - 1;
            if (map[i][j] % 2 == 1)
            {
                map[i][j]--;
                map[i + 1][j]++;
                ops.Add(new Tuple<Tuple<int, int>, Tuple<int, int>>(new Tuple<int, int>(i + 1, j + 1), new Tuple<int, int>(i + 2, j + 1)));
            }
        }
        Console.WriteLine(ops.Count);
        Console.WriteLine(string.Join("\n", ops.Select(x => $"{x.Item1.Item1} {x.Item1.Item2} {x.Item2.Item1} {x.Item2.Item2}")));
    }
}

Measured memory_bytes: 42880
/********************************
*** ******** ********** *********
*** * ****** ********* * ********
*** ** ***** ******** *** *******
*** *** **** ******* ***** ******
*** **** *** ****** ******* *****
*** ***** ** ***** +++++++++ ****
*** ****** * **** *********** ***
*** *******  *** ************* **
*** ******** ** *************** *
**********_**********************
* |   /  / \  \     /    /\     *
* |  /  |   |  \   /    /  \    *
* | /   |   |   \ /    /    \   *
* |+\   |   |    |    /______\  *
* |  \  |   |    |   |        | *
* |   \  \_/     |   |        | *
********************************/
#include<bits/stdc++.h>
#define lli long long int
#define ld long double
#define MOD 1000000007
#define KING 1000000002
#define queen 1000002
#define fi first
#define se second
#define se second
#define lsb(i) (i & -i)
#define Pi 3.141592653589793238
#define nl cout<<'\n'
#define TEST cout<<"TEST",nl
#define all(a) a.begin(), a.end()
#define remax(a, b) (a = ((a<b) ? b : a))
#define remin(a, b) (a = ((a<b) ? a : b))
#define pr pair<lli,lli>
#define pb push_back
#define eb emplace_back
#define precise(a) cout<<fixed<<setprecision(a)
#define mp make_pair
#define vi vector<lli>
#define vpi vector<pr> 
#define P pair<lli,pr>
#define fastIO ios_base::sync_with_stdio(false); cin.tie(NULL)
#define NA(i,s,n) for(lli i=s;i<n;i++)
using namespace std;

lli power(lli x,lli y,lli p) { 
	lli res = 1;	 
	x = x % p; 
	while (y > 0) 
	{ 
		if (y & 1) 
			res = (res*x) % p; 
		y = y>>1; 
		x = (x*x) % p; 
	} 
	return res; 
} 

const lli N = 1e6 + 3;
lli n, m, a[N], f[N], spf[N];

void prec(){
	spf[1] = 1;
	NA(i,2,N) spf[i] = (i%2) ? i : 2;
	for(lli i=3; i*i < N; ++i){
		if(spf[i]==i) {
			for(lli j=i*i; j < N; j+=i) {
				if(spf[j]==j) spf[j] = i;
			}
		}
	}
}	

bool fadd(lli p) {
	bool fg = 1;
	while(p > 1){
		lli tp = spf[p];
		if(fg && f[tp]) fg = 0;
		f[tp] = 1;
		while(p%tp==0) p/=tp;
	}
	return fg;
}

void solve(){
	cin >> n ;
	NA(i,0,n) cin >> a[i];
	lli g = a[0];
	bool ff = 1;
	NA(i,0,n) g = __gcd(g, a[i]);

	for(lli i=n-1; i>-1; --i) {
		bool fg = fadd(a[i]);
		ff &= fg;
	}
	if(ff) {
		cout << "pairwise coprime";
	} else if(g==1) {
		cout << "setwise coprime";
	} else {
		cout << "not coprime";
	}
	return;
}

int main(){
    fastIO;
    lli t = 1;
	prec();
	memset(f, 0, sizeof f);
	// cin >> t;
	NA(i,0,t) {
		// cout << "Case #" << i+1 << ": "; 
		solve();
	}
	return 0;
}



Measured memory_bytes: 27056
import java.util.*;

public class Main {
    public static void main (String[] args) {
        Scanner scanner = new Scanner(System.in);
        
        int n = scanner.nextInt();
        
        for (int i = 0; i < n; i++) {
            StringBuffer int1 = new StringBuffer(scanner.next());
            StringBuffer int2 = new StringBuffer(scanner.next());

            StringBuffer result = new StringBuffer();
            int carry = 0;

            int1.reverse();
            int2.reverse();

            int maxDig = Math.max(int1.length(), int2.length());
            if (maxDig > 80) {
                System.out.println("overflow");
                continue;
            }

            for (int k = 0; k < maxDig; k++) {
                int aInt1 = 0;
                int aInt2 = 0;
                if (k < int1.length()) {
                    aInt1 = Integer.parseInt(int1.substring(k, k+1));
                }
                if (k < int2.length()) {
                    aInt2 = Integer.parseInt(int2.substring(k, k+1));
                }
                int aSum = carry + aInt1 + aInt2;
                if (aSum >= 10) {
                    carry = 1;
                    result.append(aSum-10);
                } else {
                    carry = 0;
                    result.append(aSum);
                }
            }
            if (carry == 1) {
                result.append(1);
            }
            
            if (result.length() > 80) {
                System.out.println("overflow");
            } else {
                System.out.println(result.reverse());
            }
        }
    }
}

Measured memory_bytes: 17412
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<cstdlib>

using namespace std;

int main(){
	int p, q, r;
	cin >> p >> q >> r;

	if (p + q <= q + r && p + q <= r + p) {
		cout << p + q;
	}
	else if (q + r <= p + q && q + r <= r + p) {
		cout << q + r;
	}
	else {
		cout << r + p;
	}
}


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

using namespace std;

#define F first
#define S second

typedef long double ld;

string world[8] = {"U", "D", "R", "L", "UL", "UR", "DR", "DL"};
const int rx[8] = { -1,  1,  0,  0,  -1,  -1,   1,   1};
const int ry[8] = { 0,  0,  1, -1,  -1,   1,   1,  -1};

const long long mod = 1000000007;


int main() {
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#else
    //
#endif
    ios_base::sync_with_stdio(0);
    int n;
    string s, t;
    cin >> n >> s >> t;
    string ans = s + t;
    for (int i = 1; i <= n; i++){
        if (s.substr(n - i, i) == t.substr(0, i)){
            ans = s + t.substr(i, n - i);
        }
    }
    cout << ans.length() << endl;
#ifdef TIME
    cerr << "TIME = " << 1. * clock() / CLOCKS_PER_SEC;
#endif
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<iomanip>
#include<algorithm>
#include<queue>
#include<stack>
#include<map>
using namespace std;
#define ll long long
int main(){
	ll N,K,i;
	cin >> N >> K;
	double p[N];
	for(i=0;i<N;i++){
		cin >> p[i];
	}
	double sum=0.0,ans=0.0;
	for(i=0;i<K;i++){
		sum+=(p[i]+1.0)/2.0;
	}
	ans = sum;
	for(i=K;i<N;i++){
		sum+=(p[i]+1.0)/2.0-(p[i-K]+1.0)/2.0;
		ans=max(ans,sum);
	}
	cout << setprecision(10) <<ans;
	return 0;
}


Measured memory_bytes: 1792
void main() {
	auto ip = readAs!(int[]), A = ip[0], B = ip[1];
	writeln(B % A == 0 ? A + B : B - A);
}

// ===================================

import std.stdio;
import std.string;
import std.functional;
import std.algorithm;
import std.range;
import std.traits;
import std.math;
import std.container;
import std.bigint;
import std.numeric;
import std.conv;
import std.typecons;
import std.uni;
import std.ascii;
import std.bitmanip;
import core.bitop;

T readAs(T)() if (isBasicType!T) {
	return readln.chomp.to!T;
}
T readAs(T)() if (isArray!T) {
	return readln.split.to!T;
}

T[][] readMatrix(T)(uint height, uint width) if (!isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		res[i] = readAs!(T[]);
	}
	return res;
}

T[][] readMatrix(T)(uint height, uint width) if (isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		auto s = rs;
		foreach(j; 0..width) res[i][j] = s[j].to!T;
	}
	return res;
}

int ri() {
	return readAs!int;
}

double rd() {
	return readAs!double;
}

string rs() {
	return readln.chomp;
}


Measured memory_bytes: 256
/* SHUBHAM KESHARWANI */
#include<bits/stdc++.h>
#define ll long long int
#define mod 1000000007
#define fr(a,b) for(ll i=a;i<b;i++)
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
#define test ll t; cin>>t; while(t--)
#define pb push_back
#define all(x) (x).begin(),(x).end()
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
using namespace std;
int main()
{fast;
//test
{
   ll n,k,i,j;
   cin>>n>>k;
   ll a[n];
   for(i=0;i<n;i++)
   cin>>a[i];
   ll dp[k+1]={0};
   for(i=1;i<=k;i++)
   {
       for(j=0;j<n;j++)
       {
           if(i>=a[j]&&dp[i-a[j]]==0)
           {
               dp[i]=1;
               break;
           }
       }
   }
   if(dp[k]==1)
   cout<<"First";
   else
   cout<<"Second";
cout<<'\n';
}
    return 0;
}

Measured memory_bytes: 4412
S=str(input())
T=str(input())
t=1000
Slen=1000
Tlen=1000
for i in range(1000):
  try:
    k=S[i]
  except IndexError:
    Slen=i
    break
for j in range(1000):
  try:
    k=T[j]
  except IndexError:
    Tlen=j
    break

for i in range(Slen-Tlen+1):
  s=0
  for j in range(Tlen):
    if S[i+j]==T[j]:
      s+=1
    else:
      continue
  t=min(t,Tlen-s)
print (t)

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

int main(int argc, char const *argv[])
{
	int n,d;
	cin>>n>>d;
	int ini = d+1;
	int cnt=0;
	while(ini<=n){
		cnt++;
		ini+=d+1;
		if(ini+d<=n) ini+=d;
	}
	if(cnt==0) cnt++;
	cout<<cnt;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
  long long int a,b;
  cin>>a>>b;
  
  if((a+b)%2==0)
  {
    cout<<(a+b)/2<<endl;
    return 0;
  }
  else{
    cout<<"IMPOSSIBLE"<<endl;
  }
  return 0;
}

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

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

typedef long long Data;

struct SegTreeLazy {
  static const int MAX_DEPTH = 18;
  static const int STsize = 1 << MAX_DEPTH;
  Data data[STsize];
  Data lazy[STsize]; int n;
  SegTreeLazy(void) : n(STsize / 2) {
    REP(i,STsize){
      data[i]=lazy[i]=0;
    }
  }
  void update (int pos, Data value) {
    data[pos] += value;
    while (pos < 2*n-1) {
      int l = pos, r = pos^1;
      pos = pos / 2 + n;
      data[pos] = data[l] + data[r];
    }
  }
  void add(int fr, int to, Data val) { upd_sub(fr, to, 2*n-2, 0, n, val); }
  Data sum(int fr, int to) { return sum_sub(fr, to, 2*n-2, 0, n); }
 private:
  void upd_sub(int fr, int to, int node, int la, int ra, Data val) {
    if (ra<=fr || to<=la) return;
    if (fr<=la && ra<=to) {
      lazy[node] += val; return;
    }
    data[node] += (min(to, ra) - max(fr, la)) * val;
    upd_sub(fr, to, (node-n)*2+0, la, (la+ra)/2, val);
    upd_sub(fr, to, (node-n)*2+1, (la+ra)/2, ra, val);
  }
  Data sum_sub(int fr, int to, int node, int la, int ra) {
    if (ra<=fr || to<=la) return Data(0);
    if (fr<=la && ra<=to) return data[node] + lazy[node]*(ra-la);
    Data res = lazy[node] * (min(to, ra) - max(fr, la));
    res += sum_sub(fr, to, (node-n)*2+0, la, (la+ra)/2);
    res += sum_sub(fr, to, (node-n)*2+1, (la+ra)/2, ra);
    return res;
  }
};

/*
int main() {
  SegTreeLazy sgt;
  int n,q;
  cin >> n >> q;
  REP(i,n) {
    int x;
    cin >> x;
    sgt.update(i, x);
  }
  REP(i,q) {
    int x, y;
    char c;
    cin >> c >> x >> y;
    if(c == 'C') {
      int v;
      cin >> v;
      sgt.add(x-1, y, v);
    } else {
      cout << sgt.sum(x-1, y) << endl;
    }
  }
  return 0;
}
*/
int main() {
  SegTreeLazy sgt;
  int n,q;
  cin>>n>>q;
  REP(i,q){
    int c,x,y;
    cin>>c>>x>>y;
    if(c==0){
      sgt.update(x,y);
    }else{
      cout<<sgt.sum(x,y+1)<<endl;
    }
  }
  return 0;
}

Measured memory_bytes: 5256
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <tuple>
#include <numeric>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> P;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;

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

    vector<double> p(n);
    rep(i, n) {
        cin >> p[i];
    } 

    vector<vector<double>> dp(n+1, vector<double>(n+1));  // dp[i][j] : i枚目までで表がj枚の確率
    dp[0][0] = 1.0;
    rep(i, n) {
        exrep(j, 0, i) {
            dp[i+1][j+1] += p[i]*dp[i][j];
            dp[i+1][j] += (1 - p[i])*dp[i][j];
        }
    }
    
    double ans = 0.0;
    exrep(j, n/2 + 1, n) {
        ans += dp[n][j];
    }

    exout(ans);
    re0;
}

Measured memory_bytes: 73732
import numpy as np

n = int(input())
a = np.array(input().split(), dtype=np.int32)
b = np.array(input().split(), dtype=np.int32)

bit = 1 << 28
mask = 2 * bit - 1
ans = 0
while bit:
    a &= mask
    b &= mask

    b.sort()

    l1, r1, l2 = (np.searchsorted(b, v - a).sum() for v in (bit, 2*bit, 3*bit))

    cnt = r1 - l1 + n - l2
    if cnt % 2:
        ans += bit

    mask >>= 1
    bit >>= 1

print(ans)


Measured memory_bytes: 35880
int main()
{
  int n;
  scanf("%d", &n);
  int h[n], i;
  int tmp = 0, ans = 0;
  for (i = 0; i < n; i++)
    scanf("%d", &h[i]);
  for (i = 0; i < n - 1; i++)
  {
    if (h[i] >= h[i + 1])
      tmp++;
    else if (h[i] < h[i + 1])
      tmp = 0;
    if (ans < tmp)
      ans = tmp;
  }
  printf("%d", ans);
}

Measured memory_bytes: 512
#include <iostream>

using namespace std;

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

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

    long long sum = 0;
    for (int i = 1; i <= n; ++i) {
        for (int j = 1; j <= n; ++j) {
            for (int k = 1; k <= n; ++k) {
                int temp = gcd(i, j);
                sum += gcd(temp, k);
            }
        }
    }

    cout << sum << endl;
    return 0;
}

Measured memory_bytes: 3148
N = int(input())
A = list(map(int, input().split()))

count = 0
exist_odd = False

while True:
  for i in range(N):
    if A[i] % 2 != 0:
      exist_odd = True

  if exist_odd:
    break

  for i in range(N):
    A[i] /=2

  count +=1

print(count)

Measured memory_bytes: 9188
import java.util.*;
public class Main{
	public static void main(String args[]){
    	Scanner sc=new Scanner(System.in);
    	int H=sc.nextInt();
    	int W=sc.nextInt();
    	int h=sc.nextInt();
    	int w=sc.nextInt();
    	int result;
    	result=H*W-h*W-w*H+h*w;
    	System.out.println(result);
    }
}


Measured memory_bytes: 22740
#include <stdio.h>
#define N 6

int main(void) {
    int a[4] = {1, 2, 3, 4};
    int b[N], i, j, cnt;

    for(i = 0; i < N; i++) {
        scanf("%d", &b[i]);
    }
    
    for(i = 0; i < 4; i++){
        cnt = 0;
        for(j = 0; j < N; j++) {
            if(a[i] == b[j]) {
                cnt++;
            }
        }
        if(cnt > 2) {
            break;
        }
    }

    if(cnt < 3) {
        printf("YES\n");
    } else {
        printf("NO\n");
    }

    return 0;
}


Measured memory_bytes: 128
import java.util.Scanner;
import java.util.stream.IntStream;

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

        final int N = sc.nextInt();
        final int X = sc.nextInt();

        final int[] L = new int[N];
        for (int i = 0; i < N; i++) {
            L[i] = sc.nextInt();
        }

        int[] ans = new int[N+1];
        ans[0] = 0;
        for (int i = 1; i < N+1; i++) {
            ans[i] = ans[i-1] + L[i-1];
        }

        System.out.println(IntStream.of(ans).filter(i -> i <= X).count());
    }
}


Measured memory_bytes: 28240
#include <bits/stdc++.h>
#define itn int
#define gI gi

using namespace std;

typedef long long ll;

inline int gi()
{
	int f = 1, x = 0; char c = getchar();
	while (c < '0' || c > '9') {if (c == '-') f = -1; c = getchar();}
	while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
	return f * x;
}

inline ll gl()
{
	ll f = 1, x = 0; char c = getchar();
	while (c < '0' || c > '9') {if (c == '-') f = -1; c = getchar();}
	while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
	return f * x;
}

int a[100004];

int main()
{
	//freopen(".in", "r", stdin);
	//freopen(".out", "w", stdout);
	int h = gi(), n = gi(), sum = 0;
	for (int i = 1; i <= n; i+=1) a[i] = gi(), sum += a[i];
	if (sum < h) puts("No");
	else puts("Yes");
	return 0;
}



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

int func(int x){
    if (x<10) return x;
    return func(x/10)+x%10;
}

int main() {
    int N;
    cin >> N;
    if (N%func(N)==0){
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }
}


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

#define f first
#define s second
#define pb push_back
#define mp make_pair

using namespace std;

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

const int N = (int)2e5 + 123, inf = 1e9, mod = 1e9 + 7;
const ll INF = 1e18;

int n, ans, x;
map<int, int> cnt;
int main()
{
	scanf("%d", &n);
	for(int i = 0; i < n; i++){
		int x;
		scanf("%d", &x);
		cnt[x]++;
	}
	if(cnt.size() == 1 && cnt[0] == n){
		printf("Yes");
		return 0;
	}
	if(cnt.size() == 2){
		if(cnt[0] * 3 == n)
			printf("Yes");
		else
			printf("No");
		return 0;	
	}
	ans = 1;
	if(cnt.size() != 3)
		ans = 0;
	for(auto it : cnt){
		x ^= it.f;
		if(it.s * 3 != n)
			ans = 0;
	}
	if(ans && x == 0)           
		printf("Yes");
	else
		printf("No");
	return 0;
}


Measured memory_bytes: 3840
#include <bits/stdc++.h>
using namespace std;
#define _MACRO(_1, _2, _3, NAME, ...) NAME
#define _repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define _rep(i,n) _repl(i,0,n)
#define rep(...) _MACRO(__VA_ARGS__, _repl, _rep)(__VA_ARGS__)
#define pb push_back
#define all(x) begin(x),end(x)
#define uniq(x) sort(all(x)),(x).erase(unique(all(x)),end(x))
#ifdef LOCAL
#define dbg(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
void _dbg(string){cerr<<endl;}
template<class H,class... T> void _dbg(string s,H h,T... t){int l=s.find(',');cerr<<s.substr(0,l)<<" = "<<h<<", ";_dbg(s.substr(l+1),t...);}
template<class T,class U> ostream& operator<<(ostream &o, const pair<T,U> &p){o<<"("<<p.first<<","<<p.second<<")";return o;}
template<class T> ostream& operator<<(ostream &o, const vector<T> &v){o<<"[";for(T t:v){o<<t<<",";}o<<"]";return o;}
#else
#define dbg(...) {}
#endif

int main(){
  int n,h,w;
  cin>>n>>h>>w;
  int ans = 0;
  rep(i,n){
    int x,y;
    cin>>x>>y;
    if(x>=h && y>=w) ans++;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int GCD(int,int);

int main()
{
  int x,y,n;

  scanf("%d%d",&x,&y);

  n = GCD(x,y);

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

  return 0;
}

int GCD(int x,int y)
{
  int a;
  
  if(x>y){
    a = y;
    y = x%y;
    x = a;
    if(y==0)return x;
    else GCD(x,y);
  }
  else if(x<y){
    a = x;
    x = y%x;
    y = a;
    if(x==0)return y;
    else GCD(x,y);
  }
  else if(x==y) return x;
}


    

  



Measured memory_bytes: 2108
#include <algorithm>
#include <cmath>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <stack>
#include <string>
#include <vector>
typedef long long ll;
using namespace std;
const int MOD = (int)1e9 + 7;
const ll INF = (ll)1e18 + 7;
#define int long long
#define vint vector<int>
#define pint pair<int, int>
#define pb(a) push_back(a)
#define all(v) v.begin(), v.end()
#define dbg(x) cerr << #x << " = " << (x) << endl
#define yn(b) cout << ((b) ? "Yes" : "No") << endl
#define YN(b) cout << ((b) ? "YES" : "NO") << endl

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

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

    int K,N;
    cin>>K>>N;

    vint a(N);
    vint diff;

    for (int i = 0; i < N; i++)
    {
        cin>>a[i];
    }
    
    for (int i = 0; i < N-1; i++)
    {
        diff.push_back(a[i+1]-a[i]);
    }
    
    diff.push_back((a[0]-0)+K-a[N-1]);

    cout<<K-*max_element(all(diff))<<endl;

	return 0;
}


Measured memory_bytes: 3956
#include<bits/stdc++.h>
#define maxi 2000

using namespace std;

int main()
{
    long long int n,i,ar[maxi],s=0,p=0;
    cin>>n;
    for(i=0;i<n;++i){

        cin>>ar[i];
        s+=ar[i];

    }
    for(i=0;i<n;++i){

        s-=ar[i];
        p+=(ar[i]*s);

    }
    cout<<p<<endl;
    return 0;

}


Measured memory_bytes: 256
import std.stdio, std.string, std.conv;
import std.array, std.algorithm, std.range;
import std.numeric;

void main()
{
    foreach(s;stdin.byLine())
    {
        auto m = s.split().map!(to!long)();
        immutable a=m[0], b=m[1], g=gcd(a,b);
        writeln(g," ",a/g*b);
    }
}

Measured memory_bytes: 1060
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <ctime>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iostream>
#include <iterator>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

using namespace std;
using ll = long long;

#define REP(i, a) for (int i = 0; i < (a); ++i)
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define FORR(i, a, b) for (int i = (a)-1; i >= (b); --i)
#define ALL(obj) (obj).begin(), (obj).end()
#define YESNO(cond, yes, no) \
    { cout << ((cond) ? (yes) : (no)) << endl; }
#define SORT(list) sort(ALL((list)));
#define RSORT(list) sort((list).rbegin(), (list).rend())
#define ASSERT(cond, mes) assert(cond&& mes)

constexpr int MOD = 1'000'000'007;
constexpr int INF = 1'050'000'000;

template <typename T>
T round_up(const T& a, const T& b) {
    return (a + (b - 1)) / b;
}

template <typename T1, typename T2>
istream& operator>>(istream& is, pair<T1, T2>& p) {
    is >> p.first >> p.second;
    return is;
}

template <typename T1, typename T2>
ostream& operator<<(ostream& os, pair<T1, T2>& p) {
    os << p.first << p.second;
    return os;
}

template <typename T>
istream& operator>>(istream& is, vector<T>& v) {
    REP(i, (int)v.size())
    is >> v[i];
    return is;
}

template <typename T>
T clamp(T& n, T a, T b) {
    if (n < a) n = a;
    if (n > b) n = b;
    return n;
}

template <typename T>
static T GCD(T u, T v) {
    T r;
    while (v != 0) {
        r = u % v;
        u = v;
        v = r;
    }
    return u;
}

template <typename T>
static T LCM(T u, T v) {
    return u / GCD(u, v) * v;
}

template <class T>
std::vector<T> enum_div(T n) {
    std::vector<T> ret;
    for (T i = 1; i * i <= n; i++) {
        if (n % i == 0) {
            ret.push_back(i);
            if (i * i != n) { ret.push_back(n / i); }
        }
    }
    return ret;
}

bool isPrime(ll num) {
    if (num < 2)
        return false;
    else if (num == 2)
        return true;
    else if (num % 2 == 0)
        return false;

    for (ll i = 3; i * i <= num; i += 2) {
        if (num % i == 0) { return false; }
    }

    return true;
};

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

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

template <class T>
bool is_integer(T x) {
    return std::floor(x) == x;
}

struct ToUpper {
    char operator()(char c) {
        return toupper(c);
    }
};

struct ToLower {
    char operator()(char c) {
        return tolower(c);
    }
};

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

    char c;
    cin >> c;
    cout << (char)(c + 1) << endl;
    return 0;
}


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

int main() {
    long long int x,cnt = 0;
    long long int m = 100;
    cin >> x;
    while(true){
        if(m >= x){
            cout << cnt << endl;
            return 0;
        }
        m *= 1.01;
        cnt++;
    }
}


Measured memory_bytes: 3636
#include <iostream>
using namespace std;
int main(void){
  int a[31]={1,1,2};//0段目(まだ踏み出してないので1通り),1段目(1段だけなので1通り),2段目(1歩x2か2歩x1で2通り)
  for(int i=3;i<=30;++i) a[i]=a[i-1]+a[i-2]+a[i-3];//i段目にはi-1.i-2,i-3段目から来るはず
  int n;
  while(cin>>n,n) cout<<(a[n]/10/365+1)<<endl;
}

Measured memory_bytes: 1160
//I read the news today, oh boy
//About a lucky man who made the grade
 
#include <bits/stdc++.h>
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define sz(x) ll((x).size())
#define all(v) (v).begin(),(v).end()
#define trace(x) cerr << #x << " = " << x << endl
#define fastio ios_base::sync_with_stdio(0);cin.tie(0)
#define For(i,a,b) for(ll i = ll(a); i < ll(b); ++i)
#define roF(i,a,b) for(ll i = ll(a); i >= ll(b); i--)
using namespace std;

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

const ll N=1e6;

int main(){
	fastio;
	ll p, q, r; cin>>p>>q>>r;
	cout << min(p+q,min(q+r,p+r)) << endl;
	return 0;
}



Measured memory_bytes: 3604
import queue


def even_relation(N: int, edges: list)->list:
    color = [-1] * N
    color[0] = 0

    g = [[] for _ in range(N)]
    for u, v, w in edges:
        g[u-1].append((v-1, w))
        g[v-1].append((u-1, w))

    q = queue.Queue()
    q.put((0, -1))

    while not q.empty():
        u, par = q.get()

        for v, w in g[u]:
            if v == par:
                continue

            if w % 2 == 0:
                color[v] = color[u]
            else:
                color[v] = 1-color[u]

            q.put((v, u))

    return color


if __name__ == "__main__":
    N = int(input())
    edges = [tuple(int(s) for s in input().split()) for _ in range(N-1)]

    for ans in even_relation(N, edges):
        print(ans)


Measured memory_bytes: 53096
n, m = map(int, input().split())
h = list(map(int, input().split()))
j = []
sore = [[0] for i in range(n)]
for i in range(m):
    road = list(map(int, input().split()))
    sore[road[0]-1].append(h[road[1]-1])
    sore[road[1]-1].append(h[road[0]-1])
ans = 0
for i in range(n):
    if h[i] > max(sore[i]):
        ans+=1
print(ans)


Measured memory_bytes: 25928
#include<bits/stdc++.h>
using namespace std;
int main(){
	string s;
	cin >> s;
	int c = 0;
    {
      char before=s[0];
      for(int i=1;i<s.size();i++){
          if(s[i]!=before){
              c++;
          }
          before=s[i];
      }
    }
	cout << c;
	return 0;
}

Measured memory_bytes: 512
import java.io.*;

class Main {
    public static void main(String[] args) {
        try {
            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
            int x = 0;
            int y = 0;
            int max = 0;
            boolean end = false;

            while (!end) {
                String ex = br.readLine();
                String[] numbers = ex.split(" ");
                x = Integer.parseInt(numbers[0]);
                y = Integer.parseInt(numbers[1]);

                if ((x < 0 && y > 10000) || (x == 0 && y == 0) || max > 3000) {
                    end = true;
                } else if (x > y || x == y) {
                    System.out.println(y + " " + x);
                } else if (x < y) {
                    System.out.println(x + " " + y);
                }
                max++;
            }

        } catch (Exception e) {
            System.out.println(e);
        }
    }
}

Measured memory_bytes: 27008
#ifndef LOCAL
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#else
#include <iostream>
#include <iomanip> 
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <memory>
#include <cctype>
#include <cstring>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
#endif
using namespace std;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; }; sim > rge<c> range(c i, c j) { return rge<c>{i, j}; } sim > auto dud(c* x) -> decltype(cerr << *x, 0); sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; } eni(!=) cerr << boolalpha << i; ris; } eni(==) ris << range(begin(i), end(i)); } sim, class b dor(pair < b, c > d) { ris << "(" << d.first << ", " << d.second << ")"; } sim dor(rge<c> d) { *this << "["; for (auto it = d.b; it != d.e; ++it) *this << ", " + 2 * (it == d.b) << *it; ris << "]"; }
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

// #include <ext/pb_ds/assoc_container.hpp> 
// #include <ext/pb_ds/tree_policy.hpp> 
// using namespace __gnu_pbds; 
// #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 

template<typename T> void setmax(T& x, T y) {x = max(x, y);}
template<typename T> void setmin(T& x, T y) {x = min(x, y);}
#define fix(a) fixed << setprecision(a)
#define forn(i, n) for (int i = 0; i < int(n); i++)
#define rep(i, a, b) for (int i = int(a); i < int(b); i++)
#define all(V) V.begin(), V.end()
#define rall(V) V.rbegin(), V.rend()
#define len(V) (int)V.size()
#define ll long long
#define ld long double
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define endl '\n'

void solve(){
  string s;
  cin >> s;
  vector<int> a;
  forn(i, len(s)) a.pb(s[i]-'0');
  for (auto i: {0, 1}){
    for (auto j: {0, 1}) {
      for (auto k: {0, 1}){
        int x = a[0];
        string ans = "";
        ans += s[0];
        if (i%2) {
          x -= a[1];
          ans += '-';
        } else {
          x += a[1];
          ans += '+';
        }
        ans += s[1];

        if (j%2) {
          x -= a[2];
          ans += '-';
        } else {
          x += a[2];
          ans += '+';
        }
        ans += s[2];

        if (k%2) {
          x -= a[3];
          ans += '-';
        } else {
          x += a[3];
          ans += '+';
        }
        ans += s[3];
        
        if (x == 7){
          cout << ans << "=7";
          return;
        }
      }
    }
  }
}

int main() {
  ios::sync_with_stdio(false);
  // cin.tie(0); cout.tie(0);
  int t = 1;
  // cin >> t;
  forn(i, t){
    solve();
  }
}

/* 

k (k-1) (k-1)

2 6 3
4 6 5
6 6 7
7 7 7

*/

Measured memory_bytes: 3608