akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

int main(){
  vector<int> N(4);
  for(int i=0;i<4;i++){
    cin >> N.at(i);
  }
  sort(N.begin(),N.end());
  if(N.at(0)==1 && N.at(1)==4 && N.at(2)==7 && N.at(3)==9){
    cout << "YES" << endl;
  }
  else{
    cout << "NO" << endl;
  }
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include<math.h>
#include<list>
#include <algorithm>
#include<set>
#include<vector>
#include<math.h>
#include<map>
#include<string>
#include <numeric>
#include <queue>
#include <sstream>
#include <bitset>
#include<stack>

using namespace std;
using ll = long long;
using vll = vector<long long>;
using sll = set<long long>;

template<typename T>
T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }
template<typename T>
T lcm(T a, T b) { return a / gcd(a, b) * b; }

template<typename T>
map<T, T> getPrimeFactor(T n) {
	map<T, T> res;
	for (T i = 2; i * i <= n; ++i) {
		while (n % i == 0) {
			res[i] ++;
			n /= i;
		}
	}
	if (n != 1) res[n] = 1;
	return res;
}

template<typename T>
bool IsPrimeNumber(T num)
{
	if (num <= 2) return true;
	else if (num % 2 == 0) return false;

	double sqrtNum = sqrt(num);
	for (int i = 3; i <= sqrtNum; i += 2)
	{
		if (num % i == 0)
		{
			return false;
		}
	}

	return true;
}

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


#define in(x) cin >> x
#define out(x) cout << x
#define outn(x) cout << x << '\n'
#define outs(x) cout << x << ' '
#define rep(i,s,e) for(ll i=s;i<e;i++)
#define repeq(i,s,e) for(ll i=s;i<=e;i++)



int main() {

	string S;
	std::cin >> S;

	vll dp(13, 0);
	dp[0] = 1;
	ll d = 1;
	for(ll i=S.length()-1;i>=0;i--) {
		vll nextDp(13, 0);
		if (S[i] == '?') {
			rep(j, 0, 10) {
				rep(k, 0, 13) {
					nextDp[(j * d + k)%13] += dp[k];
					nextDp[(j * d + k) % 13] %= 1000000007;
				}
			}
		}
		else {
			rep(j, 0, 13) {
				nextDp[((S[i] - '0') * d + j) % 13] += dp[j]; 
				nextDp[((S[i] - '0') * d + j) % 13] %= 1000000007;
			}
		}
		d *= 10;
		d %= 13;
		dp = nextDp;
	}
	std::cout << dp[5] << endl;

	return 0;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
#include <iostream>
#include <iomanip>
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define RFOR(i, a, b) for(int i = (b) - 1; i >= (a); i--)
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i < (n); i++)
#define rrep(i, n) for(int i = (n) - 1; i >= 0; i--)
#define all(i) (i).begin(),(i).end()
#define rall(i) (i).begin(),(i).end(),greater<int>()
using namespace std;
#define elif else if
#define eb emplace_back
#define pb push_back
#define mp make_pair
#define fst first
#define sec second
template <typename T> void print(T x) { std::cout << x << '\n'; }

typedef long long ll;
#define TENNINE 1000000005
#define TENFIVE 100005

// #define int long long

typedef pair<ll , int>P;

bool pairCompare(const P &firstElof, const P &secondElof){
    return firstElof.fst < secondElof.fst;
}

signed main(){
    int N,M;
    
    cin>>N>>M;
    vector<pair<ll, int>> list[TENFIVE];
    string name_list[TENFIVE];

    rep(i,M){
        int p;
        ll y;

        cin>>p>>y;
        pair<ll, int>tmp = make_pair(y,i);
        list[p].pb(tmp);

    }
    rep1(i,N+1){
        // if(list[i].size() == 0)continue;
        sort(all(list[i]) ,pairCompare);//list[i]のpair一番目の要素でソートする
        rep(j,list[i].size()){
            ostringstream sout1,sout2;
            sout1<<setfill('0')<<setw(6)<<i;
            sout2<<setfill('0')<<setw(6)<<(j+1);
            name_list[list[i][j].sec] = sout1.str()+sout2.str();  
        }
    }
    rep(i,M){
        cout<<name_list[i]<<endl;
    }      

    return 0;
}


Measured memory_bytes: 12416
#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ll long long
#define hii cout << "hii" << endl
#define int ll
#define endl '\n'
#define all(s) s.begin(), s.end()
 
template <class T> ostream& operator << (ostream &os, const vector<T> &v) { for (T i : v) os << i << ' '; return os; }
template <class T> ostream& operator << (ostream &os, const set<T> &v) { for (T i : v) os << i << ' '; return os; }
template <class T, class S> ostream& operator << (ostream &os, const pair<T, S> &v) { os << v.first << ' ' << v.second; return os; }
template <class T, class S> ostream& operator << (ostream &os, const unordered_map<T, S> &v) { for (auto i : v) os << '(' << i.first << "=>" << i.second << ')' << ' '; return os; }
 
 
#ifndef ONLINE_JUDGE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <class Arg1> void __f(const char* name, Arg1&& arg1) { cerr << name << " : " << arg1 << endl; }
    template <class Arg1, class... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args) {
        const char* sep = strchr(names + 1, ',');
        cerr.write(names, sep - names) << " : " << arg1 << "  ";
        __f(sep + 1, args...);
    }
#else
#define trace(...) 0
#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("avx2,sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define _CRT_SECURE_NO_WARNINGS
#endif // ifndef ONLINE_JUDGE

const int N = 4e5 + 5;
const int MAX = 250000 + 5;
const int M = 3e5;
const int mod = 998244353;
const int MOD = 998244353;
const int INF = 1e18;
const int LG = 21;


int cnt[N];

void solve()
{
	for(int i = 1; i <= 100; i++)
	{
		for(int j = 1; j <= 100; j++)
		{
			for(int k = 1; k <= 100; k++)
			{
				cnt[i * i + j * j + k * k + i * j + j * k + i * k]++;
			}
		}
	}
	int n;
	cin >> n;
	for(int i = 1; i <= n; i++)
	{
		cout << cnt[i] << endl;
	}
}
 
int32_t main() 
{	

	    int t = 1;
	    // cin >> t;
	while(t--)solve();
	return 0;
}

Measured memory_bytes: 4056
S = int(input())
if S == 0:
  print(0)
  exit()
x = ""
while abs(S)>0:
  if abs(S) % 2 == 1:
    x += '1'
    S -=1
  else:
    x += '0'
  S = S //(-2)

x = x[::-1]
print(x)

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

int main()
{
	int64_t n, k;
	cin >> n >> k;
	vector<int64_t> hs(n);
	for (auto &&h : hs)
	{
		cin >> h;
	}

	int64_t ans = accumulate(hs.begin(), hs.end(), int64_t(0));

	sort(hs.rbegin(), hs.rend());

	for (int64_t i = 0; i < min(n, k); i++)
	{
		ans -= hs[i];
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 1792
program main
  implicit none
  integer :: n, m, i, j, l, r, left, right
  read (*, *) n, m
  left = 1  ! inclusive
  right = n
  do i = 1, m
    read (*, *) l, r
    left = max(left, l)
    right = min(right, r)
  end do
  write (*, "(i0)") max(0, right - left + 1)
end program main


Measured memory_bytes: 256
a=input()
b=input()
c=input()

X=[a,b,c]
LEN=[len(a),len(b),len(c)]

MF=[[[1]*2001 for j in range(3)] for i in range(3)]

for i in range(3):
    for j in range(3):
        if i==j:
            continue
        for k in range(2001):
            for l in range(LEN[j]):
                if k+l>=LEN[i]:
                    break
                if X[i][k+l]!="?" and X[j][l]!="?" and X[i][k+l]!=X[j][l]:
                    MF[i][j][k]=0
                    break

ANS=1000000
for i in range(3):
    for j in range(3):
        if i==j:
            continue
        for k in range(2001):
            if MF[i][j][k]==1:
                for l in range(2001):
                    if ANS<=max(LEN[i],LEN[j]+k,LEN[3-i-j]+k+l):
                        break
                    if MF[j][3-i-j][l]==1 and (k+l>2000 or MF[i][3-i-j][k+l]==1):
                        ANS=max(LEN[i],LEN[j]+k,LEN[3-i-j]+k+l)

print(ANS)

Measured memory_bytes: 46556
#include<iostream>
#include<iomanip>
#include<vector>
#include<algorithm>
typedef unsigned long long ull;
typedef signed long long sll;
using namespace std;

#define INF 0x7FFFFFFFFFFFFFFF
#define BIG_PRIME 1000000007

vector<pair<ull,ull>> dp;
ull size;

ull get_idx(ull height,ull START,ull END)
{
  if(START==END)return START;
  ull MID = (START+END)/2;
  if(dp[MID].first<height)
  {
    return get_idx(height,MID+1,END);
  }
  else
  {
    return get_idx(height,START,MID);
  }
}

ull get_delete_size(ull beauty,ull START,ull END)
{
  if(START==END)
  {
    return dp[START].second<=beauty?1:0;
  }
  ull MID = (START+END)/2;
  if(dp[MID].second<=beauty)
  {
    return MID-START+1+get_delete_size(beauty,MID+1,END);
  }
  else
  {
    return get_delete_size(beauty,START,MID);
  }
}

void insert(pair<ull,ull> flower)
{
  ull idx = get_idx(flower.first,0,size);
  if(idx)
  {
    flower.second += dp[idx-1].second;
  }
  if(idx<size)
  {
    ull delete_size = get_delete_size(flower.second,idx,size-1);
    if(delete_size>1)
    {
      for(ull i=idx+1;i+delete_size-1<size;++i)
      {
        dp[i]=dp[i+delete_size-1];
      }
      size -= delete_size;
    }
    else if(delete_size==0)
    {
      for(ull i=size;i>idx;--i)
      {
        dp[i]=dp[i-1];
      }
    }
    else
    {
      --size;
    }
  }
  dp[idx]=flower;
  ++size;
}

int main()
{
  ull i,N,a;
  cin >> N;
  vector<ull> h(N);
  dp.resize(N+1,make_pair(N+1,INF));
  size=0;
  for(i=0;i<N;++i)
  {
    cin >> h[i];
  }
  for(i=0;i<N;++i)
  {
    cin >> a;
    insert(make_pair(h[i],a));
  }
  cout << dp[size-1].second;
  return 0;
}

Measured memory_bytes: 4992
a = [list(map(int,input().split())) for _ in range(3)]
n = int(input())
b = [int(input()) for _ in range(n)]

c = [[0]*3 for _ in range(3)]

for k in range(n):
  for i in range(3):
    for j in range(3):
      if a[i][j] == b[k]:
        c[i][j] += 1
        
for i in range(3):
  if c[0][i] == c[1][i] == c[2][i] == 1:
    print("Yes")
    exit()
for j in range(3):
  if c[j][0] == c[j][1] == c[j][2] == 1:
    print("Yes")
    exit()
if c[0][0] == c[1][1] == c[2][2] == 1:
  print("Yes")
  exit()
if c[0][2] == c[1][1] == c[2][0] == 1:
  print("Yes")
  exit()
print("No")

Measured memory_bytes: 9040
from collections import deque
S = str(input())
q = int(input())
que =deque()
order = 1
for i in range (len(S)):
  que.append(S[i])
for j in range(q):
  Q = list(map(str, input().split()))
  T = Q[0]
  if T == "1":
        order *= -1
  elif T == "2":
    F = Q[1]
    C = Q[2]
    if F == "1":
      if order == 1:
        que.appendleft(C)
      elif order == -1:
        que.append(C)
    elif F == "2":
      if order == 1:
        que.append(C)
      elif order == -1:
        que.appendleft(C)
if order == 1:
  que_string = "".join(list(que))
  print(que_string)
else:
  que.reverse()
  que_string = "".join(list(que))
  print(que_string)

Measured memory_bytes: 8940
#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define M 1000000007
#define M2 998244353
#define ll long long
#define pll pair<long,long>
#define REP(i,a,b) for(ll i=a;i<b;i++)
#define REPI(i,a,b) for(ll i=b-1;i>=a;i--)
#define ff first
#define ss second
#define pb push_back
#define db pop_back
#define mp make_pair
#define mt make_tuple
#define g(a,b) get<a>(b)
#define INF (ll)1e18+5
#define ull unsigned long long
 
#define o_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define o_setll tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update>
//member functions :
//1. order_of_key(k) : number of elements strictly lesser than k
//2. find_by_order(k) : k-th element in the set
 
ll modI(ll a, ll m);
ll gcd(ll a, ll b);
ll powM(ll x, unsigned ll y, unsigned ll m);
void pairsort(int a[], int b[], int n);
void pairsortll(ll a[],ll b[],ll n);
ll logint(ll x,ll y);
 
 
ll gcd(ll x,ll y)
{
    if(x==0) return y;
    return gcd(y%x,x);
}
 
ll powM(ll x,ll y,ll m)
{
    if(y==0) return 1;
    ll p=powM(x,y/2,m)%m;
    p=(p*p)%m;
    return (y%2==0)?p:(x*p)%m;
}
 
ll modI(ll a, ll m)
{
   return powM(a, m-2, m);
}
 
void pairsort(int a[],int b[],int n)
{
    pair<int,int> v[n];
    REP(i,0,n)
    {
        v[i].ff=a[i];
        v[i].ss=b[i];
    }
    sort(v,v+n);
    REP(i,0,n)
    {
        a[i]=v[i].ff;
        b[i]=v[i].ss;
    }
}
 
void pairsortll(ll a[],ll b[],ll n)
{
    pair<ll,ll> v[n];
    REP(i,0,n)
    {
        v[i].ff=a[i];
        v[i].ss=b[i];
    }
    sort(v,v+n);
    REP(i,0,n)
    {
        a[i]=v[i].ff;
        b[i]=v[i].ss;
    }
}
 
ll logint(ll x,ll y)
{
    ll ans=0;
    ll a=1;
    for(ll i=0;i<=x;i++)
    {
        if(x<a)
        {
            return ans;
        }
        ans++;
        a*=y;
    }
    return -1;
}
const int N = 2e5+5;
/*ll parent[N];
ll siz[N];
vector<pair<ll, pair<ll, ll> > > v;
void make(){
    REP(i, 0, N){
        parent[i]=i;
        siz[i] = 1;
    }
}
ll find(ll x){
    while(parent[x] != x){
        x = parent[x];
    }
    return x;
}
void unite(ll a, ll b){
    a = find(a);
    b = find(b);
    if(a != b){
        if(siz[a] < siz[b]){
            swap(a, b);}
        parent[b] = a;
        if(siz[a] == siz[b]){
            siz[a]++;
        }
    }
}*/


int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    //cout<<(ull)pow(1024, 14);
    int n;
    cin>>n;
    REP(i, 1, 10){
        if(n%i == 0 && n/i < 10){cout<<"Yes"; return 0;}
    }
    cout<<"No";

}

Measured memory_bytes: 256
#include<iostream>
#include<stdio.h>
#include<string>
#include<vector>
#include<queue>
#include <cmath>
#include<algorithm>
#include<stack>
#include<map>
#include<ctime>
#define rep(i,n) for (int i=0;i<n;i++)
//#include <bits/stdc++.h>
using namespace std;

int main(){
    long int N;
    cin>>N;
    vector<long long> a(N),x(N);
    long long X;
    cin>>a[0];
    X=a[0];
    for (long int i=1;i<N;i++){
        cin>>a[i];
        X=X^a[i];
    }
    for (long int i=0;i<N;i++){
        x[i]=a[i]^X;
        cout<<x[i]<<" ";
    }
    cout<<endl;
    return 0;
}

Measured memory_bytes: 6320
import java.util.*;
import java.lang.*;

public class Main{
    public static void main(String args[]){
        Scanner scanner = new Scanner(System.in);
        int P = scanner.nextInt();
        int Q = scanner.nextInt();
        int R = scanner.nextInt();

        List<Integer> time = new ArrayList<>();
        time.add(P+Q);
        time.add(Q+R);
        time.add(R+P);

        System.out.println(Collections.min(time));

    }
}

Measured memory_bytes: 21844
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <cmath>
#include <unordered_map>
#include <climits>
using namespace std;

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

typedef long long int ll;

int SURP = 1000000007;

int ceil(int a,int b){
	return (a+b-1)/b;
}

struct task{
	int time;
	int limit;

	bool operator<(const task &a) const{
		return limit < a.limit;
	}
};

int main(){

	vector<task> P;
	int N;
	cin >> N;
	REP(i,N){
		int a,b;
		cin >> a >> b;
		task c;
		c.time = a;
		c.limit = b;
		P.push_back(c);
	}

	sort(P.begin(),P.end());
	int tot = 0;
	bool isWork = true;
	REP(i,N){
		tot += P[i].time;
		if(tot > P[i].limit) isWork = false;
	}
	if(isWork){
		cout << "Yes" << endl;
	}else{
		cout << "No" << endl;
	}

	return 0;
}


Measured memory_bytes: 2420
#!/usr/bin/env python3
import sys, math, fractions, itertools


def solve(N: int):
    print(str(N).count('2'))
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)

if __name__ == '__main__':
    main()


Measured memory_bytes: 5048
#include <cstring>
#include <cstdio>
int lst[200005], to[600005], pre[600005], tot;
int dega[200005], degb[200005];
int seq[300005], ans[200005], cnt;
bool del[300005];
inline void add_edge(int u, int v)
{
	to[tot] = v;
	pre[tot] = lst[u];
	lst[u] = tot++;
}
void work(int u)
{
	while (true)
	{
		int e = lst[u];
		if (e == -1)
			break;
		lst[u] = pre[e];
		if (del[e >> 1])
			continue;
		del[e >> 1] = true;
		work(to[e]);
		seq[cnt++] = e;
	}
}
int main()
{
	// freopen("AGC018-F.in", "r", stdin);
	memset(lst, -1, sizeof(lst));
	int n;
	scanf("%d", &n);
	for (int i = 0; i < n; i++)
	{
		int x;
		scanf("%d", &x);
		if (x == -1)
		{
			add_edge(n << 1, i);
			add_edge(i, n << 1);
		}
		else
		{
			dega[--x] ^= 1;
			add_edge(x, i);
			add_edge(i, x);
		}
	}
	for (int i = 0; i < n; i++)
	{
		int x;
		scanf("%d", &x);
		if (x == -1)
		{
			add_edge(n << 1, i + n);
			add_edge(i + n, n << 1);
		}
		else
		{
			degb[--x] ^= 1;
			add_edge(x + n, i + n);
			add_edge(i + n, x + n);
		}
	}
	for (int i = 0; i < n; i++)
	{
		if (dega[i] ^ degb[i])
		{
			puts("IMPOSSIBLE");
			return 0;
		}
		if (dega[i] ^ 1)
		{
			add_edge(i, i + n);
			add_edge(i + n, i);
		}
	}
	work(0);
	for (int i = 0; i < cnt; i++)
	{
		int u = to[seq[i] ^ 1], v = to[seq[i]];
		if (u < n && n <= v && v != n << 1)
			ans[u] = 1;
		if (v < n && n <= u && u != n << 1)
			ans[v] = -1;
	}
	puts("POSSIBLE");
	for (int i = 0; i < n; i++)
		printf("%d%c", ans[i], " \n"[i + 1 == n]);
	return 0;
}


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

struct Benri {
    Benri() {
        std::cin.tie(0); ios::sync_with_stdio(false);
        cout << fixed << setprecision(12);
    }
} benri;
template<class T>bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; }

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int, int>;
using vll = vector<long long>;
using pll = pair<ll, ll>;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define MOD 1000000007
#define MOD2 998244353



vi G[300010];
vi d(300010);

int main() {
    int N, M; cin >> N >> M;
    rep(i, M) {
        int u, v; cin >> u >> v;
        u--; v--;
        G[u].pb(N + v);
        G[N + u].pb(2 * N + v);
        G[2 * N + u].pb(v);
    }
    int S,T; cin >> S >> T;
    S--; T--;

    d.assign(3*N,-1);
    queue<int> q;
    q.push(S);
    d[S] = 0;
    int a;

    while(!q.empty()){
        a = q.front(); q.pop();
        for(auto b: G[a]){
            if(d[b] == -1){
                d[b] = d[a] + 1;
                q.push(b);
            }
        }
    }

    if(d[T] == -1) cout << -1 << endl;
    else cout << d[T] / 3 << endl; 





}




Measured memory_bytes: 17792
#include<iostream>
#include<vector>
using namespace std;
int main(){
    int N;
    cin >> N;
    vector<int> d(N);
    int i,j;
    for(i=0;i<N;i++){
        cin >> d.at(i);
    }
    for(i=0;i<N;i++){
        for(j=0;j<N-i-1;j++){
            if(d.at(j) < d.at(j+1)){
                int swap = d.at(j);
                d.at(j) = d.at(j+1);
                d.at(j+1) = swap;
            }
        }
    }
    int count = 1;
    for(i=0;i<N-1;i++){
        if(d.at(i) > d.at(i+1)){
            count++;
        }
    }
    cout << count << endl;
    return 0;
}

Measured memory_bytes: 3552
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

  public static void main(String[] args) throws IOException {
    
    try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {

      int q = Integer.parseInt(br.readLine());
      String[] query;
      MyList list = new MyList();

      for(int i=0; i<q; i++) {
        query = br.readLine().split(" ");
        switch( query[0] ) {
          case "0" :
            list.insert( Integer.parseInt(query[1]) );
            break;
          case "1" :
            list.move( Integer.parseInt(query[1]) );
            break;
          case "2" :
            list.erase();
            break;
          default :
            System.out.println("n:" + i + " is failed.");
        }
      }

      System.out.println ( list.getAllElements() );
    }
  }
}

class Node {
  Node next,prev;
  int key;

  public Node(int key) {
    this.key = key;
  }
}

class MyList {
  Node nil;
  Node current;
  int size;
  int p;

  public MyList() {
    nil = new Node(0);
    nil.next = nil.prev = nil;
    size = p = 0;
    
  }

  public String getAllElements() {
    StringBuilder buf = new StringBuilder(size*5);

    if(size > 0){
      current = nil.next;
      for(int i=0; i<size; i++){
        buf.append(current.key).append("\n");
        current = current.next;
      }
    }
    buf.setLength(buf.length()-1);

    return buf.toString();
  }
  public void insert(int x) {
    if(size == 0) {
      current = new Node(x);
      nil.next = current;
      nil.prev = current;
      current.prev = nil;
      current.next = nil;
      size++;
      p++;
    }
    else {
      Node add = new Node(x);
      
      current.prev.next = add;
      add.prev = current.prev;

      add.next = current;
      current.prev = add;

      current = add;
      size++;
    }
  }
  public void move(int d){
    if( d > 0 ) {
      for(int i=0; i<d; i++)
        current = current.next;
    } else if( d < 0 ) {
      for(int i=0; i>d; i--)
        current = current.prev;
    }

    p += d;
  }
  public void erase() {
      current.prev.next = current.next;
      current.next.prev = current.prev;
      current = current.next;
      size--;
  }
}


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

int main(int argc, const char * argv[]) {



    cin.tie(0);
    ios::sync_with_stdio(false);

    /////////////////////
    // Write code below /
    /////////////////////
    
    int r;


    cin >> r;

    cout<<2*r*M_PI<<endl;

    return 0;
}


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

dp = [[0]*(n+1) for i in range(n+1) ]
for cnt in range(1, n+1):
    i = 0
    while True:
        j = i + cnt
        if j-1 >= n:
            break
        dp[i][j] = max(a[i] - dp[i+1][j], a[j-1] - dp[i][j-1])
        i += 1
print(dp[0][n])

Measured memory_bytes: 112092
#include <iostream>
#include <string>
#include <algorithm>
#include <set>
#include <cmath>
#include <vector>

typedef long long ll;

using namespace std;

int main()
{
    ll n, k;

    cin >> n >> k;

    if (abs(n%k) != 0)
        cout << 1 << endl;
    else
        cout << 0 << endl;

    return 0;
}


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

using namespace std;

#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define FOR(i, a, b) for(int i=(a);i<(b);i++)
#define REP(i, n) FOR(i, 0, n)
#define RFOR(i, a, b) for(int i=(a);i>=(b);i--)
#define RREP(i, n) RFOR(i, n, 0)
#define MFOR(i, m) for(auto i=(m).begin();i!=(m).end();i++)
#define ALL(a) (a).begin(), (a).end()
#define SZ(x) ((int)(x).size())

typedef long long int ll;
typedef pair<int, int> P;
typedef pair<ll, ll> Pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef vector<vll> vvll;

const double eps = 1e-10;
const int MOD = 1000000007;
const int INF = 1000000000;
const ll LINF = 1 << 30;

template<typename T>
void printv(vector<T> const& s) {
  REP(i, SZ(s)) {
    cout << s[i] << " ";
  }
  cout << endl;
}

int main () {
  cin.tie(0);
  cout << setprecision(10);

  int n; cin >> n;

  vi table(100003, 0);
  REP(i, n) {
    int l, r;cin >> l >> r;
    table[l]++;
    table[r+1]--;
  }
  int ma = 0;
  REP(i, n+2) {
    table[i] += table[i-1];
    if(table[i]+1 >= i) {
      ma = i;
    }
  }

  cout << min(n, max(ma-1, 0)) << endl;
}



Measured memory_bytes: 3092
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
 
void lcs(std::string const& s, std::string const& t)
{
  std::vector<std::vector<int>> cache(s.size()+1, std::vector<int>(t.size()+1, 0));
  for (size_t ii = s.size(); ii > 0; --ii)
  {
    size_t i = ii - 1;
    for (size_t jj = t.size(); jj > 0; --jj)
    {
      size_t j = jj - 1;
      if (s[i] == t[j])
      {
        cache[i][j] = cache[i+1][j+1] + 1;
      }
      else
      {
        cache[i][j] = std::max(cache[i+1][j], cache[i][j+1]);
      }
    }
  }
  size_t i = 0, j = 0;
  while (i < s.size() && j < t.size())
  {
    if (s[i] == t[j])
    {   
      std::cout << s[i];
      ++i;
      ++j;
    }   
    else if (cache[i+1][j] >= cache[i][j+1])
    {   
      ++i;
    }   
    else
    {   
      ++j;
    }   
  }
}
 
int main()
{ 
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(0);
 
  std::string s, t;
  std::cin >> s >> t;
 
  lcs(s, t); 
 
  return 0;
}

Measured memory_bytes: 35584
use std::io;


fn main() {
    let (t, x) = {
        let i = read::<f64>();
        (i[0], i[1])
    };
    println!("{}", t / x);
}


#[allow(dead_code)]
fn read<T>() -> Vec<T>
where T:
std::str::FromStr,
T::Err: std::fmt::Debug {

    let mut buf = String::new();
    io::stdin().read_line(&mut buf).unwrap();
    buf.split_whitespace()
        .map(|s| s.trim().parse().unwrap())
        .collect()
}

#[allow(dead_code)]
fn read_one<T>() -> T
where T:
std::str::FromStr,
T::Err: std::fmt::Debug {

    let mut buf = String::new();
    io::stdin().read_line(&mut buf).unwrap();
    buf.trim().parse().unwrap()
}

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

typedef long long ll;
typedef vector<ll> vint;
typedef vector< vector<ll> > vvint;

#define rep(i,n) for(ll i=0;i<n;i++)
#define repf(i,f,n) for(ll i=f;i<n;i++)
#define repr(i,n) for(ll i=n-1;i>=0;i--)
#define mp make_pair
#define mt make_tuple
#define ALL(obj) (obj).begin(), (obj).end()
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

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


int main() {
    cout<<fixed<<setprecision(10);

    ll n; cin>>n;
    n = 100000 - n;
    cout<<n%1000<<endl;

    return 0;

}

Measured memory_bytes: 3628
#include "bits/stdc++.h"

#define REP(i, n) for (ll i = 0; i < ll(n); ++i)
#define RREP(i, n) for (ll i = ll(n) - 1; i >= 0; --i)
#define FOR(i, m, n) for (ll i = m; i < ll(n); ++i)
#define RFOR(i, m, n) for (ll i = ll(n) - 1; i >= ll(m); --i)
#define ALL(v) (v).begin(), (v).end()
#define UNIQUE(v) v.erase(unique(ALL(v)), v.end());
#define INF 1000000001ll
#define MOD 1000000007ll
#define EPS 1e-9

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

using namespace std;

using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vvl = vector<vl>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

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

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int d;
	cin >> d;
	cout << "Christmas";
	REP(i, 25 - d) cout << " Eve";
	cout << endl;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int time = scan.nextInt();
		int hour = time/3600;
		int min = time%3600/60;
		int sec = time%3600%60;

		System.out.println(hour + ":" + min + ":" + sec);
	}
}

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

int main() {
  int a,b;
  cin>>a>>b;
  for(int i=1;i<10000;i++){
    int c,d;
    c=0.08*i;
    d=0.1*i;
    if(a==c&&b==d){
      cout<<i<<endl;
      return 0;
    }
  }
  cout<<-1<<endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> Piont;

int arr[200000+10];
void inite(){
	for (int i = 0; i < 200000+10; ++i){
		arr[i] = i;
	}
}

int find(int idx){
	return arr[idx]==idx?idx:arr[idx] = find(arr[idx]);
}
bool merge(int a, int b){
	int x = find(a);
	int y = find(b);
	arr[x] = y;
	return x!=y;
}

main(){
	ios::sync_with_stdio(false);
	string s;
	while(cin>>s){
		cout << s[0] ;
		cout << s[1] ;
		cout << s[2] ;
		cout << "" << endl;
	}
}


Measured memory_bytes: 3656
using CompLib.Util;
using System;

public class Program
{

    public void Solve()
    {
        var sc = new Scanner();
        var a = sc.NextChar();
        var b = sc.NextChar();

        if (a < b)
        {
            Console.WriteLine("<");
        }
        else if (a == b)
        {
            Console.WriteLine("=");
        }
        else
        {
            Console.WriteLine(">");
        }
    }

    public static void Main(string[] args) => new Program().Solve();
}

namespace CompLib.Util
{
    using System;
    using System.Linq;
    class Scanner
    {
        private int _index;
        private string[] _line;
        const char separator = ' ';

        public Scanner()
        {
            _index = 0;
            _line = new string[0];
        }

        public string Next()
        {
            while (_index >= _line.Length)
            {
                _line = Console.ReadLine().Split(separator);
                _index = 0;
            }
            return _line[_index++];
        }
        public int NextInt() => int.Parse(Next());
        public long NextLong() => long.Parse(Next());
        public double NextDouble() => double.Parse(Next());
        public char NextChar() => Next()[0];
        public char[] NextCharArray() => Next().ToCharArray();

        public string[] Array()
        {
            _line = Console.ReadLine().Split(separator);
            _index = _line.Length;
            return _line;
        }
        public int[] IntArray() => Array().Select(int.Parse).ToArray();
        public long[] LongArray() => Array().Select(long.Parse).ToArray();
        public double[] DoubleArray() => Array().Select(double.Parse).ToArray();
    }
}

Measured memory_bytes: 13140
#include <iostream>
#include <vector>
using namespace std;
const long MOD = 10e8 + 7;
const int MAX = 2000;
long dp[MAX+1][MAX+1];
void make(){
    for(int i = 1; i <= MAX; ++i){
        for(int j = 0; j <= MAX; ++j){
            if(i == j || j == 0) dp[i][j] = 1;
            else {
                dp[i][j] = (dp[i-1][j] + dp[i-1][j-1]) % MOD;
            }
        }
    }
}

int main(){
    make();
    int N, K;
    cin >> N >> K;
    for(int i = 1; i <= K; ++i){
        if(K == 1) cout << 1 << endl;
        else if(!(i-1 <= N-K)) cout << 0 << endl;
        else {
            long long c = dp[N-K+1][i]*dp[K-1][i-1];
            c %= MOD;
            cout << c << endl;
        }
        
    }
    return 0;
}

Measured memory_bytes: 31488
#include<bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rep2(i, m, n) for(int i = (int)(m); i < (int)(n); i++)
#define rep_inv(i, n, m) for(int i = (int)(n); i > (int)(m); i--)
using namespace std;
using ll = long long;
using vl = vector<ll>;
using vc = vector<char>;
using vvl = vector<vl>;
using vvc = vector<vc>;
using pll = pair<ll, ll>;
using vpll = vector<pll>;

int main(){
  ll X, Y, A, B, C;
  cin >> X >> Y >> A >> B >> C;
  vl p(A), q(B), r(C);
  rep(i, A) cin >> p[i];
  rep(i, B) cin >> q[i];
  rep(i, C) cin >> r[i];

  stable_sort(p.begin(), p.end(), greater<ll>());
  stable_sort(q.begin(), q.end(), greater<ll>());
  stable_sort(r.begin(), r.end(), greater<ll>());

  vl pick(X + Y + C);
  rep(i, X) pick[i] = p[i];
  rep(i, Y) pick[X + i] = q[i];
  rep(i, C) pick[X + Y + i] = r[i];
  
  stable_sort(pick.begin(), pick.end(), greater<ll>());

  ll ans = 0;
  rep(i, X + Y) ans += pick[i];

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

Measured memory_bytes: 7288
import re

n = int(input())
s = input()
k = int(input())

keychar = s[k-1]
mask = "*"
mask2 = "1"

masked = re.sub(r'%s'%keychar, mask2, s)
masked = re.sub(r'[a-z]', mask, masked)
masked = re.sub(r'%s'%mask2, keychar, masked)
print(masked)


Measured memory_bytes: 3316
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<map>
#include<queue>
#define ll long long
#define maxn 200005
#define maxx 300005
#include<time.h>
#include<vector>
#include<list>
using namespace std;
int n;
int main()
{
    int ans=0;
    cin>>n;
    int x;
    for(int i=1;i<=n;i++)
    {
        scanf("%d",&x);
        ans^=x;
    }
    if(!ans)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <set>

using namespace std;

int main(){
	int N, M;
	while(cin >> N){
		set<string> S;
		for(int i=0;i<N;i++){
			string s; cin >> s;
			S.insert(s);
		}
		cin >> M;
		int open = 0;
		for(int i=0;i<M;i++){
			string s; cin >> s;
			if(S.count(s)){
				if(open) cout << "Closed by ";
				else     cout << "Opened by ";
				cout << s << endl;
				open = !open;
			} else {
				cout << "Unknown " << s << endl;
			}
		}
	}
}

Measured memory_bytes: 1232
#include <stdio.h>
#include <math.h>
int main(void)
{
    int a,s;
    scanf("%d",&a);
    s=a%10;
    if(s==3)
        printf("bon\n");
    else if((s==0)||(s==1)||(s==6)||(s==8))
        printf("pon\n");
    else
        printf("hon\n");
    return 0;
}


Measured memory_bytes: 2060
#include<bits/stdc++.h>
#define file(a) freopen(a".in","r",stdin);freopen(a".out","w",stdout)
using namespace std;
typedef long long ll;
long long f[200001][2];//到i位置选还是不选的方案数
int a[200011];
const int mod=1e9+7;
long long sum[200011];
main() {
	//file("a");
	int n;
	cin>>n;
	for(int i=1; i<=n; i++)
		cin>>a[i];
	f[0][0]=1;
	for(register int i=1; i<=n; i++) {
		if(a[i]==a[i-1]) {
			f[i][0]=f[i-1][0],f[i][1]=f[i-1][1];
			continue;
		}
		f[i][0]=(f[i-1][1]+f[i-1][0])%mod;
		f[i][1]=sum[a[i]];
		sum[a[i]]=f[i][1]+f[i][0],sum[a[i]]%=mod;
	}
	cout<<(f[n][1]+f[n][0])%mod;
	return 0;
}

Measured memory_bytes: 5760
#include<cstdio>
#include<iostream>
#define re register int
#define Starseven main
#define ll long long
using namespace std;
const int N=20;
ll a[N];

ll Dfs(int l,int r,int x,int y){
	if(l+1>=r) return 0;
	ll ans=100000000000000000;
	for(re i=l+1;i<=r-1;i++)
		ans=min(ans,Dfs(l,i,x,x+y)+Dfs(i,r,x+y,y)+a[i]*(x+y));
	return ans;	
}

int Starseven(void){
	int n;
	cin>>n;
	for(re i=1;i<=n;i++) cin>>a[i];
	cout<<a[1]+a[n]+Dfs(1,n,1,1)<<endl;
	return 0;
}

Measured memory_bytes: 384
import collections
import bisect
n,m = map(int, input().split())
p = [list(map(int,input().split())) for i in range(m)]
a = collections.defaultdict(list)
for x,y in sorted(p):
  a[x]+=[y]
for x,y in p:
  print("%06d%06d"%(x,bisect.bisect(a[x],y)))

Measured memory_bytes: 43324
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
  ll n,a[10000];
  cin>>n;
  for(ll i=0;i<n;i++)cin>>a[i];
  sort(a,a+n);
  ll ans=1;
  for(ll i=0;i<n;i++)
    if(ans>=a[i])ans+=a[i];
    else break;
  cout<<ans<<endl;
  return 0;
}

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

char dfs(char nxt, string &A, string &B, string &C, int &acnt, int &bcnt, int &ccnt)
{
    char res;
    if(nxt == 'a')
    {
        acnt++;
        if(acnt == A.length()) return 'A';
        res = dfs(A[acnt], A, B, C, acnt, bcnt, ccnt);
    }
    else if(nxt == 'b')
    {
        bcnt++;
        if(bcnt == B.length()) return 'B';
        res = dfs(B[bcnt], A, B, C, acnt, bcnt, ccnt);
    }
    else if(nxt == 'c')
    {
        ccnt++;
        if(ccnt == C.length()) return 'C';
        res = dfs(C[ccnt], A, B, C, acnt, bcnt, ccnt);
    }
    return res;
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    string A, B, C;
    cin >> A >> B >> C;

    int acnt = 0;
    int bcnt = -1;
    int ccnt = -1;

    cout << dfs('a', A, B, C, acnt, bcnt, ccnt) << endl;

    return 0;
}


Measured memory_bytes: 3652
N = int(input())
H = list(map(int,input().split()))

H.reverse()

count = 0
for i in range(N):
    count_tmp = 0
    for j in range(i+1,N):
        if H[i] < H[j]:
            count_tmp += 1
            break
    if count_tmp == 0:
        count += 1

print(count)

Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,z,i,o=0,f=0;
  cin>>n;
  for(i=0;i<n;i++){
    cin>>z;
    if(z%2==1) o++;
    else if(z%4==0) f++;
  }
  if(o<=f) cout<<"Yes"<<endl;
  else if(o+f==n&&f==o-1) cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
}

Measured memory_bytes: 3584
#include<bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
typedef long long ll;
#define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
#define REP(i,num,n) for(ll i=num, i##_len=(n); i<i##_len; ++i)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
#define print(x) cout << (x) << endl;
#define pb push_back
#define mp make_pair
#define sz(x) int(x.size())
 
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
const int INF = 1e9;
const ll LLINF = 1e16;

template<typename T>
vector<T> make_v(size_t a){return vector<T>(a);}

template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}

template<typename T,typename U,typename... V>
typename enable_if<is_same<T, U>::value!=0>::type
fill_v(U &u,const V... v){u=U(v...);}

template<typename T,typename U,typename... V>
typename enable_if<is_same<T, U>::value==0>::type
fill_v(U &u,const V... v){
  for(auto &e:u) fill_v<T>(e,v...);
}
 
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, -1, 1, -1};

int main(void){
    cout.tie(0);
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout<<fixed<<setprecision(10);
    int x,y;
    cin >> x >> y;
    if(x == 1 && y == 1){
      print(1000000);
      return 0;
    }
    int ans = 0;
    if(x == 1) ans += 300000;
    if(x == 2) ans += 200000;
    if(x == 3) ans += 100000;
    if(y == 1) ans += 300000;
    if(y == 2) ans += 200000;
    if(y == 3) ans += 100000;
    print(ans);
}


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

int main(void){
    //整数Nを読み込む
    int N;
    scanf("%d",&N);

    //Nがtrueかチェックするための配列を用意し、\0で初期化する
    char a[101] = {'\0'};

    //a[4]とa[7]はtrueとして、1を代入する
    a[4] = '1';
    a[7] = '1';

    //for文を回し、a[i-4]もしくはa[i-7]が1の場合はa[i]をtrueとして、1にする
    for(int i = 7;i<=100;i++){
        if(a[i - 4] == '1' || a[i - 7] == '1'){
            a[i] = '1';
        }
    }

    //もしa[N]が1ならYes、それ以外ならNoと出力する
    if(a[N] == '1'){
        printf("Yes\n");
    }else{
        printf("No\n");
    }
    
    return 0;
}

Measured memory_bytes: 128
N = int(input())
H = [int(x) for x in input().split()]
array = [0] * N
ans = 0
cnt = 0
for i in range(N - 1):
    if H[i] >= H[i + 1]:
        array[i] = 1

for j in array:
    if j == 1:
        cnt += 1
    else:
        if ans <= cnt:
            ans = cnt
        cnt = 0

print(ans)

Measured memory_bytes: 14228
package main

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

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

func main() {
	sc.Split(bufio.ScanWords)
	defer out.Flush() // !!!!coution!!!! you must use Fprint(out, ) not Print()
	/* --- code --- */
	L := nextFloat64()
	fmt.Printf("%.8v\n", L/3*L/3*L/3)
}

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

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

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

func nextInt64() int64 {
	a, _ := strconv.ParseInt(next(), 10, 64)
	return a
}

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

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

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

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

// -*-*-*-*-*-*-*-*-
// * tool snippets *
// -*-*-*-*-*-*-*-*-
func duplicate2Int(base [][]int) (ret [][]int) {
	ret = make([][]int, len(base))
	for i, v := range base {
		ret[i] = append([]int{}, v...)
	}
	return
}

// -*-*-*-*-*-*-*-*-*-*-*-*-*-
// * Algorithms Utility Zone *
// -*-*-*-*-*-*-*-*-*-*-*-*-*-

// -*-*-*-*-*-*-*-
// * 1. nibutan  *
// -*-*-*-*-*-*-*-
func lower_bound(arr []int, target int) int {
	l, r := 0, len(arr)
	for l < r {
		mid := (l + r) / 2
		if arr[mid] < target {
			l = mid + 1
		} else {
			r = mid
		}
	}
	return l
}

func upper_bound(arr []int, target int) int {
	l, r := 0, len(arr)
	for l < r {
		mid := (l + r) / 2
		if target < arr[mid] {
			r = mid
		} else {
			l = mid + 1
		}
	}
	return l
}

// *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
// * math flavor typical theories *
// *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
func gcd(a, b int) int {
	if a > b {
		return gcd(b, a)
	}
	for a != 0 {
		a, b = b%a, a
	}
	return b
}

func pow(a, b int) (ret int) {
	ret = a
	// 10^2 = 100ってことは10に10を1回掛けることだね
	// なので初期値を含めると上限b-1未満
	for i := 0; i < b-1; i++ {
		ret *= a
	}
	return
}

func powMod(n, m, mod int) (ret int) {
	ret = 1
	for m > 0 {
		if m&1 == 1 {
			ret *= n
			ret %= mod
		}
		n *= n
		n %= mod
		m >>= 1
	}
	return ret
}


Measured memory_bytes: 640
#include <cstdio>
#include <iostream>
#define MOD 1000000007
using namespace std;
long long rez=1;
int n;
int main()
{
    cin>>n;
    for(int i=2;i<=n;i++)
    {
        rez=(1LL*rez*i)%MOD;
    }
    cout<<rez;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define IOS                  \
    ios::sync_with_stdio(0); \
    cin.tie(0);              \
    cout.tie(0)
#define rep(i, a, b) for (int i = a; i < (b); ++i)
#define repd(i, a, b) for (int i = a; i >= (b); --i)
#define all(x) (x).begin(), (x).end()
#define sz(x) (int)(x).size()
typedef long long ll;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3fll;

int main()
{
    int n, a, b;
    cin >> n >> a >> b;
    vector<int> h(n);
    rep(i, 0, n) cin >> h[i];
    sort(all(h));
    int lb = 0, ub = h[n - 1];
    while (lb != ub)
    {
        ll t = (lb + ub) / 2;
        if (t == lb)
            break;
        ll count = 0;
        rep(i, 0, n)
        {
            if (h[i] > t * b)
                count += (h[i] - t * b) / (a - b) + ((h[i] - t * b) % (a - b) != 0);
        }
        if (count > t)
            lb = t;
        else
            ub = t;
    }
    cout << ub << endl;
}


Measured memory_bytes: 3784
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG //GCC5.4.1で配列の範囲外アクセスをエラーにする

//cmdで g++ test.cpp とするとコンパイルできる
//制限1秒なら10^6は余裕 10^7は多分間に合う 10^8はよほど単純でないと厳しい

typedef long long ll; //long long
typedef pair<int,int> pii; //pair<int,int>
typedef vector<int> vi; //vector<int>
typedef vector<vector<int>> vvi; //vector<vector<int>>
typedef vector<ll> vll; //vector<long long>
typedef vector<vector<ll>> vvll; //vector<vector<long long>>

//const int MOD=998244353;
const int MOD=1000000007; //10^9+7
const double PI=3.1415926535;

int main(){
    int N;
    cin>>N;
    vll A(N+1);
    vll B(N);
    for(int i=0;i<N+1;i++)cin>>A[i];
    for(int i=0;i<N;i++)cin>>B[i];
    ll ans=0;
    for(int i=0;i<N;i++){
        ll k;
        k=min(B[i],A[i]);
        B[i]-=k;
        ans+=k;
        k=min(B[i],A[i+1]);
        B[i]-=k;
        A[i+1]-=k;
        ans+=k;
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 1792
package main

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

const (
	initialBufSize = 10000
	maxBufSize     = 100000000
)

var sc *bufio.Scanner = func() *bufio.Scanner {
	sc := bufio.NewScanner(os.Stdin)
	buf := make([]byte, initialBufSize)
	sc.Buffer(buf, maxBufSize)
	return sc
}()

func scanIntNum() (num int) {
	sc.Scan()

	num, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return num
}

func main() {
	N := scanIntNum()

	var ans int
	for i := 1; i <= N; i++ {
		if (i%3 != 0) && (i%5 != 0) {
			ans += i
		}
	}
	fmt.Println(ans)
}


Measured memory_bytes: 1760
import copy

def j(n):
    if n:print("yes")
    else:print("no")
    exit(0)
rem = 10 ** 9 + 7

"""
def ct(x,y):
    if (x>y):print("+")
    elif (x<y): print("-")
    else: print("?")
"""

def ip():
    return int(input())
def iprow():
    return [int(i) for i in input().split()]
def ips():
    return (int(i) for i in input().split())
def ipmultiplerow(n):
    a = []
    for i in range(n):
        a.append(ip())
    return a
def printrow(a):
    for i in a:
        print(i)

n = ip()
if n%2:
    a = n//2+1
else:
    a = n//2
print(a/n)

Measured memory_bytes: 3444
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repi(i, n) for (int i = 0; i <= (n); i++)
#define all(x) (x).begin(), (x).end()
typedef long long ll;
using namespace std;

int main() {
    string b;
    cin >> b;
    if(b == "A"){
      cout << "T" << endl;
    } else if(b=="T"){
        cout << "A" << endl;
    } else if (b == "C") {
        cout << "G" << endl;
    } else if (b == "G") {
        cout << "C" << endl;
    }
}

Measured memory_bytes: 256
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author maheshwari29
*/public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		OutputWriter out = new OutputWriter(outputStream);
		AMultiplication1 solver = new AMultiplication1();
		solver.solve(1, in, out);
		out.close();
	}
static class AMultiplication1   {
public void solve(int testNumber, InputReader in, OutputWriter out) {
       int i,j;
       int a=in.ni();
       int b=in.ni();
       out.println(a*b);
    }

}
static class InputReader   {
private InputStream stream;
private byte[] buf = new byte[1024];
private int curChar;
private int numChars;
private InputReader.SpaceCharFilter filter;

public InputReader(InputStream stream) {this.stream = stream; }

public int read() { if (numChars == -1) { throw new InputMismatchException();}if (curChar >= numChars) { curChar = 0;try { numChars = stream.read(buf); } catch (IOException e) { throw new InputMismatchException(); }if (numChars <= 0) { return -1; } }return buf[curChar++]; }

public int ni() { int c = read();while (isSpaceChar(c)) { c = read(); }int sgn = 1;if (c == '-') { sgn = -1;c = read(); }int res = 0;do { if (c < '0' || c > '9') { throw new InputMismatchException(); }res *= 10;res += c - '0';c = read(); } while (!isSpaceChar(c));return res * sgn; }

public boolean isSpaceChar(int c) { if (filter != null) { return filter.isSpaceChar(c); }return isWhitespace(c); }

public   static boolean isWhitespace(int c) { return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1; }

public interface SpaceCharFilter   {
public boolean isSpaceChar(int ch);

}

}
static class OutputWriter   {
private   final PrintWriter writer;

public OutputWriter(OutputStream outputStream) { writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream))); }

public OutputWriter(Writer writer) { this.writer = new PrintWriter(writer);}

public void close() { writer.close(); }

public void println(int i) { writer.println(i); }

}
}



Measured memory_bytes: 32484