akhauriyash/Code-Regression huggingface dataset:
#include<stdio.h>
int main()
{
	char a,b,c,d,e,f;
	scanf("%c %c %c %c %c %c",&a,&b,&c,&d,&e,&f);
	if(a==f&&b==e&&c==d){
		printf("YES\n");
	}
	else{
		printf("NO\n");
	}
	return 0;
}


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

signed main(){
	int a[3];

	cin >> a[0] >> a[1] >> a[2];

	sort(a, a + 3);

	cout << a[0] << " " << a[1] << " " << a[2] << endl;
	return 0;
}



Measured memory_bytes: 3140
#include <bits/stdc++.h>
using namespace std;
using lint     = long long;
const lint inf = 1LL << 60;
const lint mod = 1000000007;

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    lint n, a, b;
    cin >> n >> a >> b;
    string s;
    cin >> s;
    int tot = 0;
    int abr = 0;
    for (int i = 0; i < n; ++i) {
        if (s[i] == 'a') {
            if (tot < a + b) {
                cout << "Yes"
                     << "\n";
                tot++;
            } else
                cout << "No"
                     << "\n";
        } else if (s[i] == 'b') {
            if (tot < a + b && abr < b) {
                cout << "Yes"
                     << "\n";
                tot++;
                abr++;
            } else
                cout << "No"
                     << "\n";
        } else
            cout << "No"
                 << "\n";
    }
    return 0;
}

Measured memory_bytes: 848
using System;
using System.Collections.Generic;
class Program
{
	static void Main(string[] args)
	{
		string[] str = Console.ReadLine().Split();
		int A = int.Parse(str[0]);
		int B = int.Parse(str[1]);
		int ans = 0;
		if(A>B){
			ans = A*2-1;
		} else if(B>A){
			ans = B*2-1;
		} else {
			ans = A+B;
		}
		Console.WriteLine(ans);
	}
}


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

#define cnd(c, a, b) (c ? a : b);
#define fl(x,y,z) for(int x=y;x<z;x++)
#define fe(x,y,z) for(int x=y;x<=z;x++)
#define fge(x,y,z) for(int x=y;x>=z;x--)

#define debug(x) std::cerr << #x << " --> " << x << "\n";
#define fastIO std::ios_base::sync_with_stdio(false);std::cin.tie(0);std::cout.tie(0);
#define pb push_back
#define pob pop_back
 
#define ln '\n'
typedef long long int ll;

ll mod=1e9+7;

void decrypt() {
	ll n;
	ll x, m;

	ll size;
	unordered_map<ll, ll> mp;
	vector<ll> vec, csum;

	cin>>n;
	cin>>x>>m;
	ll cval, val;
	cval = x;
	val = (cval*cval)%m;
	size = 0;
	ll flag = 0;
	while(mp.find(cval)==mp.end()) {
		mp[cval] = size;
		if(cval==0) {
			flag = 1;
		}
		vec.pb(cval);
		if(size==0) {
			csum.pb(cval);
		}
		else {
			csum.pb(csum[size-1] + cval);
		}
		size++;
		cval = val;
		val = (cval*cval)%m;
	}
	ll ind = mp[cval];
	// cout<<"DE: "<<cval<<" "<<ind<<ln;
	// fl(i,0,size) {
	// 	cout<<vec[i]<<" ";
	// }
	// cout<<ln;
	// fl(i,0,size) {
	// 	cout<<csum[i]<<" ";
	// }
	// cout<<ln;
	ll ans;
	ll asize = size-ind;
	// cout<<"DE:asize "<<asize<<ln;
	if(n>size) {
		ans = csum[size-1];
		n -= size;
		ll minval = (ind==0 ? 0 : csum[ind-1]);
		ans += (n/asize)*(csum[size-1]-minval);
		if(n%asize>0) {
			ans += csum[(n%asize)-1+ ind] - minval;
		}
	} else {
		ans = csum[n-1];
	}
	cout<<ans<<ln;
	return;
}

int main() {
    fastIO
    int t = 1;
    // cin >> t;
    fl(i,0,t) {
    	// cout << "Case #"<< i+1 <<": ";
    	decrypt();
    }
    return 0;
}

Measured memory_bytes: 6060
# # Make IO faster
# import sys
# input = sys.stdin.readline

# # get single (or) multiple str
# X = input()

# # get single int
# N = int(input())
# # get multiple int (e.g., 2)
# X, Y = map(int, input().split())
# # get multiple int (e.g., 2) for N lines
# XY = [list(map(int, input().split())) for _ in range(N)]

# from IPython import embed; embed(); exit();

# 全部入り
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
import numpy as np
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

r, g, b = MAP()
num = g * 10 + b
if num % 4 == 0:
    print("YES")
else:
    print("NO")


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

int n, res;
int h[100010], ans[100010];

int main() {
	cin >> n;
	for (int i = 0; i < n; ++i)
		cin >> h[i];
	for (int i = n-2; ~i; --i) {
		if (h[i] >= h[i+1])
			res = max(res, ans[i] = ans[i+1]+1);
	}
	cout << res;
}


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

using namespace std;

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	int n,k;
	cin >> n >> k;
	vector<int> a(n);
	for (int i = 0 ; i < n ; i++)
		cin >> a[i];
	vector<bool> dp(k + 5);
	for (int stone = 0 ; stone <= k ; stone++)
	{
		for (int x : a) // Foreach stones in array a
		{
			if (x <= stone && !dp[stone-x])
			{
				dp[stone] = true;
			} 			
		}
	}
	cout << (dp[k] ? "First" : "Second") << "\n";
	return 0;
}


/*
 	dp[i]: True if player 1 win with i stones remaining
    The relation is: if (current x <= i remaining stones AND dp[remaining stones] = false) dp[i] = true
    Why dp[stone-x] needs to be false: because after stone - x the turn will change to the player 2 and if dp[stone-x] = false is mean that player 2 loose => player 1 win
 */

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cstdio>
#include <vector>
#include <queue>
#include <algorithm>
#include <numeric>
#include <math.h>
#include <stdio.h>
#define MOD 1000000007

int i;

struct edge {
    int to;
    int cost;
};

typedef long long ll;
using namespace std;
using P = pair<int, int>;


int main(void) {
    int a,b;
    cin >> a >> b;
    if(a>=13){
        cout << b << endl;
    }else if(a>=6){
        cout << b/2 << endl;
    }else{
        cout << 0 << endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
 
const double EPS = 1e-10;
const ll INF = 100000000;
const ll MOD = 1000000007;

int n;
int a[200000];
int p[32];
map<int, int> m;

int main() {
    cin >> n;
    rep(i,n) {
        cin >> a[i];
        m[a[i]]++;
    }
    sort(a, a+n, greater<int>());
    for (int i = 0; i <= 31; i++) {
        p[i] = (1<<i);
    }
    ll ans = 0;
    rep(i,n) {
        if (m[a[i]] == 0) continue;
        m[a[i]]--;
        for (int j = 0; j < 31; j++) {
            if (p[j] <= a[i]) continue;
            if (m[p[j]-a[i]] > 0) {
                ans++;
                m[p[j]-a[i]]--;
            }
            break;
        }
    }
    cout << ans << endl;
}



Measured memory_bytes: 19712
/// Code By t_bone_289 (Tushar Singh)
/// An Immature Programmer.... I'm still developing !!
#include<bits/stdc++.h>
using namespace std;
#define pll pair<ll,ll>
#define fi first
#define se second
#define mp make_pair
#define pb push_back
typedef long long ll;
typedef double d;
int main()
{
    ll n,x;
    cin>>n>>x;
    vector<ll> v(n,0);
    ll sum=0;
    for(ll i=0;i<n;i++)
    {
        cin>>v[i];
        sum+=v[i];
    }
    sort(v.begin(),v.end());
    x-=sum;
    ll ans=n+(x/v[0]);
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
	"strings"
	"unsafe"
)

func main() {
	N := sc.nextInt()
	arr := []int{1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51}
	fmt.Println(arr[N-1])
}

var (
	sc scanner
)

func init() {
	sc = scanner{
		buf: make([]string, 0, 0),
		cur: 0,
		r:   bufio.NewReader(os.Stdin),
	}
}

type scanner struct {
	buf []string
	cur int
	r   *bufio.Reader
}

func (s *scanner) readln() {
	rbuf := make([]byte, 0, 0)
	for {
		line, prefix, err := s.r.ReadLine()
		if err != nil {
			panic(err)
		}
		rbuf = append(rbuf, line...)
		if prefix == false {
			break
		}
	}
	s.cur = 0
	s.buf = strings.Split(*(*string)(unsafe.Pointer(&rbuf)), " ")
}
func (s *scanner) isFull() bool {
	if s.cur == len(s.buf) {
		return true
	}
	return false
}
func (s *scanner) resetCur() {
	s.cur = 0
}
func (s *scanner) next() string {
	if s.cur == 0 {
		s.readln()
	}
	res := s.buf[s.cur]
	s.cur++
	if s.isFull() {
		s.resetCur()
	}
	return res
}
func (s *scanner) nexts() []string {
	s.readln()
	s.resetCur()
	return s.buf
}
func (s *scanner) nextInt() int {
	if s.cur == 0 {
		s.readln()
	}
	res, _ := strconv.Atoi(s.buf[s.cur])
	s.cur++
	if s.isFull() {
		s.resetCur()
	}
	return res
}
func (s *scanner) nextInts() []int {
	s.readln()
	res := make([]int, len(s.buf))
	for i := range s.buf {
		res[i], _ = strconv.Atoi(s.buf[i])
	}
	s.resetCur()
	return res
}
func (s *scanner) nextFloat() float64 {
	if s.cur == 0 {
		s.readln()
	}
	res, _ := strconv.ParseFloat(s.buf[s.cur],
		64)
	s.cur++
	if s.isFull() {
		s.resetCur()
	}
	return res
}
func (s *scanner) nextFloats() []float64 {
	s.readln()
	res := make([]float64, len(s.buf))
	for i := range s.buf {
		res[i], _ = strconv.ParseFloat(s.buf[i],
			64)
	}
	s.resetCur()
	return res
}
func digits(x int) int {
	return len(strconv.Itoa(x))
}
func powInt(x, p int) (result int) {
	result = 1
	for i := 0; i < p; i++ {
		result *= x
	}
	return
}
func max(x, y int) int {
	return int(math.Max(float64(x), float64(y)))
}
func min(x, y int) int {
	return int(math.Min(float64(x), float64(y)))
}
func abs(x int) int {
	return int(math.Abs(float64(x)))
}
func varDump(value ...interface{}) {
	for _, v := range value {
		fmt.Fprintf(os.Stderr, "%#v\n", v)
	}
}
func yes() {
	fmt.Println("Yes")
}
func no() {
	fmt.Println("No")
}

// Pair a
type Pair struct {
	first  int
	second int
}

// Queue a
type Queue struct {
	v []Pair
}

// Push for queue
func (q *Queue) Push(v Pair) {
	q.v = append(q.v, v)
}

// Pop for queue
func (q *Queue) Pop() Pair {
	r := q.v[0]
	q.v = q.v[1:]
	return r
}

// Front for queue
func (q Queue) Front() Pair {
	return q.v[0]
}

// Empty return true if empty
func (q Queue) Empty() bool {
	return len(q.v) == 0
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 

using namespace __gnu_pbds; 
using namespace std;
using   ll=long long;
using   ld=long double;

#define fast        	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define ordered_set 	tree<pll, null_type,less<pll>, rb_tree_tag,tree_order_statistics_node_update>

#define endl        	"\n"
#define pb          	push_back
#define mp          	make_pair
#define F           	first
#define S           	second
#define int             long long int

#define ALL(v)      	v.begin(),v.end()
#define ALLR(v)     	v.rbegin(),v.rend()
#define pii         	3.14159265358979323
#define inf     		LLONG_MAX
#define ones(x)     	__builtin_popcount(x)
#define fill(a,b)   	memset(a,b,sizeof(a))
#define mod 			1000000007

ll mod_pow(ll a,ll b) {
    ll res = 1;
    while(b)	
    {
        if(b&1) 	
        {
        	res=(res*a)%mod;
        }
        a=(a*a)%mod;
        b>>=1;
    }
    return res;
}

ll mod_inverse(ll a) {
	return mod_pow(a , mod-2);
}

void solve() {
	
	int n , k , s;
	
	cin >> n >> k >> s;
	
	int a[n];
	
	
	for(int i = 0; i < k; ++i) {
		a[i] = s;
	}
	
	s--;
	
	if(s == 0) {
		s += 2;
	}
	
	for(int i = k; i < n; ++i) {
		a[i] = s;
	}
	
	for(int i = 0 ;i < n; ++i) {
		cout << a[i] << " ";
	}
}

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


Measured memory_bytes: 4416
#include "bits/stdc++.h"
 
typedef long long ll;
#define int ll
#define fi first
#define se second
#define SORT(a) sort(a.begin(),a.end())
#define rep(i,n) for(int i = 0;i < (n) ; i++) 
#define REP(i,n) for(int i = 0;i < (n) ; i++) 
#define MP(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define INF LLONG_MAX/2

using namespace std;
int MOD = 1000000007;


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

    int a[100010];
    int b[100010];
    rep(i,n) cin >> a[i];
    rep(i,n) cin >> b[i];
    int sa[100010];
    rep(i,n) sa[i] = a[i] - b[i];
    sort(sa,sa+n);

    int all = 0;
    rep(i,n) all += sa[i];
    if(all < 0){
        cout << -1 << endl;
        return 0;
    }
    int ans = 0;
    int low = 0;
    int pool = 0;
    for(int i = n-1;i >= 0;i--){
        if(sa[low] >= 0){
            cout << ans << endl;
            return 0;
        }
        pool += sa[i];
        ans++;

        while(1){
            if(sa[low] < 0){
                if(pool + sa[low] >= 0){
                    ans++;
                    pool += sa[low];
                    low++;
                }else{
                    sa[low] += pool;
                    pool = 0;
                    break;
                }
            }else{
                cout << ans << endl;
                return 0;
            }
        }
    }   


    return 0;
}
// g++ -std=c++14 code1.cpp
// rm -r -f test;oj dl 
// rm -r -f test;oj dl http://arc074.contest.atcoder.jp/tasks/arc074_b

Measured memory_bytes: 2560
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>

// increment
#define rep_n(_1, _2, _3, NAME, ...) NAME
#define rep_2(i, n) for (int(i) = 0; (i) < (int)(n); ++(i))
#define rep_3(i, initial, n) for (int(i) = (int)(initial); (i) < (int)(n); ++(i))
#define rep(...) rep_n(__VA_ARGS__, rep_3, rep_2, rep_1)(__VA_ARGS__)
// decrement
#define rep_r_n(_1, _2, _3, NAME, ...) NAME
#define rep_r_2(i, n) for (int(i) = (int)(n); (i) > 0; (i)--)
#define rep_r_3(i, initial, n) for (int(i) = (int)(initial); (i) > (int)(n); (i)--)
#define rep_r(...) rep_r_n(__VA_ARGS__, rep_r_3, rep_r_2)(__VA_ARGS__)
// define type definition
using namespace std;
typedef long long ll;
using mpint = boost::multiprecision::cpp_int; // 多倍長整数（任意精度）
typedef pair<int, int> P;

// define construct variable
const double EPS = numeric_limits<double>::epsilon();
// 10^9 + 7
const ll MOD = ll(1e9) + 7;
const ll INF = ll(1e10);
const string ALPHABET = "abcdefghijklmnopqrstuvwxyz";
const double PI = acos(-1);

// define methods
// 最大公約数
ll gcd(const ll a, const ll b) { return b ? gcd(b, a % b) : a; }
// 最小公倍数
ll lcm(const ll a, const ll b) { return a / gcd(a, b) * b; }
// char -> int
int ctoi(char c) { return (int)(c - '0'); }
// 素因数分解
vector< pair<ll, ll> > prime_factorize(ll n)
{
	vector< pair<ll, ll> > p;
	for (ll i = 2; i * i <= n; i++)
	{
		if ((n % i) != 0)
			continue;
		pair<ll, ll> a = make_pair(i, 0);
		while ((n % i) == 0)
		{
			n /= i;
			a.second += 1;
		}
		p.push_back(a);
	}

	if (n != 1)
		p.push_back(make_pair(n, 1));
	return p;
}
// 組み合わせの整合性を保つ（後ほど解析する）
ll modinv(ll a)
{
	ll b = MOD, u = 1, v = 0;
	while (b)
	{
		ll t = a / b;
		a -= t * b;
		swap(a, b);
		u -= t * v;
		swap(u, v);
	}
	u %= MOD;
	if (u < 0)
	{
		u += MOD;
	}
	return u;
}
// 順列
ll permutation(const ll n, const ll m)
{
	ll result = 1;
	for (ll i = n; i > n - m; i--)
	{
		result = (result * i) % MOD;
	}
	return result;
}

// 繰り返し n 乗法
ll repeat_square(const ll n, const ll x)
{
	if (x == 0)
		return 1;
	ll res = repeat_square(n, x / 2);
	res = res * res % MOD;
	if ((x % 2) == 1)
		res = res * n % MOD;
	return res;
}
// 組み合わせ nCm
ll combination(ll n, ll m)
{
	ll p = permutation(n, m);
	ll div = 1;
	for (ll i = 2; i <= m; i++)
	{
		div = (div * i) % MOD;
	}
	return (p * modinv(div)) % MOD;
}

int main() {
	int N, M;
	cin >> N >> M;
	map<ll, ll> s; // 店
	rep(i, N) {
		ll a;
		int b;
		cin >> a >> b;
		s[a] += b;
	}

	ll ans = 0;
	for(auto itr : s) {
		ll price = itr.first;
		ll stack = itr.second;
		if (M == 0) break;

		if (M - stack >= 0) {
			ans += (itr.first * stack);
			M -= stack;
			continue;
		}
		rep(j, stack) {
			ans += itr.first;
			M -= 1;
			if (M == 0) {
				cout << ans << endl;
				return 0;
			}
		}
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 6528
import java.util.Scanner;

class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.nextLine();
        //sc.nextLine();
        //sc.close();
        String[] a  = str.split(" ");
        int A = Integer.parseInt(a[0]);
        int P = Integer.parseInt(a[1]);

        int ap = ( ( A * 3 ) + P )/ 2;
    
        System.out.println(ap);
    } 
}   

Measured memory_bytes: 20688
#include<bits/stdc++.h>
using namespace std;
#define se second
#define fi first
#define ll long long
#define ld long double
#define pll pair<ll ,ll >
#define plll pair<ll,pll>
#define ppll pair<pll, pll>
#define pii pair<int, int> 
#define pb push_back
#define mod 1000000007
#define N 2000007
ll power(ll a,ll b){
    ll res=1ll;
    while(b>0){
        if(b%2!=0) res=(res*a)%mod;
        a=(a*a)%mod;
        b/=2;
    }
    return res%mod;
}
ll ncr(ll n,ll k){
    if(k>n-k) k=n-k;
    ll pro=1;
    for(ll i=0;i<k;i++){
        pro=(pro*(n-i))%mod;
        pro/=(i+1);
    }
    return (pro)%mod;
}

void swap(ll *a,ll *b) {
    ll temp=*a;
    *a=*b;
    *b=temp;
}
vector<ll> prime;
void seive(){
    vector<bool > isprime(1000001,true);
    for(int i=2;i*i<=1000000;i++){
        if(isprime[i]){
            for(int j=i*i;j<=1000000;j+=i){
                isprime[j]=false;
            }
        }
    }
    for(int i=2;i<=1000000;i++){
        if(isprime[i]) prime.push_back(i);
    }
}
vector<ll> parent;
ll find(ll p) {
    if(parent[p]==p) return parent[p];
    return parent[p]=find(parent[p]); 
}
void unun(ll a,ll b) {
    ll r1=find(a);
    ll r2=find(b);
    if(r1!=r2) parent[r2]=r1;
}
void solve() {
    ll n,m;
    cin>>n>>m;
    ll ans=(n*(n-1))/2+(m*(m-1))/2;
    cout<<ans;
}   


int main(void){
    ios_base::sync_with_stdio(false); 
    cin.tie(NULL);
    cout.tie(NULL);
    int t;
    t=1;
    // cin>>t;
    while(t--) {
        solve();
        // cout<<endl;
    }
    return 0; 

}


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

using namespace std;

template <class TH> void _dbg(const char *sdbg, TH h){cerr<<sdbg<<"="<<h<<"\n";}
template<class TH, class... TA> void _dbg(const char *sdbg, TH h, TA... a) {
  while(*sdbg!=',')
    cerr<<*sdbg++;
  cerr<<"="<<h<<","; 
  _dbg(sdbg+1, a...);
}

template<class T> ostream & operator<<(ostream & os, vector<T> V){
  os<<"[";
  for(auto vv: V) os << vv <<",";
  return os << "]";
}
template<class L, class R> ostream & operator <<(ostream & os, pair<L,R> P){
  return os <<"("<<P.first <<","<<P.second <<")";
}

#ifdef LOCAL
#define debug(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
#else
#define debug(...) (__VA_ARGS__)
#define cerr if(0)cout
#endif

const int N = 200005;

int n, T;
int a[N], b[N];


int main() {
    
    scanf("%d %d", &n, &T);
    vector<int> t, special;
    for (int i = 1; i <= n; i++) {
        scanf("%d %d", &a[i], &b[i]);
        if (a[i] == 0) {
            special.push_back(i);
        } else {
            t.push_back(i);
        }
    }
    sort(t.begin(), t.end(), [&](int w, int u) { return b[w] + (1 + b[w])*(long long)a[u] + b[u] <
        b[u] + (1 + b[u])*(long long)a[w] + b[w]; });
    
    vector<int> dp;
    dp.push_back(0);
    for (int w : t) {
        for (int i = dp.size() - 1; i >= 0; i--) {
            long long finishTime = dp[i] + 1 + (long long)(dp[i] + 1) * a[w] + b[w];
            if (finishTime > T) {
                continue;
            }
            if (dp.size() == i + 1) {
                dp.push_back(finishTime);
            } else {
                dp[i + 1] = min(dp[i + 1], (int)finishTime);
            }
        }
//         cerr << dp.size() << endl;
    }
    
    sort(special.begin(), special.end(), [&](int w, int u) { return b[w] < b[u]; });
    vector<long long> sumPref;
    if (!special.empty()) {
        sumPref.push_back(b[special[0]]);
    }
    for (int i = 1; i < special.size(); i++) {
        sumPref.push_back(sumPref.back() + b[special[i]]);
    }
    
    int ans = dp.size() - 1;
    for (int i = 0; i < dp.size(); i++) {
        int low = 1;
        int high = special.size();
        int res = 0;
        while (low <= high) {
            int mid = (low + high) / 2;
            long long totalTime = (long long)dp[i] + mid + sumPref[mid - 1];
            if (totalTime <= T) {
                res = mid;
                low = mid + 1;
            } else {
                high = mid - 1;
            }
        }
        ans = max(ans, i + res);
    }
    
    printf("%d\n", ans);
    return 0;
}


Measured memory_bytes: 4732
using System;
using System.Linq;
using System.Collections.Generic;
using System.IO;

namespace atcorder2
{
    class Program
    {
        public static long Read()
        {
            return long.Parse(Console.ReadLine());
        }

        public static long[] Reads()
        {

            return Console.ReadLine().Split().Select(long.Parse).ToArray();
        }






        static void Main(string[] args)
        {
            var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);


            var nx = Reads();
            var n = nx[0];
            var x = nx[1];
            var a = Reads();
            Array.Sort(a);
            long sum = 0;
            long ans = 0;
            for (int i = 0; i < n; i++)
            {
                if (a[i] <= x)
                {
                    x -= a[i];
                    ans = i + 1;
                }
            }
            Console.WriteLine(x!=0&&ans==n?ans-1:ans);
              
            
           
           
            



            Console.Out.Flush();
        }
    }
}




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

int a,b;

int main()
{
	string s1,s2,c;
	cin>>s1>>s2>>a>>b>>c;
	if (c==s1)  a--;
	else if (c==s2)  b--;
	
	cout<<a<<' '<<b<<endl;
	return 0;
}

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

int main() {

  int N;
  string S;

  bool p = 0, w = 0, g = 0, y = 0;

  cin >> N;

  for(int i = 0; i < N; i++){
    
    cin >> S;
    
    if(S == "P"){
      p = 1;
    }
    if(S == "W"){
      w = 1;
    }
    if(S == "G"){
      g = 1;
    }
    if(S == "Y"){
      y = 1;
    }
  }

  if(!(p = 1 && w ==1 && g == 1 && y == 1)){
    cout << "Three" << endl;
  }
  else{
    cout << "Four" << endl;
  }
}

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

#define rep(i, n) for (int i = 0; i < n; ++i)
#define all(x) (x).begin(),(x).end()
#define endl "\n"

using ll = long long;
using P = pair<int,int>;
using mp =  map<char,int>;

const int MOD = 1e9 + 7;
const int INF = 1001001001;


int main() {
    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

    string a, b, c;
    cin >> a >> b >> c;

    char ans[3] = {a[0] + ('A' - 'a'), b[0] + ('A' - 'a'), c[0] + ('A' - 'a')};

    cout << ans[0] << ans[1] << ans[2] << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
    int n, k, ai, ans;
    scanf("%d%d", &n, &k);
    for (int i = 0; i < n; i++) {
        scanf("%d", &ai);
    }
    ans = ceil((n - 1.0) / (k - 1.0));
    printf("%d\n", ans);
}

Measured memory_bytes: 3732
#include <iostream>
#include <string>
#include <queue>

using namespace std;

char S = 'S';
char W = 'W';
char N = 'N';
char E = 'E';

class dice{
  private:
    int up;
    int down;
    int east;
    int west;
    int north;
    int south;
  public:
    dice(int up, int south, int east, int west, int north, int down);
    void move(char to);
    int get_up();
    int get_east();
    int get_south();
    bool is_up_south(int _up, int _south);
    dice* clone();
};

dice::dice(int _up, int _south, int _east, int _west, int _north, int _down) {
  up = _up;
  south = _south;
  east = _east;
  west = _west;
  north = _north;
  down = _down;
}

dice* dice::clone() {
  return new dice(up, south, east, west, north, down);
}

void dice::move(char to) {
  if(to == S) {
    int tmp = down;

    down = south;
    south = up;
    up = north;
    north = tmp;
  } else if (to == N) {
    int tmp = down;

    down = north;
    north = up;
    up = south;
    south = tmp;
  } else if (to == W) {
    int tmp = down;

    down = west;
    west = up;
    up = east;
    east = tmp;
  } else if (to == E) {
    int tmp = down;

    down = east;
    east = up;
    up = west;
    west = tmp;
  }
}

bool dice::is_up_south(int _up, int _south){
  return up == _up && south == _south;
}

int dice::get_south() {
  return south;
}

int dice::get_east() {
  return east;
}

int dice::get_up(){
  return up;
}

int turn_dice(dice* d1, int to_up, int to_south) {
  queue<dice*> steps;
  steps.push(d1);

  while(1) {
    dice* d = steps.front(); steps.pop();

    if (d->is_up_south(to_up, to_south)) {
        return d->get_east();
    }

    dice* cloned_d;

    cloned_d = d->clone();
    cloned_d->move(S);
    steps.push(cloned_d);

    cloned_d = d->clone();
    cloned_d->move(N);
    steps.push(cloned_d);

    cloned_d = d->clone();
    cloned_d->move(W);
    steps.push(cloned_d);

    cloned_d = d->clone();
    cloned_d->move(E);
    steps.push(cloned_d);
  }
}

int main() {
  int up, south, east, west, north, down;
  string move;

  dice* dices[2];

  for (int i = 0; i < 2; i++) {
    cin >> up;
    cin >> south;
    cin >> east;
    cin >> west;
    cin >> north;
    cin >> down;

    dices[i] = new dice(up, south, east, west, north, down);
  }

  int to_east = turn_dice(dices[1], dices[0]->get_up(), dices[0]->get_south());

  if (to_east == dices[0]->get_east()) {
    cout << "Yes";
  } else {
    cout << "No";
  }

  cout << endl;

  return 0;
}



Measured memory_bytes: 3152
#include <bits/stdc++.h>
  using namespace std;
#define ll long long
#define fw(p) for(int w=0;w<(p);w++)
#define fx(p) for(int x=0;x<(p);x++)
#define fy(p) for(int y=0;y<(p);y++)
#define fz(p) for(int z=0;z<(p);z++)
#define fyg(p,g) for(int y=(g);y<(p);y++)
#define fzg(p,g) for(int z=(g);z<(p);z++)
#define ce(d) cout<<d<<endl;
#define vecp(p) int aa;cin>>aa;(p).push_back(aa);
#define vecpl(p) long long aa;cin>>aa;(p).push_back(aa);
#define vecps(p) string aa;cin>>aa;(p).push_back(aa);
#define vecp2(p) int ab;cin>>ab;(p).push_back(ab);
#define vecpl2(p) long long ab;cin>>ab;(p).push_back(ab);
#define vecps2(p) string ab;cin>>ab;(p).push_back(ab);
#define set0(k,n) for(int nn=0;nn<(n);nn++){ (k).push_back(0); }
#define sorts(c) sort((c).begin(),(c).end());
#define reverses(c) reverse((c).begin(),(c).end());
#define vec(b) vector<int> (b);
#define vecl(b) vector<long long> (b);
#define vecs(b) vector<string> (b);
#define vecsize(b,size) vector<int> (b)((size));
#define pb(b,a) (b).push_back((a));
#define doublece(a,b) cout<<(a)<<' '<<(b)<<endl;
#define pairs(s) vector<pair<int,int>> (s);
#define pairsl(s) vector<pair<ll,ll>> (s);
#define pairss(s) vector<pair<string,string>> (s);
#define pairsp(s) int aa,bb;cin>>aa>>bb;(s).push_back(make_pair(aa,bb));
#define pairspl(s) int aa,bb;cin>>aa>>bb;(s).push_back(make_pair(aa,bb));
#define pairsps(s) int aa,bb;cin>>aa>>bb;(s).push_back(make_pair(aa,bb));
#define pairsREV(s) (s).push_back(make_pair(bb,aa));
#define pairslREV(s) (s).push_back(make_pair(bb,aa));
#define pairssREV(s) (s).push_back(make_pair(bb,aa));
#define MOD 1000000007

int main() {
	
	int N;
	cin>>N;
	int n=0;
	while(N>0){
		if(N%10==2){
			n++;
		}
		N/=10;
	}
	ce(n)
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	static final long M = 1000000007;
	public static void main(String[] args) {
		long N, K, res = 0;
		Scanner sc = new Scanner(System.in);
		N = sc.nextLong();
		K = sc.nextLong();
		for(long i=K; i<=N+1; i++) {
			res = (res + (N*i%M -i*i%M + i +1)%M)%M;
		}
		System.out.println(res);
	}
}


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

int main(){
	int n, k;
	cin >> n >> k;
	vector<int> h(n);
	rep(i,n) cin >> h[i];
	int sum = 0;
	rep(i,n) if(h[i] >= k) sum++;
	cout << sum << endl;
}

Measured memory_bytes: 3600
N, A, B = map(int, input().split())
src = [int(input()) for i in range(N)]

def enough(n):
    bomb = 0
    for h in src:
        if h <= B*n: continue
        h -= B*n
        bomb += (h-1)//(A-B) + 1
        if bomb > n: return False
    return True

#ok/ng: 中点が十分に大きいかどうか
ng = 0
ok = 10**9
while ok - ng > 1:
    m = (ok+ng) // 2
    if enough(m):
        ok = m
    else:
        ng = m
print(ok)

Measured memory_bytes: 7072
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
template<class T>
inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

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

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
//const ll mod = 1000000007;
ll D, G;
ll p[15], c[15];

int main() {
    cin >> D >> G;
    for(int i = 1; i <= D; i++) cin >> p[i] >> c[i];
    ll ans = 1e18;
    for(int bits = 0; bits < (1 << D); bits++) {
        ll pointsum = 0;
        ll numsum = 0;
        for(int i = 0; i < D; i++) {
            if(!(bits & (1 << i))) continue;
            pointsum += c[i+1];
            pointsum += (i + 1) * 100 * p[i+1];
            numsum += p[i+1];
        }
       // cerr << bits << " " << pointsum << " " << numsum << endl;
        if(pointsum >= G) {
            chmin(ans, numsum);
            continue;
        }
        for(int index = 0; index < D; index++) {
            if(bits & (1 << index)) continue;
            int num = (G - pointsum + (index + 1) * 100 - 1) / ((index + 1) * 100);
            if(num > p[index + 1]) continue;
            chmin(ans, numsum + num);
        }
    }
    cout << ans << endl;
    return 0;
}


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

set<int> prime_set(int n) {
    set<int> ret;
    vector<bool> v(n+1, true);
    for (int i = 2; i <= n; i++) if (v[i]) {
        ret.emplace(i);
        for (int j = i+i; j <= n; j += i) v[j] = false;
    }   
    return ret;
}

int main() {
    int n;
    cin >> n;
    set<int> prime = prime_set(n);
    map<int, int> div;
    for (int i = 2; i <= n; i++) {
        int a = i;
        for (auto e : prime) {
            while (a % e == 0) { a /= e; div[e]++; }
        }
    }
    
    int ans = 0;
    int fo = 0, tw = 0, ft = 0, tf = 0;
    // 75 = 5 * 5 * 3, 15 * 5, 75
    for (auto e : div) {
        if (e.second >= 74) ans++;
        if (e.second >= 2) tw++;
        if (e.second >= 4) fo++;
        if (e.second >= 14) ft++;
        if (e.second >= 24) tf++;
    }
    
    ans += tf * (tw - 1) + ft * (fo - 1) + fo * (fo - 1) * (tw - 2) / 2;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	Scanner sc = new Scanner(System.in);
	
	void a() {
		int a = sc.nextInt(), b = sc.nextInt();
		String aStr = Integer.toString(a),bStr = Integer.toString(b);
		if(aStr.length() >= 2 || bStr.length() >= 2) {
			System.out.println("-1");
			return;
		}else {
			System.out.println(a*b);
		}
	}
	
	public static void main(String[] args) {
		new Main().a();
	}
}


Measured memory_bytes: 23124
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll inf = 1e18;
#define rep(i, a, b) for (int i = a; i < b; i++)
#define per(i, a, b) for (int i = b - 1; i >= a; i--)
#define int ll
using pint = pair<int, int>;
int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};

signed main() {
    int n;
    cin >> n;
    int a[n];
    int even = 0;
    rep(i, 0, n) {
        cin >> a[i];
        if (a[i] % 2 == 0) {
            even++;
        }
    }
    int ans = pow(3, n) - pow(2, even);
    cout << ans << "\n";
}

Measured memory_bytes: 4052
#include <string>
#include <iostream>
#include <algorithm>

using namespace std;

const int num = 5;
const char initials[num + 1] = "MARCH";

int main(){
	int N;
	unsigned long count[num] = {0};

	cin >> N;
	for (int i = 0; i < N; i++){
		string S;
		cin >> S;

		for (int j = 0; j < num; j++){
			if(S.c_str()[0] == initials[j]){
				count[j]++;
				break;
			}
		}
	}

	unsigned long result = 0;
	result += count[0] * count[1] * count[2];
	result += count[0] * count[1] * count[3];
	result += count[0] * count[1] * count[4];
	result += count[0] * count[2] * count[3];
	result += count[0] * count[2] * count[4];
	result += count[0] * count[3] * count[4];
	result += count[1] * count[2] * count[3];
	result += count[1] * count[2] * count[4];
	result += count[1] * count[3] * count[4];
	result += count[2] * count[3] * count[4];

	cout << result << endl;

	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin >> n;
  vector<int> A(n);
  for (int i = 0; i < n; i++){
    cin >> A[i];
  }
  set<int> P;
  for (int i = 0; i < (1 << n); i++){
    int S = 0;
    for (int j = 0; j < n; j++){
      if ((i >> j) & 1 == 1){
        S += A[j];
      }
    }
    P.insert(S);
  }
  int q;
  cin >> q;
  for (int i = 0; i < q; i++){
    int M;
    cin >> M;
    if (P.count(M)){
      cout << "yes" << endl;
    } else {
      cout << "no" << endl;
    }
  }
}


Measured memory_bytes: 3124
#include<stdio.h>

int main(){
    int tako;
    scanf("%d", &tako);
    int count = (tako * (tako - 1)) / 2;
    int answer = 0;

    int point[50];
    
    int i = 0;
    for(i = 0; i < tako; i++){    
        scanf("%d", &point[i]);
    }

    int j;
    for(i = 0; i < tako; i++){
        for(j = i + 1; j < tako; j++){
            answer += point[i] * point[j];
        }
    }

    printf("%d", answer);
    
    return 0;
}

Measured memory_bytes: 128
import java.util.*;

class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int tmp = 0;
        boolean flag = false;

        for(int i = 1;i <= 9;i++){
            for(int j = 1;j <= 9;j++){
                tmp = i * j;
                if(tmp == N){
                    flag = true;
                }
            }
        }
        if(flag == true){
            System.out.println("Yes");
        } else System.out.println("No");
        
    }
}

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

int main(void){
  int H,W,n,x,y;
  int dp[17][17];
  
  while(1){
 
    cin >> W >> H;
    if( W == 0 && H == 0 ) break;
     
    for( int i = 0 ; i < 17 ; i++ )
      for( int j = 0 ; j < 17 ; j++ )
	dp[i][j] = 0;

    cin >> n;
    for( int i = 0 ; i < n ; i++ ){
      cin >> x >> y;
      dp[y][x] = -1;
    }

    dp[1][1]=1;      

    for( int i = 1 ; i <= H ; i++ ){
      for( int j = 1 ; j <= W ; j++ ){

	if( i == j && i == 1) continue;
	if( dp[i][j] == -1 ){
	  dp[i][j] = 0;
	  continue;
	}
	dp[i][j] = dp[i-1][j]+dp[i][j-1];
      }
    }
    cout << dp[H][W] << endl;
    
  }
  return 0;
}

Measured memory_bytes: 1160
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <utility>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstdio>
using namespace std;
#define REP(i,n) for((i)=0;(i)<(int)(n);(i)++)
#define foreach(c,itr) for(__typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)
typedef long long ll;
#define INF (1<<29)

int main(){
  string s;
  bool ans = true;
  cin >> s;
  if(s[0]=='A'){
    int c=0;
    for(int i=2;i<s.length()-1;i++){
      if(s[i]=='C')c++;
      else if(isupper(s[i]))ans=false;
    }
    if(c!=1)ans=false;
    if(isupper(s[1]))ans=false;
    if(isupper(s[s.length()-1]))ans=false;
  }
  else ans=false;
  if(ans)puts("AC");
  else puts("WA");
  return 0;
}


Measured memory_bytes: 256
arr=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k=int(input())
print(arr[k-1])

Measured memory_bytes: 3060
#include "bits/stdc++.h"
using namespace std;

typedef long long ll;
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)

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

ll A, B, C, D, E, F, G, H, I, J, K, L, M,
N, O, P, Q, R, S, T, U, V, W, X, Y, Z;

struct Card {
	ll number;
	char color;
} Card_t;

void aojRummy();
int main()
{
	aojRummy();
	return 0;
}

//* ?????????n??????????????\??????????????????????????????????????????
template <typename T>
vector<T> INP(ll n)
{
	vector<T> x;
	REP(i, n) {
		T tmp; cin >> tmp;
		x.push_back(tmp);
	}
	return x;
}
//* n??????1????????????????????\?????????????????????????????¨??????????????????
vector<char> SPRIT_STRING(ll n)
{
	string str; cin >> str;
	vector<char> cs(n);
	REP(i, n) cs[i] = str[i];
	return cs;
}

bool comp(const Card& a, const Card& b)
{
	return a.number < b.number;
}

bool rummyCheck(vector<Card> cards)
{
	if (cards.size() == 0) return true;
	if (cards.size() % 3 != 0) return false;
	sort(cards.begin(), cards.end(), comp);
	bool okay = false;
	do {
		int repNum = cards.size() / 3;
		bool localOkay = true;
		REP(i, repNum) {
			ll zero = cards[i * 3].number;
			ll one = cards[i * 3 + 1].number;
			ll two = cards[i * 3 + 2].number;
			if (not((zero == one and one == two) or ((zero + 1) == one and (one + 1) == two)))
				localOkay = false;
		}
		if (localOkay)
			okay = true;
	} while (next_permutation(cards.begin(), cards.end(), comp));
	return okay;
}

void aojRummy()
{
	cin >> T;
	
	N = 9;
	REP(t, T) {
		vector<Card> cards(N);
		REP(i, 9) cin >> cards[i].number;
		REP(i, 9) cin >> cards[i].color;

		vector<Card> red, green, blue;
		REP(i, N) {
			Card c = cards[i];
			if (c.color == 'R') red.push_back(c);
			else if (c.color == 'G') green.push_back(c);
			else blue.push_back(c);
		}

		if (rummyCheck(red) and rummyCheck(blue) and rummyCheck(green))
			cout << 1 << endl;
		else
			cout << 0 << endl;
	}
}

//* http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1129
void aojHanafudaShuffle()
{
	N = R = 1;
	while (true) {
		cin >> N >> R;
		if (N == 0 and R == 0) break;

		vector<ll> cards(N);
		REP(i, N) cards[i] = i + 1;

		REP(i, R) {
			cin >> P >> C;
			rotate(cards.begin() + (N - (C + P - 1)), cards.begin() + (N - (P - 1)), cards.end());
			//vector<ll> tmp(C);
			//copy(cards.begin() + (N - (C + P - 1)), cards.begin() + N - (P - 1), tmp.begin());
			//copy(cards.begin() + (N - (P - 1)), cards.end(), cards.begin() + (N - (C + P - 1)));
			//copy(tmp.begin(), tmp.end(), cards.begin() + (N - C));
		}

		cout << cards[cards.size() - 1] << endl;
	}
}


Measured memory_bytes: 3104
n = int(input())
li = []
count = 0
f = 1
for i in range(n):
    a = input()
    li.append("".join(sorted(a)))
li.sort()
for i in range(n-1):
    if li[i] == li[i+1]:
        f += 1
    else:
        count += (f*(f-1))//2
        f = 1
count += (f*(f-1))//2
print(count)

Measured memory_bytes: 57560
#include <iostream>

using namespace std;

int main(int argc, char const *argv[]) {
  int n, m;
  cin >> n >> m;
  int a[m], b[m], ans[50]={0};
  for (size_t i = 0; i < m; i++) {
    cin >> a[i] >> b[i];
    ans[a[i]-1]++;
    ans[b[i]-1]++;
  }
  for (size_t i = 0; i < n; i++) cout << ans[i] << endl;;
  return 0;
}


Measured memory_bytes: 256
x1,y1,x2,y2=map(int,input().split())
x3=int(x2+y1-y2)
y3=int(y2+x2-x1)
x4=int(x3+x1-x2)
y4=int(y3+y1-y2)
print("{} {} {} {}".format(x3,y3,x4,y4))

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

#ifdef ONLINE_JUDGE
#define endl "\n"
#endif
using namespace std;
typedef unsigned long long int lu;
typedef long long int ll;
typedef long double ld;
typedef vector<ll> v;
typedef vector<v> vv;
typedef vector<ld> vld;
typedef vector<bool> vb;
typedef vector<string> vs;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
const ll MOD = 1e9 + 7;
const v dx = {1, -1, 0, 0};
const v dy = {0, 0, 1, -1};
#define yes cout << "YES\n";
#define no cout << "NO\n";
#define yesno(f) \
    if (f)       \
        yes else no;
#define noo \
    { no return; }
#define amax(x, y) \
    if (y > x)     \
        x = y;
#define amin(x, y) \
    if (y < x)     \
        x = y;
#define sz(x) (ll) x.size()
#define sq(x) ((x) * (x))

#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()

template<typename T = ll>
vector<T> ga(ll n, bool oneIndexed = false) {
    vector<T> a = vector<T>(n + oneIndexed);

    for (ll i = 0; i < n; i++) {
        T p;
        cin >> p;
        a[i + oneIndexed] = p;
    }

    return move(a);
}

template<typename T, typename A>
void pa(vector<T, A> const &a, ll begin = 0, ll end = -1) {
    if (end == -1)
        end = sz(a) - 1;
    for (ll i = begin; i <= end; i++) {
        cout << a[i] << " ";
    }
    cout << endl;
}

void solve() {
    ll n;
    cin >> n;
    if (n == 3) {
        cout << "2 5 63";
        return;
    }

    v res;
    if (n & 1) {
        res.push_back(3e4);
        n--;
    }

    res.push_back(5);
    res.push_back(25);
    n -= 2;

    ll a = 1, b = 1.5e4 - 1;
    while (a != b) {
        res.push_back(a << 1);
        res.push_back(b << 1);
        n -= 2;
        if (a >= b)break;
        if (n == 0)goto end;
        a++;
        b--;
    }

    a = 1;
    b = 1e4 - 1;
    while (a != b) {
        res.push_back(a * 3);
        res.push_back(b * 3);
        n -= 2;
        if (a >= b)break;
        if (n == 0)goto end;
        a += 2;
        b -= 2;
    }

    end:
    pa(res);
}

int main(void) {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    // ll t;cin >> t;while(t--)
    solve();
    return 0;
}

Measured memory_bytes: 640
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx,avx2,fma")
#include <bits/stdc++.h>
using namespace std;

#define FIO ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
typedef long long ll;

int32_t main() {
	FIO;
	int n;
	cin >> n;
	unordered_map <string, int> m;
	string s;
	while (n--) {
		cin >> s;
		m[s]++;
	}
	cout << "AC x " << m["AC"] << '\n';
	cout << "WA x " << m["WA"] << '\n';
	cout << "TLE x " << m["TLE"] << '\n';
	cout << "RE x " << m["RE"] << '\n';
}


Measured memory_bytes: 3664
import sys
input = sys.stdin.readline
n = int(input())
A = list(map(int, input().split()))
q = int(input())
M = list(map(int, input().split()))
ans = []
mem = [0] * 2**n
for i in range(2 ** n):
    total = 0
    for j in range(n):
        if i >> j & 1:
            total += A[j]
            # if total > m:
            #     break
    mem[i] = total
    # if total == m:
    #     print('yes')
    #     break
# else:
#     print('no')
for m in M:
    if m > sum(A):
        print('no')
        continue
    if mem.count(m):
        print('yes')
    else:
        print('no')


Measured memory_bytes: 42972
#include<iostream>
using namespace std;
int Max(int a,int b,int c){
  if(a<b){
    if(b<c) return c;
    else return b;
  }
  else{
    if(a<c) return c;
    else return a;
  }
}
int main(){
  int a,b;
  cin >> a >> b;
  cout << Max(a+b,a-b,a*b) << "\n";
  
  return 0;
}


Measured memory_bytes: 256
import java.util.*;


public class Main {
	
	private void doit(){
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()){
			char [] c = sc.next().toCharArray();
			int x = sc.nextInt();
			int y = sc.nextInt();
			
			int ind = 0, count = 0;
			ArrayList<Integer> xlist = new ArrayList<>();
			ArrayList<Integer> ylist = new ArrayList<>();
			for(int i = 0; i < c.length; i++){
				if(c[i] == 'F'){
					count++;
				}
				else{
					if(ind % 2 == 0){
						xlist.add(count);
						count = 0;
					}
					else{
						ylist.add(count);
						count = 0;
					}
					ind++;
				}
			}
			if(count > 0){
				if(ind % 2 == 0){
					xlist.add(count);
					count = 0;
				}
				else{
					ylist.add(count);
					count = 0;
				}
			}
			
			int len = 8100;
			boolean [][] dpx = new boolean[xlist.size() + 1][len * 2];
			dpx[0][len] = true;
			for(int i = 0; i < xlist.size(); i++){
				for(int j = 0; j < len * 2; j++){
					if(dpx[i][j] == false) continue;
					dpx[i + 1][j + xlist.get(i)] = true;
					if(i != 0){
						dpx[i + 1][j - xlist.get(i)] = true;
					}
				}
			}
			
			boolean [][] dpy = new boolean[ylist.size() + 1][len * 2];
			dpy[0][len] = true;
			for(int i = 0; i <ylist.size(); i++){
				for(int j = 0; j < len * 2; j++){
					if(dpy[i][j] == false) continue;
					dpy[i + 1][j + ylist.get(i)] = true;
					dpy[i + 1][j - ylist.get(i)] = true;
				}
			}
			
			if(dpx[xlist.size()][x + len] && dpy[ylist.size()][y + len]){
				System.out.println("Yes");
			}
			else{
				System.out.println("No");
			}
		}
	}



	private void debug(Object... o) {
		System.out.println("debug = " + Arrays.deepToString(o));
	}

	public static void main(String[] args) {
		new Main().doit();
	}

}


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

int main() {
	int n,m,ans = 0,minb = 0;
	pair<int,int> a[100000];
	cin >> n >> m;
	for (int i = 0;i < m;++i) {
		cin >> a[i].first >> a[i].second;
	}
	sort(a,a+m);
	minb = a[0].second;
	for (int i = 1;i < m;++i) {
		if (minb > a[i].first) minb = min(minb,a[i].second);
		else {
			++ans;
			minb = a[i].second;
		}
	}
	cout << ans+1 << "\n";
	return 0;
}

Measured memory_bytes: 1024
import java.util.*;
	public class Main{
        public static void main(String[] args){
            Scanner sc = new Scanner(System.in);
            //入力
            int a = Integer.parseInt(sc.next());
            int b = Integer.parseInt(sc.next());
            
            String many = "";
            String few = "";
            
            if(a < b){
            	many = "#";
            	few = ".";
            }else{
            	many = ".";
            	few = "#";
            }
            
            //出力
            System.out.println(64 + " " + 63);
            
            printrow(Math.max(a, b)-1, many, few, 31);
            
            for(int i=0; i<63; i++){
    			System.out.print(few);
    		}
    		System.out.println("");
    		
    		for(int i=0; i<63; i++){
    			System.out.print(many);
    		}
    		System.out.println("");
    		
    		printrow(Math.min(a, b)-1, few, many, 31);
            
            sc.close();
        }
        
        public static void printrow(int n, String many, String few, int count){
        	if(count==0){
        		return;
        	}else if(count%2 == 0){
        		for(int i=0; i<63; i++){
        			System.out.print(few);
        		}
        		System.out.println("");
        		printrow(n, many, few, count-1);
        	}else if(n >= 32){
        		for(int i=0; i<31; i++){
        			System.out.print(many + few);
        		}
        		System.out.println(many);
        		printrow(n-32, many, few, count-1);
        	}else if(n==0){
        		for(int i=0; i<63; i++){
        			System.out.print(few);
        		}
        		System.out.println("");
        		printrow(0, many, few, count-1);
        	}else{
        		for(int i=0; i<n; i++){
        			System.out.print(many + few);
        		}
        		for(int i=0; i<63-2*n; i++){
        			System.out.print(few);
        		}
        		System.out.println("");
        		printrow(0, many, few, count-1);
        	}	
        }
	}
	

Measured memory_bytes: 24020