akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
using namespace std;

int main()
{
    int n, i, j, k, b, f, r, v;
    int num[4][3][10];
    
    for(i = 0; i < 4; i++){
        for(j = 0; j < 3; j++){
            for(k = 0; k < 10; k++){
                num[i][j][k] = 0;
            }
        }
    }

    cin >> n;
    for(i = 0; i < n; i++){
        cin >> b >> f >> r >> v;
        num[b - 1][f - 1][r - 1] = num[b - 1][f - 1][r - 1] + v;
    }

    for(i = 0; i < 4; i++){
        for(j = 0; j < 3; j++){
            for(k = 0; k < 10; k++) cout << " " << num[i][j][k];
            cout << endl;
        }
        if(i < 3){
            for(k = 0; k < 20; k++) cout << "#";
            cout << endl;
        }
    }

    return 0;
}

Measured memory_bytes: 1160
#include <iostream>
#include <algorithm>
//#include <tuple>
#include <string>
#include <vector>
#define rep(i,n) for(int i=0;i<n;i++)
#define ll long long
#define pb push_back
using namespace std;

int k, a, b;

int main() {
	cin >> k >> a >> b;

	int trn = k - a + 1;
	if (trn <= 0) {
		cout << 1 + k;
		return 0;
	}

	ll ans = (ll)a;

	if (b - a > 2) {
		ans += (ll)(b - a)*(trn / 2) + (trn % 2);
	}
	else ans = 1 + k;

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

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
typedef long long ll;
int main(void){
  int D, T, S;
  cin >> D >> T >> S;
  if(S * T >= D){
      cout << "Yes" << endl;
  }
  else{
      cout << "No" << endl;
  }
  return 0;
}

Measured memory_bytes: 3572
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    a = f()[0]
    b = f()[0]
    if a>b:
        print('GREATER')
    elif a<b:
        print('LESS')
    else:
        print('EQUAL')

solve()


Measured memory_bytes: 2940
#include<iostream>
#include<vector>
#include<cmath>
#include<algorithm>
#include<utility>
#include<map>
#include<set>
#include<string>

using namespace std;

#define ll long long

int main(){
    ll A,B,C;
    ll ans = 1e9;
    cin >> A >> B >> C;
    
    cout << min(B/A, C) << endl;
    
}

Measured memory_bytes: 888
//Mahir Ratanpara (DA-IICT)
#include<bits/stdc++.h>
using namespace std;
#define Ff(i,a,n) for(i=a;i<n;i++)
#define Fr(i,a,n) for(i=a;i>n;i--)
#define ll long long
#define FAST ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define all(x) x.begin(), x.end()
#define clr(x) memset(x, 0, sizeof(x))
#define sortall(x) sort(all(x))
#define tr(it, a) for(auto it = a.begin(); it != a.end(); it++)
typedef pair<ll, ll>	pa;
typedef vector<ll>		vc;
typedef vector<pa>		vp;
typedef vector<vc>		vvc;
int mpow(int base, int exp); 
void ipgraph(int m);
void dfs(int u, int par);
const int mod = 1000000007;
const int N = 3e5, M = N;
//=======================

vc g[N];
ll a[N];

int main() {
    FAST;
    int a,b,c,k;
    cin>>a>>b>>c;
    cin>>k;
    if(k<=a) cout<<k<<endl;
    else if(k<=a+b) cout<<a<<endl;
    else cout<<a-1*(k-a-b)<<endl;
    return 0;
}

int mpow(int base, int exp) {
  base %= mod;
  int result = 1;
  while (exp > 0) {
    if (exp & 1) result = ((ll)result * base) % mod;
    base = ((ll)base * base) % mod;
    exp >>= 1;
  }
  return result;
}

void ipgraph(int n, int m){
	int i, u, v;
	while(m--){
		cin>>u>>v;
		g[u-1].pb(v-1);
		g[v-1].pb(u-1);
	}
}

void dfs(int u, int par){
	for(int v:g[u]){
		if (v == par) continue;
		dfs(v, u);
	}
}

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

#define MOD 1000000007
#define rep(i, n) for(ll i=0; i < (n); i++)
#define rrep(i, n) for(ll i=(n)-1; i >=0; i--)
#define ALL(v) v.begin(),v.end()
#define rALL(v) v.rbegin(),v.rend()
#define FOR(i, j, k) for(ll i=j;i<k;i++)
#define DUMP(i, v)for(ll i=0;i<v.size();i++)cerr<<v[i]<<" "

using namespace std;
typedef long long int ll;
typedef vector<ll> llvec;
typedef vector<double> dvec;
typedef pair<ll, ll> P;
typedef long double ld;
struct edge{ll x, c;};

ll mod(ll a, ll mod){
  ll res = a%mod;
  if(res<0)res=res + mod;
  return res;
}

ll modpow(ll a, ll n, ll mod){
  ll res=1;
  while(n>0){
    if(n&1) res=res*a%mod;
    a=a*a%mod;
    n>>=1;
  }
  return res;
}

ll modinv(ll a, ll mod){
  return modpow(a, mod-2, mod);
}

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

bool is_prime(ll n){
  ll i = 2;
  if(n==1)return false;
  if(n==2)return true;
  bool res = true;
  while(i*i <n){
    if(n%i==0){
      res = false;
    }
    i = i+1;
  }

  //if(i==1)res = false;
  if(n%i==0)res=false;
  return res;
}

struct UnionFind{
  ll N;
  llvec p;
  llvec cnt;
  UnionFind(ll n){
    N = n;
    p=llvec(N);
    cnt=llvec(N, 0);
    rep(i, N){
      p[i] = i;
      cnt[i] = 1;
    }
  }

  void con(ll a, ll b){
    P at = root(a);
    P bt = root(b);
    if(at.second!=bt.second){
      if(at.first>bt.first){
        swap(at, bt);
        swap(a, b);
      }
      p[at.second] = bt.second;
      cnt[bt.second]+=cnt[at.second];
      p[a]=bt.second;
    }
  }

  P root(ll a){
    ll atmp = a;
    ll c=0;
    while(atmp!=p[atmp]){
      atmp = p[atmp];
      c++;
    }
    p[a] = atmp;
    return {c, atmp};
  }

  bool is_con(ll a, ll b){
    P at=root(a);
    P bt=root(b);
    return at.second == bt.second;
  }
  
};

struct dijkstra{
  ll N;
  llvec d;
  vector<vector<edge>> e;
  dijkstra(ll n){
    N = n;
    //d = llvec(N, 1e18);
    e = vector<vector<edge>>(N);
  }

  void add_edge(ll from, ll to, ll cost){
    e[from].push_back({to, cost});
  }

  void run(ll start){
    priority_queue<P, vector<P>, greater<P>> que;
    que.push({0, start});
    d = llvec(N, 1e18);
    d[start]=0;
    while(!que.empty()){
      P q = que.top();que.pop();
      ll dc = q.first;
      ll x = q.second;
      if(dc>d[x]){
        continue;
      }else{
        for(auto ip: e[x]){
          if(d[ip.x]<=d[x]+ip.c){
            continue;
          }else{
            d[ip.x]= d[x]+ip.c;
            que.push({d[ip.x], ip.x});
          }
        }
      }
    }
  }  
};


/**************************************
** A main function starts from here  **
***************************************/
int main(){
  ll N;
  cin >> N;
  set<ll> pr;
  /*
  FOR(i, 2, 1000001){
  if(is_prime(i)){
  pr.insert(i);
  }
  }
  */
  map<ll, ll>ft;
  FOR(ip, 2, 1e6+1){
    while(N%ip==0){
      ft[ip]++;
      N=N/ip;
      //cerr << ip << endl;
    }
  }
  if(N!=1){
    ft[N]++;
  }
  ll ans = 0;
  for(auto ip: ft){
    ll n = ip.second;
    ll cnt = 0;
    while(cnt*(cnt+1)/2<=n){
      cnt++;
    }
    ans += cnt-1;
  }

  cout << ans;
  return 0;
}


Measured memory_bytes: 3632
n,k = map(int,input().split())
letters = list(input())
l = letters[k-1]
if l == "A":
  l = "a"
elif l == "B":
  l = "b"
elif l == "C":
  l = "c"
letters[k-1] = l  
for letter in letters:
  print(letter, end="")

Measured memory_bytes: 3060
#require 'pp'
def makeSet(x)
  $ps << x
  $rank << 0
end
def union(x,y)
  link(findSet(x), findSet(y))
end
def link(x,y)
    $ps[y] = x
end
def findSet(x)
  if x != $ps[x]
    $ps[x] = findSet($ps[x])
  end
  return $ps[x]
end
$ps = []
$rank = []

n,q = gets.split.map(&:to_i)
n.times{|i|
  makeSet(i)
}
E = []
q.times{|i|
  E << gets.split.map(&:to_i)
}
E.sort_by!{|x| x[2]}
#pp E

cou = 0
sum = 0
while cou <= n-2
  i = E.shift
#  puts "s:#{findSet(i[0])}"
#  puts "s:#{findSet(i[1])}"
  next if findSet(i[0]) == findSet(i[1])
  union findSet(i[0]), findSet(i[1])
  cou += 1
  sum += i[2]
#  puts sum
  gets
end
puts sum


Measured memory_bytes: 16496
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <bits/stdc++.h>
using namespace std;
char s[1005];
char t[1005];
int main()
{
    cin >> s >> t;
    int len = strlen(s);
    int len2 = strlen(t);
    int same =  0 ;
    int ans = 0 ;
    //cout << len - len2 <<endl;
    for(int i=0;i+len2-1<len;i++){
           // cout << i <<endl;
        same = 0 ;
        for(int j=0;j<len2;j++){
            if(s[i+j]==t[j])
                same++;
        }
        ans = max(same,ans);
    }
    cout <<len2-ans <<endl;
    return 0;
}


Measured memory_bytes: 3628
# 整数の入力
N = int(input())
# スペース区切りの整数の入力
p = [int(x) for x in input().split()]


# 1からNまでの昇順リスト
correct = range(1, N+1)
# カウンタ
count = 0


# リストpとcorrectを比較する
for i in range(len(p)):
  if p[i] != correct[i]:
    count += 1


# カウンタを確認、3以上だったらNo
print('NO') if count >= 3 else print('YES')

Measured memory_bytes: 3060
import sys

n = int(sys.stdin.readline())
jobs = [tuple(map(int, sys.stdin.readline().split())) for _ in range(n)] # time taken, deadline

jobs.sort(key = lambda x: x[1])

def solve(jobs):
	total = 0
	for time, deadline in jobs:
		total += time
		if total >  deadline:
			return False
	return True
print("Yes" if solve(jobs) else "No")

Measured memory_bytes: 31824
n = int(input())
array = []
for i in range(n):
    array.append(input())
ac = 0
wa =0
tle = 0
re = 0

for s in array:
    if s=='AC':
        ac += 1
    elif s=='WA':
        wa += 1
    elif s=='TLE':
        tle += 1
    elif s=='RE':
        re += 1
print('AC x '+str(ac))
print('WA x '+str(wa))
print('TLE x '+str(tle))
print('RE x '+str(re))

Measured memory_bytes: 16300
#include <algorithm>
#include <string.h>
#include <iostream>
#include <stdio.h>
using namespace std;

const int mod = 1e9 + 7;;
const int N = 1e5 + 10;
long long num[N];
long long result[N];
long long power(long long a, long long b) {
	long long res = 1;
	while (b > 0) {
		if (b & 1)
			res = res * a % mod;
		a = a * a % mod;
		b >>= 1;
	}

	return res % mod;
}

long long comb(long long a, long long b) {
	if (b > a)
		return 0;
	return result[a] * power(result[b] * result[a - b] % mod, mod - 2) % mod;
}

int main() {
	int n, k;
	result[0] = 1;
	for (int i = 1; i < N; ++i)
		result[i] = result[i - 1] * i % mod;
	
	cin >> n >> k;
	for (int i = 0; i < n; ++i)
		cin >> num[i];
	long long ans = 0;

	sort(num, num + n);

	for (int i = 0; i < n - k + 1; i++)
		ans = (ans + (num[n - i - 1] - num[i]) % mod * comb(n - i - 1, k - 1) % mod) % mod;
	cout << ((ans % mod + mod) % mod) << endl;
	return 0;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string S;
  int N;
  cin >> S;
  N = S.size();
  int a=1;
  for (int i=0; i<N; ++i) {
    if (i%2 == 1 && S.at(i) != 'R') {
      a *= 1;
    }else if (i%2 == 0 && S.at(i) != 'L') {
      a *= 1;
    }else{
      a *= 0;
    }
  }
  if (a == 0) {
    cout << "No" << endl;
  }else{
    cout << "Yes" << endl;
  }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long int 
#define mod 1000000007
#define se second
#define fi first
#define endl "\n"
#define pi 3.1415926535897932384626433832795028841971
#define MAX 9223372036854775807
using namespace std;
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
//	cout<<fixed<<setprecision(10);
	ll n,m;
	cin>>n>>m;
	vector<ll> adj[n+1];
	ll x,y,z;
	for(int a=0;a<m;a++)
	{
		cin>>x>>y;
		adj[x].push_back(y);
		adj[y].push_back(x);
	}
	queue<ll> q;
	q.push((ll)1);
	ll vis[n+1]={0};
	ll dis[n+1]={0};
	ll par[n+1];
	for(int a=0;a<=n;a++)
	par[a]=a;
	while(!q.empty())
	{
		x=q.front();
		q.pop();
		vis[x]=1;
		for(int i=0;i<adj[x].size();i++)
		{
			ll j=adj[x][i];
			if(vis[j]==0)
			{
				vis[j]=1;
				dis[j]=dis[x]+1;
				par[j]=x;
				q.push(j);
			}
		}
	}
	ll ans=1;
	for(int a=2;a<=n;a++)
	{
		if(dis[a]==0)
		{
			ans=0;
			break;
		}
	}
	if(ans==0)
	cout<<"No";
	else
	{
		cout<<"Yes"<<endl;
		for(int a=2;a<=n;a++)
		cout<<par[a]<<endl;
	}
	return 0;
}

Measured memory_bytes: 14484
# frozen_string_literal: true

n, m = gets.split.map(&:to_i)
ab = m.times.map { gets.split.map(&:to_i) }

# Disjoint Set Union
class DSU
  def initialize(n = 0)
    # root node: -1 * component size
    # otherwise: parent
    @n = n
    @parent_or_size = Array.new(n, -1)
  end

  def merge(a, b)
    x = leader(a)
    y = leader(b)
    return x if x == y

    x, y = y, x if -@parent_or_size[x] < -@parent_or_size[y]
    @parent_or_size[x] += @parent_or_size[y]
    @parent_or_size[y] = x
    x
  end

  def same(a, b)
    leader(a) == leader(b)
  end

  def leader(a)
    @parent_or_size[a].negative? ? a : (@parent_or_size[a] = leader(@parent_or_size[a]))
  end

  def size(a)
    -@parent_or_size[leader(a)]
  end

  def groups
    leader_buf = Array.new(@n, 0)
    group_size = Array.new(@n, 0)
    (0...@n).each do |i|
      leader_buf[i] = leader(i)
      group_size[leader_buf[i]] += 1
    end
    result = Array.new(@n) { [] }
    (0...@n).each do |i|
      result[leader_buf[i]].push i
    end
    result.delete_if(&:empty?)
    result
  end

  alias root leader
  alias find leader
  alias unite merge
  alias same? same
end

UnionFind        = DSU
UnionFindTree    = DSU
DisjointSetUnion = DSU
u = UnionFind.new(n)

ab.each do |a, b|
  u.merge(a - 1, b - 1)
end
puts u.groups.size - 1


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

//BEGIN CUT HERE
//Dinic
class Dinic{
public:
    explicit Dinic(int v):vertex(static_cast<unsigned int>(v)){//v->MAX_VERTEX_SIZE
        G.resize(vertex+10);
        for (auto &i : G)i.resize(vertex+10);
    }
    void add_edge(int from,int to,int cap){
        G[from].push_back((edge){to, cap, static_cast<int>(G[to].size())});
        G[to].push_back((edge){from, 0, static_cast<int>(G[from].size() - 1)});
    }
    ll max_flow(int s,int t){//s->start , t->end
        ll flow=0;
        for(;;){
            bfs(s);
            if(level[t]<0)return flow;
            iter.clear();
            iter.resize(vertex+10,0);
            ll f;
            while((f=dfs(s,t,INF))>0)flow+=f;
        }
    }
private:
    unsigned int vertex;
    struct edge{
        int to;
        ll cap;
        int rev;
    };
    vector<vector<edge> > G;
    vector<int> level;
    vector<int> iter;
    ll INF=(ll)1e16;
    void bfs(int start){
        level.clear();
        level.resize(vertex+10,-1);
        queue<int> q;
        q.push(start);
        level[start]=0;
        while(!q.empty()){
            int now=q.front();
            q.pop();
            for(int i=0;i<(int)G[now].size();i++) {
                if(G[now][i].cap>0 && level[G[now][i].to]<0){
                    level[G[now][i].to]=level[now]+1;
                    q.push(G[now][i].to);
                }
            }
        }
    }
    ll dfs(int now,int t,ll f){
        if(now==t)return f;
        for(int &i=iter[now];i<(int)G[now].size();i++){
            edge &e=G[now][i];
            if(e.cap>0 && level[now]<level[e.to]){
                ll d=dfs(e.to,t,min(f,e.cap));
                if(d>0){
                    e.cap-=d;
                    G[e.to][e.rev].cap+=d;
                    return d;
                }
            }
        }
        return 0;
    }
};
//END CUT HERE

//ARC092-B 2D Plane 2N Points
int main(){
    int n;cin>>n;
    Dinic f(2*n);
    int s=2*n;
    int t=s+1;
    vector<pair<int,int> > aka,ao;
    for(int i=0;i<n;i++){
        int a,b;cin>>a>>b;
        aka.push_back({a,b});
        f.add_edge(s,i,1);
    }
    for(int i=0;i<n;i++){
        int a,b;cin>>a>>b;
        ao.push_back({a,b});
        f.add_edge(n+i,t,1);
    }
    for(int i=0;i<n;i++){
        for(int j=0;j<n;j++){
            if(aka[j].first<ao[i].first && aka[j].second<ao[i].second){
                f.add_edge(j,n+i,1);
            }
        }
    }
    cout<<f.max_flow(s,t)<<endl;
}

Measured memory_bytes: 2304
#include <stdio.h>

int main(void){

  int n;
  scanf("%d", &n);
  char s[n+1];
  scanf("%s", s);

  int flag = 0;
  if (n % 2 == 0) {
    flag = 1;
    for (int i = 0; i < n/2; i++) {
      if (s[i] != s[i+n/2]) {
        flag = 0;
        break;
      }
    }
  }

  if (flag == 1) {
    printf("Yes\n");
  } else {
    printf("No\n");
  }

  return 0;
}

Measured memory_bytes: 128
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ViewPatterns #-}
{-# LANGUAGE TemplateHaskell #-}
--atcoder {-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NoImplicitPrelude #-}

import Prelude
import System.IO
import System.Environment
import System.Exit
import Data.List
import Data.Maybe
import qualified Data.Char as Char
import qualified Data.Text as T
import qualified Data.Text.IO as TIO
import qualified Control.Monad
--atcoder import qualified Data.Semigroup
import qualified Data.Map as Map
import qualified Data.Set as Set

readInt :: IO Int
--readInt = read <$> getLine
readInt = getLine >>= (return . read)

readInts :: IO [Int]
readInts = map (read :: String -> Int) <$> words <$> getLine

solve :: Int -> Int -> Int
solve l r = if r - l + 1 >= 2019
            then 0
            else minimum $ concat (map (\x -> map (\y -> mod (x*y) 2019) [(x+1) .. r]) [l .. r])

main :: IO ()
main = do
    lr <- getLine >>= (return . words) >>= (return . map (read :: String -> Int))
    let l = lr !! 0
    let r = lr !! 1
    let ret = solve l r
    print ret

Measured memory_bytes: 892
N, M = map(int, input().split())
MOD = 10**9 + 7
F = [0]*(N+1)
for i in range(M):
    F[int(input())-1] = 1

a = 1; b = 0
for i in range(N):
    if F[i]:
        a, b = 0, a
    else:
        a, b = (a+b) % MOD, a
print(a)


Measured memory_bytes: 3828
from bisect import bisect_left

s = input()
n = len(s)+1

#a = [-1]*n
localmin = set()
localmax = set()

if s[0]=="<":
    #a[0]=0
    localmin.add(0)
else:
    localmax.add(0)
    

if s[n-2]==">":
    #a[n-1]=0    
    localmin.add(n-1)
else:
    localmax.add(n-1)

for i in range(n-2):
    if s[i]==">" and s[i+1]=="<":
        #a[i+1] = 0
        localmin.add(i+1)
    elif s[i]=="<" and s[i+1]==">":
        localmax.add(i+1)        

localmin.add(-1)
localmin.add(n)

ans = 0

localmin = list(localmin)
localmin.sort()
for i in localmax:
    j = bisect_left(localmin, i)
    left = i - localmin[j-1]
    right= localmin[j] - i
    long = max(left, right)
    short= min(left, right)
    
    ans += (long * (long + 1))//2
    ans += (short* (short- 1))//2    

print(ans)

Measured memory_bytes: 20628
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
using namespace std;
const int RANDOM1 = chrono::high_resolution_clock::now().time_since_epoch().count();
struct chash {
    int operator()(int x) const { return hash<int>{}(x ^ RANDOM1); }
};
#define ll long long
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define deb(x) cout<<#x<<" : "<<x<<"\n";
#define debug(x,y) cout<<#x<<" : "<<x<<"\t"<<#y<<" : "<<y<<"\n";
#define ff first
#define ss second
#define ub upper_bound
#define lb lower_bound
#define all(a) (a).begin(),(a).end()
#define bs binary_search
#define sz size()
#define vi vector<int>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define ld long double
#define clr fflush(stdout);
//#define clr cout.flush();
#define N 100001
#define fpr(i,a,b) for(int i=a;i<b;i++)
#define fdr(i,a,b) for(int i=a;i>b;i--)
#define repp(i,a,b,d) for(int i=a;i<b;i+=d)
#define repd(i,a,b,d) for(int i=a;i>b;i-=d)
#define LLMIN LLONG_MIN
#define LLMAX LLONG_MAX
#define AKASH_PATEL ios_base::sync_with_stdio(false);
#define SVNIT_SURAT cin.tie(NULL);cout.tie(NULL);
#define mset(x,a) memset(x,a,sizeof(x));
#define nl cout<<'\n';
#define print(c) cout<<c<<'\n';
#define setp(n) cout << fixed << setprecision(n)
#define take_arr(a,n) fpr(i,0,n) cin>>a[i];
#define print_arr(a,n) for(int i=0;i<n;i++) {cout<<a[i]<<" ";} cout<<'\n';
#define take_mat(mat,n,m) fpr(i,0,n) fpr(j,0,m) cin>>mat[i][j];
#define set_mat(mat,n,m,k) fpr(i,0,n) fpr(j,0,m) mat[i][j]=k;
#define print_mat(dist,n,m) for(int i=0;i<n;i++){for(int j=0;j<m;j++){cout<<dist[i][j]<<" ";}cout<<'\n';}
template< class T > bool inside(T a, T b, T c) { return a<=b && b<=c; }
bool fun(string s)
{
    fpr(i,0,s.size()/2)
    {
        if(s[i]!=s[s.size()-i-1])
        {
            return false;
        }
    }
    return true;
}
int main()
{
    AKASH_PATEL;
    SVNIT_SURAT;
    string s;
    cin>>s;
    string s1=s.substr(0,s.sz/2);
    string s2=s.substr(s.size()/2+1);
    if(fun(s) && fun(s1) && fun(s2))
    {
        cout<<"Yes\n";
    } else{
        cout<<"No";
    }
    return 0;
}





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

#include <stdio.h>

#include <math.h>
/********
*	????§???¢?????????????±???????????????°??????
*********/	
/*********??¢?????´?????????
*	(1)??°????????\???
*	(2)?¨???????????????????
*********/
#define PI 3.1415926535

int main(void)
{
	double a,b, h, S, L, rad,c;
//?§?C?????§??????(???) 			????????¢??? = ??? *??/180???
	
    cin >> a >> b >> c;
	
	rad = (c * PI)/180.0;
	S = (a*b *sin(rad))/2.0;
	L =a + b + sqrt(a*a + b*b - (2.0*a*b*cos(rad)));
	h = b * sin(rad);
	
	printf("%f\n", S);
	printf("%f\n", L);
	printf("%f\n", h);
	
	return 0;
}

Measured memory_bytes: 1232
#include <iostream>
typedef long long ll;
using namespace std;

int main(){    
    ll a,b,c,x,y,ans;
    cin>>a>>b>>c>>x>>y;  
    if(x<y){
        swap(a,b);
        swap(x,y);} 
    ans=min(c*(x*2),c*(y*2)+a*(x-y));  
    cout<<min(ans,a*x+b*y)<<endl; 
    return 0;}

Measured memory_bytes: 256
#include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 99999999999999999
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;



int main(){

	int a,b,c,d;

	scanf("%d %d %d %d",&a,&b,&c,&d);

	int ans = min(abs((a+b)-(c+d)),min(abs((a+c)-(b+d)),abs((a+d)-(b+c))));

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

	return 0;
}



Measured memory_bytes: 3220
#include <bits/stdc++.h>
#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++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;


int main()
{
    string a, b;
    cin >> a >> b;
    bool flag = true;
    REP(i, 3) {
        if (a.at(i) != b.at(2 - i)) flag = false;
    }
    string ans = flag ? "YES" : "NO";
    cout << ans << endl;
    return 0;
}

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

long long DP[500005];

int main(){
	memset(DP,-1,sizeof DP);
	DP[0] = 0;
	int n,w,ww,vv;
	scanf("%d%d",&n,&w);
	for (int i= 0; i<n;i++){
		scanf("%d%d",&ww,&vv);
		for(int j = 100005;j>=0;j--){
			if(DP[j]!=-1){
				if(DP[j+vv]==-1) DP[j+vv] = 1000000000000000;
				DP[j+vv] = min(DP[j+vv],DP[j]+ww);
			}
		}
	}
	long long ans = 0;
	for (int i= 500004; i>=0;i--){
		if(DP[i]!=-1 && DP[i]<=w)ans = max((long long)i,ans);
	}
	printf("%lld\n",ans);
	return 0;
}

Measured memory_bytes: 4096
#include <iostream>
#include <algorithm>
#include <sstream>
#include <string>
#include <queue>
#include <cstdio>
#include <map>
#include <set>
#include <utility>
#include <stack>
#include <cstring>
#include <cmath>
#include <vector>
using namespace std;
typedef long long ll;

int main()
{
#ifdef LOCAL
    freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
#endif // LOCAL

    char op[5];
    int a,b;
    ll ans=0;
    scanf("%d",&a);
    scanf("%s",op);
    scanf("%d",&b);
    if(op[0]=='+')
        ans=a+b;
    else
        ans=a-b;
    printf("%lld",ans);
    return 0;
}


Measured memory_bytes: 384
#include "bits/stdc++.h"
#include <sys/timeb.h>
#include <fstream>

using namespace std;

#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define replrev(i,a,b) for(int i=(int)(b)-1;i>=(int)(a);i--)
#define reprev(i,n) replrev(i,0,n)
#define repi(itr,ds) for(auto itr = ds.begin(); itr != ds.end(); ++itr)
#define mp make_pair
#define INF 2000000000
#define INFL 2000000000000000000LL
#define EPS 1e-9
#define MOD 1000000007
#define PI 3.1415926536
#define RMAX 4294967295
typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<double> vd;
typedef vector<P> vP;
typedef vector<vector<int> > vvi;
typedef vector<vector<ll> > vvll;
typedef vector<vector<char> > vvc;
typedef vector<vector<double> > vvd;
typedef vector<vector<P> > vvP;
typedef priority_queue<int, vector<int>, greater<int> > pqli;
typedef priority_queue<ll, vector<ll>, greater<ll> > pqlll;
typedef priority_queue<P, vector<P>, greater<P> > pqlP;
typedef pair<int, pair<int, int> > Edge;
typedef vector<Edge> vE;

int main() {
	int N, L;
	cin >> N >> L;
	vi a(N);
	rep(i, N)cin >> a[i];
	int left = -1;
	rep(i, N - 1) {
		if (a[i] + a[i + 1] >= L) {
			left = i;
			break;
		}
	}
	if (left == -1) {
		cout << "Impossible" << endl;
		return 0;
	}
	cout << "Possible" << endl;
	repl(i, 1, left + 1) {
		cout << i << endl;
	}
	replrev(i, left + 1, N) {
		cout << i << endl;
	}

	return 0;
}

Measured memory_bytes: 1152
#include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <tuple>
#include <vector>
using namespace std;
typedef long long ll;
ll const INF = 1LL << 60;

int main() {
  string S;
  cin >> S;
  set<char> s;
  for (int i = 0; i < S.size(); i++) {
    s.insert(S[i]);
  }
  string ans = (s.size() == S.size()) ? "yes" : "no";
  cout << ans << endl;
  return 0;
}

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

using namespace std;

#define MAX 1011
#define INF 1e9

struct Edge{
  int u,v;
};

vector<int> G[MAX];

int bfs(int s,int t){
  queue<int> Q;
  Q.push(s);
  int dist[MAX];
  fill(dist,dist+MAX,INF);
  dist[s] = 0;
  
  while(!Q.empty()){
    int v = Q.front(); Q.pop();
    if(v == t) return dist[t];
    for(int i = 0 ; i < (int)G[v].size() ; i++){
      if(dist[v] + 1 < dist[G[v][i]]){
        dist[G[v][i]] = dist[v] + 1;
        Q.push(G[v][i]);
      }
    }
  }
  return INF;
}

int main(){
  int N,S,T,M;
  while(cin >> N,N){
    vector<Edge> e;
    cin >> S >> T >> M;
    S--; T--;
    for(int i = 0 ; i < MAX ; i++){
      G[i].clear();
    }
    for(int i = 0 ; i < M ; i++){
      int u,v;
      cin >> u >> v;
      u--; v--;
      e.push_back((Edge){u,v});
      G[u].push_back(v);
    }
    int res,nc,num;
    res = nc = bfs(S,T);
    for(int i = 0 ; i < (int)e.size() ; i++){
      for(int j = 0 ; j < N ; j++){
        G[j].clear();
      }
      swap(e[i].u,e[i].v);
      for(int j = 0 ; j < (int)e.size() ; j++){
        G[e[j].u].push_back(e[j].v);
      }
      int r = bfs(S,T);
      if(r < res){
        res = r;
        num = i+1;
      }
      swap(e[i].u,e[i].v);
    }
    if(res == nc){
      cout << res << " " << 0 << endl;
    }else{
      cout << res << " " << num << endl;
    }
  }
  return 0;
}

Measured memory_bytes: 1544
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define PI 3.14159265358979323846
#define int long long
constexpr int INF = numeric_limits<int>::max() / 2;
constexpr long long INFL = numeric_limits<long long>::max() / 2;
constexpr int MOD = 1000000007;
using Graph = vector<vector<int>>;

const string dx[3]={"3","5","7"};

int ans=0;
int N;
void sol(string x){
    if(x!=""){
        if(stol(x) > N) return;
    }
    bool z3=false,z5=false,z7=false;
    rep(i,x.size()){
        if(x[i]=='3') z3=true;
        if(x[i]=='5') z5=true;
        if(x[i]=='7') z7=true;
    }
    if(z3&&z5&&z7) ans++;
    rep(i,3){
        string nx=x+dx[i];
        sol(nx);
    }



}


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

    cin>>N;
    sol("");
    cout << ans << endl;


}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, n) for (int i = 1; i < (int)(n); i++)
#define Sort(a) sort(a.begin(), a.end())
typedef long long int ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
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;}

int main(){
    int n;
    cin >> n;
    string ans = "hon";
    if(n%10 == 0 ||n%10 == 1||n%10 == 6 ||n%10 == 8){
        ans = "pon";
    }
    if(n%10 == 3){
        ans = "bon";
    }
    cout << ans << endl;
    return 0;
}

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

public class Program
{
    static void Main()
    {
        var alpha = Console.ReadLine().Split().Select(int.Parse).ToArray();
        var a = Enumerable.Range(0, alpha[0]).Select(zeta => Console.ReadLine().Split().Select(int.Parse).ToArray()).ToArray();
        var b = Enumerable.Range(0, alpha[1]).Select(zeta => int.Parse(Console.ReadLine())).ToArray();

        foreach (var delta in a.Select(beta => beta.Select((gamma, epsilon) => gamma * b[epsilon]).Sum()))
        {
            Console.WriteLine(delta);
        }
    }
}


Measured memory_bytes: 20432
#include <bits/stdc++.h>
// #include <iostream>
// #include <vector>
// #include <map>
// #include <algorithm>
using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())

template<typename T>
T mod(T a, T b){
    return (a + b) % b;
}

template<typename T>
T gcd(T a, T b){
    if (b == 0) return a;
    return gcd(b, a % b);
}

ll lcm(ll a, ll b){
    return a * b / gcd(a,b);
}

// n を素因数分解
map<ll, ll> factor(ll n){
    map<ll, ll> mp;
    for (ll i = 2; i*i <= n; i++) {
        while (n % i == 0) {
            mp[i]++;
            n /= i;
        }
    }

    if (n > 1) {
        mp[n]++;
    }

    return mp;
}

// 文字列に "hoge" が含まれているか
// string str = "hogepiyo";
// if (str.find("hoge") != string::npos) {
//     cout << "文字列が含まれています" << endl;
// }

// char to string
// char c = 'a';
// string str = {c};

void solve(){
    int K, X;
    cin >> K >> X;

    for (int i = X-K+1; i <= X+K-1; i++) {
        if (i == X-K+1) {
            cout << i;
        } else {
            cout << " " << i;
        }
    }
    cout << endl;

    return;
}

int main(int argc, char const* argv[])
{
    solve();
    return 0;
}


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


int main(){
  int n;cin>>n;
  int t[n],x[n],y[n];

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

  if(t[0]!=x[0]+y[0]){cout<<"No"<<endl;return 0;}
  else{
    for(int i=1;i<n;i++){
      if(abs(x[i]-x[i-1])+abs(y[i]-y[i-1])<=t[i]-t[i-1]){
	if(abs((t[i]-t[i-1])-(abs(x[i]-x[i-1])+abs(y[i]-y[i-1])))%2==0){}
	else{cout<<"No"<<endl;return 0;}
      }
      else{cout<<"No"<<endl;return 0;}
    }
  }

  cout<<"Yes"<<endl;
  
  return 0;
}


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

int main() {
  long long N;
  cin >> N;
  string res = "";
  while (N) {
    --N;
    res += (char)('a' + (N % 26));
    N /= 26;
  }
  reverse(res.begin(), res.end());
  cout << res << endl;
}

Measured memory_bytes: 3628
using System;
using System.Text;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Threading.Tasks;
using System.IO;

class Solve
{
	const int mod = 1000000007;
	static void Main(string[] args)
	{
		var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
		Console.SetOut(sw);

		int N = int.Parse(Console.ReadLine());
		string[] W = new string[N];
		string ans = "Yes";
        for(var i = 0; i < N; i++)
		{
			W[i] = Console.ReadLine();
		}
		List<string> used = new List<string>();
        for(var i = 0; i < N; i++)
		{
			if (i == 0)
			{
				used.Add(W[i]);
				continue;
			}
			if (W[i][0] != W[i - 1][W[i - 1].Length - 1] || used.Contains(W[i]))
			{
				ans = "No";
				break;
			}
			used.Add(W[i]);
		}
		Console.WriteLine(ans);

		Console.Out.Flush();
	}
}

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

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

	S = A * B;
	T = C * D;

	if (S > T)
		cout << S << endl;
	else
		cout << T << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
typedef long long LL;
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<double> VD;
#define MP make_pair
#define PB push_back
#define X first
#define Y second
 
#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define RFOR(i, b, a) for(int i = (b) - 1; i >= (a); --i)
#define ITER(it, a) for(__typeof(a.begin()) it = a.begin(); it != a.end(); ++it)
#define ALL(a) a.begin(), a.end()
#define SZ(a) (int)((a).size())
#define FILL(a, value) memset(a, value, sizeof(a))
#define debug(a) cout << #a << " = " << a << endl;

const double PI = acos(-1.0);
const LL INF = 1e9 + 47;
const LL LINF = INF * INF;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const int N = 1 << 9;
int n;
int a[N][N];

void print()
{
	FOR(i, 1, n)
	{
		FOR(j, i + 1, n + 1)
			cout << a[i][j] << ' ';
		cout << endl;
	}
	
	exit(0);
}

void solve(vector<int> x, int color)
{
	sort(ALL(x));
	if (SZ(x) == 1)
		return;
		
	if (SZ(x) == 2)
	{
		a[x[0]][x[1]] = color;
		return;
	}
	
	int m = SZ(x) >> 1;
	
	vector<int> l, r;
	FOR(i, 0, m)
		l.PB(x[i]);
	FOR(i, m, SZ(x))
		r.PB(x[i]);
		
	for(auto i: l)
		for(auto j: r)
			a[i][j] = color;
	
	solve(l, color + 1);
	solve(r, color + 1);
}

int main()
{
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	//freopen("In.txt", "r", stdin);
	//freopen("In.txt", "w", stdout);
		
	cin >> n;
	vector<int> x;
	FOR(i, 1, n + 1)
		x.PB(i);
	solve(x, 1);	
	print();
	
	cerr << "Time elapsed: " << clock() / (double)CLOCKS_PER_SEC << endl;
	return 0;
}


Measured memory_bytes: 1536
#include<stdio.h>
#include<iostream>
#include<string>
#include<memory>
#include<cmath>
#include<algorithm>
#include<vector>
#include<unordered_map>
double min_double(double a,double  b){
    if(a<b) return a;
    else return b;
}
void swap(int *x,int *y){
    int tmp;
    tmp=*x;
    *x=*y;  
    *y=tmp;
}
int gcd(int a,int b){
    if(a<b) swap(&a,&b);
    if(b<1) return -1;

    if(a%b==0) return b;
    return gcd(b,a%b);
}
int lcm(int a,int b){
    return a * b / gcd(a,b);
}

int main(){
    int N;
    std::cin>>N;
    std::vector<double> v(N);
    for(int i=0;i<N;i++) std::cin>>v[i];
    std::sort(v.begin(),v.end());
    for(int i=0;i<N-1;i++){
        v[0]=(v[0]+v[1])/2;
        v.erase(v.begin()+1);
    }
    std::cout<<v[0]<<std::endl;
    return 0;
}

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

int main(){
  double H , W, N;
  cin >> H >> W >> N;
  int ans;
  
  if(H >= W){
	ans = ceil(N/H);
  }
  else{
    ans = ceil(N/W);
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#ifdef DEBUG
#define _GLIBCXX_DEBUG
#endif

#include <bits/stdc++.h>

using namespace std;

mt19937 mrand(random_device{} ()); 

int rnd(int x) {
  return mrand() % x;
}

typedef long double ld;
typedef long long ll;

#ifdef DEBUG
#define eprintf(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
#else
#define eprintf(...) ;
#endif

#define pb push_back
#define mp make_pair
#define sz(x) ((int) (x).size())
#define TASK "text"

const int inf = (int) 1.01e9;
const ld eps = 1e-9;
const ld pi = acos((ld) -1.0);

const int mod = (int) 1e9 + 7;

void add(int &x, int y) {
  if ((x += y) >= mod) {
    x -= mod;
  }
}

int mult(int x, int y) {
  return (long long) x * y % mod;
}

int myPower(int x, int pw) {
  int res = 1;
  for (; pw; pw >>= 1) {
    if (pw & 1) {
      res = mult(res, x);
    }
    x = mult(x, x);
  }
  return res;
}

void precalc() {
}


const int maxn = (int) 1e5 + 10;
vector<vector<int> > es;

int n, m;

int read() {
  if (scanf("%d%d", &n, &m) < 2) {
    return 0;
  }
  es = vector<vector<int> >(n);
  for (int i = 0; i < m; ++i) {
    int s, t;
    scanf("%d%d", &s, &t);
    --s, --t;
    es[s].pb(t), es[t].pb(s);
  }
  return 1;
}

int used[maxn];

bool ok;

void dfs(int v) {
  for (int u : es[v]) {
    int ncol = (used[v] ^ 1);
    if (used[u] != -1) {
      if (used[u] != ncol) {
        ok = 0;
      }
      continue;
    }
    used[u] = ncol;
    dfs(u);
  }
}

void solve() {
  for (int i = 0; i < n; ++i) {
    used[i] = -1;
  }
  long long one = 0, two = 0, three = 0;
  for (int i = 0; i < n; ++i) {
    if (used[i] != -1) {
      continue;
    }
    if (sz(es[i]) == 0) {
      ++one;
      continue;
    }

    ok = 1;
    used[i] = 0;
    dfs(i);

    (ok ? two : three) += 1;
  }
  //eprintf("%lld %lld %lld\n", one, two, three);

  long long res = one * one + 2 * one * (n - one);
  res += (three + two) * (three + two);
  res += two * two;
  printf("%lld\n", res);
}

int main() {
  precalc();
#ifdef LOCAL
  freopen(TASK ".out", "w", stdout);
  assert(freopen(TASK ".in", "r", stdin));
#endif

  while (1) {
    if (!read()) {
      break;
    }
    solve();
#ifdef DEBUG
    eprintf("Time %.2f\n", (double) clock() / CLOCKS_PER_SEC);
#endif
  }
  return 0;
}


Measured memory_bytes: 9088
#include <iostream>
#include <algorithm>
#include <cmath>
#include <math.h>
#include <vector>
using namespace std;
int main() {
	int N; cin >> N;
	vector<pair<int, int>>a(N);
	for (int i = 0; i < N; i++) {
		cin >> a.at(i).first;
		a.at(i) = make_pair(a.at(i).first, i + 1);
	}
	sort(a.begin(), a.end());
	for (int i = 0; i < N; i++) {
		cout << a.at(i).second;
		if (i != N - 1) cout << ' ';
	}
}

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

#define int long long

#define all(v) (v).begin(),(v).end()
#define pb push_back
#define fi first
#define se second
#define rep(i,s,n) for(int i = s;i<n;i++)
#define repe(i,s,n) for(int i = s;i<=n;i++)
#define rrep(i,s,n) for(int i = (n)-1;i>=(s);i--)
#define chmin(a,b) a=min((a),(b))
#define chmax(a,b) a=max((a),(b))
#define low(a,b) lower_bound(all(a),(b))
#define upp(a,b) upper_bound(all(a),(b))
#define fill(i,n) memset(i,n,sizeof(i)
#define endl '\n'
#define IOS() ios_base::sync_with_stdio(0);cin.tie(0)
typedef long long ll;
typedef pair<int,int>pint;
typedef vector<int>vint;
typedef vector<pint>vpint;
typedef pair<pint,int> P1;
typedef pair<int,pint> P2;
typedef pair<pint,pint> PP;
static const ll maxLL = (ll)1 << 62;
const ll MOD=1000000007;
const ll INF=1e18;

int N,M,A,B,C,K;
string s,t;
int a[100010],b[100010],c[100010];

signed main() {
    //IOS();
    /*シフト演算は(1ll<<x)*/
    cin>>N;
    if(N==3||N==5||N==7)cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    return 0;
}

Measured memory_bytes: 256
N = gets.to_i
Ps = (0...3).map{ |i|
  gets.split.map{ |a| a.to_i*3 + 2-i }
}.flatten(1).sort
#p Ps

n = [0,0,0,1]
Ps.each{ |a|
  i = a%3
  n[i] += n[i+1]
  #p n
}
p n[0]

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

#define F first
#define S second
#define MP make_pair
#define pb push_back
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define LCM(a, b) (a) / __gcd((a), (b)) * (b)
#define CEIL(a, b) (a)/(b)+(((a)%(b))?1:0)
#define ln '\n'

using namespace std;

typedef long long LL;
typedef long double ldouble;
typedef pair<int, int> P;
typedef pair<LL, LL> LP;

static const int INF = INT_MAX;
static const LL LINF = LLONG_MAX;
static const int MIN = INT_MIN;
static const LL LMIN = LLONG_MIN;
static const int MOD = 1e9 + 7;
static const int SIZE = 200005;

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

vector<LL> Div(LL n) {
    vector<LL> ret;
    for(LL i = 1; i * i <= n; ++i) {
        if(n % i == 0) {
            ret.pb(i);
            if(i * i != n) ret.pb(n / i);
        }
    }
    sort(all(ret));
    return ret;
}

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

    int a[3];
    cin >> a[0] >> a[1] >> a[2];
    sort(a, a + 3);
    int res = 0;
    res += (a[1] - a[0]) / 2;
    if((a[1] - a[0]) % 2 != 0) {
        ++res;
        ++a[2];

    }
    cout << res + (a[2] - a[1]) << endl;
    return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int k;
long long ans = 1,p = 1;
int cnt(long long a){
	if(a < 10)return a;
	return a%10 + cnt(a/10);
}
int main(){
	//freopen("readin.txt","r",stdin);
	scanf("%d",&k);
	for(int i = 0;i < k;i++){
		printf("%lld\n",ans);
		if((ans + p)*cnt(ans + p*10) > (ans + p*10)*cnt(ans + p))p*=10;
		ans+=p;
	}	
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main()
{
    int a, b;
    char op;
    cin >> a >> op >> b;
    while (op != '?')
    {
        int answer;
        switch (op) {
            case '+':
                answer = a + b;
                break;
            case '-':
                answer = a - b;
                break;
            case '*':
                answer = a * b;
                break;
            case '/':
                answer = a / b;
                break;
        }
        cout << answer << endl;
        cin >> a >> op >> b;
    }

    return 0;
}

Measured memory_bytes: 1160
N,X = map(int,input().split())

L = [int(i) for i in input().split()]

D =[]
D.append(0)
x = 0

for i in range(N):
  x += L[i]
  D.append(x)
  
ans = 0

for i in range(N+1):
  
  if D[i] <= X:
    ans += 1

print(ans)



Measured memory_bytes: 3060
//                                    ∴In the name of God∴
//                     ✫✗⚡😳😳😄😄😝😝😁😁😎😎😛😛😄😄😮😮⚡✗✫
//                                       H.Pouya  ◠?◠
#include<set>
#include<map>
#include<list>
#include<queue>
#include<stack>
#include<vector>
#include<math.h>
#include<bitset>
#include<iostream>
#include<algorithm>
using namespace std;
typedef short int ss;
typedef long double dd;
typedef long long int ll;
#define give_up return 0;
#define mix(x,y) x*pow(10,y)+10
const int maxn=mix(1,6);
int main()
{
    int a,b;
    cin>>a>>b;
    if(a<=5)
        cout<<0;
    else if(13<=a)
        cout<<b;
    else
        cout<<b/2;
    give_up
}
//  🙄


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

typedef long lint;
typedef long long llint;
typedef pair<int, int> pint;
typedef pair<long long, long long> pllint;

// static const int MAX = 1e6;
// static const int NIL = -1;
// static const llint INF = 1<<21;
// static const llint MOD = 1e9 + 7;

bool compPair(const pint& arg1, const pint& arg2) { return arg1.first > arg2.first; }
template<class T> void chmax(T& a, T b) { if (a < b) { a = b; } }
template<class T> void chmin(T& a, T b) { if (a > b) { a = b; } }

int main(void) {
    int r, g, b;
    cin >> r >> g >> b;

    if((10*g+b)%4==0) cout << "YES" << endl;
    else cout << "NO" << endl;
    return 0;
}


Measured memory_bytes: 3636
#include <iostream>
//#include <algorithm>
//#include <vector>
//#include <string>
using namespace std;
//#include <stdio.h>

 
int main(void)
{
    int i, n;
    bool ans = false;
    cin >> n;
    for(i = 1; i < 10; i++) {
        if(n % i == 0 && n / i < 10)
            ans = true;
    }

    if(ans)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
}

Measured memory_bytes: 256
/*
"Won't stop until I'm phenomenal."
- Phenomenal, Eminem
 */
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define ff first
#define Shazam ios_base::sync_with_stdio(false);   cin.tie(NULL); cout.tie(NULL);
#define ss second
#define all(c) c.begin(),c.end()
#define endl "\n"
#define test() int t; cin>>t; while(t--)
#define fl(i,a,b) for(int i = a ; i <b ;i++)
#define get(a) fl(i,0,a.size())  cin>>a[i];
#define pra(a) fl(i,0,a.size()) cout<<a[i]<<" ";	cout<<endl;
#define pr(a,n) fl(i,0,n) cout<<a[i]<<" ";	cout<<endl;
const ll INF = 2e18;
const int inf = 2e9;
const int mod1 = 1e9 + 7;


ll binmodulo(ll x, ll y){

    ll res = 1;
    while(y){
        if(y&1){
            res = res*x;
        }
        y/=2;
        x = x*x;
    }
    return res;
}
 
int main(){
    Shazam;
    ll n; cin>>n;
    
    cout<<binmodulo(2, log2(n)+1)-1<<endl;
    return 0;
}

Measured memory_bytes: 3748
#include<cstdio>
#include<cstring>
const int MAXN=10010;
const int MOD=1e9+7;

int n,k;
int f[MAXN][110],ans;
char ch[MAXN];

void upd(int &x,int y){
	x=(x+(y+MOD)%MOD)%MOD;
}
int main() {
	scanf("%s%d",ch+1,&k);n=strlen(ch+1);
	f[1][0]=1;
	for(int i=2;i<=n;i++)
		for(int d=0;d<=9;d++)
			for(int j=0;j<=k;j++)
				upd(f[i][(d+j)%k],f[i-1][j]);
	int sum=0;
	for(int i=1;i<=n;i++){
		for(int j=0;j<ch[i]-'0';j++)
			upd(ans,f[n-i+1][(-(sum+j)%k+k)%k]);
		sum=(sum+ch[i]-'0')%k;
	}
	if(sum)
		upd(ans,-1);
	printf("%d\n",ans);
	return 0;
}

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

int main() {
  string str;
  cin >> str;
  int counter = 0;
  for (int i = 0; i < str.size(); i++) {
    if (str.at(i) == 'o') {
      counter++;
    }
  }
  cout << 700 + 100 * counter << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define     debug       printf("\n<<CameHere<<\n")
#define     mem(x,y)    memset(x, y, sizeof(x))
#define     all(qz)     qz.begin(),qz.end()
#define     rall(qz)    qz.rbegin(),qz.rend()
#define     inf         LLONG_MIN
#define     INF         LLONG_MAX
#define     mod         1000000007
#define     Sqr(x)      ((x)*(x))
#define     ll          long long
#define     mk          make_pair
#define     pb          push_back
#define     pi          acos(-1.0)
#define     cos(a)      cos(a*pi/180)
#define     sin(a)      sin(a*pi/180)
#define     tan(a)      tan(a*pi/180)

ll pow(ll c,ll d){return d==0?:c*pow(c,d-1);}
ll gcd(ll a,ll b) {return b==0? a:gcd(b,a%b);}
ll lcm(ll a,ll b) {return ((a*b)/gcd(a,b));}
/*---------AL ASAD NUR RIYAD------------*/


int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);

    ll n;
    cin>>n;
    ll ar[5];
    mem(ar,0);
    for(ll i=0;i<n;i++){
        string s;
        cin>>s;
        if(s=="AC") ar[0]++;
        else if(s=="TLE") ar[1]++;
        else if(s=="WA") ar[2]++;
        else ar[3]++;
    }
    cout<<"AC x "<<ar[0]<<endl;
    cout<<"WA x "<<ar[2]<<endl;
    cout<<"TLE x "<<ar[1]<<endl;
    cout<<"RE x "<<ar[3]<<endl;
    return 0;
}



















Measured memory_bytes: 3636
#include<stdio.h>

int main(){
  char ch,ch_small,ch_large;

  while(1){
    scanf("%c", &ch);

    if(ch == '\n'){
      break;
    }else if (ch > 64 && ch < 91){
      ch_small = ch + 32;
      printf("%c",ch_small);
    }else if (ch > 96 && ch < 123){
      ch_large = ch - 32;
      printf("%c",ch_large);
    }else{
      printf("%c",ch);
    }
  }

  printf("\n");

  return 0;
}

Measured memory_bytes: 524
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
using namespace std;
int main() {
	int a, b, c;
	cin >> a >> b >> c;
	if (a == b) {
		cout << c<<endl;
	}
	else if (b == c) {
		cout << a << endl;
	}
	else if (c == a) {
		cout << b << endl;
	}
	return 0;
}



Measured memory_bytes: 256