akhauriyash/Code-Regression huggingface dataset:
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author Kein Yukiyoshi
 */

#include "bits/stdc++.h"
#define int long long
#define rep(i, n)           for (int i = 0; i < (int)(n); i++)
#define REP(i, a, b)        for (int i = (int)(a); i < (int)(b); i++)
#define FOR(i, a)           for (auto &i : a)
#define ALL(obj)            begin(obj), end(obj)
#define MAX(x)              *max_element(ALL(x))
#define MIN(x)              *min_element(ALL(x))
#define sum(x)              accumulate(ALL(x), 0LL)
#define LOWER_BOUND(A, key) distance(A.begin(), lower_bound(ALL(A), key))
#define UPPER_BOUND(A, key) distance(A.begin(), upper_bound(ALL(A), key))

using namespace std;
const int MOD    = (int)(1e9 + 7);
const int INF    = (int)(1e13 + 7);
const double EPS = 1e-14;
const double PI  = acos(-1);

int CEIL(int a, int b) { return (a >= 0 ? (a + (b - 1)) / b : (a - (b - 1)) / b); } //ceil() for int
int mod(int a, int b) { return a >= 0 ? a % b : a - (b * CEIL(a, b)); }             //always return positive num
int bpm(int a, int b) {                                                             //return x^y in order(log(y))
  int res = 1;
  for (a %= MOD; b; a = a * a % MOD, b >>= 1)
    if (b & 1) res = res * a % MOD;
  return res;
}

class BBetweenAAndB {
public:
  static void solve(istream &cin, ostream &cout) {
    int a, b, x;
    cin >> a >> b >> x;
    if (a == 0) {
      cout << b / x + 1 << endl;
    } else {
      cout << b / x - (a - 1) / x << endl;
    }
  }
};


signed main() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(false);
  cout<<fixed<<setprecision(15);
  BBetweenAAndB solver;
  std::istream& in(std::cin);
  std::ostream& out(std::cout);
  solver.solve(in, out);
  return 0;
}


Measured memory_bytes: 256
//By Zank100
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define mod 1000000007
#define din(t) long long t;cin>>t;
#define in(t) cin>>t;
int main() 
{
	ios_base::sync_with_stdio(false); cin.tie(NULL);
	din(n);din(k);
	ll h[n],dp[n],sum=0,curr;
	for(ll i=0;i<n;i++)
	{
	    in(h[i]);
	}
	dp[0]=0;
	dp[1]=abs(h[1]-h[0]);
	for(ll i=2;i<n;i++)
	{
	    ll p=1<<30;
	    ll j=1;
	    ll a=min(i,k);
	    while(j<=a)
	    {
	        if(p>dp[i-j]+abs(h[i]-h[i-j]))
	        {
	            p=dp[i-j]+abs(h[i]-h[i-j]);
	            //cout<<p<<" ";
	        }
	        j++;
	    }
	    //cout<<endl;
	    dp[i]=p;
	}
	/*for(ll i=0;i<n;i++)
	{
	    cout<<dp[i]<<" ";
	}*/
	//cout<<endl;
	sum=dp[n-1];
	cout<<sum<<endl;
	return 0;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<int(n);i++)
#define FOR(i,n,m) for(int i=n;i<int(m);i++)
#define ALL(v) (v).begin(),(v).end()
#define pb push_back
using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;

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

int gcd(int a,int b){return b?gcd(b,a%b):a;}
int lcm(int a,int b){return a*b/gcd(a,b);}	

const ll mod=1e9+7;
const int INF=INT_MAX/2;
const int N_MAX=100010;

int main(){
	int m1,d1,m2,d2;
	cin>>m1>>d1;
	cin>>m2>>d2;
	if(d2==1)cout<<1<<endl;
	else cout<<0<<endl;
	return 0;
}



Measured memory_bytes: 256
/* 
	Author: ankrypt
*/


#include <bits/stdc++.h>

using namespace std;

#define MOD 1000000007
#define ll long long int
#define u64 unsigned long long int

ll N;
ll arr[100005];
multiset<int> ms;

int main() {
	scanf("%lld", &N);
	for(int i = 0; i < N; i++) {
		scanf("%lld", &arr[i]);
	}
	for(int i = 0; i < N; i++) {
		multiset<int> :: iterator itr = ms.lower_bound(arr[i]);
		if(itr == ms.begin()) {
			ms.insert(arr[i]);
		}
		else {
			itr--;
			ms.erase(itr);
			ms.insert(arr[i]);
		}
	}
	// multiset<int> :: iterator it;
	// for(it = ms.begin(); it != ms.end(); it++) {
	// 	cout << *it << " ";
	// }
	int ans = ms.size();
	printf("%d\n", ans);
	return 0;
}
/*
	Powered by Buggy Plugin
*/


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

typedef vector<int> vi;
typedef vector<bool> vb;
typedef pair<int,int> pii;
typedef vector<pair<int,int> > vpii;
typedef vector<vector<bool> > vvb;
typedef map<int, bool> mib;

typedef long long ll;
typedef vector<long long> vl;
typedef pair<long long,long long> pll;
typedef vector<pair<long long,long long> > vpll;

typedef vector<string> vs;

typedef long double ld;

#define _GLIBCXX_DEBUG

#define REP(i,n) for (int i = 0; i < (n); ++i)
#define REPD(i,n) for (int i = (n-1); i >= 0; --i)
#define FORE(i, s, n) for (int i = (s); i <= (int)(n); i++)
#define debug(x) cerr << #x << ": " << x << '\n'
#define debug2(x, y) cerr << #x << ": " << x << ", " << #y << ": " << y << '\n'
#define debug3(x, y, z) cerr << #x << ": " << x << ", " << #y << ": " << y << ", " << #z << ": " << z << '\n'
#define debugs(s) cerr << s << "\n"
#define hyphen() cerr << "--\n"

#define ALL(vec) (vec).begin(), (vec).end()
#define REVALL(vec) (vec).rbegin(), (vec).rend()

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

#define fst first
#define snd second
#define pb push_back
#define mk(x,y) make_pair((x),(y))

// http://ehafib.hatenablog.com/entry/2015/12/23/164137
int qp(int a,ll b){int ans=1;do{if(b&1)ans=1ll*ans*a;a=1ll*a*a;}while(b>>=1);return ans;}
int qpm(int a,ll b,int mo){int ans=1;do{if(b&1)ans=1ll*ans*a%mo;a=1ll*a*a%mo;}while(b>>=1);return ans;}
int gcd(int a,int b){return b?gcd(b,a%b):a;}

#define sz(v) int(v.size())

// x1, x2ライブラリとの被りを避ける
#define x1 x192837465
#define x2 x123456789
#define y1 y192837465
#define y2 y123456789

// typo
#define itn int
#define reutrn return
#define reutnr return

#define make(type, x) type x; cin>>x;
#define make2(type, x, y) type x, y; cin>>x>>y;
#define make3(type, x, y, z) type x, y, z; cin>>x>>y>>z;
#define make4(type, x, y, z, t) type x, y, z, t; cin>>x>>y>>z>>t;

const int MOD = (int)1e9 + 7;
const int INF = numeric_limits<int>::max();

signed main() {
    make4(int, x1, y1, x2, y2);

    int x3, y3, x4, y4;

    // double d = sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
    int dsin = y2 - y1;
    int dcos = x2 - x1;
    x3 = x2 - dsin;
    y3 = y2 + dcos;

    x4 = x3 - dcos;
    y4 = y3 - dsin;

    cout << x3 << " " << y3 << " " << x4 << " " << y4 << endl;
}


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

typedef struct pro{
  char name[100];
  int time;
}p;


void enqueue(p);
p dequeue(void);
int min(int, int);

int head, tail;
p proc[N];

int main(){
  int i, n, q, c, total=0;
  p data;

  scanf("%d%d", &n, &q);
  for(i=1;i<=n;i++){
    scanf("%s%d",proc[i].name, &proc[i].time);
  }


  head = 1;
  tail = n+1;

  while(head != tail){
    data = dequeue();
    c = min(q, data.time);
    data.time -= c;
    total += c;

    if(data.time > 0){
      enqueue(data);
    }else{
      printf("%s %d\n", data.name, total);
    }
  }

  return 0;
}




void enqueue(p n){
  proc[tail] = n;
  tail = (tail+1)%N;
}


p dequeue(){
  p n = proc[head];
  head = (head+1)%N;
  return n;
}

int min(int a, int b){
  if(a>=b){
    return b;
  }else{
    return a;
  }
}





Measured memory_bytes: 11996
#include <cstdint>
#include <iostream>
#include <queue>
#include <vector>

using namespace std;

template <class T, class Compare>
class SizedHeap
{
public:
    SizedHeap(size_t max_size) : max_size_(max_size), sum_(0) {}

    void Push(const T &val)
    {
        heap_.push(val);
        sum_ += val;

        while (heap_.size() > max_size_) {
            sum_ -= heap_.top();
            heap_.pop();
        }
    }

    T Sum() const { return sum_; }

    size_t Size() const { return heap_.size(); }

protected:
    priority_queue<T, vector<T>, Compare> heap_;
    size_t max_size_;
    T sum_;
};

template <class T>
using MinSizedHeap = SizedHeap<T, greater<T>>;

template <class T>
using MaxSizedHeap = SizedHeap<T, less<T>>;


vector<int64_t> GetPrefixes(const vector<int64_t> &vec, size_t size)
{
    vector<int64_t> prefixes(vec.size(), 0);
    MinSizedHeap<int64_t> heap(size);

    for (size_t i = 0; i < vec.size(); i += 1) {
        heap.Push(vec[i]);
        if (heap.Size() >= size) {
            prefixes[i] = heap.Sum();
        }
    }
    return prefixes;
}

vector<int64_t> GetSuffixes(const vector<int64_t> &vec, size_t size)
{
    vector<int64_t> suffixes(vec.size(), 0);
    MaxSizedHeap<int64_t> heap(size);

    for (int i = vec.size() - 1; i >= 0; i -= 1) {
        heap.Push(vec[i]);
        if (heap.Size() >= size) {
            suffixes[i] = heap.Sum();
        }
    }
    return suffixes;
}

int64_t Solve(const vector<int64_t> &vec)
{
    auto n = vec.size() / 3;
    auto prefixes = GetPrefixes(vec, n);
    auto suffixes = GetSuffixes(vec, n);

    int64_t res = prefixes[n - 1] - suffixes[n];
    for (size_t i = n - 1; i + n < vec.size(); i += 1) {
        res = max(res, prefixes[i] - suffixes[i + 1]);
    }
    return res;
}

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

    vector<int64_t> vec(3 * n);
    for (auto &num : vec) {
        cin >> num;
    }

    auto res = Solve(vec);
    cout << res << "\n";

    return 0;
}


Measured memory_bytes: 9068
#include <bits/stdc++.h>
#define ll long long
#define MODV 1000000007
#define INFLL LLONG_MAX // 9223372036854775807
#define EPS 1e-9
#define rep(i, n) for(ll i=0, i##_len=(ll)(n); i<i##_len; i++)
#define repf(i, n) for(ll i=1, i##_len=(ll)(n+1); i<i##_len; i++)
#define all(v) v.begin(), v.end()
#define endl "\n"
#define vi vector<ll>
#define vvi vector<vector<ll>>
#define Yes() cout << "Yes" << endl
#define YES() cout << "YES" << endl
#define No() cout << "No" << endl
#define NO() cout << "NO" << endl
#define Init() std::ios::sync_with_stdio(false); std::cin.tie(0); std::cout<<fixed<<setprecision(15);
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 namespace std;

int main(){
    Init();
    string s, t; cin >> s >> t;
    vector<vector<ll>> dp(s.size()+1, vector<ll>(t.size()+1, 0));

    // 最長共通部分列長の計算
    repf(i, s.size()){
        repf(j, t.size()){
            if(s[i-1] == t[j-1]) chmax(dp[i][j], dp[i-1][j-1]+1);
            chmax(dp[i][j], max(dp[i-1][j], dp[i][j-1]));
        }
    }
    
    // 復元
    ll i=s.size(), j=t.size();
    string ans = "";
    while(i>0 && j>0){
        if(dp[i][j] == dp[i-1][j]) i--;
        else if(dp[i][j] == dp[i][j-1]) j--;
        else{
            ans = s[i-1] + ans;
            i--; j--;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 71844
#include <bits/stdc++.h>
#define itn int
#define REP(i, n) for (int i = 0; i < n; i++)
#define IREP(i, n) for (int i = n - 1; i >= 0; i--)
#define FOR(a, b) for (int i = a; i < b + 1; i++)
#define all(v) v.begin(), v.end()
#define SENTINEL 2000000000
#define NIL -1
using namespace std;
typedef long long ll;

const ll INF = 1LL << 60;
const ll MOD = 1000000007;
template <class T>inline bool chmin(T &a, T b){if(a>b){a=b;return true;}return false;}
template <class T>inline bool chmax(T &a, T b){if(a<b){a=b;return true;}return false;}

int main()
{
    ll n,k;
    cin >> n >> k;
    if(n>k){
        ll tmp=n/k;
        n-=k*tmp;
    }
    if(k-n<n){
        cout << k-n << endl;
    }
    else{
        cout << n << endl;
    }
}

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

int main() {
    int x;
    cin >> x;
    if (x == 2) {
        cout << x << endl;
    } else {
        bool flag = true;
        // x が素数かどうか -> x + 1
        while (flag) {
            for (int i = 2; i < x; i++) {
                if (x % i == 0) {  // i は x の約数
                    x++;
                    break;
                } else {  // i は x の約数でない
                    if (i == x - 1) {
                        flag = false;
                    } else {
                        continue;
                    }
                }
            }
        }
        cout << x << endl;
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i=0; i < n; i ++)
#define rep1(i, n) for (int i=1; i <= n; i ++)
#define _min(x, y) x = min(x, y)
#define _max(x, y) x = max(x, y)
using namespace std;

typedef pair<int, int> P;
vector<vector<int> > to(100005);
vector<P> _log;
int from[100005];
int color[100005] = {0};
int unused[100005];

map<P, int> cmap;

int main() {
  int N; cin >> N;
  int a, b;
  rep(i, N - 1) {
    cin >> a >> b;
    to[a].push_back(b);
    // to[b].push_back(a);
    _log.push_back(P(a, b));
    from[b] = a;
  }
  int ans = 0;
  rep1(i, N) {
    int size = to[i].size();
    if (from[i] != 0) size ++;
    _max(ans, size);
  }
  cout << ans << endl;

  int parent, grand;
  for (int node = 1; node < N; node ++) {
    int used_color = cmap[P(from[node], node)];
    int next_color = 1;
    for (int child: to[node]) {
      if (next_color == used_color) {
        next_color ++;
      }
      cmap[P(node, child)] = next_color;
      next_color ++;
    }

  }
  rep(i, N - 1) {
    cout << cmap[_log[i]] << endl;
  }
  return 0;
}


Measured memory_bytes: 11892
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const ll MOD = 1000000007;
const int IINF = INT_MAX;
const ll LLINF = LLONG_MAX;
const int MAX_N = int(1e5 + 5);
const double EPS = 1e-10;
const int di[] = {0, 1, 0, -1}, dj[] = {1, 0, -1, 0};
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define SORT(v) sort((v).begin(), (v).end())
#define ALL(v) (v).begin(), (v).end()

int main() {
    ll x, cnt = 0;
    cin >> x;
    if(x>=11){
        cnt += x/11*2;
        x %= 11;
    }
    if(x>0){
        if(x<=6)cnt++;
        else cnt+=2;
    }
    cout << cnt << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int (i)=0; (i)<(n); (i)++)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define ll long long
#define pii pair<int,int> 
#define Yes cout << "Yes" << endl
#define No cout << "No" << endl
int inf=1000001000;
ll INF=100000000000000000;
//int 2×10の9乗
//vector<vector<int>> a(n, vector<int>(m));
//rep(i,n) rep(j,m) cin >> a[i][j]; 
//cout << fixed << setprecision(10) << ans << endl;
//int gcd(int x, int y){
//if(y==0) return x;
//return gcd(y, x%y);
//}
//sort小さい順(昇順)
//g++ code.cpp   ./a.out 
int main(){
 int n; 
 cin >> n;
 vector<int> a(n);
 rep(i,n) cin >> a[i];
 int k=1, ans=0;
 rep(i,n){
   if(a[i]==k){
     ans++;
     k++;
   }
 }
 if(ans==0) cout << -1 << endl;
 else cout << n-ans << endl; 
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
#define rep(i, n) for (int i=0;i<(n);i++)
using namespace std;
typedef long long ll;
 
int main(void){
    int h1, m1, h2, m2, k;
    cin>>h1>>m1>>h2>>m2>>k;
    int time = h2*60+m2-(h1*60+m1);
    cout<<time-k<<endl;
    return 0;
}

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

int solve(int n) {
  int shoot = n / 4;

  int sum = 0;
  for (auto i = 0; i < shoot; ++i) {
    int num;
    cin >> num;
    sum += num;
  }

  return sum;
}

int main() {
  int n;
  
  while(cin >> n, n)
    cout << solve(n) << endl;
  
  return 0;
}


Measured memory_bytes: 3008
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

A, B, Q = mapint()
Ss = [-10**20]+[int(input()) for _ in range(A)]+[10**20]
Ts = [-10**20]+[int(input()) for _ in range(B)]+[10**20]
Ss.sort()
Ts.sort()
from bisect import bisect_left

for _ in range(Q):
    x = int(input())
    xs = bisect_left(Ss, x)
    xt = bisect_left(Ts, x)

    rr = max(Ss[xs]-x, Ts[xt]-x)
    ll = max(x-Ss[xs-1], x-Ts[xt-1])
    lr = min(abs(x-Ss[xs-1])*2+abs(x-Ts[xt]), abs(x-Ts[xt-1])*2+abs(x-Ss[xs]))
    rl = min(abs(x-Ss[xs-1])+abs(x-Ts[xt])*2, abs(x-Ts[xt-1])+abs(x-Ss[xs])*2)
    print(min(rr, ll, rl, lr))

Measured memory_bytes: 115324
#include<stdio.h>
int main()
{
	int a[4][102]={0},n,i,j;
	scanf("%d",&n);
  for(i=1;i<=2;i++)
	  for(j=1;j<=n;j++)
	  {
		  scanf("%d",&a[i][j]);
	      if(a[i-1][j]>=a[i][j-1])
			  a[i][j]+=a[i-1][j];
		  else
			  a[i][j]+=a[i][j-1];
	  }
		  printf("%d\n",a[2][n]);    
  return 0;
}

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

li = list(map(int,input().split()))
av = sum(li) / n


ans = 0
tp = abs(li[ans] - av)
for i in range(1,n):
    if(abs(li[i] - av) < tp):
        tp = abs(li[i] - av)
        ans = i

print(ans)

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

using namespace std;

using ll = long long;
constexpr ll MOD = 1e9 + 7;
constexpr ll INF = 1e18;

struct box {
    ll item[3];
};

int main() {
    ll n, m, i, j, k;
    cin >> n;
    vector<ll> A(n);
    for(auto &x : A) {
        cin >> x;
    }
    if(n % 2 == 0) {
        if(n == 2) {
            cout << max(A[0], A[1]) << endl;
            return 0;
        }
        ll odd[n / 2 + 10] = {}, even[n / 2 + 10] = {};
        for(i = 1; i <= n; i++) {
            if(i % 2 == 0)
                even[i / 2] = A[i - 1];
            else
                odd[i / 2 + 1] = A[i - 1];
        }
        for(i = 0; i < n / 2 + 1; i++) {
            even[i + 1] += even[i];
            odd[i + 1] += odd[i];
        }
        ll ret = -INF;
        for(i = 0; i <= n / 2; i++) {
            ret = max(odd[i] + even[n / 2 + 1] - even[i], ret);
        }
        cout << ret << endl;
    } else {
        vector<box> v(n / 2 + 1);
        for(i = 1; i < n; i += 2) {
            v[i / 2] = {A[i - 1], A[i], A[i + 1]};
            //cout << i/2 << endl;
        }
        vector<vector<ll>> dp(n / 2 + 1, vector<ll>(3, -INF));
        function<ll(int, int)> dfs = [&](const int now, const int cnt) {
            if(now == n / 2 - 1) {
                return v[now].item[cnt];
            }
            if(dp[now][cnt] != -INF)
                return dp[now][cnt];
            else {
                ll tmp = -INF;
                for(int x = cnt; x <= 2; x++) {
                    tmp = max({v[now].item[cnt] + dfs(now + 1, x), tmp});
                }
                return dp[now][cnt] = tmp;
            }
        };

        ll ret = max({dfs(0, 0), dfs(0, 1), dfs(0, 2)});
        cout << ret << endl;
        //cout << v[n/2-1].item[2] << endl;
    }
    return 0;
}

Measured memory_bytes: 21952
#include<bits/stdc++.h>
using namespace std;
#define MEM(a, b) memset(a, (b), sizeof(a))
#define FOR(i, j, k, in) for (int i=j ; i<k ; i+=in)
#define RFOR(i, j, k, in) for (int i=j ; i>=k ; i-=in)
#define REP(i, j) FOR(i, 0, j, 1)
#define RREP(i, j) RFOR(i, j, 0, 1)
#define MP make_pair
#define PB push_back
#define INF (int)1e9
#define EPS 1e-9
#define MOD 1000000007
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<PII> VII;
typedef vector<VI> VVI;
typedef map<int, int> MPII;
typedef set<int> SETI;
typedef multiset<int> MSETI;
typedef long int int32;
typedef unsigned long int uint32;
typedef long long int int64;
typedef unsigned long long int  uint64;
int n, k, min_;
VI nums, dp;


void solve() {
	cin >> n >> k;
	nums.resize(n);
	for (int i = 0; i < n; i++) {
		cin >> nums[i];
	}
	dp.resize(k+1,0);

	for(int i = 1; i <= k; i++) {
		for(int num: nums) {
			if(i-num < 0) continue;

			if(dp[i-num] == 0) {
				dp[i] = 1;
			}
		}
	}

	if(dp[k]) cout << "First";
	else cout << "Second";

}

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

	return 0;
}

Measured memory_bytes: 3704
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
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; }
const ll INF=1LL<<60;
int main(){
    int a,b;
    while(cin >> a >> b){
        cout << a+b << endl;
    }
}


Measured memory_bytes: 3104
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define int long long
#define endl '\n'
#define pb push_back
#define fi first
#define se second
#define PI acos(-1)
#define all(c) (c).begin(),(c).end()
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef vector<int> vi;

template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

#define TRACE
#ifndef ONLINE_JUDGE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
	cerr << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
	const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...)
#endif

int modpow(int x, int n, int m) {
	x %= m;
	int res = 1;
	while(n > 0) {
		if(n & 1)
			res = res * x % m;
		x = x * x % m;
		n >>= 1;
	}
	return res;
}

const ll inf = 2e18;
const int mod = 1e9 + 7;
const int N = 2e5 + 10;

signed main() {
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	srand(chrono::steady_clock::now().time_since_epoch().count());
	#ifndef ONLINE_JUDGE
		// freopen("input.txt", "r", stdin);
		// freopen("output.txt", "w", stdout);
	#endif

	int a, b;
	cin >> a >> b;
	int tmp;
	if(a <= b) {
		tmp = b;
		while(tmp--) {
			cout << a;
		}
	}
	else {
		tmp = a;
		while(tmp--) {
			cout << b;
		}
	}

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long int64;
const string tmp = "NESW";
const int vy[] = {-1, 0, 1, 0}, vx[] = {0, 1, 0, -1};
int H, W;
int64 L;
string C[100];
int sx, sy, sv;
int64 nxt[100][100][4];
inline void dfs(int x, int y, int v, int64 step)
{
  int nx = x + vx[v], ny = y + vy[v], nv = (v + 1) % 4;
  if(step == 0) {
    cout << y + 1 << " " << x + 1 << " " << tmp[v] << endl;
    return;
  } else if(0 <= nx && 0 <= ny && nx < W && ny < H && C[ny][nx] != '#') {
    int64 loop = ~nxt[nx][ny][v] ? nxt[x][y][v] - nxt[nx][ny][v] + 1 : step;
    nxt[nx][ny][v] = nxt[x][y][v] + 1;
    return(dfs(nx, ny, v, (step - 1) % loop));
  } else {
    nxt[x][y][nv] = nxt[x][y][v];
    return(dfs(x, y, nv, step));
  }
}
int main()
{
  while(cin >> H >> W >> L, H) {
    memset(nxt, -1, sizeof(nxt));
    for(int i = 0; i < H; i++) {
      cin >> C[i];
      for(int j = 0; j < W; j++) {
        int p = tmp.find(C[i][j]);
        if(p != string::npos) sx = j, sy = i, sv = p;
      }
    }
    nxt[sx][sy][sv] = 0;
    dfs(sx, sy, sv, L);
  }
}

Measured memory_bytes: 1560
#!/usr/bin/env python3

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

def gcd(n,m):
    if m == 0:
        return n
    return gcd(m,n%m)
n,X = LI()
x = LI()
x = [abs(i-X) for i in x]
for i in range(n):
    if i == 0:
        g = x[i]
    g = gcd(g,x[i])
print(g)

Measured memory_bytes: 59800
// I make this just for fun because i'm done
// Aimi Haraguni >> Konomi Suzuki >> Yui >>  Ikimono Gakari >> Garnidelia >> Kalafina >> Eir Aoi.   .. dude? 
// problems that involves any kind of persistent data structures are the best of the best, are not them?
 
// #pragma GCC optimize ("Ofast,unroll-loops")
// #pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
 
#include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
 
#define pb push_back
#define ff  first
#define ss second
#define tm1 first
#define tm2 second.first
#define tm3 second.second
#define sz(x) ll(x.size())
#define all(v) (v).begin(), (v).end()
#define FER(i,a,b) for(ll i=ll(a); i< ll(b); ++i)
#define IFR(i,a,b) for(ll i=ll(a); i>=ll(b); --i )
#define fastio ios_base::sync_with_stdio(0); cin.tie(0)
 
#define N 31000000
// #define M 19
 
// #define mod  11092019
#define mod1 1000000007
#define mod2 1000000009
#define bas 987625403
#define sqr(x) (x)*(x)  
#define INF 2000000000000
 
using namespace std;
using namespace __gnu_pbds;
 
typedef long long ll;
typedef pair<ll, ll> ii;
typedef pair<ll, ii > tri;
typedef vector<ll> vi;
typedef vector<ii> vii;
typedef tree<pair<ll, ll>, null_type, less<pair<ll, ll>>, rb_tree_tag, tree_order_statistics_node_update> S_t;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
 
#define trace(...) fff(#__VA_ARGS__, __VA_ARGS__)
template<typename t> void fff(const char* x, t&& val1) { cout<<x<< " : "<<val1<<"\n";}
template<typename t1, typename... t2> void fff(const char* x, t1&& val1, t2&&... val2){
    const char* xd=strchr(x+1, ',');
    cout.write(x, xd-x)<<" : "<<val1<<" | ";
    fff(xd+1, val2...);
}

inline ll mul(ll a, ll b, ll mod) { return (long long) a*b%mod;}
inline ll add(ll a, ll b, ll mod) { return a+b < mod? a+b: a+b-mod;}
inline void Mul(ll &a, ll b, ll mod) { a = (long long) a*b%mod;}
inline ll bp(ll a, ll p, ll mod){
	ll ret;
	for(ret = 1; p; p>>=1, Mul(a, a, mod)) (p & 1) && (Mul(ret, a, mod), 1);
	return ret;
}

static inline ll get_num() {
    ll num = 0;
    char c = getchar_unlocked();
    while(!((c>='0') & (c<='9')))  c=getchar_unlocked();
    while(c>='0' && c<='9'){
        num = (num<<1)+(num<<3)+c-'0';
        c=getchar_unlocked();
    }
    return num;
}

static inline void read(ll &x) { x = get_num();}

int main(){
	ll n; read(n);
	ll times = 0;
	FER(i, 0, n){
		ll x; read(x);
		if(!(i&1) and (x&1)) times++;
	}
	cout<<times<<"\n";
	return 0;
}

Measured memory_bytes: 3584
//的場梨沙★担当
//結城晴★副担当
//日野茜★副担当
#include <vector>
#include <list>
#include <map>
#include <climits>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string.h>
#include <string>
#include <cstring>
#include <ctime>
#include <queue>
#include <random>
#include <cctype>
#include <complex>
#include <regex>
#include <unordered_map>
#include <string>
#include <algorithm>
#include <cctype>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <iomanip>
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <vector>
#include <stdio.h>


using namespace std;

int main(void) {
    string S;
    cin>>S;

    int A=S.length();
    if(A%2==0) {

        for (int i = 0; i < A; i++) {
            if (i % 2 == 0) {
                if (S[i] != 'h') {
                    cout << "No" << endl;
                    return 0;
                }
            } else {
                if (S[i] != 'i') {
                    cout << "No" << endl;
                    return 0;
                }
            }
        }

        cout << "Yes" << endl;
    }
    else{
        cout<<"No"<<endl;
    }
}


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

#define __STDC_FORMAT_MACROS
#define p64 PRId64

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR (i, 0, n)
#define ALL(f, x, ...)                                                         \
    ([&] (decltype ((x)) ALL) {                                                \
        return (f) (begin (ALL), end (ALL), ##__VA_ARGS__);                    \
    }) (x)

using namespace std;
using ll = int64_t;

int main() {
    ll N, A, B;
    cin >> N >> A >> B;
    ll dv, rm;
    dv = N / (A + B);
    rm = N % (A + B);
    cout << A * dv + min (A, rm) << endl;
    return 0;
}


Measured memory_bytes: 256
import sys
import math
import itertools
import bisect
from copy import copy,deepcopy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
INF = 10**9
mod = 10**9+7

N = i()
A = l()
ans = 0
num = sum(A)
for i in range(N-1):
     num -= A[i]
     ans = (ans+A[i]*num)%mod
print(ans)

Measured memory_bytes: 96636
#pragma GCC optimize("Ofast")  
#pragma GCC target("avx,avx2,fma") 
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#define ALL(x) x.begin(),x.end()
#define PB push_back
#define EB emplace_back
#define F first
#define S second
#define ll long long
#define MP make_pair
// #define int long long
// #define MAX LONG_LONG_MAX
// #define MIN LONG_LONG_MIN
#ifdef LOCAL // setting up print debugging (yes lol)
template<class K, class V>ostream& operator<<(ostream&s,const pair<K,V>&p){s<<'<'<<p.x<<','<<p.y<<'>';return s;}
template<class T, class=typename T::value_type, class=typename enable_if<!is_same<T,string>::value>::type>
ostream& operator<<(ostream&s,const T&v){s<<'[';for(auto&x:v){s<<x<<", ";}if(!v.empty()){s<<"\b\b";}s<<']';return s;}
void __prnt(){cerr<<endl;} template<class T, class...Ts>void __prnt(T&&a,Ts&&...etc){cerr<<a<<' ';__prnt(etc...);}
#define print(...) __prnt(__VA_ARGS__)
#else
#define print(...)
#endif
using namespace std;

const size_t MAXN = 1e5 +7;


void check(){
	int x;
	cin >> x;
	cout << !x;
}

int32_t main(){
	ios_base::sync_with_stdio(false); cin.tie(NULL); 
	cin.exceptions(cin.failbit);
	int t = 1;	
	// cin >> t;
	for(int i = 1 ; i <= t ;i++){
		// cout << "Case "<< i << ":\n";
		check();
	}
	return 0;
}


Measured memory_bytes: 3608
#include<bits/stdc++.h>
#define iint int
#define pll std::pair<iint,iint>
#define rep(i,a,b) for(iint i=(iint)a;i<(iint)b;i++)
#define per(i,a,b) for(iint i=(iint)a;i>(iint)b;i--)
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define full(a) a.begin(),a.end()
#define rfull(a) a.rbegin(),a.rend()

using namespace std;
const double pi=acos(-1.0);
const double pii=2*pi;
const double eps=1e-6;
const long long MOD=1e9+7;

int get_fact(int n){
	if(n==0 || n == 1){
		return 1;
	}
	return n*get_fact(n-1);
}

long double dist_f(long long a, long long b, long long c, long long d){
	return sqrt(1.0*(a-c)*(a-c) + 1.0*(b-d)*(b-d));
}

long double get_dist(int n, std::vector<int>& a, std::vector<std::pair<long long, long long>>& arr){
	long double ans =0;
	for(int i=0;i<n-1;i++){
		ans += dist_f(arr[a[i]].F, arr[a[i]].S, arr[a[i+1]].F, arr[a[i+1]].S);
	}
	return ans;
}

void solve(){
	int n;
	std::cin >> n;
	std::vector<std::pair<long long, long long>> arr(n,{0ll,0ll});
	for(int i=0;i<n;i++){
		std::cin >> arr[i].F >> arr[i].S;
	}

	std::vector<int> ind;
	for(int i=0;i<n;i++)
		ind.pb(i);

	long double dist = 0ll;
	do{
		dist += get_dist(n,ind,arr);
	}while(next_permutation(ind.begin(),ind.end()));

	std::cout << std::fixed << std::setprecision(10) << dist/(get_fact(n)*1.0) << "\n";
}

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

	// int t;
	// std::cin >> t;
	// while(t--){
	// 	solve();
	// }

	solve();
	return 0;
}


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

using namespace std;
using llong = long long;
using P = pair<llong, llong>;

#define BE(x) x.begin(), x.end()

const llong inf = llong(1e18)+7;
const llong mod = 1e9+7;

int main(){
	llong K,T;
	multiset<llong> s;

	cin >> K >> T;
	llong a;
	for(int i = 0; i < T; i++){
		cin >> a;
		s.insert(a);
	}

	while(s.size() > 1){
		auto it1 = s.end();
		it1--;
		auto it2 = it1;
		it2--;
		int a = *it1, b = *it2;
		s.erase(it1);
		s.erase(it2);

		a--;
		b--;
		if(a)
			s.insert(a);
		if(b)
			s.insert(b);
	}
	if(s.size() == 0)
		s.insert(1);

	cout << *s.begin()-1 << endl;

	return 0;
}

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

int main(){
  int h, w;
  cin >> h >> w;
  for(int i=0; i<w+2; i++)cout << '#';
  cout << endl;
  for(int i=0; i<h; i++){
    cout << '#';
    for(int j=0; j<w; j++){
      char a;
      cin >> a;
      cout << a;
    }
    cout << '#' << endl;
  }
  for(int i=0; i<w+2; i++)cout << '#';
  return 0;
}

Measured memory_bytes: 384
from math import floor  
stairs_num, broken_num = tuple(int(i) for i in input().split(" "))
broken_list = []
for i in range(broken_num):
    broken_list.append(int(input()))
trance_num_list = []
if len(broken_list) >= 1 and broken_list[0] == 1:
    trance_num_list.append(0)
else:
    trance_num_list.append(1)
if (len(broken_list) >= 1 and broken_list[0] == 2) or \
 (len(broken_list) >= 2 and broken_list[1] == 2):
    trance_num_list.append(0)
else:
    if trance_num_list[0] == 0:
        trance_num_list.append(1)
    else:
        trance_num_list.append(2)
if stairs_num > 2:
    a = len(broken_list)
    for i in range(stairs_num - 2):
        key = 0
        left = 0
        right = a
        while left < right:
            midle = floor((left + right) / 2)
            if broken_list[midle] < i + 3:
                left = midle + 1
            elif broken_list[midle] == i + 3:
                key = 1
                break
            else:
                right = midle
        if key:
            trance_num_list.append(0)
        else:
            trance_num_list.\
             append((trance_num_list[-1] + trance_num_list[-2]) % 1000000007)
print(trance_num_list[stairs_num - 1])

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

inline int digits(int a, int b){
    int n=0,m=0;
    while(a>0){
        n++;
        a/=10;
    }
    while(b>0){
        m++;
        b/=10;
    }
    return max(n,m);
}

signed main(){
    int n; cin>>n;
    int ans=INT_MAX;
    for(int i=1; i*i<=n; i++){
        if(n%i==0){
            ans=min(ans,digits(i,n/i));
        }
    }
    cout<<ans<<endl;
}

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

int main() {
  
  int n;
  cin >> n;
  
  int s = 0, m = n;
  while(m > 0) {
    s += m % 10;
    m /= 10;
  }
  
  cout << ((n % s == 0) ? "Yes" : "No") << endl;
   
}

Measured memory_bytes: 256
#include <cstring>
#include <map>
#include <unordered_map>
#include <string>
#include <list>
#include <vector>
#include <algorithm>
#include <queue>
#include <stack>
#include <cstdio>
#include <iostream>
#include <set>
#include <unordered_set>
using namespace std;

#define MAX(a,b) (a>b?a:b)
#define MIN(a,b) (a<b?a:b)
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int ui;
typedef pair<int, int> pii;

int gi() {
    int a;
    scanf("%d", &a);
    return a;
}

ll gli() {
    ll a;
    scanf("%lld", &a);
    return a;
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n = gi();
    int m = gi();
    printf("%d\n", n*(n-1)/2 + m*(m-1)/2);

    return 0;
}


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

int n, d[101010];

int main(){
  cin >> n;
  rep(i, n) cin >> d[i];
  sort(d, d + n);
  cout << d[n / 2] - d[n / 2 - 1] << endl;
  return 0;
}

Measured memory_bytes: 640
H, W, M = gets.split.map(&:to_i)
HWs = readlines.map{_1.split.map(&:to_i)}
Hs, Ws = HWs.transpose

ht, wt = Hs.tally, Ws.tally
hm, wm = ht.max_by{_2}.last, wt.max_by{_2}.last
hn, wn = ht.count{_2 == hm}, wt.count{_2 == wm}
puts hm + wm - (hn*wn > HWs.count{ht[_1] == hm && wt[_2] == wm} ? 0 : 1)

Measured memory_bytes: 92112
// This code writed by chtholly_micromaker(MicroMaker)
#include <bits/stdc++.h>
#define reg register
using namespace std;
template <class t> inline void rd(t &s)
{
	s=0;
	reg char c=getchar();
	while(!isdigit(c))
		c=getchar();
	while(isdigit(c))
		s=(s<<3)+(s<<1)+(c^48),c=getchar();
	return;
}
signed main(void)
{
 string s;
 cin>>s;
 if(s=="Sunny")
 	cout<<"Cloudy"<<endl;
else if(s=="Rainy")
	cout<<"Sunny"<<endl;
else
	cout<<"Rainy"<<endl;
	return 0;
}



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

int simulator(vector<long>& cur) {
  long sum = 0;
  for(int i = 0; i < cur.size(); i++) {
    sum += cur[i] - 1;
  }
  bool win = (sum & 1);
  int odds = 0;
  for(int i = 0; i < cur.size(); i++) {
    if(cur[i] == 1) return win;
    if(cur[i] & 1) odds++;
  }
  // 奇数が2つあると勝負は動かない
  if(odds >= 2) return win;
  // 奇数が1つで自分のターンなら勝負は動かない
  if(odds >= 1 && win) return win;
  // 奇数は1つで負け確定 → 勝負するしかない
  // TODO: 例外: N = 2 もう片方を奇数にすると今度は相手が偶数にするしかない
  for(int i = 0; i < cur.size(); i++) {
    if(cur[i] & 1) {
      cur[i]--;
      long gcd = cur[0];
      for(int i = 0; i < cur.size(); i++) {
        gcd = std::__gcd(cur[i], gcd);
      }
      for(int i = 0; i < cur.size(); i++) {
        cur[i] /= gcd;
      }
      return !simulator(cur);
      break;
    }
  }
}
int main() {
  int N;
  cin >> N;
  vector<long> a(N);
  long sum = 0;
  for(int i = 0; i < N; i++) {
    cin >> a[i];
    sum += a[i];
  }
  cout << (simulator(a) ? "First" : "Second") << endl;
  return 0;
}

Measured memory_bytes: 1152
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <numeric>
#include <map>
#include <cmath>
#include <iostream>
#include <deque>
#include <math.h>
#include <cstdio>
#include <functional>
#include <set>
#include <iomanip>
typedef  long long ll;
using namespace std;

int main(void) {
	ll a, b, c, x, y;
	cin >> a >> b >> c >> x >> y;
	ll ans = a * x + b * y;
	for (ll i = 0; i < 100001; i++)
	{
		ll fee = i * 2 *c + max((ll)0,x - i) * a + max((ll)0, y - i) * b;
		ans = min(ans, fee);
	}
	cout << ans << endl;
	return 0;
}

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

int N;
string S;

int main() {
	cin >> N;
	cin >> S;

	int x = 0;
	int ans = x;
	for( int i = 0; i < N; i++ ) {
		if( S[i] == 'I' ) {
			x++;
		}
		else {
			x--;
		}
		ans = max( ans, x );
	}

	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<map>
#include<set>
#include<algorithm>
#include<cstdio>
#include<cmath>
using namespace std;

int main(){
  int n, min, input, md, dt;
  cin >> n;
  for(int i = 0; i < n; i++){
    cin >> input;
    if(i == 0){
      min = input;
    }else{
      dt = input - min;
      if(i == 1 || dt > md) md = dt;
      if(min > input)min = input;
    }
  }
  cout << md << endl;
  return 0;
}


Measured memory_bytes: 3108
#include<bits/stdc++.h>
#define N 40005
using namespace std;
int n,a[N],b[N],A[N];

int main(){
  while(1){
    cin>>n;
    if(!n)break;
    for(int i=0;i<n;i++)cin>>a[i];
    for(int i=0;i<n;i++)cin>>b[i];
    sort(a,a+n,greater<int>());
    sort(b,b+n,greater<int>());
    for(int i=0;i<n;i++)A[i]=n;
    int x=0;
    for(int i=0;i<n;i++)
      for(int j=x;j<n;j++)
	if(b[i]>=a[j]){
	  A[j]=i;
	  x=j+1;
	  break;
	}
    int cnt=0,ans=n;
    for(int i=0;i<n;i++){
      if(A[i]!=n)cnt++;
      if(cnt<(i+2)/2)ans=min(ans,i+1);
    }
    if(ans==n)cout<<"NA"<<endl;
    else cout<<ans<<endl;
  }
  return 0;
}

Measured memory_bytes: 3588
#include <bits/stdc++.h>
 
using namespace std;
typedef long long ll;
typedef vector<int> VI;
ll mm=1000000000;ll MM=mm+7;
#define rep(i, n) for(int i=0;i<n;i++)
#define PI 3.141592653589793

int main(){
 string s1,s2,s3;
 cin >> s1 >> s2 >> s3;
 cout << 'A' << s2.at(0) << 'C';
}

Measured memory_bytes: 3616
import java.util.Scanner;

public class Main {

	@SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		int h = scanner.nextInt();
		int w = scanner.nextInt();
		String[] s = new String[h];

		for (int i = 0; i < h; i++) {
			s[i] = scanner.next();
		}
		for (int i = 0; i < w + 2; i++) {
			System.out.print("#");
		}
		System.out.println("");
		for (int i = 0; i < h; i++) {
			System.out.print("#");
			System.out.print(s[i]);
			System.out.println("#");
		}
		for (int i = 0; i < w + 2; i++) {
			System.out.print("#");
		}
	}
}


Measured memory_bytes: 23124
#include <iostream>

using namespace std;

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

	int n, q, t, count = 0;
	int left, right, center;
	int S[100000];

	cin >> n;
	for (int i = 0; i < n; i++)
		cin >> S[i];

	cin >> q;
	for (int i = 0; i < q; i++) {
		cin >> t;
		left = 0;
		right = n;
		while (left <= right)
		{
			center = (left + right) / 2;
			if (S[center] < t) {
				left = center + 1;
			}
			else if (S[center] > t) {
				right = center - 1;
			}
			else {
				count++;
				break;
			}
		}
	}

	cout << count << endl;

	return 0;
}

Measured memory_bytes: 1584
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#pragma GCC optimize("Ofast")
//*********************************************DO IT NOW****************************************************************
#include<bits/stdc++.h> 
#include<random>
#define int long long   
#define pp pair<int,int> 
#define ss second 
#define ff first 
#define pb push_back
#define mod 1000000007
#define pi 3.14159265359
#define mk(arr,n,type)  type *arr=new type[n];
#define sl s1.length();
#define yes cout<< "YES"<<endl
#define no  cout<< "NO"<<endl
#define all(v) (v).begin(),(v).end()
#define s(v)   sort(v,v+n)
#define  mt mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define read(a,n) for(int i=0;i<n;i++)cin>>a[i]
#define print(a,n) for(int i=0;i<n;i++)cout<<a[i]<<" "
#define for1(i,a,n)  for(int i=0;i<n;i++)
using namespace std;
//**********************************************DO IT NOW***************************************************************
void fastio()
{  
  #ifndef ONLINE_JUDGE
  freopen("INPUT.txt","r",stdin);
  freopen("OUTPUT.txt","w",stdout); 
  #endif
  ios_base :: sync_with_stdio(false); 
  cin.tie(NULL) ; 
  cout.tie(NULL);
}
int dp[101][1001],ans1=1e9,dp1[1000001];
int num[10];
int a[1000000];
signed main()
{   
    fastio();
    int t=1;
   // cin>>t;
    while(t--)
    { 
       int n,m;
       cin>>n>>m;
       printf("%d\n",(n+m-1)/m);
    }
}
// 🍪 🍪 🍪


Measured memory_bytes: 3772
#include <bits/stdc++.h>
using namespace std;
//using Graph = vector<vector<int>>;
using P = pair<int,int>;
//int dy[4] = {-1,0,1,0};
//int dx[4] = {0,-1,0,1};

int main()
{
    int N,K;
    cin >> N >> K;
    vector<int> a(N);
    for(int i=0;i<K;i++)
    {
        int t;
        cin >> t;
        for(int j=0;j<t;j++)
        {
            int b;
            cin >> b;
            b--;
            a[b]++;
        }
    }
    
    int ans = 0;
    for(int i=0;i<N;i++)
    {
        if(a[i]==0) ans++;
    }
    cout << ans << endl;
}



/*
int main()
{
    int N;
    cin >> N;
    
    
    return 0;
}
*/

Measured memory_bytes: 3628
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
#include <stdlib.h>
#include <functional>
#define ll long long
#define llu unsigned long long
#define INF 0x3f3f3f3f
#define LINF 0x3f3f3f3f3f3f3f3f
#define MOD 1000000007
using namespace std;
int n, m;
int seg[2010];

int update(int node, int l, int r, int pos, int val) {
	if (pos < l || pos > r) return seg[node];
	if (l == r) return seg[node] += val;
	int mid = (l + r) >> 1;
	return seg[node] = update(2 * node, l, mid, pos, val) + update(2 * node + 1, mid + 1, r, pos, val);
}

int query(int node, int l, int r, int ql, int qr) {
	if (ql > r || qr < l) return 0;
	if (ql <= l && r <= qr) return seg[node];
	int mid = (l + r) >> 1;
	return query(2*node, l, mid, ql, qr) + query(2 * node + 1, mid + 1, r, ql, qr);
}

pair<pair<int, int>, int> L[200010];
pair<pair<int, int>, int> Q[100010];
int res[100010];

bool cmp(pair<pair<int, int>, int> &a, pair<pair<int, int>, int> &b) {
	if (a.first.second < b.first.second) return true;
	return false;
}

int main()
{
	int i, l, r, k;
	scanf("%d%d%d", &n, &m, &k);

	for (i = 1; i <= m; ++i) {
		scanf("%d%d", &l, &r);
		L[i].first.first = l;
		L[i].first.second = r;
		L[i].second = i;
	}

	for (i = 1; i <= k; ++i) {
		scanf("%d%d", &l, &r);
		Q[i].first.first = l;
		Q[i].first.second = r;
		Q[i].second = i;
	}

	sort(L + 1, L + 1 + m, cmp);
	sort(Q + 1, Q + 1 + k, cmp);

	int idx = 1;
	for (i = 1; i <= k; ++i) {
		while (idx <= m && Q[i].first.second >= L[idx].first.second) {
			update(1, 1, n, L[idx].first.first, 1);
			idx++;
		}
		res[Q[i].second] = query(1, 1, n, Q[i].first.first, Q[i].first.second);
	}

	for (i = 1; i <= k; ++i) {
		printf("%d\n", res[i]);
	}
}

Measured memory_bytes: 4864
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const long double PI = 3.14159265358979323846;

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

    int n, k;
    cin >> n >> k;
    bitset<105> snuckes;
    for (int i = 0; i < k; ++i) {
        int di;
        cin >> di;
        for (int j = 0; j < di; ++j) {
            int snuke;
            cin >> snuke;
            snuckes[snuke - 1] = true;
        }
    }
    int ans = n;
    for (int i = 0; i < n; ++i) {
        ans -= snuckes[i];
    }
    cout << ans << '\n';

    return 0;
}


Measured memory_bytes: 3656
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n) ;i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define sz(x) ((int)(x).size())
using ll=long long;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define MOD  1000000007
const ll INF=1e18;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b){ a = b; return 1; } return 0; }



int main(int argc, char const *argv[]) {
  int a,p;
  cin >> a >> p;
  cout << (a*3+p)/2 << endl;
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<math.h>
using namespace std;


int main(){
  int K,S;
  cin >> K >> S;
  int cnt = 0;
  for(int i = 0; i <= K; i++){
    for(int j = 0; j <= K; j++){
      if(i + j <= S && i + j >= S - K ) cnt++; 
    }
  }
  cout << cnt << endl;
}


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

using namespace std;

int main() {
	int a, b;
	cin >> a >> b;
	vector<int> v = { 0,2,0,1,0,1,0,0,1,0,1,0 };
	if (v[a - 1] == v[b - 1]) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
	return 0;
}

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

#define FOR(i,a,b)  for(ll (i)=a;(i)<(b);++(i))
#define RFOR(i,a,b) for(ll (i)=a;(i)>=(b);--(i))
#define REP(i,n)    FOR(i,0,n)
#define RREP(i,n)   RFOR(i,n,0)
#define ALL(v)      (v).begin(),(v).end()
#define BIT(n)      (1LL<<(n))
#define IN(x,l,r)   ((l)<=(x)&&(x)<=(r))
#define SHOW(x)     cout<<#x<<" = "<<x<<endl
#define SORT(v)     sort(ALL(v))
#define SZ(v)       (ll)(v).size()
#define UNIQ(v)     SORT(v);(v).erase(unique(ALL(v)),(v).end())
#define PERM(v)     for(bool p=1;p;p=next_permutation(ALL(v)))
#define PQ(T)       priority_queue<T,vector<T>,greater<T>>

template<typename T>string join(const vector<T>& v, string d=" ")
{stringstream s;REP(i,SZ(v))s<<d<<v[i];return s.str().substr(d.length());}

template<typename T> ostream& operator<<(ostream& s, const vector<T>& v)
{if(SZ(v))s<<join(v,", ");return s;}

const ll INF = 1e15;
const ll MOD = 1e9+7;
const double EPS = 1e-10;

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

int main() {
    ll N; cin >> N;
    vector<ll> a(N); REP(i, N) cin >> a[i];
    
    vector<ll> b(N+1, -1);
    REP(i, N) b[a[i]] = i;
    
    set<ll> s;
    s.insert(-1);
    s.insert(N);
    
    ll ans = 0;
    FOR(i, 1, N+1) {
        s.insert(b[i]);
        auto it = s.find(b[i]);
        --it;
        ll left = *it;
        ++it;
        ++it;
        ll right = *it;
        
        ans += i * (b[i] - left) * (right - b[i]);
    }
    cout << ans << endl;
    
    return 0;
}

Measured memory_bytes: 12800