akhauriyash/Code-Regression huggingface dataset:
#!python3.8
# -*- coding: utf-8 -*-
# abc170/abc170_d
from collections import Counter

def main():
    N = input()
    A = sorted(map(int, input().split(' ')))
    B = Counter(A)
    for a in A:
        if B[a] == 0:
            continue
        if B[a] > 1:
            B[a] = 0
        for i in range(2, A[-1] // a + 1):
            if B[a * i]:
                B[a * i] = 0
    print(sum(B.values()))
    return

main()


Measured memory_bytes: 35900
A, B = [int(input()) for i in range(2)]
if A==1:
  if B==2:
    print(3)
  elif B==3:
    print(2)
elif A==2:
  if B==1:
    print(3)
  elif B==3:
    print(1)
elif A==3:
  if B==1:
    print(2)
  elif B==2:
    print(1)


Measured memory_bytes: 3060
#include <iostream>
#include <cctype>
#include <algorithm>
#include <vector>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <utility>
#include <string>
#include <functional>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cmath>
typedef long long ll;
const int INF = 100000000, mod = 1000000007;
const ll LLINF = 1LL << 50;
using namespace std;

int main() {
    int a, b;
    string s;
    cin >> a >> b >> s;
    for (int i = 0; i < a; i++) {
        if (s[i] == '-') {
            cout << "No";
            return 0;
        }
    }
    if(s[a]!='-') {
        cout << "No";
        return 0;
    }
    for (int i = a + 1; i <= a+b; i++) {
        if (s[i] == '-') {
            cout << "No";
            return 0;
        }
    }
    cout << "Yes" << endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int n;
const int MAX=1e6+5;
bool shibushi[MAX];
int counts[MAX];
void isprime()
{
	memset(shibushi,true,sizeof(shibushi));
	int c=0;
	counts[1]=0;
	for(int i=2;i<MAX;i++)
	{
		if(shibushi[i])
		{
			counts[i]=++c;
			for(int j=2*i;j<MAX;j+=i)
			shibushi[j]=false;
		}
		else counts[i]=c;
	}
}
int main()
{
	isprime();
	while(cin>>n)
	{
		if(n<=0) cout<<0<<endl;
		else cout<<counts[n]<<endl;
	}
	return 0;
}




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

const int N = 250005, MOD[2] = {1035534743, 1043802787};

constexpr int power(int a, int x, int P) {
	int ans = 1;
	for (; x; x >>= 1, a = 1ll * a * a % P)
		if (x & 1) ans = 1ll * ans * a % P;
	return ans;
}

constexpr int B[2] = {327337, 329191}, C[2] = {power(B[0], MOD[0] - 2, MOD[0]), power(B[1], MOD[1] - 2, MOD[1])};
int n;
char s[N];
array<pair<int, int>, 2> f[N];
array<int, 2> a[N], b[N];
map<array<int, 2>, int> buc;

int main() {
	scanf("%d%s", &n, s + 1);
/*	+ t + 1
	- t - 1
	> t / x
	< t * x*/
	f[n + 1][0] = f[n + 1][1] = {1, 0};
	array<int, 2> c = {};
	for (int i = n; i; --i)
		for (int j = 0; j < 2; ++j)
			if (s[i] == '+')
				++c[j];
			else if (s[i] == '-')
				--c[j];
			else if (s[i] == '<')
				c[j] = 1ll * c[j] * B[j] % MOD[j];
			else
				c[j] = 1ll * c[j] * C[j] % MOD[j];
	c[0] = (c[0] + MOD[0]) % MOD[0];
	c[1] = (c[1] + MOD[1]) % MOD[1];
	f[n + 1][0] = f[n + 1][1] = {1, 0};
	for (int i = n; i; --i)
		for (int j = 0; j < 2; ++j) {
			f[i][j] = f[i + 1][j];
			if (s[i] == '-')
				(f[i][j].second += f[i][j].first) %= MOD[j];
			else if (s[i] == '+') {
				f[i][j].second -= f[i][j].first;
				if (f[i][j].second < 0) f[i][j].second += MOD[j];
			} else if (s[i] == '<')
				f[i][j].first = 1ll * f[i][j].first * C[j] % MOD[j];
			else
				f[i][j].first = 1ll * f[i][j].first * B[j] % MOD[j];
		}
	long long ans = 0;
	for (int i = n; i; --i) {
		++buc[{f[i + 1][0].second, f[i + 1][1].second}];
		ans += buc[{int((1ll * f[i][0].first * c[0] + f[i][0].second) % MOD[0]), int((1ll * f[i][1].first * c[1] + f[i][1].second) % MOD[1])}];
	}
	printf("%lld\n", ans);
	return 0;
}


Measured memory_bytes: 37504
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from itertools import permutations, accumulate, combinations, combinations_with_replacement
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right, insort_left, insort_right
from copy import deepcopy
from operator import itemgetter
from functools import reduce
from fractions import gcd
import sys
def input(): return sys.stdin.readline().rstrip()
def I(): return int(input())
def Is(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()
def LS(): return list(input())
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(10**6)
MOD = 10**9+7
INF = float('inf')
# ----------------------------------------------------------- #

n = I()
H = LI()

ans = 1
tmp = H[0]
for i in range(1, n):
    if tmp <= H[i]:
        ans += 1
        tmp = H[i]
print(ans)


Measured memory_bytes: 63212
#![allow(unused_imports)]
#![cfg_attr(feature = "cargo-clippy", allow(redundant_field_names))]

use std::{cmp, fmt};
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};
use std::io::{self, BufWriter, Read, Write};
use std::ops::{Add, Div, Mul, Sub};
use std::str::{self, FromStr};

fn main() {
    let (h, w, s) = {
        let mut sc = InputScanOnce::new(io::stdin(), 1024);
        let (h, w) = (sc.next(), sc.next::<usize>());
        (h, w, sc.strings_as_mat(h, |c| c == b'#'))
    };
    for i in 0..h {
        for j in 0..w {
            let c = s[i][j];
            let u = i > 0 && s[i - 1][j];
            let d = i < h - 1 && s[i + 1][j];
            let l = j > 0 && s[i][j - 1];
            let r = j < w - 1 && s[i][j + 1];
            if c && !(u || d || l || r) {
                println!("No");
                return;
            }
        }
    }
    println!("Yes");
}

struct InputScanOnce {
    buf: Vec<u8>,
    pos: usize,
}

#[allow(dead_code)]
impl InputScanOnce {
    fn new<R: Read>(mut reader: R, estimated: usize) -> Self {
        let mut buf = Vec::with_capacity(estimated);
        let _ = io::copy(&mut reader, &mut buf).unwrap();
        InputScanOnce { buf: buf, pos: 0 }
    }

    #[inline]
    fn next<T: FromStr>(&mut self) -> T
    where
        T::Err: fmt::Debug,
    {
        let mut start = None;
        loop {
            match (self.buf[self.pos], start.is_some()) {
                (b' ', true) | (b'\n', true) => break,
                (_, true) | (b' ', false) | (b'\n', false) => self.pos += 1,
                (_, false) => start = Some(self.pos),
            }
        }
        let target = &self.buf[start.unwrap()..self.pos];
        unsafe { str::from_utf8_unchecked(target) }.parse().unwrap()
    }

    fn vec<T: FromStr>(&mut self, n: usize) -> Vec<T>
    where
        T::Err: fmt::Debug,
    {
        (0..n).map(|_| self.next()).collect()
    }

    fn pairs<T1: FromStr, T2: FromStr>(&mut self, n: usize) -> Vec<(T1, T2)>
    where
        T1::Err: fmt::Debug,
        T2::Err: fmt::Debug,
    {
        (0..n).map(|_| (self.next(), self.next())).collect()
    }

    fn trios<T1: FromStr, T2: FromStr, T3: FromStr>(&mut self, n: usize) -> Vec<(T1, T2, T3)>
    where
        T1::Err: fmt::Debug,
        T2::Err: fmt::Debug,
        T3::Err: fmt::Debug,
    {
        (0..n)
            .map(|_| (self.next(), self.next(), self.next()))
            .collect()
    }

    fn mat<T: FromStr>(&mut self, m: usize, n: usize) -> Vec<Vec<T>>
    where
        T::Err: fmt::Debug,
    {
        (0..m).map(|_| self.vec(n)).collect()
    }

    fn strings_as_mat<T, F: FnMut(u8) -> T>(&mut self, h: usize, mut f: F) -> Vec<Vec<T>> {
        (0..h)
            .map(|_| {
                let l = self.next::<String>();
                l.as_bytes().iter().cloned().map(&mut f).collect()
            })
            .collect()
    }
}


Measured memory_bytes: 4352
import sys
li  =   lambda : [int(x) for x in sys.stdin.readline().strip().split()]
rw  =   lambda : sys.stdin.readline().strip().split()
ni  =   lambda : int(sys.stdin.readline().strip())
nsi =   lambda : sys.stdin.readline().strip()

from collections import defaultdict as df
import math
n,x,t=map(int,input().split())

s=n/x
s=math.ceil(s)
print(s*t)


Measured memory_bytes: 9460
#include <iostream>
#include <algorithm>
#include <ctype.h>
#include <math.h>
using namespace std;


int main ()
{

long long x;
cin >> x;

long long happiness=0;
long long a,b,c;

a=x/500;
b=x%500;
c=b/5;

cout << a*1000+c*5 << endl;


	return 0;
}











Measured memory_bytes: 3164
from sys import stdin


def main(inp1, inp2):
    h, n = [int(i) for i in inp1.split(sep=' ')]
    a_list = [int(i) for i in inp2.split(sep=' ')]
    if sum(a_list) >= h:
        return 'Yes'
    else:
        return 'No'


if __name__ == '__main__':
    input1 = stdin.readline().rstrip()
    input2 = stdin.readline().rstrip()
    ret = main(input1, input2)
    print(ret)

Measured memory_bytes: 14240
#include <iostream>
#include <string>
#define REP(i,n) for(int i=0;i<(n);++i)
#define INT_MAX 0x7FFFFFFF
#define MIN(a,b) ((a)<(b)?(a):(b))
#define ABS(a) ((a)<0?(-(a)):(a))
using namespace std;
typedef long long int LL;

int main(){
  int N, K;
  LL h[100000], c[100000];
  cin >> N >> K;
  REP(i, N) {
    cin >> h[i];
    c[i] = INT_MAX;
  }
  c[0] = 0;
  REP(i, N) {
    for(int j=1; j<=K; ++j) {
      if(i+j < N) {
        c[i+j] = MIN(c[i+j],c[i]+ABS(h[i+j]-h[i]));
      }
    }
  }
  cout << c[N-1] << endl;
}

Measured memory_bytes: 1792
N=int(input())
E=[tuple(sorted(map(int,input().split()))) for i in range(N-1)]

EDICT={x:ind for ind,x in enumerate(E)}

ELIST=[[] for i in range(N+1)]
ED=[0]*(N+1)

for x,y in E:
    ELIST[x].append(y)
    ELIST[y].append(x)
    ED[x]+=1
    ED[y]+=1

MAX=max(ED)
print(MAX)

from collections import deque

Q=deque()
Q.append(1)

USED=[0]*(N+1)

ANS=[-1]*(N-1)
count=1
BAN=[set() for i in range(N+1)]

while Q:
    x=Q.pop()
    USED[x]=1

    for to in ELIST[x]:
        if USED[to]==1:
            continue

        while count in BAN[x] or count in BAN[to]:
            count=count%MAX+1
            
        ANS[EDICT[tuple(sorted([x,to]))]]=count
        BAN[x].add(count)
        BAN[to].add(count)
        Q.append(to)

for a in ANS:
    print(a)

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

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

	int x [200000];
	vector<int>y;
	for(int i = 0; i < n; i++){
		cin>>x[i];
		y.push_back(x[i]);
	}

	sort(y.begin(), y.end());
	
	int m1 = y[n/2 - 1];
	int m2 = y[n/2];

	for(int i = 0; i < n; i++){
		if(x[i] <= m1){
			cout<<m2<<endl;
		}else if(x[i] >= m2){
			cout<<m1<<endl;
		}
	}


	return 0;
}

Measured memory_bytes: 3956
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define int long long
#define SPEED ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
signed main()
{
    SPEED;
    int h,w,n;
    cin>>h>>w>>n;
    h=max(h,w);
    if(n%h==0)
    {
        cout<<n/h;
    }
    else
    {
        cout<<n/h+1;
    }
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <cstdlib>

using namespace std;
//DP用
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;
}
const long long INF = 1LL << 60;

int main() {
    int a,b,c;
    cin >> a >> b >> c;
    if(a == b) {
        if(a != c) {
            cout << "Yes";
            return 0;
        }
    }
    if(b == c) {
        if(b != a) {
            cout << "Yes";
            return 0;
        }
    }
    if(c == a) {
        if(c != b) {
            cout << "Yes";
            return 0;
        }
    }
    cout << "No";
    return 0;
}



Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args){
		
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		// スペース区切りの整数の入力
		int a = sc.nextInt();
		int b = sc.nextInt();
		
		int c  ;
		c = a % 3 ;
        if(c == 0){
			// 出力
			System.out.println("Possible");
			return;
        }

		c = b % 3 ;
        if(c == 0){
			// 出力
			System.out.println("Possible");
			return;
        }

		c = (a + b) % 3 ;
        if(c == 0){
			// 出力
			System.out.println("Possible");
			return;
        }

		System.out.println("Impossible");

	}
}


Measured memory_bytes: 20948
import sys
input = lambda: sys.stdin.readline().rstrip() 
import math

def base_cvt(value, n=2):
    characters = '0123456789'
    result = ''
    tmp = int(value)
    while tmp >= n:
        idx = tmp%n
        result = characters[idx] + result
        tmp = int(tmp / n)
    idx = tmp%n
    result = characters[idx] + result
    return result

def resolve():
    N, K = map(int, input().split())
    print(len(str(base_cvt(N, n=K))))

if __name__ == '__main__':
    resolve()


Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
int main(){
  string str;
  cin >> str;
  string t = "keyence";
  if(str == t){
    cout << "YES" << endl;
    return 0;
  }
  int n = str.size();
  for(int i = 0; i < n; i++){
    for(int j = i; j < n; j++){
      string S = "";
      for(int k = 0; k < n; k++){
        if(i <= k && k <= j) continue;
        else S.push_back(str[k]);
      }
      if(S == t){
        cout << "YES" << endl;
        return 0;
      }
    }
  }
  cout << "NO" << endl;
  return 0;
}


Measured memory_bytes: 256
#!/usr/bin/env ruby
n = gets.split(' ')
n.each_with_index do |str, i|
  n[i] = str.to_i
end

if n[0] > n[1]
  n[0], n[1] = n[1], n[0]
end
if n[0] > n[2]
  n[0], n[2] = n[2], n[0]
end
if n[1] > n[2]
  n[1], n[2] = n[2], n[1]
end
printf("%d %d %d\n", n[0], n[1], n[2])



Measured memory_bytes: 6888
#include <bits/stdc++.h>
using namespace std;
#define int long long int
int32_t main(){
	string a,b;cin>>a>>b;
	a += b;
	int n = stoll(a);
	for(int i=1;i<n;i++){
		if((i*i)==n){
			cout<<"Yes";return 0;
		}
	}
	cout<<"No";
}


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

int main(void) {
  int x;
  rep(i, 5) {
    cin >> x;
    if (x == 0) {
      cout << i + 1 << endl;
    }
  }
 
  return 0;
}

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

constexpr int LEN = 1005;
constexpr int di[] = {0, 1, 0, -1};
constexpr int dj[] = {1, 0, -1, 0};
char m[LEN][LEN];
int v[LEN][LEN];

int main(){
    memset(v, 0, sizeof(v));
    int h, w; cin >> h >> w;
    queue<P> q;
    rep(i, h)rep(j, w){
        char c; cin >> c;
        m[i][j] = c;
        if(c == '#') {
            q.push({i, j});
        }
    }

    while(q.size()){
        P now = q.front(); q.pop();
        int i = now.first, j = now.second;
        rep(k, 4){
            int ni = i + di[k], nj = j + dj[k];
            if(0 <= ni && ni < h && 0 <= nj && nj < w && m[ni][nj] != '#'){
                v[ni][nj] = v[i][j] + 1;
                m[ni][nj] = '#';
                q.push({ni, nj});
            }
        }
    }

    int ans = -1;
    rep(i, h)rep(j, w) ans = max(ans, v[i][j]);
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 13328
//#pragma GCC optimize ("-O3","unroll-loops")
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>


#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 FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define REVERSE(v,n) reverse(v,v+n);
#define VREVERSE(v) reverse(v.begin(), v.end());
#define ll long long
#define pb(a) push_back(a)
#define m0(x) memset(x,0,sizeof(x))
#define print(x) cout<<x<<'\n';
#define pe(x) cout<<x<<" ";
#define lb(v,n) lower_bound(v.begin(), v.end(), n);
#define ub(v,n) upper_bound(v.begin(), v.end(), n);
#define int long long
//#define int unsigned long long
#define all(x) (x).begin(), (x).end()
#define double long double

using namespace std;

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 MOD = 1e9 + 7;
const ll INF = 1e17;
const double pi = acos(-1);
const double EPS = 1e-10;
typedef pair<int, int>P;
const int MAX = 200020;


int A[200020];
int B[200020];
signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	int N; cin >> N;
	REP(i, N) {
		cin >> B[i+1];
	}
	int cnt = 0;
	for (int i = N; i >= 1; i--) {
		int res = 0;
		res += B[i];
		for (int j = i; j <= N; j += i) {
			res += A[j];
		}
		res %= 2;
		if (res)cnt ++ ;
		A[i] = res;
	}
	print(cnt);
	REP(i, N + 1) {
		if (A[i])print(i);
	}
}


Measured memory_bytes: 3968
{-# OPTIONS_GHC -O2 -funbox-strict-fields #-}
{-# LANGUAGE BangPatterns      #-}
{-# LANGUAGE CPP               #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TupleSections     #-}

import           Control.Applicative
import           Control.Monad
import           Control.Monad.Primitive
import           Control.Monad.ST
import           Control.Monad.State.Strict
import           Data.Bool
import qualified Data.ByteString             as B
import qualified Data.ByteString.Unsafe      as B
import           Data.Char
import           Data.Function
import qualified Data.HashMap.Strict         as M
import qualified Data.IntMap.Strict          as IM
import qualified Data.IntSet                 as IS
import           Data.List
import           Data.Monoid
import           Data.Ord
import           Data.Primitive.MutVar
import qualified Data.Set                    as S
import           Data.Tuple
import qualified Data.Vector                 as V
import qualified Data.Vector.Generic         as G
import qualified Data.Vector.Generic.Mutable as GM
import qualified Data.Vector.Unboxed         as U
import qualified Data.Vector.Unboxed.Mutable as UM
import           Debug.Trace
import           Foreign                     hiding (void)
import           Unsafe.Coerce

main :: IO ()
main = do
    !n <- readLn :: IO Int
    bs <- B.getLine
    print $ solve n bs

solve :: Int -> B.ByteString -> Int
solve n bs = sum [M.lookupDefault 0 pair rightFreq| pair<-lefts]
  where
    (left, right) = B.splitAt n bs
    lefts = pairs n left
    rights = pairs n $ B.reverse right
    !rightFreq = foldl' (\m pair -> M.insertWith (+) pair 1 m) M.empty rights

pairs n bs = [divide i bs|i<-[0..2^n-1]]
  where
    divide i bs = B.pack $ map (B.unsafeIndex bs) xis ++ 0:map (B.unsafeIndex bs) yis
      where
        (xis, yis) = partition (testBit (i :: Int)) [0..n-1]


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


int main() {
  int n;
  cin >> n;
  ll sum_a = 0;
  ll sum_b = 0;
  vector<int> a(n);
  vector<int> b(n);
  vector<int> mx;
  rep(i, n){
    cin >> a[i];
    sum_a += a[i];
  }
  rep(i, n){
    cin >> b[i];
    sum_b += b[i];
  }
  if(sum_a < sum_b){
    cout << -1 << endl;
    return 0;
  }
  int ans = 0;
  ll minus_sum = 0;
  rep(i, n){
    if(b[i] > a[i]){
      ans++;
      minus_sum += abs(a[i] - b[i]);
    }else if(a[i] > b[i]){
      mx.push_back(a[i] - b[i]);
    }else{
      continue;
    }
  }
  sort(mx.begin(), mx.end(), greater<int>());
  vector<ll> mx_sum(mx.size() + 1, 0);
  rep(i, mx.size()){
    mx_sum[i + 1] += mx_sum[i] + mx[i];
  }
  auto ite = lower_bound(mx_sum.begin(), mx_sum.end(), minus_sum);
  ans += (int)distance(mx_sum.begin(), ite);
  cout << ans << endl;
}

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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> veci;
typedef vector<ll> vecll;
typedef vector<string> vecs;
template<class T,class U> using Hash=unordered_map<T,U>;

#define REP(i, a, n) for(ll i = a; i < (ll)n; i++)
#define RREP(i, a, n) for(ll i = n-1; i >= a; i--)
#define rep(i, n) REP(i, 0, n)
#define rrep(i, n) RREP(i, 0, n)
#define MD 1000000007
#define _SPLIT " "

template<class T> T read(){T a;cin >> a;return a;}
template<class T> void read(T& a){cin >> a;}
template<class T,class ...Args> void read(T& a, Args&... args){cin >> a; read(args...);} 
template<class T> void rarr(T a, int n){for(int i = 0; i < n; i++) {cin >> a[i];}}
template<class T> void write(T a){cout << setprecision(12) << a << endl;}
template<class T,class ...Args> void write(T a, Args... args){cout << setprecision(12) << a << _SPLIT; write(args...);}
template<class T> void warr(vector<T> a, const char* c = " "){cout << a[0];for(int i = 1; i < (int)a.size(); i++)cout << c << a[i];cout << endl;;}
template<class T> void warr(T a, int n, const char* c = " "){cout << a[0];for(int i = 1; i < n; i++)cout << c << a[i];cout << endl;}
void split(string s, string delim, veci& result){result.clear();string::size_type pos = 0;while(pos != string::npos){string::size_type p = s.find(delim, pos);if(p == string::npos){result.push_back(atoi(s.substr(pos).data()));break;}else {result.push_back(atoi(s.substr(pos, p - pos).data()));}pos = p + delim.size();}}
void split(string s, string delim, vecs& result){result.clear();string::size_type pos = 0;while(pos != string::npos){string::size_type p = s.find(delim, pos);if(p == string::npos){result.push_back(s.substr(pos));break;}else {result.push_back(s.substr(pos, p - pos));}pos = p + delim.size();}}
ll gcd(ll a, ll b){while(true){ll k = a % b;if(k == 0)return b;a = b;b = k;}}
ll comb(ll n, ll m){ll p=1;m=min(m,n-m);for(ll i=1;i<=m;i++){p*=n-i+1;p/=i;}return p;}

int main(void)
{
    int n,a[100];
    read(n);
    rarr(a,n);
    int res=1e9;
    REP(x,-100,101){
        int s=0;
        rep(i,n)s+=(a[i]-x)*(a[i]-x);
        res=min(res,s);
    }
    write(res);
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <random>
#include <map>
#include <queue>
#include <cstring>
using namespace std;
typedef long long int ll;

int a[]={1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};

int main(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	int k; cin >> k;
	k--;
	cout << a[k] << endl;
}


Measured memory_bytes: 256
import sys
readline = sys.stdin.readline
write = sys.stdout.write
def solve():
    M, N = map(int, readline().split())
    if M == N == 0:
        return False
    P = [list(map(int, readline().split())) for i in range(M)]
    Q = [list(map(int, readline().split())) for i in range(N)]
    xs = set()
    xs.update(x for x, y in P)
    xs.update(x for x, z in Q)
    *X, = xs
    X.sort()
    def calc(x):
        y_ma = -100; y_mi = 100
        for i in range(M):
            x0, y0 = P[i-1]; x1, y1 = P[i]
            if x0 <= x <= x1 or x1 <= x <= x0:
                if x0 == x1:
                    y_ma = max(y_ma, max(y1, y0))
                    y_mi = min(y_mi, min(y1, y0))
                else:
                    y = (x - x0)*(y1-y0) / (x1-x0) + y0
                    y_ma = max(y_ma, y)
                    y_mi = min(y_mi, y)
        if not y_mi <= y_ma:
            return 0
        z_ma = -100; z_mi = 100
        for i in range(N):
            x0, z0 = Q[i-1]; x1, z1 = Q[i]
            if x0 <= x <= x1 or x1 <= x <= x0:
                if x0 == x1:
                    z_ma = max(z_ma, max(z1, z0))
                    z_mi = min(z_mi, min(z1, z0))
                else:
                    z = (x - x0)*(z1-z0) / (x1-x0) + z0
                    z_ma = max(z_ma, z)
                    z_mi = min(z_mi, z)
        if not z_mi <= z_ma:
            return 0
        return (z_ma - z_mi) * (y_ma - y_mi)
    ans = 0
    L = len(X)
    for i in range(L-1):
        x0 = X[i]; x1 = X[i+1]
        s0 = calc(x0); s1 = calc((x0 + x1)/2); s2 = calc(x1)
        if s1 > 0:
            ans += (x1 - x0) * (s0 + s2 + 4*s1) / 6
    write("%.16f\n" % ans)
    return True
while solve():
    ...


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

using namespace std;

unsigned int H, W, A, B;
vector<unsigned long long> fact_table;
vector<unsigned long long> fact_inv_table;
const unsigned long long MOD = 1000000007;

unsigned long long power(unsigned long long x, unsigned long long p);
unsigned long long nCr(unsigned int n, unsigned int r);

int main()
{
	cin >> H >> W >> A >> B;
	unsigned long long ans = 0;
	fact_table.resize(H + W - 2);
	fact_inv_table.resize(H + W - 2);
	fact_table[0] = 1;
	fact_inv_table[0] = 1;
	for (size_t i = 1; i < H + W - 2; i++)
	{
		fact_table[i] = (fact_table[i - 1] * i) % MOD;
		fact_inv_table[i] = power(fact_table[i], MOD - 2);
	}
	for (size_t i = 0; i < H - A; i++)
	{
		ans += (nCr(B - 1 + i, B - 1) * nCr(W - B - 1 + H - 1 - i, W - B - 1)) % MOD;
	}
	cout << ans % MOD << endl;
	return 0;
}

unsigned long long power(unsigned long long x, unsigned long long p)
{
	if (p == 0) return 1;
	else if (p == 1) return x % MOD;
	else if (p == 2) return (x * x) % MOD;
	else
	{
		unsigned long long xpowp = power(x, p / 2);
		if (p % 2 == 0)
		{
			return power(xpowp, 2) % MOD;
		}
		else
		{
			return (power(xpowp, 2) * x) % MOD;
		}
	}
}

unsigned long long nCr(unsigned int n, unsigned int r)
{
	return ((fact_table[n] * fact_inv_table[n - r]) % MOD) * fact_inv_table[r] % MOD;
}

Measured memory_bytes: 3328
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<iomanip>

typedef std::pair<double, double> point;

point hoge(point q2, point q4){
    point q3;
    point r = std::make_pair((q2.first + q4.first)/2, (q2.second + q4.second)/2);
    point vec = std::make_pair(-(q4.second - q2.second), q4.first - q2.first);
    q3 = std::make_pair(r.first + vec.first * sqrt(3)/2, r.second + vec.second * sqrt(3)/2);
    return q3;
}

void kochCurve(point p1, point p2, int i, int n){
    if(i == n){
        std::cout << std::setprecision(8) << p1.first << " " << p1.second << std::endl;
        //std::cout << p2.first << " " << p2.second << std::endl;
        return;
    }
    if(i > n){
        std::cout << "something wrong";
        return;
    }
    point q1 = std::make_pair(p1.first, p1.second);
    point q2 = std::make_pair(p1.first * 2/3 + p2.first * 1/3, p1.second * 2/3 + p2.second * 1/3);
    kochCurve(q1, q2, i + 1, n);
    point q4 = std::make_pair(p1.first * 1/3 + p2.first * 2/3, p1.second * 1/3 + p2.second * 2/3);    
    point q3 = hoge(q2, q4);   
    kochCurve(q2, q3, i + 1, n);
    kochCurve(q3, q4, i + 1, n);
    kochCurve(q4, p2, i + 1, n);
}

int main(){
    int n;
    scanf("%d", &n);
    int i = 0;
    std::cout << std::fixed;
    point start = std::make_pair(0.0, 0.0);
    point end = std::make_pair(100.0, 0.0);
    kochCurve(start, end, i, n);
    std::cout << end.first << " " << end.second << std::endl;
    return 0;
}


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

int main(void) {
    long double A, B, H, M;   
    cin >> A >> B >> H >> M;

    static const double pi = 3.141592653589793;
    double alpha = (60 * H + M) / (12 * 60) * 2 * pi;
    double beta  = (M / 60) * 2 * pi;
    double theta = alpha - beta;

    double res = sqrt(A * A + B * B - 2 * A * B * cos(theta));
    cout << fixed << setprecision(20) << res << endl;

    return 0;

}

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

int main(){
    int N;
    cin >> N;
    int a[110];
    int ans = 1;
    for(int i = 0; i < N; i++){
        cin >> a[i];
    }

    sort(a,a + N, greater<int>());

    int Max = a[0];

    for(int i = 1; i < N ; i++){
        if(Max > a[i]){
            Max = a[i];
            ans++;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

x = sum(B)
for i in range(N-1):
	if A[i] + 1== A[i+1]:
		x += C[A[i]-1]

print(x)

Measured memory_bytes: 3060
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std ;
#define int                 long long
#define ull                 unsigned long long int
#define ld                  long double
#define vi                  vector<int>
#define vii                 vector<pair<int,int>>
#define vvi                 vector<vector<int>>
#define pii                 pair<int,int>
#define prec(x)             fixed<<setprecision(15)<<x
#define all(x)              x.begin(),x.end()
#define rall(x)             x.rbegin(),x.rend()
#define rev(x)              reverse(x.begin(),x.end())
#define mset(a,b)           memset(a,b,sizeof(a))
#define mcpy(a,b)           memcpy(a,b,sizeof(a))
#define fo0(i,n)            for(int i=0,i##end=n;i<i##end;i++)
#define fo1(i,n)            for(int i=1,i##end=n;i<=i##end;i++)
#define fo(i,a,b)           for(int i=a,i##end=b;i<=i##end;i++)
#define foe(i,x)            for(__typeof((x).end())i=(x).begin();i!=(x).end();++i)
#define fre(i,x)            for(__typeof((x).rend())i=(x).rbegin();i!=(x).rend();++i)
#define mk(arr,n,type)      type *arr=new type[n];
#define dbg(x) cerr << #x << " is " << x << endl;
#define FAST_IO ios_base::sync_with_stdio(false); cin.tie(0);cout.tie(0)
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;
int gcd(int a, int b) { return b ? gcd(b, a%b) : a; }
clock_t beg = clock();
const int inf=1e18;const int mod=1e9+7;const int N=2e5+9;
const double pi = 3.1415926535897932384626433;
void FILE_IO(){
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
}

void JH(){
    int d=0,e=0,f=0,g=0,p=0,w=0,flag=0,ans=0,res=0,cnt=0,sum=0;double f1=0.0,f2=0.0,f3=0.0;
    int a,b;cin>>a>>b;
    cout<<a*b<<endl;
}

int32_t main()
{
    FILE_IO();FAST_IO;int t=1;
    // cin>>t;
    while(t--){JH();}cerr<<"Execution time: "<<(double)(clock()-beg)/1000<<"s ";
}

Measured memory_bytes: 3804
#include<iostream>
#include<stdio.h>
using namespace std;

int main(){
    int W,H,x,y,r;
    cin>>W>>H>>x>>y>>r;
    if(x-r<0 || W<x+r || y-r<0 || H<y+r) cout<<"No"<<endl;
    else cout<<"Yes"<<endl;
    

    return 0;
}


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

#define mod 1000000007
int add(int x,int y){
	return (x+=y)<mod?x:x-mod;
}
int sub(int x,int y){
	return add(x,mod-y);
}
int mul(int x,int y){
	return (int)((long long int)x*y%mod);
}

int dp[1111111],n;

int main(){
	scanf("%d",&n);
	dp[0] = 1;
	int sum = 1;
	for(int i=1; i<=n; i++){
		dp[i] = sum;
		if(i >= 2)dp[i] = sub(dp[i], dp[i-2]);
		sum = add(sum,dp[i]);
	}
	int res = 0;
	int coef = mul(n-1,n-1);
	for(int i=0; i<=n-2; i++){
		res = add(res, mul(dp[i],coef));
		res = add(res, mul(dp[i],i+1));
	}
	res = add(res, mul(dp[n-1], n-1));
	res = add(res, dp[n]);
	printf("%d\n",res);
	return 0;
}


Measured memory_bytes: 4352
unittest
{
	assert( [ "7" ].parse.expand.solve == 4 );
	assert( [ "32" ].parse.expand.solve == 32 );
	assert( [ "1" ].parse.expand.solve == 1 );
	assert( [ "100" ].parse.expand.solve == 64 );
}



import std.conv;
import std.functional;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto n = input.front.strip.to!( long );
	return tuple( n );
}

auto solve( long n )
{
	auto ri = -1L;
	auto rd = -1L;
	foreach( i; 1 .. n + 1 )
	{
		auto d = memoize!div( i );
		if( rd < d )
		{
			ri = i;
			rd = d;
		}
	}
	
	return ri;
}

long div( long n )
{
	if( n % 2 != 0 ) return 0;
	else             return 1 + memoize!div( n / 2 );
}


Measured memory_bytes: 256
s = [list(input()) for x in range(3)]
t = 0
while len(s[t]) != 0:
    nextt = s[t][0]
    del s[t][0]
    if nextt == "a":
        t = 0
    elif nextt == "b":
        t = 1
    elif nextt == "c":
        t = 2

print("ABC"[t])

Measured memory_bytes: 3060
#include <iostream>
#include<queue>
#include<stack>
#include<vector>
#include<set>
#include<map>
#include<algorithm>
#include<cstring>
#include<string>
#include<cassert>
#include<cmath>
#include<climits>
#include<iomanip>
#include<bitset>
#include<unordered_map>

using namespace std;

#define REP(i,n) for(ll (i)=0;(i)<(n);(i)++)
#define rep(i,j,n) for(ll (i)=(j);(i)<(n);(i)++)
#define FOR(i,c) for(decltype((c).begin())i=(c).begin();i!=(c).end();++i)
#define ll long long
#define ull unsigned long long
#define all(hoge) (hoge).begin(),(hoge).end()
#define pb push_back
#define mp make_pair
typedef pair<ll, ll> P;
const long long INF = 1LL << 60;
const long long MOD = 1e9 + 7;
typedef vector<ll> Array;
typedef vector<Array> Matrix;



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

//グラフ関連
struct Edge {//グラフ
	ll to, cap, rev;
	Edge(ll _to, ll _cap, ll _rev) {
		to = _to; cap = _cap; rev = _rev;
	}
};
typedef vector<Edge> Edges;
typedef vector<Edges> Graph;

void add_edge(Graph& G, ll from, ll to, ll cap, bool revFlag, ll revCap) {
	G[from].push_back(Edge(to, cap, (ll)G[to].size()));
	if (revFlag)G[to].push_back(Edge(from, revCap, (ll)G[from].size() - 1));
}

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

	ll n,m;
	cin >> n >> m;

	if (n == m) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <utility>
#include <map>

using namespace std;

using Vector = vector<bool>;

template<typename T>
T mod(T i, T N)
{
  return (i + N) % N;
}

bool is_okay(
  const Vector& answers,
  const Vector& animals,
  const Vector& determined,
  size_t now
) {
  const auto N = animals.size();
  auto next = mod(now + 1, N);
  auto prev = mod(now - 1, N);

  if (!determined[now] or !determined[next] or !determined[prev]) return true;
  if (animals[now]) {
    // sheep
    return
      (answers[now] and animals[prev] == animals[next]) or
      (!answers[now] and animals[prev] != animals[next]);
  } else {
    // wolf
    return
      (answers[now] and animals[prev] != animals[next]) or
      (!answers[now] and animals[prev] == animals[next]);
  }
}

bool traverse(const Vector& answers, Vector& animals, Vector& determined, size_t now) {
  const auto N = animals.size();

  /*
  for (size_t i = 0; i < N; ++i) {
    cout << (determined[i] ? (animals[i] ? 'S' : 'W') : '?');
  }
  cout << endl;
  */

  if (now == N) {
    for (size_t now = 0; now < N; ++now) {
      cout << (animals[now] ? 'S' : 'W');
    }
    return true;
  }

  bool values[] = {false, true};
  auto next = mod(now + 1, N);
  auto prev = mod(now - 1, N);
  determined[now] = true;
  for (int i = 0; i < 2; ++i) {
    animals[now] = values[i];
    if (is_okay(answers, animals, determined, now) and
        is_okay(answers, animals, determined, prev) and
        is_okay(answers, animals, determined, next)) {
      if (traverse(answers, animals, determined, now + 1)) return true;
    }
  }
  determined[now] = false;
  return false;
}

int main()
{
  int N;
  cin >> N;
  Vector answers(N);
  Vector animals(N);
  Vector determined(N, false);

  for (int i = 0; i < N; ++i) {
    char c;
    cin >> c;
    answers[i] = c == 'o' ? true : false;
  }

  if (!traverse(answers, animals, determined, 0)) cout << -1;
  cout << endl;

  return 0;
}


Measured memory_bytes: 12928
#include <bits/stdc++.h>
  
using namespace std;
  
#define rep(i,n) REP(i,0,n)
#define REP(i,s,e) for(int i=(s); i<(int)(e); i++)
#define repr(i, n) REPR(i, n, 0)
#define REPR(i, s, e) for(int i=(int)(s-1); i>=(int)(e); i--)
#define pb push_back
#define all(r) r.begin(),r.end()
#define rall(r) r.rbegin(),r.rend()
#define fi first
#define se second
  
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
 
const int INF = 1e9;
const ll MOD = 1e9 + 7;
double EPS = 1e-8;

int main(){
	int n;
	cin >> n;
	vi x(n);
	rep(i, n) cin >> x[i], --x[i];
	vi a(n*n, -1);
	rep(i, n) a[x[i]] = i;
	int idx = 0;
	bool f = true;
	vi id(n);
	rep(i, n) id[i] = i;
	sort(all(id), [&](int a, int b) {return x[a] < x[b];});
	rep(i, n) {
		rep(j, id[i]) {
			while(a[idx]!=-1) ++idx;
			a[idx] = id[i];
		}
		if(idx > x[id[i]]) f = false;
	}
	idx = (int)a.size()-1;
	repr(i, n) {
		rep(j, n-1-id[i]) {
			while(a[idx] != -1) --idx;
			a[idx] = id[i];
		}
		if(idx < x[id[i]]) f = false;
	}
	cout << (f?"Yes" : "No") << endl;
	if(f) {
		rep(i, a.size()) {
			if(i != 0) cout << " ";
			cout << a[i]+1; 
		}
		cout << endl;
	}
	return 0;
}

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

using namespace std;
using ll  = long long;
using ii  = pair < int , int >;
using i3  = pair < int , ii >;
using vi  = vector < int >;
using vii = vector < ii >;
using vi3 = vector < i3 >;

const int N = 2e5 + 5;
const ll INF = 1e12;
const double eps = 1e-9 , PI = acos(-1);

ll a , b , c , d;

void solve(){
    scanf("%lld %lld" , &a , &b);
    scanf("%lld %lld" , &c , &d);

    if(a < b)swap(a , b);

    ll lcm = (c*d) / __gcd(c , d);

    ll common = a/lcm - ((b-1ll) / lcm);
    ll ans = (a/c - (b-1ll)/c) + ((a)/d - (b-1ll)/d) - common;

    printf("%lld\n" , a - (b-1ll) - abs(ans));

}

main(){
    int t = 1;
    //scanf("%d" , &t);

    while( t -- ){
            solve();
    }

    return 0;
}




Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <climits>
#include <math.h>
#define rep(i,n) for (int i=0; i<n; i++)

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


int main(){
  int T;
  cin >> T;
  if(T>=30){
    cout<<"Yes"<<endl;
  }else{
    cout<<"No"<<endl;
  }
  return 0;
}

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

int main() {
    string s;
    cin >> s;
    if (s.at(0) == s.at(1) || s.at(1) == s.at(2) || s.at(2) == s.at(3)) cout << "Bad" << endl;
    else cout << "Good" << endl;
    return 0;
}


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

using namespace std;

const int MX = 200000;
const long long INF = 1e15;

int cost(int a, int j) {
	if (j == 0 || j == 4) return a;
	if (j == 1 || j == 3) return a == 0 ? 2 : a % 2;
	if (j == 2) return (a + 1) % 2;
	assert(false);
}

long long dp[MX + 1][5];

int main() {
	int n;
	ignore = scanf("%d", &n);
	for (int i = 1; i <= n; i++) fill(dp[i], dp[i] + 5, INF);
	for (int i = 0, a; i < n; i++) {
		ignore = scanf("%d", &a);
		for (int j = 0; j < 5; j++) {
			dp[i + 1][j] = min(dp[i + 1][j], dp[i][j] + cost(a, j));
			if (j + 1 < 5) {
				dp[i + 1][j + 1] = min(dp[i + 1][j + 1], dp[i][j] + cost(a, j + 1));
				dp[i][j + 1] = min(dp[i][j + 1], dp[i][j]);
			}
		}
	}
	
	printf("%lld\n", *min_element(dp[n], dp[n] + 5));
	
	return 0;
}


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

//--------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define LL long long
#define INF INT_MAX/3

//--------------------------------------------
const double EPS = 1e-14;
const double PI  = acos(-1.0);

//--------------------------------------------

int main(){
  int s[] = {1,2,4,8,16,32,64};
  int n;

  scanf("%d",&n);

  int ans;
  REP (i, n + 1) {
    REP (j, 7){ 
      if (i == s[j]) ans = i;
    }
  }

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

}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        final Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        final int n = in.nextInt();
        final int r = in.nextInt();
        if (n >= 10) {
            System.out.println(r);
        } else {
            System.out.println(100 * (10 - n) + r);
        }
    }
}


Measured memory_bytes: 23124
#include <bits/stdc++.h>
#define NMAX 200005
#define INF 0x3f3f3f3f
#define x first
#define y second

using namespace std;

int sumdigit(int n) {
	int s=0;
	while(n) {
		s+=n%10;
		n/=10;
	}

	return s;
}

int main() {
	int n,ans = INF,i;

//	ifstream cin("fisier.in");

	cin >> n;

	for(i=1;i<=n/2;++i) {
		ans=min(ans, sumdigit(i)+sumdigit(n-i));
	}

	cout << ans;

	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 vvec(m,n) vector<vector<int>> (int(m), vector<int>(n))
#define ALL(a) (a).begin(), (a).end()
using ll = long long;

int main(){
    char c;
    cin >> c;
    c += 1;
    cout << c << endl;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(int argc, const char * argv[]) {
    // insert code here...
    int W,H,x,y,r,x1,y2,x2,y3;
    scanf("%d %d %d %d %d",&W,&H,&x,&y,&r);
    x1=x+r;
    y2=y+r;
    x2=x-r;
    y3=y-r;

    if((W>=x1 && x2>=0 )&&(H>=y2 && y3>=0)){
        printf("Yes\n");
    }else{
        printf("No\n");

    }
//    if(x1<0){
//        printf("Yes\n");
//    }
//    if(H>y2){
//        printf("Yes\n");
//    }
//    if(y2<0){
//        printf("Yes\n");
//    }
    return 0;
}


Measured memory_bytes: 2048
#include <stdio.h>

int main()
{
	int a,b;
	scanf("%d %d",&a,&b);
	int sum=0;
	sum=a+b;
	if(sum>=10)
	{
		printf("error");
	}
	else
	{
		printf("%d",sum);
	}
	return 0;
}

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

int* mallocint(int si)
{
    return (int*) malloc(si * sizeof(int));
}

int* inputint(int n)
{
    int *ans = mallocint(n);
    for( int i = 0; i < n; i++ ) cin >> ans[i];
    return ans;
}

#define _LL long long

int main()
{
    int n;
    cin >> n;
    int *a = inputint(n);

    sort(a, a + n, greater<>());
    _LL ans = 0;

    priority_queue<int> q;

    ans += a[0];
    q.push(a[1]);
    q.push(a[1]);

    for( int i = 2; i < n; i++ )
    {
//        cout << q.top() << endl;
        ans += q.top();
        q.pop();
        q.push(a[i]);
        q.push(a[i]);
    }

    cout << ans;
}

Measured memory_bytes: 5104
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <stack>
#include <queue>
#include <cmath>
#include <tuple>
#include <cstdio>
#include <bitset>
#include <sstream>
#include <iterator>
#include <numeric>
#include <map>
#include <cstring>
#include <set>
#include <functional>
#include <iomanip>

using namespace std;

#define DEBUG_ //!!提出時にコメントアウト!!
#ifdef DEBUG_
	#define dump(x)  cerr << #x << " = " << (x) << endl;
#else
	#define dump(x)  ;
#endif

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define SZ(x) ((int)(x).size())
#define pb push_back
#define eb emplace_back

//#define int long long

typedef long long LL;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;

template <typename T>
std::string printVector(const std::vector<T> &data)
{
    std::stringstream ss;
    std::ostream_iterator<T> out_it(ss, ", ");
    ss << "[";
    std::copy(data.begin(), data.end() - 1, out_it);
    ss << data.back() << "]";
    return ss.str();
}

const int MOD = 1e9+7;
const LL LINF = 1001002003004005006ll;
const int INF = 1001001001;

signed main(int argc, char const *argv[])
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N; cin >> N;
    char masu[310][310] = {};
    REP(i,N){
        string s; cin >> s;
        REP(j,N){
            masu[i][j] = s[j];
        }
    }
    int memo[310][310] = {};
    REP(i,N){ // offset 0,i
        bool ok = 1;
        REP(j,N){
            REP(k,N){
                int x = j;
                int y = (k + i) % N;
                int rx = k;
                int ry = (j+i) % N;
                if(masu[x][y] != masu[rx][ry]) ok = 0;
            }
        }
        if(ok) memo[0][i] = 1;
    }

    REP(i,N){ // offset i,0
        bool ok = 1;
        REP(j,N){
            REP(k,N){
                int x = (j+i)%N;
                int y = k % N;
                int rx = (k+i)%N;
                int ry = j % N;
                if(masu[x][y] != masu[rx][ry]) ok = 0;
            }
        }
        if(ok) memo[i][0] = 1;
    }

    int ans = 0;
    REP(i,N) REP(j,N){
        if(i == j) ans += memo[0][0];
        else if(i > j){
            ans += memo[i-j][0];
        }
        else{
            ans += memo[0][j-i];
        }
    }
    cout << ans << endl;


}


Measured memory_bytes: 768
#include <bits/stdc++.h>
#define BIT(n) (1LL << (n))
#define BITF(n, i) (((n) >> i) & 1)
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPB(i, n) for (int i = 0; i < BIT(n); i++)
#define REPS(i, x) for (int i = 1; i <= (int)(x); 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 FORA(i, n) for (auto &&i : n)
#define FORS(i, m, n) for (int i = m; i <= 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 PRINTALL(V)    \
  for (auto v : (V)) { \
    cerr << v << " ";  \
  }                    \
  cerr << "\n";
#define ALL(v) v.begin(), v.end()
#define fst first
#define snd second
#define mp make_pair
#define pb push_back
#define epb emplace_back
#define int long long
#define pint pair<int, int>
#define ld long double
using namespace std;
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 (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T> using vec = std::vector<T>;
template <class T> void print(const T &x) { cout << x << "\n"; }
template <class T> void print2(const T &x, const T &y) { cout << x << " " << y << "\n"; }
template <class T> void print3(const T &x, const T &y, const T &z) { cout << x << " " << y << " " << z << "\n"; }
const int MOD = 1000000007, MOD2 = 998244353, INF = 1061109567, INF2 = INF * INF;
const double EPS = 1e-10, PI = acos(-1.0);
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
vec<pint> a, b;
int N;
vec<pint> memo(int id) {
  if (b[id * 2].fst != INF) {
    vec<pint> tmp = {b[id * 2], b[id * 2 + 1]};
    return tmp;
  } else {
    set<pint> lis;
    lis.insert(a[id]);
    lis.insert(pint(INF, INF));
    REP(i, N) {
      if (BITF(id, i)) {
        vec<pint> tmp(memo(id - BIT(i)));
        lis.insert(tmp[0]);
        lis.insert(tmp[1]);
      }
    }
    //   sort(ALL(lis));
    //   reverse(ALL(lis));
    auto itr = lis.begin();
    auto itr2 = itr;
    itr2++;
    // DEBUG(id);
    // FORA(e, lis) DEBUG2(e.fst, e.snd);
    // cout << "\n";
    vec<pint> tmp = {*itr, *itr2};
    b[id * 2] = tmp[0];
    b[id * 2 + 1] = tmp[1];
    return tmp;
  }
}
signed main() {
  cin.tie(0), ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  cin >> N;
  a.resize(BIT(N));
  b.resize(2 * BIT(N), pint(INF, INF));
  REP(i, BIT(N)) {
    cin >> a[i].fst;
    a[i].fst *= -1;
    a[i].snd = i;
  }
  int val = 0;
  REPS(i, BIT(N) - 1) {
    // DEBUG(i);
    vec<pint> tmp(memo(i));
    int tmpval = -tmp[0].fst - tmp[1].fst;
    chmax(val, tmpval);
    print(val);
  }
  //  REPS(i, BIT(N) - 1) { DEBUG2(b[2 * i].fst, b[2 * i + 1].fst); }
}
/*
答え比較にエラーあり。
*/

Measured memory_bytes: 15360