akhauriyash/Code-Regression huggingface dataset:
#!/usr/bin/env python
# coding: utf-8

def readInt():
    return int(input())

def readList():
    return list(input().split())

def readListI():
    return list(map(int, input().split()))

def main():
    n = readInt()
    l = {}
    for i in range(n):
        s, p = readList()
        l[(s, -int(p), i+1)] = True
    l = sorted(l)
    for e in l:
        print(e[2])


if __name__ == '__main__':
    main()


Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define all(vec) vec.begin(),vec.end()
#define mp make_pair
using namespace std;
using ll=long long;
using P=pair<int,int>;
const ll INF=1LL<<30;
const ll LINF=1LL<<61;
const double eps=1e-9;
const ll MOD=1e9+7;
int main(){
    int n;cin>>n;
    bool f=false;
    for(int i=0;i<n;i++){
        int a;cin>>a;f|=a%2;
    }    
    if(f){
        cout<<"first"<<endl;
    }else{
        cout<<"second"<<endl;
    }
}


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

using namespace std;
long fun(long a){
	if (a == 1)return 0;
	if (a == 0)return 0;
	return a*(a - 1) / 2;
}
int main(){
	string str;
	cin >> str;
	long out = 0, me[str.length()];
	char c[str.length()];

	for (char ca = 'a'; ca <= 'z'; ca++){
		me[ca] = 0;
	}
	for (int i = 0; i < str.length(); i++){
		c[i] = str[i];
	}

	for (int i = 0; i < str.length(); i++){
		for (char ca = 'a'; ca <= 'z'; ca++){
			if (c[i] == ca){
				me[ca]++;
			}
		}
	}
	out = fun(str.length());
	for (char ca = 'a'; ca <= 'z'; ca++){

		out -= fun(me[ca]);
	}

	cout << out + 1 << endl;

	return 0;


}

Measured memory_bytes: 772
import sys
#import numpy as np
import math
from fractions import Fraction
import itertools

input=sys.stdin.readline

a,b=map(int,input().split())
if (a+1)/0.08<=b/0.1 or (b+1)/0.1<=(a/0.08):
    print(-1)
    exit()
print(int(math.ceil(max(a/0.08,b/0.1))))

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

int main() {
   int N, X, T;
   std::cin >> N >> X >> T;
   int n = (N/X)*T;
   if (N % X != 0) {
      n += T;
   }
   std::cout << n << '\n';

   return 0;
}


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

using namespace std;

#define SZ(x) (int)(x.size())

using ll = long long;
using ld = long double;
using P = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
const double eps = 1e-10;
const int MOD = 1000000007;
const int INF = 1000000000;
const ll LINF = 1ll<<50;

template<typename T>
void printv(const vector<T>& s) {
  for(int i=0;i<(int)(s.size());++i) {
    cout << s[i];
    if(i == (int)(s.size())-1) cout << endl;
    else cout << " ";
  }
}

int n;
vi a;

double memo[301][301][301];

double dp(int v1, int v2, int v3) {
  
  if(v1 < 0 || v2 < 0 || v3 < 0) return 0;
  if(v1 == 0 && v2 == 0 && v3 == 0) return 0;
  if(memo[v1][v2][v3] != -1) return memo[v1][v2][v3];
  //cout << v1 << ":" << v2 << ":" << v3 << endl;

  double su = n;
  double p0 = (n-v1-v2-v3) / su, p1 = v1 / su, p2 = v2 / su, p3 = v3 / su;

  double mul = 1 / (1 - p0);
  memo[v1][v2][v3] = 1 + dp(v1-1, v2, v3) * p1 + dp(v1+1, v2-1, v3) * p2 + dp(v1, v2+1, v3-1) * p3;
  memo[v1][v2][v3] *= mul;
  //cout << memo[v1][v2][v3] << endl;

  return memo[v1][v2][v3];
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);

  cin >> n;
  a.resize(n);
  map<int, int> mp;
  for(int i=0;i<n;++i) {
    cin >> a[i];
    mp[a[i]]++;
  }

  for(int i=0;i<301;++i) {
    for(int j=0;j<301;++j) {
      for(int k=0;k<301;++k) {
        memo[i][j][k] = -1;
      }
    }
  }

  

  cout << dp(mp[1], mp[2], mp[3]) << endl;
  //cout << memo[1][0][0] << endl;



}


Measured memory_bytes: 213376
use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("filed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let n:usize = read();
    let arr:Vec<usize> = (0..n).map(|_| read()).collect();
    let mut dp = vec![std::usize::MAX; n+1];
    for i in 0..n {
        let index = lower_bound(&dp, arr[i]);
        dp[index] = arr[i];
    }
    println!("{}", lower_bound(&dp, std::usize::MAX));
}

fn lower_bound(v:&Vec<usize>, x:usize) -> usize {
    let mut l = 0;
    let mut h = v.len() - 1;
    while l < h {
        let mid  = (l + h) / 2;
        if x <= v[mid] {
            h = mid;
        } else {
            l = mid + 1;
        }
    }   l
}


Measured memory_bytes: 7096
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(s,i, n) for (int i = (int)s; i < (int)(n); i++)
#define pb push_back
typedef long long ll;
  
int main(){
    int n,m;
    int mod=1000000007;
    cin>>n>>m;
    vector<int> a(n,0);
    int x=0;
    rep(i,n){
        cin>>x;
        a[x]=1;
    }
    ll ans=0;
    int dp[100002];
    dp[0]=1;
    rep2(1,i,n+1){
        if(a[i]!=1){
            if(i==1)dp[i]=(dp[i-1])%mod;
            else{
                dp[i]=(dp[i-1]+dp[i-2])%mod;
            }
        }else{
            dp[i]=0;
        }
        
        
    }
    cout<<dp[n]<<endl;
    return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
#define ll long long
#define vi vector<int>
#define pii pair<int,int>
#define F first
#define S second
#define pb push_back
#define forn(b) for(int i = 0; i < b; i++)
#define rforn(b) for(int i = b - 1 ;i >= 0; i--)
#define It(m) for(auto it = m.begin(); it != m.end(); it++)
#define N 500500
#define PI 3.14159265358979323846264338327950L
#define speed ios_base :: sync_with_stdio(0);cin.tie(0);cout.tie(0);
    
const ll mod = (ll)1e9 + 7;
    
int main(){
    speed;
    int a, b, c; cin >> a >> b >>c;
    int pos = abs(a - b);
    c -= pos;
    if(c < 0) c = 0;
    cout << c;   
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#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() {

ll ans=1e9;

int mina=1e9,minb=1e9;
int AA,BB,M;
cin >> AA >> BB >>M;


vector<ll>A(AA);
vector<ll>B(BB);

rep(i,AA)
{int a;
 cin>>a;
 A[i]=a;
 mina=min(a,mina);
}
rep(i,BB)
{int b;
cin>>b;
B[i]=b;
minb=min(b,minb);}

ans=mina+minb;
//cout<<ans<<" "<<mina<<" "<<minb<<endl;
rep(i,M)
{ll x,y,c;
 cin>>x>>y>>c;
 //cout<<x<<" y:"<<y<<" c:"<<c<<endl;
 //cout<<A[x-1]<<" "<<B[y-1]<<endl;
 ans=min(ans,A[x-1]+B[y-1]-c);}

cout<<ans<<endl;


}
/*vector <int> a(3);
for (int i = 0; i < n; i++) {
    cin >> a.at(i);
  }*/

Measured memory_bytes: 1792
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>

using namespace std;

int main()
{
	int n;
	cin >> n;
	vector<long long> a(n);
	for(int i=0;i<n;i++)
		cin >> a[i];
	sort(a.begin(),a.end());
	long long ans=0;
	ans+=a[n-1];
	ans-=a[0];
	for(int i=1;i<n-1;i++)
		ans+=abs(a[i]);
	cout << ans << endl;
	
	long long plus=a[n-1];
	long long minus=a[0];
	for(int i=1;i<n-1;i++)
	{
		if(a[i]<0)
		{
			cout << plus << " " << a[i] << endl;
			plus-=a[i];
		}
		else
		{
			cout << minus << " " << a[i] << endl;
			minus-=a[i];
		}
	}
	cout << plus << " " << minus << endl;



	
}

Measured memory_bytes: 2688
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vvl = vector<vl>;
const ll INF = 1LL << 60;
const ll MOD = 1000000007;
template <class T>
bool chmax(T &a, const T &b) {
    return (a < b) ? (a = b, 1) : 0;
}
template <class T>
bool chmin(T &a, const T &b) {
    return (b < a) ? (a = b, 1) : 0;
}

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

Measured memory_bytes: 256
//#pragma GCC target("avx2")
//#pragma GCC optimize("O3")
 
//#include <x86intrin.h>
#include <bits/stdc++.h>   
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
 
using namespace __gnu_pbds;
using namespace std;

template<typename T> using ordered_set = tree <T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
     
#define F first
#define S second           
#define lb lower_bound               
#define ub upper_bound
#define pb push_back
#define pf push_front    
#define ppb pop_back
#define mp make_pair                                     
#define bpp __builtin_popcountll                                                                                        
#define sqr(x) ((x) * (x)) 
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
#define in insert
#define ppf pop_front
#define endl '\n'
//#define int long long
 
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
typedef pair <int, int> pii;
 
const int mod = (int)1e9 + 7;
const int N = (int)3e5 + 123;
const ll inf = (ll)1e18 + 1;

const double pi = acos (-1.0);
const double eps = 1e-7;                  
const int dx[] = {0, 0, 1, 0, -1};
const int dy[] = {0, 1, 0, -1, 0};

int n, k, ans;

inline void boost () {                    
   ios_base :: sync_with_stdio (NULL);
   cin.tie (NULL), cout.tie (NULL);          
}                                                     

inline void Solve () {
   cin >> n >> k;
   while (n) n /= k, ans ++;
   cout << ans;
}

int main () {                                       
// freopen (".in", "r", stdin);    
// freopen (".out", "w", stdout);              
   boost ();
   int tt = 1;
   //cin >> tt;   
   while (tt --) {
      Solve ();
   }                                               
   return 0;      
}


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

#define lld long long
#define pi pair<int,int>
#define pl pair<lld,lld>
#define mp(k,v) make_pair(k,v)
#define mem0(x) memset(x,0,sizeof(x))
#define fillnum(x,n) fill(begin(x),end(x),n)
#define asort(x) sort(x.begin(),x.end())
#define dsort(x,t) sort(x.begin(),x.end(),greater<t>())

int main() {
    int n;
    string q,s;
    map<string,int> m;
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> q >> s;
        if(q == "insert"){
            m.insert(mp(s,1));
        } else if(q == "find"){
            if(m.find(s) != m.end()){
                cout << "yes" << endl;
            } else {
                cout << "no" << endl;
            }
        }
    }
}


Measured memory_bytes: 36864
# -*- coding: utf-8 -*-
# AtCoder Beginner Contest


if __name__ == '__main__':
    n = int(input())
    a = list(map(int, input().split()))
    total = 0

    for i in range(n):
        a[i] -= i + 1

    sorted_a = sorted(a)
    b = sorted_a[n // 2]

    for i in range(n):
        total += abs(a[i] - b)

    print(int(total))


Measured memory_bytes: 26180
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

# sys.setrecursionlimit(100000)
input = sys.stdin.buffer.readline
INF = 2**62-1

def read_int():
    return int(input())


def read_int_n():
    return list(map(int, input().split()))


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(N, S):
    return len(set(S))


def main():
    N = read_int()
    S = [read_str() for _ in range(N)]
    print(slv(N, S))


if __name__ == '__main__':
    main()


Measured memory_bytes: 106876
N = int(input())
x = list(map(int, input().split()))

ans = float("inf")

l = []
for i in range(1, N+101):
    pow = 0
    for j in range(N):
        # print("x[j]", x[j])
        # print("i", i)
        # print((x[j]-i)**2)
        pow += (x[j]-i)**2
    # print(pow)
    if ans > pow:
        ans = min(ans, pow)
        l.append(i)

print(ans)
# print(l)

Measured memory_bytes: 3064
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<utility>
#include<algorithm> // sort
#include<map> // pair
#include<cmath>
#include<cstring>
#include<set>
using namespace std;
typedef long long ll;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
#define rep(i, n) REP(i, 0, n)
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
#define all(x) (x).begin(),(x).end()
ll tmp1,tmp2;
const ll mod = 1e9+7;
const int INF = 1e9;
const ll INFLONG = 1e18;
void swap(ll *x,ll *y){
  ll tmp = *x;
  *x = *y;
  *y = tmp;
}
void selectionsort(ll num,vector<ll> vec){
  ll sum = 0;
  rep(i,num){
    ll minj = i;
    REP(j,i,num){
      if(vec[minj] > vec[j]){
        minj = j;
      }
    }
    // cout << i << " " << minj << endl;
    if(minj != i){
      swap(&vec[i],&vec[minj]);
      sum++;
    }
  }
  rep(i,num){
    if(i == num-1){cout << vec[i];break;}
    cout << vec[i] << " ";
  }
  cout << endl;
  cout << sum << endl;
}
int main(){
  ll n;
  cin >> n;
  vector<ll> a(n);
  rep(i,n){
    cin >> a[i];
  }
  selectionsort(n,a);
}



Measured memory_bytes: 3164
#include <bits//stdc++.h>
using namespace std;
#define int long long
signed main(){
	string s;
	cin>>s;
	int a[4];
	for(int i=0;i<s.size();i++){
		a[i]=(int)(s[i]-'0');
	}
	for(int i=0;i<2;i++){
		int t=0;
		if(i==0) t=a[0]+a[1];
		else t=a[0]-a[1];
		for(int j=0;j<2;j++){
			int r=t;
			if(j==0) r+=a[2];
			else r-=a[2];
			for(int x=0;x<2;x++){
				int q=r;
				if(x==0) q+=a[3];
				else q-=a[3];
				if(q==7){
					cout<<a[0]<<(i==0?'+':'-')<<a[1]<<(j==0?'+':'-')<<a[2]<<(x==0?'+':'-')<<a[3]<<"=7\n";
					return 0;
				}
			}
		}
	}
}


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

int main(){
	int N;
	cin >> N;
	vector<int> X(N);
	for (int i = 0; i < N; i++) cin >> X.at(i);
	long double tmp_ave = 0;
	for (int i = 0; i < N; i++) tmp_ave += X.at(i);
	tmp_ave /= N;
	int ave;
	if (ceil(tmp_ave) - tmp_ave > 0.5) ave = ceil(tmp_ave) - 1;
	else ave = ceil(tmp_ave);
	long ans = 0;
	for (int i = 0; i < N; i++){
		int tmp;
		tmp = ave - X.at(i);
		ans += tmp * tmp;
	}
	cout << ans << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <cmath>
#include <iomanip>
#include <stack>
#include <queue>
#include <numeric>
#include <map>
#include <unordered_map>
#include <set>
#include <fstream>
#include <chrono>
#include <random>
#include <bitset>
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define sz(x) ((int)(x).size())
#define pb push_back
using ll = long long;
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 (b<a) { a=b; return 1; } return 0; }
ll gcd(ll a, ll b) {return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) {return a/gcd(a,b)*b;}

int main(){
  int X; cin >> X;
  int now = 0;
  int ans = 0;
  rep(i,1000){
    now += X;
    ans++;
    if(now%360==0) break;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3628
#include <iostream>
#include <fstream>
#include <climits>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <deque>
#include <cstdio>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#include <list>
#include <ctime>

#define FOR(i , n)      for(int i = 0 ; i < n ; i++)
#define FORmn(i,m,n)	for(int i = m ; i < n ; i++)
#define FORrev(i,n,m)	for(int i = n - 1 ; i >= m ; i--)
#define ALL(a)			a.begin(),a.end()
#define pii				pair<long long int , long long int>
#define mp(a , b)		make_pair(a , b)

typedef long long int ll; 

using namespace std;

int main() {
	int ta[2] , ao[2];
	cin>>ta[0]>>ta[1]>>ao[0]>>ao[1];
	int step = 0;
	bool taWon = false;
	while(true) {
		if( (step++) % 2 == 0) {
			ao[0] -= ta[1];
		} else {
			ta[0] -= ao[1];
		}
		if(ta[0] <= 0) {
			taWon = false;
			break;
		} 
		if(ao[0] <= 0) {
			taWon = true;
			break;
		}
	}
	if(taWon) {
		cout<<"Yes";
	} else {
		cout<<"No";
	}
}

Measured memory_bytes: 3544
def getint(): return int(input())
def getints(): return list(map(int, input().split()))

def gcd(x, y):
    return gcd(y, x % y) if y else x

n,x=getints()
xs=getints()

res = abs(x-xs[0])

for i in range(n):
    d = abs(x - xs[i])
    res = gcd(res, d)

print(res)


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

using namespace std;

#define INF 1000000007
#define LINF (1LL << 60)
#define PI 3.14159265358979

typedef long long i64;
typedef pair<i64,i64> P;

inline i64 mod(i64 a, i64 m) { return (a % m + m) % m; }

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



i64 n, a[202020];
i64 dp[202020][3];
void solve(){
	cin >> n;
	for(int i = 0; i < n; i++){
		cin >> a[i];
	}
	
	for(int i = 0; i <= n+1; i++) for(int j = 0; j < 3; j++) dp[i][j] = -LINF;
	int k = 1+n%2;
	i64 ans = -LINF;
	queue<pair<P, i64>> q;
	q.push({{0,k},0});
	while(!q.empty()){
		pair<P,i64> p = q.front(); q.pop();
		i64 pos = p.first.first, c = p.first.second, sum = p.second;
		if(pos > n+1) continue;
		bool ok = 1;
		for(int i = c; i <= k; i++){
			if(dp[pos][i] >= sum) ok = 0;
		}
		if(!ok) continue;
		dp[pos][c] = sum;
		if(pos >= n){
			chmax(ans, sum);
			continue;
		}
		if(c) q.push({{pos+1,c-1},sum});
		q.push({{pos+2,c},sum+a[pos]});
	}
	cout << ans << endl;
}

int main(){
	std::cin.tie(0);
	std::ios::sync_with_stdio(false);
	int t = 1;
	//cin >> t;
	while(t--){
		solve();
	}
	
	return 0;
}


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

typedef long long ll;
#define NUM 40001

int n,m;
int q;
vector<int> a(20,0);
vector<bool> table(NUM,false);

void setable(int d,int i){
    if(i>20){
        return;
    }else{
        table[d]=true;
        setable(d,i+1);
        setable(d+a[i],i+1);
    }
}


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> n;
    a.resize(n);
    for(int i=0;i<n;i++)cin >> a[i];
    setable(0,0);
    cin >> q;
    for(int i=0;i<q;i++){
        cin >> m;
        if(table[m])cout << "yes\n";
        else cout << "no\n";
    }
}



Measured memory_bytes: 3200
#include<bits/stdc++.h>
using namespace std;
int n,a[10005],b[10005];
long long int suma,sumb,cha,cishu;
int main()
{
    cin>>n;
    for(int i=1;i<=n;i++)
	{
	    cin>>a[i];
		suma+=a[i];
	}
    for(int i=1;i<=n;i++)
	{
	    cin>>b[i];
		sumb+=b[i];
	}
    if(suma>sumb)
	{
        cout<<"No"<<endl;
		return 0;
    }
    cha=sumb-suma;
    for(int i=1;i<=n;i++)
    {
        if(b[i]>a[i])
        {
            cishu+=(b[i]+1-a[i])/2;
        }
    }
    if(cishu>cha)
	{
	    cout<<"No"<<endl;
	    return 0;
	}
    cout<<"Yes"<<endl;
    return 0;
}

Measured memory_bytes: 384
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        final Scanner sc = new Scanner(System.in);

        final int k = sc.nextInt();
        final int a = sc.nextInt();
        final int b = sc.nextInt();

        for (int i = k; i <= b; i += k) {
            if (a <= i && i <= b) {
                System.out.println("OK");
                return;
            }
        }
        System.out.println("NG");
    }
}


Measured memory_bytes: 35588
#include <bits/stdc++.h>
 
using namespace std;
typedef long long LL;
typedef pair<int,int> pii;
 
#define pb push_back 
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second 
#define debug(x)  do{cerr<<#x<<": "<<x<<"\n";}while(0)
#define debugv(x) do{cerr<<#x<<": ";for(auto&e: (x))cerr<<e<<" ";cerr<<"\n";}while(0)
#define fori(i, n) for (int i = 0; i < (int)(n); ++i)
#define forn(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n); i >= 0; --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)
#define RETURN(x) do{cout << x << '\n'; return 0;}while(0)
#define FIRSTWIN do{cout << "Monocarp\n"; return 0;}while(0)
#define SECONDWIN do{cout << "Bicarp\n"; return 0;}while(0)
 
const int MAXN = 1e5+4;
const int MOD = 1e9+7;
const int INF = 1e9+1;

int N;
char S[104];

int main() {
#ifdef OJ
    freopen("input.txt", "rt", stdin);
    //freopen("output.txt", "wt", stdout);
#endif
    ios::sync_with_stdio(false);
    cin.tie(0);

    cin >> N >> S;
    if(N%2) RETURN("No");
    
    int i = 0, j = N/2;
    while(i < N/2 && S[i] == S[j]) {
        i++; j++;
    }

    if(i != N/2) RETURN("No");
    RETURN("Yes");
    return 0;
}



Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include <cmath>
#include <limits>
#include<set>
#include <iomanip>
#include <queue>
#include <map>
#include <string>
#pragma GCC optimize("Ofast")
using namespace std;
typedef long long ll;
const long long INF=(1LL<<62);
const double inf=pow(10,10);
double pi=3.141592653589793;
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
const ll MOD = 1000000007;
void init(){
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
}

int main(){
	init();
	string s;
	cin>>s;
	cout<<"ABC"+s<<endl;
}


Measured memory_bytes: 256
# coding: utf-8
# Your code here!

s = input()
t = input()

lens = len(s)
lent = len(t)
check = 0
ansindex = []
for i in range(lens-lent+1):
    for j in range(lent):
        
        if not((s[i+j]==t[j]) or (s[i+j]=='?')):
            break
        if j ==lent -1:
            ansindex.append(i)
            check +=1


if check == 0:
    print('UNRESTORABLE')
    exit()
ans =s.replace('?','a')
ans = ans[:ansindex[-1]]+t+ans[ansindex[-1]+lent:]
print(ans)
            

Measured memory_bytes: 3064
from itertools import permutations

def solve(n,k):
    c=[]
    s=set()
    for _ in range(n):
        c+=[int(input())]

    for e in permutations(c,k):
        tmp=''
        for f in e:
            tmp+=str(f)
        s.add(tmp)
    print(len(s))


for i in range(5):
    n=int(input())
    k=int(input())
    if n==k==0:exit()
    solve(n,k)


Measured memory_bytes: 5904
//繝・Φ繝励Ξ
#include <bits/stdc++.h>
#define int long long
#define REP(i,n) for(int i = 0; i < (n); ++i)
#define FOR(i,a,b)  for(int i = (a); i <= (b); ++i)
#define ALL(v) (v).begin(),(v).end()

using namespace std;
//constexpr int MOD = 10e9+7;
//constexpr int INF = 1LL << 60;
template <class T> inline bool chmin(T& a, T b){if(a > b){ a = b; return 1;} return 0;}  
template <class T> inline bool chmax(T& a, T b){if(a < b){ a = b; return 1;} return 0;}  
const int dx[] = {0, 1, 0, -1, 1, -1, 1, -1}, dy[] = {1, 0, -1, 0, 1, -1, -1, 1};
//
signed main (){
   ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
   string S,T;
   cin >> S >> T;
   sort(ALL(S));
   sort(ALL(T));
   if(S.size() < T.size())
   {
      bool matched = true;
      REP(i,S.size())
      {
         if(S[i] != T[i])
         {
            matched = false;
            break;

         }
      }
      if (matched)
      {
         cout << "Yes" << endl;
         return 0;
      }
   }
   sort(ALL(T),greater<char>());
   if(S.compare(T) < 0)
   {
      cout << "Yes" << endl;
   }
   else {
      cout << "No" << endl;
   }
}

//驛ｨ蛻・・譛蟆丞､
//譖ｴ譁ｰ縺励↑縺・ｴ蜷遺・邏ｯ遨阪ｏ
//莠梧ｬ｡蜈・↓縺励◆縺・・縺・ｂ縺呎ｳ・
//荳邂・園繧剃ｽ募屓繧よ峩譁ｰ縺励◆縺・・Segment Tree(縺溘□縺怜叙蠕涌(logN))
//遽・峇繧剃ｽ募屓繧よ峩譁ｰ縺励◆縺・・Lazy Segment Tree


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll=long long;using ull=unsigned ll;
using vi=vector<int>;using vvi=vector<vi>;using vl=vector<ll>;
using P=pair<int,int>;using PL=pair<ll,ll>;
const int INF=1<<30,MOD=1000000007;const ll LINF=1ll<<60;
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) _repi(i,0,n)
#define _repi(i,a,b) for(int i=a,i##_l=(b);i<i##_l;++i)
#define REP(...) _overload3(__VA_ARGS__,_repi,_rep,)(__VA_ARGS__)
#define REPR(i,n) for(int i=n-1;i>=0;--i)
#define REPARR(i,v) for(int i=0;i<v.size();++i)
#define all(v) (v).begin(),(v).end()
#define uniq(v) sort(all(v));v.erase(unique(all(v)),v.end())
#define bit(n) (1ll<<(n))
#define d(n) cerr<<#n":"<<n<<endl;
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;}
#define cut(n, Min, Max) max(min(n,Max),Min)
#define YES(n) cout<<((n)?"YES":"NO")<<endl
#define Yes(n) cout<<((n)?"Yes":"No")<<endl
#define yes(n) cout<<((n)?"yes":"no")<<endl
#define poss(n) cout<<((n)?"":"im")<<"possible"<<endl
#define Poss(n) cout<<((n)?"P":"Imp")<<"ossible"<<endl
template<typename T>ostream&operator<<(ostream&o,const vector<T>&v){for(T i:v)o<<i<<' ';return o;}
template<typename T>istream&operator>>(istream&i,vector<T>&v){for(T&j:v)i>>j;return i;}
template<typename T>ostream&operator<<(ostream&o,const set<T>&v){for(T i:v)o<<i<<' ';return o;}
template<typename T,typename U>ostream&operator<<(ostream&o,const pair<T,U>&v){o<<v.first<<' '<<v.second;return o;}

template<typename TypeInt>
std::string Itoa(const TypeInt v, int base)
{
    static const char table[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
    string ret;
    static numeric_limits<TypeInt> t;
    TypeInt n = v;
    if (t.is_signed) {
        if (v < 0) n *= -1;
    }
 
    while (n >= base) {
        ret += table[n%base];
        n /= base;
    }
    ret += table[n];
    if (t.is_signed) {
        if (v < 0 && base == 10) ret += '-';
    }
    // 文字列の順番を逆にする
    std::reverse(ret.begin(), ret.end());
 
    return ret;
}


int main(){
    ll n,a,b,c;
    cin>>n>>a>>b>>c;
    vi l(n);
    cin>>l;
    ll mi=LINF;
    REP(x,bit(n*2)){
        ll cost=-30;
        ll aa=0,bb=0,cc=0;
        //cerr<<Itoa(x,4);
        //cerr<<endl;
        REP(i,n){
            //cerr<<((x&(3<<(i*2)))>>(i*2));
            switch((x&(3<<(i*2)))>>(i*2)){
                case 0:
                    aa+=l[i];
                    cost+=10;
                    break;
                case 1:
                    bb+=l[i];
                    cost+=10;
                    break;
                case 2:
                    cc+=l[i];
                    cost+=10;
                    break;
                case 3:
                    // pass
                    break;
                
            }
            //d(aa);d(bb);d(cc);
        }
        if(!(aa && bb && cc))continue; // no 0->1(tekina?)
        
        cost+=abs(a-aa)+abs(b-bb)+abs(c-cc);
        //cerr<<aa<<','<<bb<<','<<cc<<':'<<cost<<endl;
        //cerr<<':'<<cost<<endl;
        chmin(mi,cost);
    }
    cout<<mi<<endl;
    return 0;
}


Measured memory_bytes: 256
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
      
      int i = 0;
      
      int a = sc.nextInt();
      int b = sc.nextInt();
      int c = sc.nextInt();
      
      if(a==7){
        i++;
      }
            if(b==7){
        i++;
      }
            if(c==7){
        i++;
      }
      
      if(i == 1){
        System.out.println("YES");
      }else{
        System.out.println("NO");
      }
	}
}


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

int main(int argc, char const *argv[])
{
	int n;
	cin>>n;
	int n2=1; //n2<=262144
	for (int i = 0; i < n; ++i)
	{
		n2*=2;
	}
	int tmp;
	multiset<int> memo;
	for (int i = 0; i < n2; ++i)
	{
		cin>>tmp;
		tmp*=-1;
		memo.insert(tmp);
	}
	multiset<int> ok[n+2];
	ok[0].insert(*memo.begin());
	memo.erase(memo.begin());
	int now=0;
	while (memo.size()>0)
	{
		for (auto itr = ok[now].begin(); itr != ok[now].end(); ++itr)
		{
			auto make=memo.upper_bound(*itr);
			if (make==memo.end())
			{
				cout<<"No\n";
				return 0;
			}
			ok[now+1].insert(*itr);
			ok[now+1].insert(*make);
			memo.erase(make);
		}
		++now;
	}
	cout<<"Yes\n";
	return 0;
}

Measured memory_bytes: 24832
from collections import deque

result = deque()
for _ in input().split():
    if 'apple' in _ : 
        if _ == 'apple' : result.append('peach') 
        else : result.append(_.replace('apple', 'peach'))
    elif 'peach' in _ : 
        if _ == 'peach' : result.append('apple')
        else : result.append(_.replace('peach', 'apple'))
    else : result.append(_)
print(*result)

Measured memory_bytes: 7804
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i ++)
using namespace std;
using ll = long long;
using PL = pair<ll,ll>;
using P = pair<int,int>;
constexpr int INF = 1000000000;
constexpr long long HINF = 1000000000000000;
constexpr long long MOD = 1000000007;
constexpr double EPS = 1e-4;
constexpr double PI = 3.14159265358979;

struct StronglyConnectedComponents {
    int N;
    vector<vector<int>> G,rG;
    vector<int> group,order;

    StronglyConnectedComponents(int _N): N(_N), G(N), rG(N), group(N,1) {}
    
    void add_edge(int a,int b) {
        G[a].push_back(b);
        rG[b].push_back(a);
    }

    void dfs(int v) {
        group[v] = -1;
        for (int e: G[v]) {
            if (group[e] > 0) dfs(e);
        }
        order.push_back(v);
    }

    void rdfs(int v,int cnt) {
        group[v] = cnt;
        for (int e: rG[v]) {
            if (group[e] < 0) rdfs(e,cnt);
        }
    }

    void build() {
        for (int i = 0;i < N;i ++) {
            if (group[i] > 0) dfs(i);
        }
        reverse(begin(order),end(order));
        int cnt = 0;
        for (int v: order) {
            if (group[v] < 0) rdfs(v,cnt),cnt++;
        }
    }

    int operator[](int i) {
        return group[i];
    }
};

int main() {
    int V,E; cin >> V >> E;
    StronglyConnectedComponents scc(V);

    rep(i,E) {
        int a,b; cin >> a >> b;
        scc.add_edge(a,b);
    }
    scc.build();

    int Q; cin >> Q;
    rep(i,Q) {
        int u,v; cin >> u >> v;
        if (scc[u] == scc[v]) cout << 1 << endl;
        else cout << 0 << endl;
    }
    return 0;
}


Measured memory_bytes: 4516
#include <iostream>
#include <vector>
#include <string>

using namespace std;

int main(void)
{
	int A, B, C, N, sum=0;
	char c = '0';
	string S;
	cin >> N;
	//vector<int> vec(N);
	
	cin >> S;

	for (int i = 0; i < S.size(); i++)
	{
		if (c == S[i])
		{
			continue;
		}
		sum++;
		c = S[i];

	}

	cout << sum << endl;

}

Measured memory_bytes: 512
# -*- coding: utf-8 -*-

import sys
import math


debug = False

def log(text):
    if debug:
        print(text)

def parse_input(lines_as_string = None):

    global debug
    lines = []
    if lines_as_string is None:
        debug = False
        # for line in sys.stdin:
        #     lines.append(line)
        lines.append(input())
    else:
        debug = True
        lines = [e for e in lines_as_string.split("\n")][1:-1]

    (r, ) = [int(e) for e in lines[0].split(' ')]

    return (r, )


def solve(r):

    
    return  2 * r * math.pi
    


def main():
    # 出力
    result = solve(*parse_input())
    if isinstance(result, list):
        for r in result:
            print("%s" % r, sep='')
    else:
        print("%s" % result, sep='')

if __name__ == '__main__':

    main()
	

Measured memory_bytes: 62192
#include <iostream>
#include <sstream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <random>
#include <chrono>
#include <queue>
#include <ctime>
#include <cassert>
using namespace std;
typedef long long ll;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;
#define fs first
#define sc second
#define INF 1000000000
#define MOD 1000000007
#define EPS 0.00000001




int main() {
    int N; cin >> N;
    vector<int> V(N);
    for(int &i:V){
        cin >> i;
    }
    
    int cnt = 0;
    for(int i=0; i<N-2; i++){
        vector<int> C(3);
        C[0] = V[i];
        C[1] = V[i+1];
        C[2] = V[i+2];
        int ni = C[1];
        sort(C.begin(), C.end());
        if(ni == C[1]) cnt++;
    }
    
    cout << cnt << endl;
    return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;

int main(){
	int n;
	cin>>n;
	vector<double> a(n);
	rep(i,n){
		cin>>a[i];
	}
	double ans=0;
	rep(i,n){
		ans +=(1/a[i]);
	}

	cout << 1/ans;
}

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

using ll=long long;
using namespace std;

#define rep_i(i, n) for (int i = 0; i < (n); ++i)
#define rep_ll(i, n) for (long long i = 0; i < (n); ++i)
#define r_rep_i(i, start, end) for (int i = (start); i < (end); ++i)
#define r_rep_ll(i, start, end) for (long long i = (start); i < (end); ++i)
#define debug_vi(v) copy((v).begin(), (v).end(), ostream_iterator<int>(cout, " "));
#define debug_vll(v) copy((v).begin(), (v).end(), ostream_iterator<long long>(cout, " "));
#define debug_vd(v) copy((v).begin(), (v).end(), ostream_iterator<double>(cout, " "));
#define sort_v(v) sort((v).begin(), (v).end()); //昇順
#define d_sort_vi(v) sort((v).begin(), (v).end(), greater<int>()); //降
#define d_sort_vll(v) sort((v).begin(), (v).end(), greater<long long>()); //降
#define d_sort_vd(v) sort((v).begin(), (v).end(), greater<double>()); //昇順
#define say(t) cout << (t) << endl;
#define sum_vi(v) accumulate((v).begin(), (v).end(), 0);
#define sum_vll(v)accumulate((v).begin(), (v).end(), 0LL);

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

const int IINF=(1<<30);
const ll LLINF = 1LL<<60;

char BigAlphaToSmall(char a){
    if (a >= 65 && a <= 90){
        return a + 32;
    }
    return a;
}

char SmallAlphaToBig(char a){
    if (a >= 97 && a <= 122){
        return a - 32;
    }
    return a;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(0);
    string s;
    int n;
    int a;
    string tmp;
    while(true){
        cin >> s;
        if(s == "-")break;
        cin >> n;
        for (int i = 0; i < n; i++){
            cin >> a;
            tmp = s.substr(0, a);
            s.erase(0, a);
            s = s + tmp;
        }
        say(s)
    }
}


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

#define LL long long
#define MOD 1000000007
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define print(a, n) for(auto _=0; _<n; _++) cout<<a[_]<<" "; cout<<"\n"
#define prints(a) for(auto _: a) cout<<_<<" "; cout<<"\n"
#define read(a, n) for(auto _=0; _<n; _++) cin>>a[_]

const int dr4[] = {1, -1, 0, 0};
const int dc4[] = {0, 0, 1, -1};

int main()
{
	fastio;
	int n, m, sr, sc, er, ec;
	cin>>n>>m;
	cin>>sr>>sc>>er>>ec;

	char maze[n][m];
	int ans[n][m];

	for(int i=0; i<n; i++){
		for(int j=0; j<m; j++)
			ans[i][j] = INT_MAX;
	}

	for(int i=0; i<n; i++){
		for(int j=0; j<m; j++)
			cin>>maze[i][j];
	}

	deque<array<int, 2> > q;
	q.push_back({sr-1, sc-1});
	ans[sr-1][sc-1] = 0;

	while(!q.empty()){
		auto u = q.front();
		q.pop_front();

		for(int i=0; i<4; i++){
			int r = u[0] + dr4[i];
			int c = u[1] + dc4[i];
			if(r>=0 && c>=0 && r<n && c<m && maze[r][c]!='#' && ans[r][c]>ans[u[0]][u[1]])
					q.push_front({r, c}), ans[r][c] = ans[u[0]][u[1]];
		}

		for(int i=max(0, u[0]-2); i<=min(n-1, u[0]+2); i++){
			for(int j=max(0, u[1]-2); j<=min(m-1, u[1]+2); j++){
				if(maze[i][j]!='#' && ans[i][j]>ans[u[0]][u[1]]+1)
					q.push_back({i, j}), ans[i][j] = ans[u[0]][u[1]]+1;
			}
		}
	}

	if(ans[er-1][ec-1]==INT_MAX)
		cout<<-1<<"\n";
	else
		cout<<ans[er-1][ec-1]<<"\n";

	exit(0);
}


Measured memory_bytes: 8496
#include <bits/stdc++.h>
#define MOD 1000000007
#define INF 1000000000
#define LINF 1000000000000000000
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define bit(n) (1LL<<(n))
using namespace std;

typedef pair<int, int> P;
typedef pair<long long, long long> LLP;

int main() {

    int N, R;
    cin >> N >> R;

    cout << R + (N >= 10 ? 0 : 100 * (10 - N)) << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define All(v) v.begin(), v.end()
using namespace std;
typedef long long lint;
typedef pair<int, int> pii;
typedef pair<lint, lint> pll;

const int MAX_N = (int)1e5 + 5;
lint A[MAX_N], ans[MAX_N];

int main(){
    ios::sync_with_stdio(false), cin.tie(nullptr);
    int N;
    lint cur = 0;
    cin>>N;
    for(int i=0;i<N;i++){
        cin>>A[i];
        if(i%2) cur -= A[i];
        else cur += A[i];
    }
    cur /= 2LL;
    for(int i=0;i<N;i++){
        cout<<2 * cur<<' ';
        cur = A[i] - cur;
    }
    cout<<endl;
    return 0;
}

Measured memory_bytes: 2176
#include <bits/stdc++.h>
using namespace std;
int main(){
	long long K,A,B;
	cin>>K>>A>>B;
	if(B-A<=2){
		cout<<1+K;
	}else{
		if((K-(A-1))%2==0 && (K-(A-1))/2>0){
			cout<<(long long)(A-((K-(A-1))/2)*A+((K-(A-1))/2)*B);
			
		}else{
			if( (K-(A-1))/2>0){
				cout<<(long long)(A-((K-(A))/2)*A+(((K-(A))/2)*B)+1);
			}else{
				cout<<K+1;
			}
		}
	}
}

Measured memory_bytes: 256
#include<stdio.h>
int main(void){
    int a;
    int b;
    int c;
    scanf("%d %d %d",&a,&b,&c);
    int x;
    int y;
    for(x=a;x <= b;x++){
        if(a <= x && x <= b && c % x == 0){
            y++;
        }
    }
    printf("%d\n",y);
    return 0;
}


Measured memory_bytes: 2104
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;} return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;} return 0;}
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(vec) vec.begin(),vec.end()
typedef long long ll;
typedef pair<ll,ll> l_l;
typedef pair<int,int> i_i;
const ll MOD=1e9+7;
const int INF=1<<30;

int main(){
  int n; cin >> n;
  string s; cin >> s;
  rep(i,s.size()){
    if(int(s[i]+n)<=90) s[i]=s[i]+n;
    else s[i]=s[i]-26+n;
  }
  cout << s << endl;
  //char t='Z';
  //out << int(t) << endl;
}

Measured memory_bytes: 256
n = input()
ns = list(map(int, input().split()))
nums = {}
for i in ns:
    if i not in nums:
        nums[i] = 1
    else:
        nums[i] += 1

count = 0

for k, v in nums.items():
    if k > v:
        count += v
    elif k < v:
        count += v - k


print(count)


Measured memory_bytes: 18164
#include<stdio.h>
int w[3001], s[3001];
int main(){
        int a, b, c, d, e, f;
        scanf("%d%d%d%d%d%d", &a, &b, &c, &d, &e, &f);
        a*=100; b*=100;
        w[0] = 1; s[0] = 1;
        for(int i=0; i<3000; i++){
                if(i+a <= 3000) w[i+a] |= w[i];
                if(i+b <= 3000) w[i+b] |= w[i];
                if(i+c <= 3000) s[i+c] |= s[i];
                if(i+d <= 3000) s[i+d] |= s[i];
        }
        int x=0, y=a;
        for(int i=1; i<f; i++){
                if(!w[i]) continue;
                for(int j=1; i+j <= f; j++){
                        if(!s[j]) continue;
                        if( j*100 > e*i ) continue;
                        if( x*(i+j) >= j*(x+y) ) continue;
                        x = j; y = i;
                }
        }
        printf("%d %d\n", x+y, x);
        return 0;
}

Measured memory_bytes: 128
fun main(args : Array<String>) {
    val n = readLine()!!.toLong()
    val dd = divisor(n)

    var min = Long.MAX_VALUE

    dd.forEach {
        val d1 = it
        val d2 = n / d1

        val l1 = d1.toString().length.toLong()
        val l2 = d2.toString().length.toLong()

        min = Math.min(min, Math.max(l1, l2))
    }

    println(min)
}

fun divisor(value : Long) : List<Long> {
    val divisors = mutableListOf<Long>()
    var i = 1L
    while (i * i <= value) {
        if (0L == value % i) {
            divisors.add(i)
            if (i != value/i) divisors.add(value/i)
        }
        i++
    }
    return divisors.sorted()
}


Measured memory_bytes: 35924
#define TEST_MODE true
 
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
 
#include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep2(i, a, b) for (int i = (a); i < (b); ++i)
#define rrep(i, n) for (int i = (n)-1; i >= 0; --i)
#define rrep2(i, a, b) for (int i = (a)-1; i >= b; --i)
#define range(i, a, b, c) for (int i = a;             \
                               c > 0 ? i < b : i > b; \
                               i += c)
#define chmax(a, b) (a = (a) < (b) ? (b) : (a))
#define chmin(a, b) (a = (a) > (b) ? (b) : (a))
using ll = long long;
using ull = unsigned long long;
using ld = long double;
#define all(a) begin(a), end(a)
#define ifnot(a) if (not(a))
#define int long long
 
#if TEST_MODE == true
const bool test = true;
#define dump(x) cerr << #x << " = " << (x) << endl
#else
const bool test = false;
#define dump(x) 
#endif
 
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};

const int INF = (int)1 << 60;
const ll INFL = (ll)1 << 60;
ll mod_n = (int)1e9 + 7;
const double eps = 1e-10;
typedef long double Real;
// return -1, 0, 1
int sgn(const Real &r) { return (r > eps) - (r < -eps); }
int sgn(const Real &a, const Real &b) { return sgn(a - b); }
 
//.....................
const int MAX = (int)2e5 + 5;
 
vector<string> split(const string &str, char sep)
{
    vector<string> v;
    stringstream ss(str);
    string buffer;
    while (getline(ss, buffer, sep))
    {
        v.push_back(buffer);
    }
    return v;
}
 
template <class InputIterator>
int sum(InputIterator begin, InputIterator end)
{
    return accumulate(begin, end, 0ll);
}

int H = 20, W = 30;

bool ng(int y, int x) {
    return y < 0 || H <= y || x < 0 || W <= x;
}

void solve();

string dir_str[] = {"RIGHT", "DOWN", "LEFT", "UP"};
bool visited[40][40];

class Solver {
public:
  string s;

  void solve() {
    cin >> s;
	cout << s.front() << s.size() - 2 << s.back() << endl;
  }
};
 
signed main()
{
    cout << fixed << setprecision(20);
    auto ptr = new Solver();
    ptr->solve();
    delete ptr;
	// while (true) {
	//   auto ptr = new Solver();
	//   ptr->solve();
	//   delete ptr;
    // }
    return 0;
}
 
// class Mycin {
// 	bool flag = true;
// public:
// 	Mycin& operator >> (int& a) {flag = scanf("%lld", &a) != EOF; return *this;}
// 	Mycin& operator >> (char& a) {flag = scanf("%c", &a) != EOF; return *this;}
// 	Mycin& operator >> (string& s) {flag = (bool)(cin >> s); return *this;}
// 	operator bool() {return flag;}
// } mycin;
 
// class Mycout {
// public:
// 	Mycout& operator << (const int& a) {printf("%lld", a); return *this;}
// 	Mycout& operator << (const char c) {printf("%c", c); return *this;}
// 	Mycout& operator << (const string& s) {printf("%s", s.c_str()); return *this;}
// } mycout;
 
// #define cin mycin
// #define cout mycout
// #define endl '\n'
 


Measured memory_bytes: 256
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		int [] a=new int[n];
		for(int i=0;i<n;i++){
			a[i]=sc.nextInt();
		}
		Arrays.sort(a);
		long ans=1;
		if(n%2==0){
			for(int i=0;i<n-1;i+=2){
				if(a[i]==i+1 && a[i+1]==i+1){}
				else{
					System.out.println(0);
					return;
				}
			}
			for(int i=0;i<n/2;i++){
				ans*=2;
				ans%=(1000000000+7);
			}
			System.out.println(ans);
		}else{
			for(int i=1;i<n-1;i+=2){
				if(a[0]==0){}
				else System.out.println(0);
				
				if(a[i]==i+1 && a[i+1]==i+1){}
				else{
					System.out.println(0);
					return;
				}
			}
			for(int i=0;i<n/2;i++){
				ans*=2;
				ans%=(1000000000+7);
			}
			System.out.println(ans);
		}
	}
}


Measured memory_bytes: 50816
using System;

class program
{
    public static int Main()
    {
        var In = Console.ReadLine();
        var a = int.Parse(In.Split(' ')[0]);
        var b = int.Parse(In.Split(' ')[1]);
        var c = int.Parse(In.Split(' ')[2]);
        int[] array = new int[3] { a, b, c };
        int buf;

        if (array[2] < array[1])
        {
            buf = array[1]; array[1] = array[2]; array[2] = buf;
        }

        if (array[1] < array[0])
        {
            buf = array[0]; array[0] = array[1]; array[1] = buf;
        }

        if (array[2] < array[1])
        {
            buf = array[1]; array[1] = array[2]; array[2] = buf;
        }

        Console.WriteLine("{0} {1} {2}", array[0], array[1], array[2]);        

        return 0;
    }
}

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

int MOD=1000000007;
struct edge {
    int to, cost;
};

int modpow(int a,int x){
  if(a<0)a+=MOD;
  int ans=1;
  while(x>0){
    if(x&1) ans=ans*a%MOD;
      a=a*a%MOD;
      x>>=1;
  }
  return ans;
}

int gyaku(int n){
    return modpow(n,MOD-2);
}

auto factor(int n){
  map<int,int>res;
  for(int i=2;i*i<=n;i++){
      for(; n%i==0;n/=i) res[i]++;
  }
  if(n>1)res[n]++;
  return res;
}
////////////////////////////////////////////////////////////
signed main() {
  int n;
  cin>>n;
  vector<int>a(n);
  rep(i,n)cin>>a[i];
  int streak=0;
  int ans=0;
  rep(i,n){
    if(a[i]==i+1){
      if(streak){streak=0;}
      else {
        ans++;
        streak++;
      }
    }
    else streak=0;
  }
  cout<<ans<<endl;
}


Measured memory_bytes: 4032
#include<iostream>
#include<list>
#include<vector>
#include<algorithm>
#include<string>
#include<stdio.h>
#include<math.h>
#include<unordered_map>
#include<map>

using namespace std;
using ll = long long;
using vec = vector<ll>;
using mat = vector<vec>;


int main()
{
	double W, H, x, y;
	cin >> W >> H >> x >> y;

	printf("%.9f ", W*H / 2);
	if (W == x * 2 && H == y * 2)
	{
		cout << 1 << endl;
	}
	else
	{
		cout << 0 << endl;
	}

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define rep(i,n) for (int i = (0); i < (n); ++i)
#define rng(x) (x).begin(),(x).end()
#define rrng(x) (x).rbegin(),(x).rend()
#define debug(x) cout << #x << " = " << (x) << endl;
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define uni(x) x.erase(unique(rng(x)),x.end())
#define SP << " " <<
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using pii = pair<int, int>;
using tiii = tuple<int, int, int>;
const int mod = 1000000007;
const double EPS = 1e-9;
const int INF = 1<<30;
const ll INFLL = 1LL<<60;
//cout << fixed << setprecision(10);

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;
  vi c(n-1), s(n-1), f(n-1);
  rep(i,n-1) cin >> c[i] >> s[i] >> f[i];

  vi t(n);
  rep(i,n) {
    for (int j = i; j < n-1; ++j) {
      if (t[i] < s[j]) t[i] += s[j] - t[i] + c[j];
      else if (t[i]%f[j] == 0) t[i] += c[j];
      else t[i] += (t[i]/f[j]+1)*f[j] - t[i] + c[j];
    }
  }

  rep(i,t.size()) printf("%d\n", t[i]);
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string N;
  cin >> N;
  int counter=0;
  for (int i=0 ; i<3 ; i++){
    if (N.at(i)== '7')
      counter++;
  }
  if(counter > 0)
    cout << "Yes" <<endl;
  else
    cout << "No" <<endl;
}


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

using namespace std;
using ll=long long;

int main(){
  cin.tie(nullptr);ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(15);
  ll n,a,b;
  cin>>n>>a>>b;
  ll cnt=0;
  cnt=n%(a+b)>=a? a:n%(a+b);
  //cout<<cnt<<endl;
  //cout<<n/(a+b)*a<<endl;
  cout<<cnt+n/(a+b)*a<<endl;
}


Measured memory_bytes: 256