akhauriyash/Code-Regression huggingface dataset:
/////////////////////////////////////////////////////////
//
//  c/temp.cpp file
//  Last Updated: 2018-10-23 ...Maybe
//
//    I hope you adding this code to the setting file
//    alias g++='g++ -std=c++1y -DDEBUG_LOCAL'
//
/////////////////////////////////////////////////////////

#include <bits/stdc++.h>

using namespace std;

#define fi first
#define se second
#define mp make_pair
#define pb push_back

//#define int long long

#define _overload3(_1,_2,_3,name,...) name
#define _REP(i,n) REAP(i,0,n)
#define REAP(i,a,b) for(int i=int(a);i<int(b);++i)
#define REP(...) _overload3(__VA_ARGS__,REAP,_REP,)(__VA_ARGS__)

#define _REPR(i,n) REAPR(i,n,0)
#define REAPR(i,a,b) for(int i=int(a-1);i>=int(b);--i)
#define REPR(...) _overload3(__VA_ARGS__,REAPR,_REPR,)(__VA_ARGS__)

#define ALL(a) a.begin(),a.end()
#define rALL(a) a.rbegin(),a.rend()

#define coutALL(a) {int loop_coutALL=0;for(auto e:a) cout<<(loop_coutALL++?" ":"")<<e; cout<<endl;}

#define coutYN(a) cout<<((a)?"YES":"NO")<<endl;
#define coutYn(a) cout<<((a)?"Yes":"No")<<endl;
#define coutyn(a) cout<<((a)?"yes":"no")<<endl;

#define pcnt __builtin_popcount
#define buli(x) __builtin_popcountll(x)

const int INF=1145141919;
//const long long INF=114514191911451419;
const int MOD=(int)1e9+7;
const double EPS=1e-12;
const int dx[]={1,0,-1,0},dy[]={0,1,0,-1};
//const int dx[]={-1,-1,-1,0,1,1,1,0},dy[]={-1,0,1,1,1,0,-1,-1};

using vi=vector<int>;
using vvi=vector<vi>;
using vs=vector<string>;

typedef pair<int,int> pii;
typedef pair<int,string> pis;
typedef pair<string,int> psi;
typedef pair<string,string> pss;

typedef long long ll;

template<typename T> istream &operator >> (istream &is, vector<T> &v){for(T &x:v) is>>x;return is;}
template<typename T> ostream &operator << (ostream &os, vector<T> &v){int i=0;for(T &x:v) os<<(i++?" ":"")<<x;return os;}

ll rev(ll n){ll x=0;for(;n>0;){x=x*10+n%10;n/=10;}return x;}

ll upper(ll n,ll m){return (n+m-1)/m;};
ll rounding(ll n){return (long double)n+0.5;};

bool inG(ll x,ll n){return 0<=x && x<n;}
bool outG(ll x,ll n){return x<0 || n<=x;}

inline int qp(int a,ll b){if(!b)return 1;int ans=1;do{if(b&1)ans=1ll*ans*a;a=1ll*a*a;}while(b>>=1);return ans;}
inline int qp(int a,ll b,int mo){if(!b)return 1;int ans=1;do{if(b&1)ans=1ll*ans*a%mo;a=1ll*a*a%mo;}while(b>>=1);return ans;}

inline ll fac(ll k,ll n){ll a=1;for(int i=0;i<n;i++)a*=k--;return a;}
inline ll fac(ll k,ll n,int mo){ll a=1;for(int i=0;i<n;i++)a*=k--,a%=mo;return a;}

inline int dsum(ll n){int a=0;for(;n;n/=10)a+=n%10;return a;}

struct Arithmetic{Arithmetic(){cin.tie(0);ios::sync_with_stdio(0);cout<<fixed<<setprecision(20);}};

//#define DEBUG_LOCAL

#ifdef DEBUG_LOCAL
template<typename T> void deb(T a){cerr<<"deb: "<<a<<"です"<<endl;}
#define debl {cerr<<"debug: "<<__LINE__<<"行目だ"<<endl;}
void what_cr(){cout<<__GCC_ATOMIC_CHAR16_T_LOCK_FREE<<" ←？"<<endl;}
//ori_func S

//ori_func E
#else
template<typename T>void deb(T a){}
#define debl
void what_cr(){}void t_t(){}
#endif

signed main(){

  Arithmetic Exception;

  int a,b,c;

  cin>>a>>b>>c;

  cout<<c/a*b<<endl;

  return 0;

}


Measured memory_bytes: 256
//suhan lee,saitama university

#include <vector>
#include <list>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <utility>
#include <functional>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <ctime>
#include <climits>
#include <cassert>
#include <complex>
using namespace std;

inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;

#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define rep(i,a,b) for(int i=(a);i<(b);++i)
#define repn(i,n) for(int i=0;i<n;i++)
#define EACH(t,i,c) for(t::iterator i=(c).begin(); i!=(c).end(); ++i)
#define pb push_back 
#define pf push_front
ll ex1(string input,ll& i);
ll ex2(string input,ll& i);
ll ex3(string input,ll& i);
ll exnum(string input,ll& i);
ll ex1(string input,ll& i){
  ll a=0;;
  a=+ex2(input,i);
  while(true){
    if(input[i]=='+')
      a= a+ex2(input,++i);
    else if(input[i]=='-')
      a=a-ex2(input,++i);
    else return a;
  }
}

ll ex2(string input,ll& i){
  ll a=ex3(input,i);
  while(true){
    if(input[i]=='*')
      a*=ex3(input,++i);
    else if(input[i]=='/')
      a/=ex3(input,++i);
    else return a;
  }
}
ll ex3(string input,ll& i){
  ll a;
  if(input[i]=='('){
    a=ex1(input,++i);
    i++;
  }
  else a=exnum(input,i);
  return a;
}
ll exnum(string input,ll &i){
  ll a=0;
  while(isdigit(input[i])){
    //  cout<<"i:"<<i<<endl;
    a*=10;
    a+=input[i]-'0';
    i++;
  }
  //  cout<<"a:"<<a<<endl;
  return a;
}

int main(){
  ll n;
  cin>>n;
  repn(k,n){
    ll i=0;
    string input;
    cin>>input;
    cout<<ex1(input,i)<<endl;
  }
  return 0;
}

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

#define rep(i, n) for(int i = 0; i<(n); i++)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
using namespace std;
using ll = long long;

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

    ll ans = N;
    chmin(ans, N % K);
    chmin(ans, abs(K - N % K));
    cout << ans << endl;
}


Measured memory_bytes: 256
import sys
k=int(input())
a,b=map(int, input().split())
if a==b:
  area=[a,b]
else:
  area=[int(i) for i in range(a,b+1)]

for i in area:
  if i % k ==0:
    print('OK')
    sys.exit()

print('NG')

Measured memory_bytes: 62096
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(x) (x).begin(),(x).end()
const int mod=1000000007,MAX=200005,INF=1<<30;

int main(){
    
    std::ifstream in("text.txt");
    std::cin.rdbuf(in.rdbuf());
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int A,B;cin>>A>>B;
    for(int i=1;i<=100000;i++){
        if(i*8/100==A&&i*10/100==B){
            cout<<i<<endl;
            return 0;
        }
    }
    
    cout<<-1<<endl;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i, n) for(int i=0; i < n; i++)
#define reps(i, n) for(int i=1; i <= n; i++)
#define INF 1e9
#define ALL(v) v.begin(), v.end()

using namespace std;
using ll=long long;


int main() {
  int h,a,ans;
  cin >> h >> a;
  cout << (h%a? h/a+1:h/a);
}

Measured memory_bytes: 764
L = input()
l = len(L)
dp = [[0]*2 for _ in range(100005)]
# dp[i][smaller]: i桁目までみる　未満なら1
# dp[i][1] : i桁目までみて、a, bどちらもL未満
# dp[i][0] : i桁目までみて、a+b = L
dp[0][0] = 1
mod = 10**9+7

for i in range(l):
  n = L[i]
  # a + b = 0
  if n == "0":
    dp[i+1][0] = dp[i][0]
    dp[i+1][1] = dp[i][1]
  else: 
    dp[i+1][1] = (dp[i][0] + dp[i][1]) % mod

  # a + b = 1
  if n == "0": 
    dp[i+1][1] += dp[i][1] * 2 % mod
  else: 
    dp[i+1][0] += dp[i][0] * 2 % mod
    dp[i+1][1] += dp[i][1] * 2 % mod

print((dp[l][0]+dp[l][1])%mod)

Measured memory_bytes: 23872
#include <iostream>
#include <set>

int main()
{
  unsigned N;
  std::cin >> N;
  
  std::set<unsigned long long> s;
  
  for (unsigned n = 0; n < N; ++n) {
    unsigned long long A;
    std::cin >> A;
    
    auto itr = s.find(A);
    if (itr == s.end()) {
      s.insert(A);
    } else {
      s.erase(itr);
    }
  }
  
  std::cout << s.size() << std::endl;
  
  return 0;
}

Measured memory_bytes: 4864
#include <bits/stdc++.h>
using namespace std;
int main() {
    int N;
    cin >> N;
    for ( int i = 1; i < N; i++ ) {
        for ( int j = i+1; j <= N; j++ ) {
            cout << __builtin_ffs(i^j) << " ";
        }
        cout << "\n";
    }
    return 0;
}

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

int main(){
  string s;
  cin >> s;
  
  int n = 0;
  for (int i=0 ; i<4 ; i++){
    if (s.at(i) == '+')
      n++;
    else
      n--;
  }
  
  cout << n << endl;
}

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

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;cin>>n;
    if (n%1000==0)cout<<0<<endl;
    else cout<<1000 - n%1000<<endl;
    return 0;
}


Measured memory_bytes: 3664
#include<cstdio>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
    int n;
    int imos[101][101];
    fill_n(*imos,101*101,0);
    scanf("%d",&n);
    for(int i=1;i<=n;i++){
        for(int j=1;j<=n;j++){
            int val;
            scanf("%d",&val);
            imos[i][j]=imos[i-1][j]+imos[i][j-1]-imos[i-1][j-1]+val;
        }
    }

    int ans=-1000000000;
    for(int i=1;i<=n;i++){
        for(int j=1;j<=n;j++){
            for(int y=1;y<=i;y++){
                for(int x=1;x<=j;x++){
                    ans=max(ans,imos[i][j]-imos[y-1][j]-imos[i][x-1]+imos[y-1][x-1]);
                }
            }
        }
    }
    printf("%d\n",ans);
}

Measured memory_bytes: 1068
#pragma GCC optimize(3)
#include <bits/stdc++.h>
using namespace std;
#define maxn 100010
#define ll long long
#define db double
#define vi vector<int>
#define pb push_back
#define mod 1000000007
int c[4005][4005];
int a[4005];
const int mxs = 4005;
void read(int &a) {
	a = 0;
	char ch = getchar();
	while (ch > '9' || ch < '0') ch = getchar();
	while (ch >= '0' && ch <= '9') a = a * 10 + ch - '0', ch = getchar();
}
int main() {
	for (int i = 0; i < 4005; i++) {
		for (int j = 0; j <= i; j++) {
			if (j == 0 || j == i) c[i][j] = 1;
			else {
				c[i][j] = (c[i - 1][j] + c[i - 1][j - 1]) % mod;
			}
		}
	}
	int test = 0;
	int n;
	if (test) n = 200000;
	else
		read(n);
	const int pls = 2001;
	ll ans = 0;
	for (int i = 1; i <= n; i++) {
		int x, b;
		if (test) b = 1900 + rand() % 100, x = 1900 + rand() % 100;
		else read(x), read(b);
		x += b;
		double nans = 0;
		for (int j = pls - b; j <= min(mxs - 1, x + pls - b); j++) {
			ll q = 1ll * a[j] * c[x][b + j - pls];
			nans = (nans + q), ans = (ans + q);
		}
		ans -= (ll)(nans / mod) * mod;
		ans %= mod;
		if (ans < 0) ans += mod;
	//	cout << ans << ' ' << nans << endl;
		for (int j = b + pls - x; j <= b + pls; j++) {
			a[j] += c[x][b + pls - j];
			a[j] = (a[j] >= mod ? a[j] - mod : a[j]);
		}
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 61440
#ifdef _DEBUG
#include "MyLib.h"
#else
#define main_A main
#include "bits/stdc++.h" 
#include <regex>
#define _USE_MATH_DEFINES
#include <math.h>
#define FOR(i,s,e) for (int i = int(s); i < int(e); ++i)
#define REP(i,e) FOR(i,0,e)
#define INF (INT_MAX/2)
#define EPS (1.0e-8)
#define LINF (LLONG_MAX/2)
const int MGN = 8;
const int ARY_SZ_MAX = 10000000;
using namespace std;
using ll = long long; using ull = unsigned long long;
using vi = vector<int>; using vvi = vector<vi>; using vvvi = vector<vvi>;
using vb = vector<bool>; using vvb = vector<vb>; using vvvb = vector<vvb>;
using vl = vector<ll>; using vvl = vector<vl>;
using vd = vector<double>; using vs = vector<string>;
using pii = pair<int, int>; using pll = pair<ll, ll>;
using psi = pair<string, int>;
// functions

#endif


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

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

    int ans = min(A*N, B);
    cout << ans << endl;

    return 0;
}

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

#define ll long long 
#define inf 0x3f3f3f3f
#define infll 0x3f3f3f3f3f3f3f3f
#define all(x) (x).begin (),(x).end()
#define f(i, a, b) for (int i=a; i<(signed)(b); ++i)
#define pc __builtin_popcount // counts number of 1's in bin(num)

const double pi = 2*acos(0.0);
//__gcd(n1, n2);
//cout << fixed;
//cout << setprecision(6); //fixes # of dp



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

	int n, r;
    cin >> n >> r;
	
    if(n>9){
        cout << r;
    } else{
        cout << (10-n)*100 + r;
    }
}








Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main()
{
    int N,K;
    cin >> N >> K;
    int square1001=1;
    for(int i=0; i<N; i=i+1)
    {
        if(K>square1001)
        {
            square1001=2*square1001;
        }
        else
        {
            square1001=square1001+K;
        }
    }
    cout << square1001 << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define fi first
#define se second
#define dbg(x) cout<<#x" = "<<((x))<<endl
template<class T,class U> ostream& operator<<(ostream& o, const pair<T,U> &p){o<<"("<<p.fi<<","<<p.se<<")";return o;}
template<class T> ostream& operator<<(ostream& o, const vector<T> &v){o<<"[";for(T t:v){o<<t<<",";}o<<"]";return o;}

using vl = vector<ll>;

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

    vector<vl> c(n);
    rep(i,n){
        vl v(3);
        rep(j,3) cin >>v[j];
        c[i] = v;
    }

    ll ans = 0;
    rep(mask,1<<3){
        vl t;
        rep(i,n){
            ll v = 0;
            rep(j,3){
                if(mask>>j&1) v += c[i][j];
                else v -= c[i][j];
            }
            t.pb(v);
        }

        sort(all(t), greater<ll>());

        ll x = 0;
        rep(j,m) x += t[j];
        ans = max(ans, x);
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
process.stdin.resume();
process.stdin.setEncoding("utf8");
process.stdin.on("data", (input) => {
  const n = Number(input);

  const result = getResult(n);

  console.log(result);
});

const getResult = (n) => {
  let k = 1;
  let sum = 0;
  let result = convert(n);
  return result;
};

const convert = (value) => {
  let result = "";
  let div = value;
  let per = 0;
  do {
    const numbers = calculate(div);
    per = numbers.per;

    div = per === 0 ? numbers.div - 1 : numbers.div;
    result = convertNumToChar(per) + result;
  } while (div !== 0);
  return result;
};

const calculate = (num) => {
  const div = Math.floor(num / 26);
  const per = num % 26;
  return {
    div: div,
    per: per,
  };
};

const CHAR_CODE_0F_a = 97;

const convertNumToChar = (num) => {
  const offset = num > 0 ? num - 1 : 25;
  return String.fromCharCode(CHAR_CODE_0F_a + offset);
};


Measured memory_bytes: 29980
#include <iostream>
#include <queue>
#include <vector>
#include <iostream>
#include <vector>
#include <cassert>
#include <algorithm>
#include <functional>
#include <cmath>
#include <queue>
#include <set>
#include <stack>
#include <deque>
#include <map>
#include <iomanip>
#include <utility>
using ll = long long;
using ld = long double;
using namespace std;
//const int INF = 7+(1e+9);
ll GCD(ll x, ll y)
{
    if (y == 0)
    {
        return x;
    }
    else
    {
        return GCD(y, x % y);
    }
}
ll LCM(ll x, ll y)
{
    return x / GCD(x, y) * y;
}
struct UnionFind
{
    vector<int> par; // par[i]:iの親の番号　(例) par[3] = 2 : 3の親が2
    UnionFind(int N) : par(N)
    { //最初は全てが根であるとして初期化
        for (int i = 0; i < N; i++)
            par[i] = i;
    }

    int root(int x)
    { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
        if (par[x] == x)
            return x;
        return par[x] = root(par[x]);
    }

    void unite(int x, int y)
    {                     // xとyの木を併合
        int rx = root(x); //xの根をrx
        int ry = root(y); //yの根をry
        if (rx == ry)
            return;   //xとyの根が同じ(=同じ木にある)時はそのまま
        par[rx] = ry; //xとyの根が同じでない(=同じ木にない)時：xの根rxをyの根ryにつける
    }

    bool same(int x, int y)
    { // 2つのデータx, yが属する木が同じならtrueを返す
        int rx = root(x);
        int ry = root(y);
        return rx == ry;
    }
};
long long modinv(long long a, long long m)
{
    long long b = m, u = 1, v = 0;
    while (b)
    {
        long long t = a / b;
        a -= t * b;
        swap(a, b);
        u -= t * v;
        swap(u, v);
    }
    u %= m;
    if (u < 0)
        u += m;
    return u;
}
ll MOD = 1e9 + 7;

int main()
{
    int n, m, r;
    cin >> n >> m >> r;
    vector<int> vec(r);
    for (int i = 0; i < r; i++)
    {
        cin >> vec[i];
    }
    sort(vec.begin(), vec.end());
    vector<vector<int>> dis(n + 1, vector<int>(n + 1, 1e9));
    for (int i = 0; i < m; i++)
    {
        int a, b, c;
        cin >> a >> b >> c;
        dis[a][b] = c;
        dis[b][a] = c;
    }
    for (int k = 1; k <= n; k++)
    {
        for (int i = 1; i <= n; i++)
        {
            for (int j = 1; j <= n; j++)
            {
                dis[i][j] = min(dis[i][j], dis[i][k] + dis[k][j]);
            }
        }
    }
    int MIN = 1e9;
    do
    {
        int sum = 0;
        for (int i = 0; i < vec.size() - 1;i++){
            sum += dis[vec[i]][vec[i + 1]];
        }
        MIN = min(sum, MIN);
    } while (next_permutation(vec.begin(), vec.end()));
    cout << MIN << endl;
}


Measured memory_bytes: 384
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a) (a).begin(),(a).end()
#define pb emplace_back
#define INF (1e9+1)

//0-index 抽象化半開区間遅延セグツリー
template<typename T, typename E>
class segment_tree{
    typedef function<T(T,T)> F; //要素に適用する演算
    typedef function<T(T,E)> G; //作用素の適用
    typedef function<E(E,E)> H; //作用素の合成
    typedef function<E(E,int)> P;
private:
    int num_of_elm_;
    vector<T> dat_, lazy_;
    F f_;
    G g_;
    H h_;
    P p_;
    T ident_;
    E op_ident_;
public:
    segment_tree(int n, F f, G g, H h, P p, T ident, E op_ident):f_(f), g_(g), h_(h), p_(p), ident_(ident), op_ident_(op_ident){
        num_of_elm_ = 1;
        while(num_of_elm_<n)num_of_elm_*=2;
        dat_ .resize(2*num_of_elm_,ident);
        lazy_.resize(2*num_of_elm_,op_ident);
    }
    
    void eval(int k, int len){
        if(lazy_[k] == op_ident_)return ;
        
        if(k<num_of_elm_){
            lazy_[k*2]=h_(lazy_[k*2], lazy_[k]);
            lazy_[k*2+1]=h_(lazy_[k*2+1], lazy_[k]);
        }
        dat_[k] = g_(dat_[k],p_(lazy_[k], len));
        lazy_[k] = op_ident_;
    }
    
    T update(int L, int R, int val, int l=0, int r=0, int k=1){
        if(k==1)r = num_of_elm_;
        
        eval(k,r-l);
        if(r<=L || R<=l)return dat_[k];
        else if(L<=l && r<=R){
            lazy_[k] = h_(lazy_[k], val);
            return g_(dat_[k], p_(lazy_[k], r-l));
        }
        else{
            return dat_[k] = f_(update(L,R,val,l,(l+r)/2,k*2), update(L,R,val,(l+r)/2,r,k*2+1));
        }
        
    }
    
    T query(int L, int R,int l=0,int r=0, int k=1){
        if(k==1)r = num_of_elm_;
        
        eval(k,r-l);
        if(r<=L || R<=l)return ident_;
        else if(L<=l && r<=R){
            return dat_[k];
        }
        else{
            return f_(query(L,R,l,(l+r)/2,k*2), query(L,R,(l+r)/2,r,k*2+1));
        }
    }
};

int main(){
    int n,q;
    cin>>n>>q;
    auto f = [](int a, int b){return min(a,b);};
    auto g = [](int a, int b){return a+b;};
    auto h = g;
    auto p = [](int a, int len){return a;};
    segment_tree<int,int> st(n, f, g, h, p, INF, 0);
    st.update(0,n,-INF);
    rep(i,q){
        int com;
        cin>>com;
        if(com==0){
            int s,t,x;
            cin>>s>>t>>x;
            st.update(s,t+1,x);
        }else{
            int x,y;
            cin>>x>>y;
            cout<<st.query(x,y+1)<<endl;
        }
    }
}





Measured memory_bytes: 4976
def main():
    x, y = (int(i) for i in input().split())
    getGreatestCommonDiviser(x,y)


def getGreatestCommonDiviser(x, y):
    c = max(x,y) % min(x,y)
    if c == 0:
        print(min(x,y))
    else:
        getGreatestCommonDiviser(min(x,y),c)

main()


Measured memory_bytes: 5604
fn main() {
    let n: usize = read();
    let mut map = vec![vec![vec![0; 10]; 3]; 4];
    for _ in 0..n {
        let (b, f): (usize, usize) = (read::<usize>(), read::<usize>());
        let (r, v): (usize, isize) = (read::<usize>(), read::<isize>());
        map[b - 1][f - 1][r - 1] += v;
    }
    for b in 0..4 {
        for f in 0..3 {
            for r in 0..10 {
                print!(" {}", map[b][f][r]);
            }
            println!("");
        }
        if b != 3 {
            println!("####################");
        }
    }
}

// =========
#[allow(unused_imports)]
use std::cmp::{max, min};
#[allow(unused_imports)]
use std::collections::{HashMap, HashSet};
#[allow(unused_imports)]
use std::process::exit;

#[allow(dead_code)]
const MOD: isize = 1000000007;

fn read<T: std::str::FromStr>() -> T {
    use std::io::Read;
    let stdin = std::io::stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

// =========



Measured memory_bytes: 5032
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#include <cstring>
#include <utility>
#include <set>
#include <stack>
#include <climits>
#include <cmath>
#include <iomanip>
#include <unordered_map>
#include <map>
#include <boost/multiprecision/cpp_int.hpp>

#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define rep1(i,n) for(int i=1, i##_len=(n); i<=i##_len; ++i)
#define reps(i,s,n) for(int i=s, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
#define MEMSET(v, h) memset((v), h, sizeof(v))
typedef long long ll;
typedef long double ld;
const char sp = ' ';

using namespace boost::multiprecision;
using namespace std;

int main(void){
    ll K;
    cin>>K;
    ll d=7%K;
    ll ini=d, count=1;
    while(d!=0){
        count++;
        d=(d*10+7)%K;
        if(count>=K+2){
            cout<<-1<<endl;
            return 0;
        }
    }
    cout<<count<<endl;
    return 0;
}


Measured memory_bytes: 3588
n = int(input())
a = input()
b = input()
c = input()

ans = 0

for i in range(n):
    temp = set([a[i], b[i], c[i]])
    if len(temp) == 2:
        ans += 1
    elif len(temp) == 3:
        ans += 2

print(ans)

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

int main() {
  int sum = 0;
   int N;
  cin >> N;
  for (int i = 0; i < N; i++) {
    string S;
    cin >> S;
    if (S == "Y") {
      sum = sum + 1;
    } 
  }
  if (sum > 0) {
    cout << "Four";
  } else {
    cout << "Three";
  }
}

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

using namespace std;

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

#define each(i,a) for (auto&& i : a)
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
#define pb push_back
#define all(a) (a).begin(),(a).end()
#define chmin(x,v) x = min(x, v)
#define chmax(x,v) x = max(x, v)

const ll linf = 1e18;
const double eps = 1e-12;
const double pi = acos(-1);

template<typename T>
istream& operator>>(istream& is, vector<T>& vec) {
    each(x,vec) is >> x;
    return is;
}
template<typename T>
ostream& operator<<(ostream& os, const vector<T>& vec) {
    rep(i,vec.size()) {
        if (i) os << " ";
        os << vec[i];
    }
    return os;
}
template<typename T>
ostream& operator<<(ostream& os, const vector< vector<T> >& vec) {
    rep(i,vec.size()) {
        if (i) os << endl;
        os << vec[i];
    }
    return os;
}
ll normalize(ll x, ll L, char c) {
    if (c == 'B') x += L;
    ll res = x % (2 * L);
    return res;
}
class Grid {
    ll n;
    vector<vector<ll>> S;
public:
    Grid(ll n) : n(n), S(n+1, vector<ll>(n+1)) {
    }
    void fill(ll x1, ll y1, ll x2, ll y2) {
        if (x1 < 0) {
            fill(0, y1, x2, y2);
            fill(x1+n, y1, n, y2);
            return;
        }
        if (x2 > n) {
            fill(x1, y1, n, y2);
            fill(0, y1, x2-n, y2);
            return;
        }
        if (y1 < 0) {
            fill(x1, 0, x2, y2);
            fill(x1, y1+n, x2, n);
            return;
        }
        if (y2 > n) {
            fill(x1, y1, x2, n);
            fill(x1, 0, x2, y2-n);
            return;
        }
        S[y1][x1]++;
        S[y2][x1]--;
        S[y1][x2]--;
        S[y2][x2]++;
    }
    vector<vector<ll>> calc() {
        rep(y, n+1) rep(x, n) {
            S[y][x+1] += S[y][x];
        }
        rep(y, n) rep(x, n+1) {
            S[y+1][x] += S[y][x];
        }
        return S;
    }
};
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll n, L; cin >> n >> L;
    vector<ll> X(n), Y(n);
    vector<char> c(n);
    rep(i, n) cin >> X[i] >> Y[i] >> c[i];
    Grid g(2*L);
    rep(i, n) {
        ll x = normalize(X[i], L, c[i]);
        ll y = normalize(Y[i], L, 'W');
        // cout << x << " " << y << endl;
        g.fill(x-L+1, y-L+1, x+1, y+1);
        g.fill(x+1, y+1, x+1+L, y+1+L);
    }
    vector<vector<ll>> S = g.calc();
    // cout << S << endl;
    ll ans = 0;
    rep(y, 2*L) rep(x, 2*L) {
        chmax(ans, S[y][x]);
    }
    cout << ans << endl;
}


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

namespace ABC042_D
{
    class Program
    {      
        static void Main(string[] args)
        {
            var a = scan();
            maketable(a[0], a[1]);
            long ans = 0;
            for (long i =a[3]; i < a[1]; i++)
            {
                long ue = getC(a[0] - a[2] - 1, i);
                long shita = getC(a[2]-1,a[1]-i-1);             
                ans += ue * shita;
                ans %= q;
            }
            Console.WriteLine(ans);
        }

        const int q = 1000000007;
        static long[] t = new long[200000];
        static long[] s = new long[200000];

        
        //(a+b)!/a!b!｛a+bCa｝を計算
        static long getC(long a,long b)
        {
            return(((t[a+b]*s[a])% q)*s[b])%q;           
        }
        
        // x! と(x!)^-1をtableにしたいです。
        static void maketable(long H,long W)
        {
            t[0] = 1;
            long i;
            for (i = 1; i < H+W-1; i++)
            {
                t[i] = (i*t[i - 1])%q;   
            }

            i--;
            s[i] = powmod(t[i],q-2, q);

            for (; i > 0; i--)
            {
                s[i-1] = (s[i] * i) % q;
            }
        }
       
        //a^b(modq)
        static long powmod(long a, long b, long p)
        {
            if (b == 0) return 1;
            if (b % 2 == 0)
            {
                long d = powmod(a, b / 2, p);
                return (d * d) % p;
            }
            else return (a * powmod(a, b - 1, p)) % p;         
        }

        static long[] scan()
        {
            return
               Console.ReadLine().Split(' ')
               .Select(i => long.Parse(i)).ToArray();
        }
    }

}


Measured memory_bytes: 5976
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vl = vector<ll>;
using vll = vector<vl>;
using Pll = pair<ll, ll>;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(v) v.begin(), v.end()
#define sz(x) ((int) x.size())
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define F first
#define S second
const int MOD = 1e9+7;
const ll INF = 2e15;
template<class T> void print(const T& t){ cout << t << endl; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
int gcd(int a,int b){return b?gcd(b,a%b):a;}

int main(){
  ll n;
  cin >> n;
  vl a(n);
  rep(i,n){
    cin >> a[i];
  }
  sort(all(a));
  ll count = 1;
  ll total = 0;
  ll sum = a[n - 1];
  if(n==2){
    print(a[n - 1]);
    return 0;
  }
  for (ll i = n - 2; i >= 0; i--){
    sum += a[i];
    count++;
    if (count==n-1){
      break;
    }
    sum += a[i];
    count++;
    if (count==n-1){
      break;
    }
  }
  print(sum);
}

Measured memory_bytes: 4828
n,x = map(int,input().split())
al = list(map(int,input().split()))

ans = 0
for i in range(n):
   if i == 0:
      p = max(al[i] - x, 0)
      ans += p
      al[i] -= p
   else:
      p = max(al[i-1] + al[i] - x, 0)
      ans += p
      al[i] -= p

print(ans)

Measured memory_bytes: 14540
#include<iostream>
#include<vector>
#include<utility>
#include<map>
#include<deque>
#include<numeric>
#include<algorithm>

using namespace std;
using ll = long long int;

string s;
int ret = 0;

int main(void) {
	cin >> s;

	for (int i = 0; i < int(s.size()) - 1; i++) {
		if (s[i] != s[i + 1]) {
			s.erase(s.begin() + i, s.begin() + i + 2);
			if (i > 0)
				i--;
			i--;
			ret += 2;
		}
	}
	cout << ret << endl;
	return 0;
}

Measured memory_bytes: 512
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<iostream>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<sstream>
#include<unordered_map>
#include<unordered_set>
#include<vector>
using ll = long long;
enum : int { M = (int)1e9 + 7 };
enum : ll { MLL = (ll)1e18L + 9 };
using namespace std;
#ifdef LOCAL
#include"rprint2.hpp"
#include"debug_deque.hpp"
#define vector DebugDeque
#else
#define FUNC(name) template <ostream& out = cout, class... T> void name(T&&...){ }
FUNC(prints) FUNC(printe) FUNC(printw) FUNC(printew) FUNC(printb) FUNC(printd) FUNC(printde) FUNC(printdu);
#endif
template <class S, class T>
istream& operator >> (istream& in, pair<S, T>& p){ return in >> p.first >> p.second; }
template <class T>
istream& operator >> (istream& in, vector<T>& v){ for(auto& e : v){ in >> e; } return in; }

#include<unistd.h>
char buff[1 << 22];
template <int size>
struct Buffer{
    int idx = 0;
    Buffer(){ read(0, buff, size); }
    int next(){
        int ret = 0;
        while(!(buff[idx] & 0x10)){ idx++; }
        while(buff[idx] & 0x10){ ret = ret * 10 + buff[idx++] - '0'; }
        // while(!isdigit(buff[idx])){ idx++; }
        // while(isdigit(buff[idx])){ ret = ret * 10 + buff[idx++] - '0'; }
        return ret;
    }
};
struct FastInput {
    Buffer<1 << 22> buf;
    template <class T>
    FastInput& operator >> (T& num) { num = buf.next(); return *this; }
    void tie(int){ }
    template <class S, class T>
    friend FastInput& operator >> (FastInput& in, pair<S, T>& p){ return in >> p.first >> p.second; }
    template <class T>
    friend FastInput& operator >> (FastInput& in, vector<T>& v){ for(auto& e : v){ in >> e; } return in; }
};
FastInput fin;
#define cin fin

enum { SIZE = 1 << 20 };
char buf[SIZE];
int accs[512][512];
pair<int, int> pqs[100000];
int main(){
    int n, m, q;
    cin >> n >> m >> q;
    for(int i = 0; i < m; i++){
        int l, r;
        cin >> l >> r;
        accs[0][r]++;
        accs[l + 1][r]--;
    }
    for(int i = 0; i <= n; i++){
        for(int j = 0; j <= n; j++){
            accs[i + 1][j] += accs[i][j];
            accs[i][j] += accs[i][j - 1];
        }
    }
    int idx = SIZE;
    for(int i = 0; i < q; i++){
        cin >> pqs[i].first >> pqs[i].second;
    }
    for(int i = q - 1; i >= 0; i--){
        int p = pqs[i].first, q = pqs[i].second;
        buf[--idx] = '\n';
        div_t num2;
        num2.quot = accs[p][q];
        do{
            num2 = div(num2.quot, 10);
            buf[--idx] = num2.rem + '0';
        }while(num2.quot);
    }
    write(1, buf + idx, SIZE - idx);
}


Measured memory_bytes: 6784
N = int(input())
R = [1,400,800,1200,1600,2000,2400,2800,3200,4801]
r = [0] * 10
A = list(map(int,input().split()))
for a in A:
	m = 0
	M = 9
	while True:
		n = (m + M) // 2
		if a < R[n]:
			M = n
		elif a >= R[n + 1]:
			m = n
		else:
			break
	r[n] += 1
cnt = 0
for i in r[:-2]:
	if i > 0:
		cnt += 1
if cnt == 0:
	max_cnt = r[8]
	cnt = 1
else:
	max_cnt = cnt + r[8]
print(cnt,max_cnt)

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

using namespace std;
typedef long long ll;

#define MOD (long long)(1e9+7)
#define INF (1LL<<60)
#define rep(i,n) for(ll i = 0; i < (n); i++)
#define rep1(i,n) for(ll i = 1; i <= (n); i++)

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


// 最大公約数
ll gcd(ll a, ll b)
{
  if(b == 0) return a;
  return gcd(b, a % b);
}

// mod m におけるa の逆元
ll modinv(ll a, ll m) {
  ll b = m, u = 1, v = 0;
  while (b) {
    ll t = a / b;
    a -= t * b; swap(a, b);
    u -= t * v; swap(u, v);
  }
  u %= m;
  if (u < 0) u += m;
  return u;
}

// 素因数分解
vector<pair<ll, ll>> prim;
void pf(ll n)
{
  ll s = sqrt(n);
  ll r = 0;
  for(ll i = 2; i <= s; i++) {
    if((n % i) == 0) {
      r = 0;
      do {
	r++;
	n = n / i;
      } while((n % i) == 0);
      prim.push_back({i, r});
    }
  }
  if(n > s) {
    prim.push_back({n, 1});
  }
}

void solve()
{
  ll N; cin >> N;
  // ll N, K; cin >> N >> K;
  // ll x, y, z; cin >> x >> y >> z;
  // ll a, b, c; cin >> a >> b >> c;
  // string s; cin >> s;
  vector<ll> a(N); rep(i, N) cin >> a[i];
  sort(a.begin(), a.end());
  ll ans1 = a[a.size()-1];
  ll ans2;
  ll dif = INF;
  rep(i, N) {
    ll d = abs(ans1 - 2* a[i]);
    if(d < dif) {
      ans2 = a[i];
      dif = d;
    }
  }
  
  cout << ans1 << " " << ans2 << endl;
  
}


int main(void)
{
  // ll t; cin >> t; rep(i, t)
  solve();
}


Measured memory_bytes: 4072
#include <iostream>
#include <string>
#include <algorithm>
#include <utility>
#include <iomanip>
#include <functional>
#include <queue>
#include <stack>
#include <map>
#include <vector>
#include <cmath>
#include <cctype>
#include <cstdio>
#define ll long long
#define INF 1e+18
#define MOD 1000000007
using namespace std;



int main(){
    int N;
    cin >> N;
    
    ll A[N],B[N];
    for(int i=0; i<N; i++){
        cin >> A[i] >> B[i];
    }
    
    ll sumA=0, sumB=0;
    ll C[N];
    for(int i=0; i<N; i++){
        C[i]=A[i]+B[i];
        sumA+=A[i];
        sumB+=B[i];
    }
    
    sort(C,C+N, greater<ll>());
    
    ll takahashi = -sumB;
    ll aoki = -sumA;
    
    for(int i=0; i<N; i++){
        if(i%2==0){
            takahashi+=C[i];
        }else{
            aoki+=C[i];
        }
    }
    
    cout<<takahashi<<endl;
    return 0;
}


Measured memory_bytes: 2560
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Created: Jul, 12, 2020 15:41:56 by Nobody
# $Author$
# $Date$
# $URL$
__giturl__ = "$URL$"


from sys import stdin
input = stdin.readline


def main():
  N, M = list(map(int, input().split()))

  min_ = -float('inf')
  max_ = float('inf')
  for _ in range(M):
    L, R = map(int, input().split())
    min_ = max(min_, L)
    max_ = min(max_, R)

  ans = 0
  for i in range(1, N+1):
    (max_ - min_ + 1)
    if min_<=i<=max_:
      ans += 1
  print(ans)


if(__name__ == '__main__'):
  main()


Measured memory_bytes: 73828
import java.util.*

fun main(args:Array<String>){
    val a = readLine()!!.toInt()
    val b = readLine()!!.toInt()
    val c = readLine()!!.toInt()
    val d = readLine()!!.toInt()
    println(Math.min(a,b) + Math.min(c,d))
}

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

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


Measured memory_bytes: 3624
#include <cstdio>

inline int readin(){
	int x=0,c;
	for (;(c=getchar())<'0'||c>'9';);
	for (;c>='0'&&c<='9';c=getchar()) x=(x<<1)+(x<<3)+c-48;
	return x;
}

int gcd(int x,int y){return !y?x:gcd(y,x%y);}
int abs(int x){return x>0?x:-x;}

int main(){
	int n=readin(),c=readin(),x=c,ans;
	for (int i=1;i<=n;i++){
		int p=readin();
		if (i==1) ans=abs(p-x);
			else ans=gcd(ans,abs(p-x));
		ans=gcd(ans,abs(c-p));
		x=p;
	}
	printf("%d",ans);
}

Measured memory_bytes: 128
#include <cstdio>
#include <cstring>

int H, W;
char sbuf[6];

int main(void)
{
	//freopen("input.txt", "r", stdin);
	scanf("%d %d", &H, &W);
	for (int h = 1; h <= H; ++h)
	{
		for (int w = 1; w <= W; ++w)
		{
			scanf("%s", sbuf);
			if (strcmp("snuke", sbuf) == 0)
			{
				printf("%c%d", (char)('A' + (w - 1)), h);
				return 0;
			}
		}
	}
	return 0;
}

Measured memory_bytes: 128
using System;

namespace B
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());

            int c0 = 0;
            int c1 = 0;
            int c2 = 0;
            int c3 = 0;
            string[] A = new string[N];
            for (int i = 0; i < N; i++)
            {
                A[i] = Console.ReadLine();
                switch (A[i])
                {
                    case "AC":
                        c0++;
                        break;
                    case "WA":
                        c1++;
                        break;
                    case "TLE":
                        c2++;
                        break;
                    case "RE":
                        c3++;
                        break;
                    default:
                        break;

                }
            }

            Console.WriteLine($"AC x {c0}");
            Console.WriteLine($"WA x {c1}");
            Console.WriteLine($"TLE x {c2}");
            Console.WriteLine($"RE x {c3}");
        }
    }
}


Measured memory_bytes: 31152
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
const long long INF=1LL<<60;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
using namespace std;
int main(){
 long long n;
  cin>>n;
  vector<long long>moji(n);
  for(long long i=0;i<n;i++) cin>>moji.at(i);
  long long counter=0;
  for(long long i=1;i<=n-1;i++){
  	if(moji.at(i-1)<=moji.at(i)){
       counter+=0;
  }
    else {
    	counter+=moji.at(i-1)-moji.at(i);
      moji.at(i)=moji.at(i-1);
    }
  }
  cout<<counter<<endl;
 }


Measured memory_bytes: 4792
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int mod=1e9+7;
const ll inf=0x3f3f3f3f;
const int maxn=2e5+7;
char ss[maxn];
char ss1[maxn];
char ss2[maxn];
char ss3[maxn];
int main(){
    cin>>ss+1;
    int len=strlen(ss+1);
    int flag=1;
    for(int i=1;i<=len;i++){
        ss1[i]=ss[len-i+1];
        if(ss1[i]!=ss[i])
        {
            flag=0;
            break;
        }
    }
    int limit=(len-1)/2;
    for(int i=1;i<=limit;i++){
        ss2[i]=ss[limit-i+1];
        if(ss2[i]!=ss[i]){
            flag=0;
            break;
        }
    }
    for(int i=(len+3)/2;i<=len;i++){
        ss3[i]=ss[len-i+1];
        if(ss3[i]!=ss[i]){
            flag=0;
            break;
        }
    }
    if(flag) printf("Yes\n");
    else printf("No\n");
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>

int main(void)
{
    int n,k,i;
    scanf("%d",&n);
    char s[n];
    scanf("%s %d",&s,&k);
    for(i=0; i<n; i++){
        if(s[i]!=s[k-1]){
            s[i]='*';
        }
    }
    printf("%s\n",s);
    return 0;
}

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

int main(){
  string s,d,f; cin>>s>>d>>f;
  int sa = 'A'-'a';
  cout<<(char)(s.at(0)+sa)<<(char)(d.at(0)+sa)<<(char)(f.at(0)+sa)<<endl;
}

Measured memory_bytes: 256
import java.io.*;

public class Main{
    public static void main(String[]args)throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        while(true){
            String[] str = br.readLine().split(" ");
            int x = Integer.parseInt(str[0]);
            int y = Integer.parseInt(str[1]);

            if(x == 0 && y == 0){
                break;
            }else if(x > y){
                int swp = x;
                x = y;
                y = swp;
            }
            System.out.println(x +" "+ y);
        }
    }
}

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

#define int long long int

int32_t main()
{
    int n;
    cin>>n;
    string str;
    cin>>str;
    vector<int> right(26,0),left(26,0);
    for(int i=0;i<str.size();i++)
    {
        left[str[i]-'a']++;
    }
    int ans=0;
    for(int i=0;i<str.size();i++)
    {
       right[str[i]-'a']++;
       left[str[i]-'a']--;
       int c=0;
       for(int j=0;j<26;j++)
       {
           if(right[j] && left[j])
           c++;
       }
       ans=max(ans,c);
    }
    cout<<ans<<endl;


}

Measured memory_bytes: 3608
var n,m,i,j,k,sum,now,c,d : longint ;
    cc,yo : array [0..1000001] of int64 ;
    a,b : int64 ;
    so,s1,s2 : ansistring ;
begin
 readln(a,b);
 while a<=b do
  begin
   a:=a*2;
   inc(sum);
  end;
 writeln(sum);
end.


Measured memory_bytes: 128
import sys
import math
sys.setrecursionlimit(10000)

def primes(x):
    if x < 2: return []

    primes = [i for i in range(x)]
    primes[1] = 0 # 1は素数ではない

    # エラトステネスのふるい
    for prime in primes:
        if prime > math.sqrt(x): break
        if prime == 0: continue
        for non_prime in range(2 * prime, x, prime): primes[non_prime] = 0

    return [prime for prime in primes if prime != 0]

def is_prime(x):
    if x < 2: return False # 2未満に素数はない
    if x == 2 or x == 3 or x == 5: return True # 2,3,5は素数
    if x % 2 == 0 or x % 3 == 0 or x % 5 == 0: return False # 2,3,5の倍数は合成数

    # ためし割り: 疑似素数(2でも3でも5でも割り切れない数字)で次々に割っていく
    prime = 7
    step = 4
    while prime <= math.sqrt(x):
        if x % prime == 0: return False

        prime += step
        step = 6 - step

    return True

n = int(input())
#h, w = list(map(int, input().split(" ")))

p = primes(55555)

q = []
for i in p:
    if(i % 5 == 1): q.append(i)
    if(len(q) == n): break

for i in range(len(q)):
    if(i == len(q)-1): print(q[i])
    else: print(q[i], end=" ")

Measured memory_bytes: 5300
#include<stdio.h>
#include<math.h>

int main()
{
	int yoko,tate,high;
	int n,i,j,temp;
	int hole[10000];
	
	double taikaku;
	
	for(;;){
		scanf("%d%d%d",&tate,&yoko,&high);
		if(tate==0)break;
		
		taikaku=sqrt(yoko*yoko+high*high);
		
		scanf("%d",&n);
		
		for(i=0;i<n;i++){
			scanf("%d",&temp);
			hole[i]=temp*2;
		}
		
		for(i=0;i<n;i++){
			if(hole[i]>taikaku)puts("OK");
			if(hole[i]<taikaku)puts("NA");
			if(hole[i]==taikaku)puts("NA");
		}
		
		
	}
	return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
  ll n,w,a,b;
  cin >> n >> w;
  vector<pair<ll,ll>> wv(n);
  for(ll i=0;i<n;i++){
    cin >> a >> b;
    wv.at(i) = make_pair(a,b);
  }
  vector<vector<ll>> dp(n+1,vector<ll>((1e+5)+1,1e+10));
  dp.at(0).at(0) = 0;
  for(ll i=0;i<n;i++){
    for(ll j=0;j<=(1e+5);j++){
      if(wv.at(i).second > j) dp.at(i+1).at(j) = dp.at(i).at(j);
      else{
        dp.at(i+1).at(j) = min(dp.at(i).at(j),dp.at(i).at(j-wv.at(i).second)+wv.at(i).first);
      }
    }
  }
  ll ans=0;
  for(ll i=0;i<=(1e+5);i++){
      if(dp.at(n).at(i) <= w)   ans = max(ans,i);
  }
  cout << ans << endl;
}
      
                         
  





Measured memory_bytes: 80256
#![allow(unused_imports, dead_code, non_snake_case)]

use std::io::*;
use std::cmp::{max, min, Ordering};
use std::collections::*;
use std::str::FromStr;

const MOD: i32 = 1_000_000_007;

macro_rules! get {
    ($t:ty) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().parse::<$t>().unwrap()
        }
    };
    ($($t:ty),*) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            (
                $(iter.next().unwrap().parse::<$t>().unwrap(),)*
            )
        }
    };
    ($t:ty; $n:expr) => {
        (0..$n).map(|_|
            get!($t)
        ).collect::<Vec<_>>()
    };
    ($($t:ty),*; $n:expr) => {
        (0..$n).map(|_|
            get!($($t),*)
        ).collect::<Vec<_>>()
    };
    ($t:ty ;;) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.split_whitespace()
                .map(|t| t.parse::<$t>().unwrap())
                .collect::<Vec<_>>()
        }
    };
    ($t:ty ;; $n:expr) => {
        (0..$n).map(|_| get!($t ;;)).collect::<Vec<_>>()
    };
}

fn main() {
    let N = get!(usize);
    let v: Vec<usize> = (0..N).map(|_| get!(usize)).collect();
    let sum = v.iter().sum();
    let ans = if sum % 10 != 0 {
        sum
    } else {
        if let Some(x) = v.iter().filter(|&x| x % 10 != 0).min() {
            sum - x
        } else {
            0
        }
    };
    println!("{}", ans);
}

Measured memory_bytes: 4352
// vim:ts=4:sts=4:sw=4:et
// MOSCOW IPT JINOTEGA
// Table #14
#include <bits/stdc++.h>
using namespace std;
#define forn(i,n) for (int i = 0; i < int(n); ++i)
#define sz(x) ((int) (x).size())
#define all(x) (x).begin(), (x).end()
typedef long double ld;
typedef long long ll;
typedef long long i64;

const int M = 40;
const ll infl = 1e18;

ll n, a[M];

void read() {
    fill(a, a + M, infl);
    for (int i = 0; i < 4; ++i)
        cin >> a[i];
    cin >> n;
    n *= 4;
}

void kill() {
    for (int i = 1; i < M; ++i)
        a[i] = min(a[i], 2 * a[i - 1]);

    ll ans = 0;
    for (int i = 0; i < M; ++i) {
        if ((n >> i) & 1)
            ans += a[i];
    }

    cout << ans << "\n";
}

int main() {
#ifdef LOCAL
    assert(freopen("a.in", "r", stdin));
#endif
    //ios_base::sync_with_stdio(false);

    read();
    kill();

    return 0;
}



Measured memory_bytes: 256
//A.cpp
#include <iostream>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <vector>
#include <queue>
#include <stack>
#include <math.h>
#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b){return b!=0?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a*b/gcd(a,b);}
const ll mod=1e9+7;

int main(){
  int n;
  cin >> n;
  string s;
  map<string,int> chk;
  rep(i,n){
    cin >> s;
    chk[s]++;
  }
  int len = 0;
  for(auto x: chk){
    len = max(len,x.second);
  }
  vector<string> ans;
  int cnt = 0;
  for(auto x: chk){
    if(x.second == len){
      ans.push_back(x.first);
      cnt++;
    }
  }
  sort(ans.begin(), ans.end());
  // printf("\n");
  rep(i,cnt) cout << ans[i] << endl;

  return 0;
}


Measured memory_bytes: 26868