akhauriyash/Code-Regression huggingface dataset:
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    N = I()

    if N % 2== 0:
        print(N)
    else:
        print(2 * N)

if __name__ == '__main__':
    resolve()


Measured memory_bytes: 10100
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define     ll          long long int
#define     REP(i,n)    for(ll i=0;i<n;i++)
#define     SZ(v)       (ll)v.size()
#define     endl        "\n"
#define     ff          first
#define     ss          second
#define     PQ_MIN      priority_queue <ll, vector<ll>, greater<ll> >
#define     PQ          priority_queue <int>
#define     pbds        tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define     setbit(x)   __builtin_popcount(x)
#define     prec(n)     fixed<<setprecision(n)
using namespace std;
using namespace __gnu_pbds;
bool comp(pair<ll,ll> a,pair<ll,ll> b) {       }
const ll INF=1e16;
const ll MOD=5;
const ll nxm=1e6+5;
vector<ll> allprime;
bool isprime[nxm];
void sieve()
{
    memset(isprime,1,sizeof(isprime));
    for(ll i=2;i<nxm;i++)
    {
        if(isprime[i])
        for(ll j=i*i;j<nxm;j+=i)
        {
            isprime[j]=0;
        }
    }
    for(ll i=2;i<nxm;i++)
        if(isprime[i])
        allprime.push_back(i);
}
void print(vector<vector<ll> >&v)
{
    ll n=v.size();
    ll m=v[0].size();
    cout<<"\n";
    for(ll i=0;i<n;i++)
    {
        for(ll j=0;j<m;j++)
            cout<<v[i][j]<<" ";
        cout<<"\n";
    }
}
void print(vector<ll>&v)
{
    ll n=v.size();
    cout<<"\n";
    for(ll i=0;i<n;i++)
    {
            cout<<v[i]<<" ";
    }
        cout<<"\n";

}
void print(set<ll>&s)
{

cout<<endl;

set<ll>::iterator it;
for(it=s.begin();it!=s.end();it++)
    cout<<*it<<" ";
cout<<endl;
}

ll power(ll a,ll p)
{
    ll res=1;
    while(p>0)
    {
        if(p&1){
            res=(res*a)%MOD;
            p--;
        }
            a=(a*a)%MOD;
            p/=2;
    }

    return res%MOD;


}
ll __lcm(ll a,ll b)
{
    return ((a*b)/__gcd(a,b));
}
ll fact(ll a)
{
    ll res=1;
    for(ll i=1;i<=a;i++)
        res*=i;
    return res;
}
ll sqroot[nxm];
ll perfect_square()
{
    memset(sqroot,-1,sizeof(sqroot));
    for(ll i=1;i*i<=nxm;i++)
    {
        sqroot[(i*i)]=i;
    }
}
bool is_prime(ll n)
{
    for(ll i=2;i*i<=n;i++)
        if(n%i==0)
        return false;
    return true;
}
void solve(){
    ll l,r,d;
    cin>>l>>r>>d;
    if(l%d!=0)
        l=(l/d+1)*d;
    if(r%d)
        r=(r/d)*d;
    cout<<(r-l)/d+1;
}
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	ll t=1;
//	cin >> t;
	while(t--){
		solve();
	}
	return 0;
}


Measured memory_bytes: 3644
#include <stdio.h>
#include <stdlib.h>

int main()
{
    int n;
    int a[200000];
    int i;
    int tmp;

    scanf("%d", &n);
    for(i=0; i<n; i++){
        scanf("%d", &tmp);
        if(n%2!=i%2){
            a[99999-i/2]=tmp;
        }else{
            a[100000+i/2]=tmp;
        }
    }
    for(i=0; i<n; i++){
        printf("%d", a[99999-(n-1)/2+i]);
        if(i!=n-1){
            printf(" ");
        }
    }
    printf("\n");

    return 0;
}


Measured memory_bytes: 2816
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <iostream>
#include <algorithm>
using namespace std;

template <typename Tp> inline void getint(Tp &num){
	register int ch, neg = 0;
	while(!isdigit(ch = getchar())) if(ch == '-') neg = 1;
	num = ch & 15;
	while(isdigit(ch = getchar())) num = num * 10 + (ch & 15);
	if(neg) num = -num;
}

int N, a[100005];

int main(){
	getint(N);
	for(register int i = 1; i <= N; i++) getint(a[i]);
	for(register int i = 1; i <= N; i++) if(a[i] & 1) return puts("first"), 0;
	return puts("second"), 0;
}


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

int main(){
	ll n,a,b,ans=0;
	cin>>n>>a>>b;
	
	if(a==0){
		cout<<0;
	}else{
		ans+=n/(a+b)*a;
		if(n%(a+b)>=a){
			ans+=a;
		}else{
			ans+=n%(a+b);
		}
		
		cout<<ans;
	}
	
	return 0;
}

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

using namespace std;

#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define replrev(i,a,b) for(int i=(int)(b)-1;i>=(int)(a);i--)
#define reprev(i,n) replrev(i,0,n)
#define repi(itr,ds) for(auto itr=ds.begin();itr!=ds.end();itr++)
#define all(a) a.begin(),a.end()
#define mp make_pair
#define mt make_tuple
#define INF 2000000000
#define INFL 1000000000000000000LL
#define EPS (1e-8)
#define MOD 1000000007
#define PI 3.141592653589793
#define RMAX 4294967295
#define equals(a,b)(fabs((a)-(b))<EPS)

typedef long long ll;
typedef pair<ll, ll> P;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<P> vP;
typedef vector<vector<int> > vvi;
typedef vector<vector<bool> > vvb;
typedef vector<vector<ll> > vvll;
typedef vector<vector<char> > vvc;
typedef vector<vector<string> > vvs;
typedef vector<vector<double> > vvd;
typedef vector<vector<P> > vvP;
typedef complex<double> comp;
typedef vector<complex<double>> vcomp;
typedef priority_queue<int, vector<int>, greater<int> > pqli;
typedef priority_queue<ll, vector<ll>, greater<ll> > pqlll;
typedef priority_queue<P, vector<P>, greater<P> > pqlP;
typedef string::const_iterator State;
class ParseError {};
struct Edge {
	int from, to, cost;
	bool operator<(Edge e) {
		return cost < e.cost;
	}
};
typedef vector<Edge> Edges;
typedef vector<Edges> Graph;

Graph G;
vll depth;

void dfs(int pos, int par, ll d) {
	depth[pos] = d;
	rep(i, G[pos].size()) {
		if (G[pos][i].to == par)continue;
		dfs(G[pos][i].to, pos, d + G[pos][i].cost);
	}
}

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

	int N;
	cin >> N;
	G = Graph(N);
	rep(i, N - 1) {
		int a, b, c;
		cin >> a >> b >> c;
		a--; b--;
		G[a].push_back(Edge{ a,b,c });
		G[b].push_back(Edge{ b,a,c });
	}
	int Q, K;
	cin >> Q >> K;
	K--;
	depth = vll(N);
	depth[K] = 0;

	dfs(K, -1, 0);

	rep(i, Q) {
		int x, y;
		cin >> x >> y;
		x--; y--;
		cout << depth[x] + depth[y] << endl;
	}

	return 0;
}

Measured memory_bytes: 15872
import java.util.Scanner;

/**
 * @author Dell
 *
 */
public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int a = in.nextInt(),b = in.nextInt();
		in.close();
		int area = a*b,zc = 2*(a+b);
		System.out.print(area + " " + zc);
		System.out.println();// TODO Auto-generated method stub

	}

}


Measured memory_bytes: 26404
#include <iostream>
#include<string>
#include<cmath>
#include<algorithm>
#include<cctype>
#include<queue>
#include<stack>
#include<stdio.h>
#include<vector>
#include<set>
#include<map>
#include<iomanip>
#define rep(i,n) for(double i=0;i<n;i++)
typedef int long long ll;
using namespace std;
int const INF = 1000000;


int main(){
    ll h,w;
    cin>>h>>w;
    if(h%3==0||w%3==0){
        cout<<0<<endl;
    }else{
        ll ans=100000000000;
       
        if(h>=3){
            ans=min(ans,(h/3+h%3)*w-(h/3)*w);
        }
        if(w>=3){
            ans=min(ans,((w/3+w%3)*h-(w/3)*h));
        }
        
        ll s1,s2,s3;
        for(int i=1;i<=h;i++){
            s1=i*w;
            s2=(h-i)*(w/2);
            s3=(h-i)*w-s2;
            ans=min(ans,max({s1,s2,s3})-min({s1,s2,s3}));
            s2=((h-i)/2)*w;
            s3=(h-i)*w-s2;
             ans=min(ans,max({s1,s2,s3})-min({s1,s2,s3}));
            
            
        }
        for(int i=1;i<=w;i++){
            s1=i*h;
            s2=(w-i)*(h/2);
            s3=(w-i)*h-s2;
            ans=min(ans,max({s1,s2,s3})-min({s1,s2,s3}));
            s2=((w-i)/2)*h;
            s3=(w-i)*h-s2;
            ans=min(ans,max({s1,s2,s3})-min({s1,s2,s3}));
        }
                    
        
        
        cout<<ans<<endl;
    }
    return 0;
}


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

int n;
bool ch = 0;

int main() {
  cin >> n;
  for(int i = 0; i < 10; ++i)
    for(int j = 0; j < 10; ++j)
      if(i * j == n) ch = 1;
  if(ch)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}

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

string t = "AGCT";

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

  string s; cin >> s;
  int ans = 0,cnt = 0;
  for(int i = 0; i < s.size(); i++){
    int res = 0;
    for(int j = 0; j < t.size(); j++){
      if(s[i] == t[j]){
        res = 1;
      }
    }
    if(res == 1){
      cnt++;
    }
    else {
      cnt = 0;
    }
    ans = max(ans,cnt);
  }
  cout << ans << endl;

  return 0;
}


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

using namespace std;

long long func(long long a,long long b,long long c ,long long d){
    long long x,y;
    x = a - c;
    y = b - d;

    if(x < 0)x = -x;
    if(y < 0)y = -y;

    return x + y;
}
int main(){
    int n,m;
    long long a[55],b[55],c[55],d[55];
    cin >> n >> m;

    for(int i =0; i< n;i++){
        cin >> a[i] >> b[i];
    }
    for(int i = 0;i < m ; i++){
        cin >> c[i] >> d[i];
    }

    for(int i = 0;i< n;i++){
        int ans = 0;
        for(int j = 1;j< m;j++){
            if(func(a[i],b[i],c[j],d[j]) < func(a[i],b[i],c[ans],d[ans]))ans = j;
        }
        cout << ans + 1 << endl;
    }
}

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

#define for_(i,a,b) for(int i=(a);i<(b);++i)

int m;
string S;

bool check(string x) {
	vector< bool > vis(26, false);
	for_(i,0,m) {
		if (x[i] != 'a' && !vis[x[i] - 'a']) {
			vis[x[i] - 'a'] = true;
			x[i] = char(x[i] - 1);
		}
	}
	return S == x;
}

void dfs(int i, string& cur, set< string >& ans) {
	if (i == m) {
		if (check(cur)) ans.insert(cur);
		return;
	}
	
	if (S[i] == 'z') {
		cur += 'z';
		dfs(i + 1, cur, ans);
		cur.pop_back();
	} else {
		cur += S[i];
		dfs(i + 1, cur, ans);
		cur.pop_back();
		
		cur += char(S[i] + 1);
		dfs(i + 1, cur, ans);
		cur.pop_back();
	}
}

void solve() {
	m = S.size();
	set< string > ans;
	string cur = "";
	dfs(0, cur, ans);
	
	int n = ans.size();
	cout << n << endl;
	if (n <= 10) {
		for (string x : ans) cout << x << endl;
	} else {
		auto it = ans.begin();
		for_(i,0,5) {
			cout << *it << endl;
			++it;
		}
		
		it = ans.end();
		for_(i,0,5) --it;
		for_(i,0,5) {
			cout << *it << endl;
			++it;
		}
	}
}

int main() {
	while (cin >> S) {
		if (S == "#") break;
		solve();
	}
}

Measured memory_bytes: 5272
#include <iostream>

using namespace std;

const int MOD = 1000000007;

int dv[1000];

int sqrt(int x) {
  int l = 1, r = x;
  while (l + 1 < r) {
    int m = (l + r) / 2;
    (m * m <= x ? l : r) = m;
  }
  return l;
}

void memoDivisor(int n) {
  while (n > 1) {
    for (int i = 2; i <= n; ++i) {
      if (n % i == 0) {
        dv[i]++;
        n /= i;
        break;
      }
    }
  }
}

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

  for (int i = 1; i <= N; ++i) memoDivisor(i);

  long long cnt = 1;
  for (int i = 2; i <= N; ++i) {
    cnt = cnt * (dv[i] + 1) % MOD;
  }

  cout << cnt << endl;
}


Measured memory_bytes: 3564
n=int(input())
INF=float('inf')

cmin0,cmax0=INF,-INF
cmin1,cmax1=INF,-INF
for _ in range(n):
  x,y=map(int,input().split())
  cx,cy=x-y,x+y
  cmin0=min(cmin0,cx)
  cmax0=max(cmax0,cx)
  cmin1=min(cmin1,cy)
  cmax1=max(cmax1,cy)
  
ans=max(cmax0-cmin0,cmax1-cmin1)
print(ans)

Measured memory_bytes: 70912
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>

using namespace std;

const int MOD = 1000000007;
typedef pair<int, int> P;
typedef long long ll;
#define rep(i, n) for(int i=0;i<n;i++)
#define rep2(i, m, n) for(int i=m;i<n;i++)
#define rrep(i, n, m) for(int i=n;i>=m;i--)
using Graph = vector<vector<int>>;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

int main() {
    ll n;
    cin >> n;
    pair<ll, ll> ab[n];
    rep(i, n) {
        cin >> ab[i].second >> ab[i].first;
    }
    sort(ab, ab + n);

    ll sum = 0;
    rep(i, n) {
        ll a, b;
        b = ab[i].first;
        a = ab[i].second;
        if (sum + a <= b) {
            sum += a;
        }else{
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;



}


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

int main ()
{
	int a[105], c = 0, n; 
	cin >> n; 
	for (int i = 0; i < n; ++i)cin >> a[i]; 
	sort(a, a + n); 
	for (int i = 0; i < n; ++i)
	{
		for (int j = i + 1; j < n; ++j)
		{
			for (int k = j + 1; k < n; ++k)
			{
				if (a[i] == a[j] || a[i] == a[k] || a[j] == a[k])continue; 
				else if (a[i] + a[j] > a[k] && a[i] + a[k] > a[j] && a[j] + a[k] > a[i])c++; 
			}
		}
	}
	cout << c << endl; 
}

Measured memory_bytes: 3604
N = int(input())
flg = 0
k = 0
while k * (k - 1) <= 2 * N:
  if k * (k - 1) == 2 * N:
    flg = 1
    break
  else:
    k += 1
if flg == 0:
  print("No")
else:
  print("Yes")
  print(k)
  S = [[k-1] for _ in range(k)]
  cnt = 1
  for i in range(k-1):
    for j in range(i+1, k):
      S[i].append(cnt)
      S[j].append(cnt)
      cnt += 1
  for i in range(k):
    for j in range(k):
      if j == k:
        print(S[i][j])
      else:
        print(S[i][j], end = ' ')
    print()

Measured memory_bytes: 9420
import Control.Applicative ((<$>))
import Control.Monad (replicateM, unless)

import Data.ByteString.Char8 (ByteString)
import qualified Data.ByteString.Char8 as B

import Control.Monad.State

main :: IO ()
main = do
  n <- f
  unless (n == 0) $ do
    solve <$> replicateM n f >>= print
    main
  where f = readi B.readInt <$> B.getLine

solve :: [Int] -> Int
solve xs = evalState (puto xs) []

puto :: [Int] -> State [(Int, Int)] Int
puto [] = do
  ls <- get
  return $ sum $ map snd $ filter ((==0) . fst) ls
puto (x:xs) = do
  ls <- get
  case ls of
   ((c, s) : rs) | c == x -> put $ (x, s+1) : rs
   _ -> modify ((x, 1) :)
  pute xs
  
pute :: [Int] -> State [(Int, Int)] Int
pute [] = do
  ls <- get
  return $ sum $ map snd $ filter ((==0) . fst) ls
pute (x:xs) = do
  ls <- get
  case ls of
   ((c, s) : rs) | x == c -> put $ ((x, s+1) : rs)
   ((_, s1) : (_, s2) : rs) -> put $ (x, (1+s1+s2)) : rs
   [(c, s)] -> put [(x, s+1)]
  puto xs

readi :: Integral a =>  (ByteString -> Maybe (a, ByteString)) -> ByteString -> a
readi f s = let Just (n, _) = f s in n



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

int main(){

    int a,b,c;
    cin >> a >> b >> c;
    map<int,int> mp;

    mp[a]++;
    mp[b]++;
    mp[c]++;

    cout << mp.size() << endl;

    return 0;
}

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

int main(void) {
  int N, K; cin >> N >> K;
  for (int i = 1; i <= N; i++) {
    char s; cin >> s;
    if (i == K) cout << (char)(s+0x20);
    else cout << s;
  }
  cout << endl;

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
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; }
using ll = long long;
using P = pair<int, int>;
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; }

ll k;

int main() {
    cin >> k;
    vector<string> ans;
    if(k < 10) cout << k << endl;
    else {
        for(int i = 1; i < 10; ++i) {
            ans.emplace_back(to_string(i));
        }

        int cnt = 9;
        int no = 0;
        while(cnt <= k) {
            string ch = ans.at(no);
            no++;
            int chlen = ch.size();
            if(ch.at(chlen-1) == '0') {
                ans.emplace_back(ch+"0");
                ans.emplace_back(ch+"1");
                cnt += 2;
            }else if(ch.at(chlen-1) == '9') {
                ans.emplace_back(ch+"8");
                ans.emplace_back(ch+"9");
                cnt += 2;
            }else {
                for(int i = 0; i < 3; ++i) {
                    int now = ch.at(chlen-1) - '0';
                    ans.emplace_back(ch+to_string(now+i-1));
                }
                cnt += 3;
            }
        }

        cout << ans.at(k-1) << endl;
    }
}

Measured memory_bytes: 7488
#include<bits/stdc++.h>
using namespace std;
typedef vector<int> vi;

int main(){
  int n,m,q;
  scanf("%d%d%d",&n,&m,&q);

  vi prv(n),nxt(n),remain(n,1);
  for(int i=0;i<n;i++){
    prv[i] = (i+n-1)%n;
    nxt[i] = (i+1)%n;
  }

  int cur = 0;
  for(int i=0;i<m;i++){
    int a;
    scanf("%d",&a);
    if(a%2==0){
      while(a--)cur = nxt[cur];
    }else{
      while(a--)cur = prv[cur];
    }
    remain[cur] = 0;
    nxt[prv[cur]] = nxt[cur];
    prv[nxt[cur]] = prv[cur];
    cur = nxt[cur];
  }

  for(int i=0;i<q;i++){
    int a;
    scanf("%d",&a);
    cout << remain[a] << endl;
  }
}

Measured memory_bytes: 3380
#include<iostream>
#include<queue>
using namespace std;
int main()
{
	int i;
	priority_queue<int>que;
	int a[10];
	for(i=0;i<10;i++)
		cin>>a[i];
	for(i=0;i<10;i++)
		que.push(a[i]);
	for(i=0;i<3;i++)
	{
		cout<<que.top()<<endl;
		que.pop();
	}
	return 0;
}

Measured memory_bytes: 1216
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/detail/standard_policies.hpp>
#include <ext/rope>

using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define long long long 

#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <typename Arg1>
    void __f(const char* name, Arg1&& arg1){
        cout << name << " : " << arg1 << endl;
        //use cerr if u want to display at the bottom
    }
    template <typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args){
        const char* comma = strchr(names + 1, ','); cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
    }
#else
#define trace(...)
#endif

typedef trie<string,null_type,trie_string_access_traits<>,pat_trie_tag,trie_prefix_search_node_update> pref_trie;
typedef tree<long int,null_type,less<long int>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;
typedef cc_hash_table<long int,long int, hash<long int>, equal_to<long int>, direct_mask_range_hashing<long int>, 
hash_standard_resize_policy<hash_exponential_size_policy<>, hash_load_check_resize_trigger<true>, true>> ht;
typedef gp_hash_table<long int,long int> HashTable;

int main(){
   IOS;
 /*    #ifndef ONLINE_JUDGE
         freopen("in.txt",  "r",  stdin);
         freopen("out.txt", "w", stdout);
     #endif */
   
   string s;
   cin>>s;

   long int n = s.size();
   for(long int i = 0; i < n; i++){
   	if(s[i] == '?')
   		s[i] = 'D';
   }

   cout<<s;
   return 0;
}

Measured memory_bytes: 3736
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#define  boost ios_base::sync_with_stdio(false);cin.tie(NULL);
#define ull unsigned long long
#define deb(x) cout<<#x<<" "<<x<<endl;
#define deb2(x,y) cout<<#x<<" "<<x<<" "<<#y<<" "<<y<<endl;
#define deb2l(x,y,i) cout<<#x<<i<<" "<<x<<" "<<#y<<i<<" "<<y<<endl;

#define fr(i,l,r) for(ll i=l;i<r;i++)
#define mems(a,x) memset(a,x,sizeof(a))
#define mod 1000000007
#define ff first
#define ss second
#define pb(x) push_back(x)
#define vll vector<ll>
#define pbp(x,y) push_back(make_pair(x,y))
#define  mat vector<vector<ll>>
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



void solve(){
   string str;
   cin>>str;
   fr(i,0,str.size())
   cout<<'x';
   
    


  }
int main(){
    ll t=1;
   // cin>>t;
    while(t--){
        solve();
        cout<<endl;
    }
    return 0;
}

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

using namespace std;

#define long long long
//#define double __float128
#define INF (long) 1e18
#define MOD 1'000'000'007
#define mll map<long, long>
#define pll pair<long, long>
#define umap unordered_map
#define umll umap<long, long>
#define pb push_back
#define FOR(i, a, b) \
  for (long i = a; i < (long) b; i++)
#define SORT(v, atr) \
  stable_sort(v.begin(), v.end(), \
    [](auto &a, auto &b) { return a.atr < b.atr; });
#define UNSORT(v, atr) \
  sort(v.begin(), v.end(), \
    [](auto &a, auto &b) { return a.atr > b.atr; });
#define PRINTV(v) \
  FOR (_i, 0, v.size()) \
    cout << v[_i] << " "; \
  cout << "\n";

set<long> gera_primos(long n)
{
  set<long> primos;
  vector<bool> crivo(n+1);
  primos.insert(2);
  for (long i = 3; i <= n; i += 2) {
    if (crivo[i]) continue;
    primos.insert(i);
    for (long j = i; j <= n; j += i) {
      crivo[j] = true;
    }
  }
  return primos;
}

struct Link
{
  long from, to, t;
};

struct Node
{
  bool visitado = false;
  set<long> in, out;
};

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

  long n;
  cin >> n;

  string first;
  cout << 0 << endl;
  cin >> first;
  if (first == "Vacant") return 0;

  long l = 1;
  long r = n;
  while (true) {
    long m = (l + r) / 2;
    string x;
    cout << m << endl;
    cin >> x;
    if (x == "Vacant") return 0;
    if ((m % 2 == 0 and x == first) or
        (m % 2 != 0 and x != first)) {
      l = m;
    } else {
      r = m;
    }
  }
}


Measured memory_bytes: 852
n = int(input())
p = list(map(int, input().split()))
cnt = 0

for i in range (1, n-1):
  if p[i-1] < p[i] and p[i] < p[i+1]:
    cnt += 1
  elif p[i-1] > p[i] and p[i] > p[i+1]:
    cnt += 1
    
print(cnt)

Measured memory_bytes: 3064
#include <iostream>
#include <climits>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <string>
#define INF_INT (INT_MAX / 2)
#define INF_LONG (LONG_MAX / 2)
//#define DEBUG true
#define DEBUG false
using namespace std;

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

  int n, a;
  cin >> n;
  cin >> a;

  for(int i = 0; i <= a; i++){
    if((n - i) % 500 == 0){
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;

  return 0;
}


Measured memory_bytes: 888
#include <iostream>
#include <stdio.h>
#include <fstream>
#include <algorithm>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <limits.h>
#include <math.h>
#include <functional>
#include <bitset>
#include <iomanip>

#define repeat(i,n) for (long long i = 0; (i) < (n); ++ (i))
#define debug(x) cerr << #x << ": " << x << '\n'
#define debugArray(x,n) for(long long i = 0; (i) < (n); ++ (i)) cerr << #x << "[" << i << "]: " << x[i] << '\n'
#define debugArrayP(x,n) for(long long i = 0; (i) < (n); ++ (i)) cerr << #x << "[" << i << "]: " << x[i].first<< " " << x[i].second << '\n'

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> Pii;
typedef vector<int> vint;
typedef vector<ll> vll;
const ll INF = INT_MAX;
const ll MOD = 1e9+7;


int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int M;cin>>M;
  cout << 48-M<<endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define watch(x) cout << (#x) << " is " << (x) << '\n'
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define sz(x) ((int)(x).size())
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int, int> pi;
typedef pair<ll, ll> pll;
typedef double db;
ll gcd(ll a, ll b) { return b?gcd(b,a%b):a; }
//head

void solve(){
    int n, i;
    cin >> n >> i;
    cout << n-i+1 << '\n';
}

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

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

Measured memory_bytes: 3584
using namespace std;
#include <bits/stdc++.h>
#define fdto(i, r, l) for(int i = r; i >= l; --i)
#define fto(i, l, r) for(int i = l; i <= r; ++i)
#define forit(it, type, var) for(type::iterator it = var.begin(); it != var.end(); it++)
#define ii pair<int, int>
#define iii pair<int, ii>
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define ll long long
#define ld long double
#define maxN 1000000000000000000

int main()
{
    
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll h1,m1,h2,m2,k,st1,st2;
    cin>>h1>>m1>>h2>>m2>>k;

    st1=h1*60 + m1;
    st2=h2*60 + m2;

    st2=st2-k-st1;

    if(st2<=0)
    cout<<"0"<<endl;
    else
    {
        cout<<st2<<endl;
    }
    return 0;
}

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

#define rep(i, n) for (int i = (int)(0); i < (int)(n); ++i)
#define reps(i, n) for (int i = (int)(1); i <= (int)(n); ++i)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; i--)
#define irep(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define ireps(i, m, n) for (int i = (int)(m); i <= (int)(n); ++i)
#define FOR(e, c) for (auto &e : c)
#define SORT(v, n) sort(v, v + n);
#define vsort(v) sort(v.begin(), v.end());
#define rvisort(v) sort(v.begin(), v.end(), greater<int>());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define cout(d) cout<<d<<endl;
#define coutd(d) cout<<std::setprecision(10)<<d<<endl;
#define cinline(n) getline(cin,n);
#define replace_all(s, b, a) replace(s.begin(),s.end(), b, a);
// #define int long long
#define PI (acos(-1))
#define FILL(v, n, x) fill(v, v + n, x);
#define sz(x) int(x.size())

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using ul = unsigned long;

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

int GCD(int a, int b) { return b ? GCD(b, a%b) : a; }
int LCM(int a, int b) { return a * b / GCD(a, b); }

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

inline bool inside(int y, int x, int H, int W) {
    return (y >= 0 && x >= 0 && y < H && x < W);
}

const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

signed main()
{
  cin.tie( 0 ); ios::sync_with_stdio( false );
  int n; cin>>n;
  map<int,int> m;
  rep(i,n){
    int a; cin>>a;
    m[a]++;
  }
  vi a;
  a.push_back(0);
  a.push_back(0);
  for(auto e: m){
    while(e.second>=2){
      a.push_back(e.first);
      e.second-=2;
    }
  }
  sort(a.rbegin(),a.rend());
  cout<<(ll)a[0]*a[1]<<endl;
  
}


Measured memory_bytes: 4992
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <list>
#include <iomanip>
#include <queue>
#include <functional>
#include <cassert>
#include <cmath>
#include <set>

#define REP(i, n) for(int i = 0; i < (n); i++)
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define NL << endl

using namespace std;
using ll = long long;
using ull = unsigned long long;


int main() {

	int n;

	cin >> n;

	vector<pair<int, int>> x(n);

	REP(i, n) {
		cin >> x[i].first;
		x[i].second = i;
	}

	sort(x.begin(), x.end(), [](pair<int, int> x, pair<int, int>y) {
		return x.first < y.first;
	});
	vector<int> ans(n);
	REP(i, n) {
		if (i < n / 2) {
			ans[x[i].second] = x[n / 2].first;
		} else {
			ans[x[i].second] = x[n / 2 - 1].first;
		}
	}
	REP(i, n) {
		cout << ans[i] NL;
	}



	return 0;

}

Measured memory_bytes: 4480
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define gc getchar
#define pb push_back
#define eb emplace_back
#define all(x) (x).begin(),(x).end()
#define x1 uvuvwevwevwe
#define y1 onyetenyevwe
#define x2 ugwemubwem
#define y2 ossas
typedef long long LL;
typedef long double LD;
typedef pair<int,int> pii;
template <typename T> void scan(T &angka){
	angka=0;char input=gc();T kali=1;
	while(!(48<=input&&input<=57)){	if(input=='-')	kali=-1;input=gc();}
	while(48<=input&&input<=57)	angka=(angka<<3)+(angka<<1)+input-48,input=gc();angka*=kali;
}
template <typename T1,typename T2> void scan(T1 &angka1,T2 &angka2){
	scan(angka1);scan(angka2);
}
const int MAXN=100000;
int nodes,batas,subtree[MAXN+5];
LL ans=0;
vector <pii> node[MAXN+5];
void hitungans(int now,int par){
	subtree[now]=1;
	for(auto v:node[now])
	{
		if(v.fi==par)
			continue;
		hitungans(v.fi,now);
		subtree[now]+=subtree[v.fi];
		ans+=(LL) (min(nodes-subtree[v.fi],subtree[v.fi])*2)*v.se;
	}
}
void perbaikians(int now,int par){
	int masalah=-1;
	for(auto v:node[now])
	{
		if(v.fi==par)
			continue;
		if(subtree[v.fi]==nodes/2&&((nodes&1)==0))
		{
			//cout<<"case 1"<<endl;
			ans-=v.se;
			return;
		}
		if(subtree[v.fi]>=batas)
			masalah=v.fi;
	}
	if(masalah!=-1)
		perbaikians(masalah,now);
	else
	{
		//cout<<"case 2"<<endl;
		//cout<<"pada "<<now<<endl;
		int kurang=node[now][0].se;
		for(auto v:node[now])
			kurang=min(kurang,v.se);
		ans-=kurang;
	}
}
int main()
{
	scan(nodes);
	batas=(nodes+1)/2;
	for(int i=0;i<nodes-1;i++)
	{
		int u,v,weight;
		scan(u,v),scan(weight);
		node[u].pb(mp(v,weight));
		node[v].pb(mp(u,weight));
	}
	hitungans(1,-1);
	perbaikians(1,-1);
	cout<<ans<<endl;
}

Measured memory_bytes: 12800
import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc =new Scanner(System.in);
    int M [][]=new int [3][3];
    for(int i=0;i<3;i++){
      for(int j=0;j<3;j++){
        M[i][j]=sc.nextInt();}}
    int N = sc.nextInt();
    int P[] =new int [N];
    int x=0;
    for(int k=0;k<N;k++){
      P[k]=sc.nextInt();
      if(P[k]==M[0][0]){x=x+1;}
      else if(P[k]==M[0][1]){x=x+2;}
      else if(P[k]==M[0][2]){x=x+4;}
      else if(P[k]==M[1][0]){x=x+8;}
      else if(P[k]==M[1][1]){x=x+16;}
      else if(P[k]==M[1][2]){x=x+32;}
      else if(P[k]==M[2][0]){x=x+64;}
      else if(P[k]==M[2][1]){x=x+128;}
      else if(P[k]==M[2][2]){x=x+256;}}
    if((x>427)&&
       !(x==432)){System.out.println("Yes");}
    else if((x<424)&&
            (x>419)){System.out.println("Yes");}
    else if((x<416)&&(x>398)){
      if(((x==412)||(x==408))||((x==404)||(x==400))){System.out.println("No");}
      else{System.out.println("Yes");}}
    else if(((x==391)||(x==361))||((x==345)||(x==337))){System.out.println("Yes");}
    else if((x<384)&&
            (x>362)){if(x==368){System.out.println("No");}
                     else{System.out.println("Yes");}}
    else if((x<360)&&
            (x>355)){System.out.println("Yes");}
    else if((x<352)&&
            (x>346)){System.out.println("Yes");}
    else if((x<344)&&
            (x>338)){System.out.println("Yes");}
    else if((((x==335)||(x==333))||((x==331)||(x==329)))||(x==327)){System.out.println("Yes");}
    else if((x<320)&&
            (x>299)){if((x==306)||(x==304)){System.out.println("No");}
                     else{System.out.println("Yes");}}
    else if((x<296)&&
            (x>291)){System.out.println("Yes");}
    else if(((((x==287)||(x==285))||((x==283)||(x==281)))||(((x==279)||(x==277))||((x==275)||(x==273))))||((x==271)||(x==263))){System.out.println("Yes");}
    else if((x<256)&&
            (x>241)){System.out.println("Yes");}
    else if((((x==239)||(x==237))||((x==235)||(x==233)))||(x==231)){System.out.println("Yes");}
    else if((x<224)&&
            (x>209)){if(x==216){System.out.println("No");}
                     else{System.out.println("Yes");}}
    else if((((x==207)||(x==205))||((x==203)||(x==201)))||(x==199)){System.out.println("Yes");}
    else if((x<192)&&
            (x>181)){System.out.println("Yes");}
    else if((((((x==179)||(x==178))||((x==175)||(x==167)))||(((x==159)||(x==158))||((x==155)||(x==154))))||((((x==151)||(x==150))||((x==147)||(x==146)))||(((x==143)||(x==135))||((x==111)||(x==109)))))||((((x==107)||(x==105))||((x==103)||(x==79)))||(((x==77)||(x==75))||((x==73)||(x==71)))))
    {System.out.println("Yes");}
    else if((x<128)&&
            (x>115)){System.out.println("Yes");}
    else if((x<96)&&
            (x>83)){if((x==90)||(x==88)){System.out.println("No");}
                    else{System.out.println("Yes");}}
    else if((x<64)&&
            (x>54)){System.out.println("Yes");}
    else if(((x==47)||(x==39))||(((x==31)||(x==23))||((x==15)||(x==7)))){System.out.println("Yes");}
    else {System.out.println("No");}
  }
}

Measured memory_bytes: 21972
class PriorityQueue
  attr_accessor :data, :size

  def initialize(array = [])
    @data=[]
    array.each {|a| push(a) }
  end

  def push(element)
    current = @data.size
    while current > 0
      p = parent(current)
      break if @data[p] <= element
      @data[current] = @data[p]
      current = p
    end
    @data[current] = element
  end

  def pop
    ret = @data.first
    x = @data.last
    current = 0
    while have_child?(current)
      a = left_child_index(current)
      b = right_child_index(current)
      a = b if b < @data.size - 1 && @data[b] < @data[a]
      break if @data[a] >= x
      @data[current] = @data[a]
      current = a
    end
    @data[current] = x
    @data.pop

    ret
  end

  def size
    @data.size
  end

  def front
    @data.first
  end

  def empty?
    @data.empty?
  end

  private

  def parent(num)
    (num-1)/2
  end

  def left_child_index(num)
    2*num+1
  end

  def right_child_index(num)
    2*num+2
  end

  def have_child?(index)
    left_child_index(index) < @data.size
  end
end

n, m = gets.strip.split.map(&:to_i)
aa = gets.strip.split.map {|e| -(e.to_i) }

pq = PriorityQueue.new(aa)

m.times do
  current = pq.pop
  current = -1*(-1*current/2)
  pq.push(current)
end

p (-1*pq.data.inject(:+))





Measured memory_bytes: 10580
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <iostream>
#include <iostream>
#include <fstream>
#include <numeric>
#include <cstring>
#include <cassert>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <cmath>
#include <set>
#include <map>
#include <functional>
#include <bitset>
#include <iomanip>
#include <stack>
#include <list>
using namespace std;
#define     loop(n,i,a)     for(int i=a;i<n;i++)
#define     loopR(n,i,a)    for(int i=n-1;i>=a;i--)
#define     all(arr,n)      arr,arr+n
#define     allv(v)         (v).begin(),(v).end()
#define     rallv(v)        (v).rbegin(),(v).rend()
#define     m_p             make_pair
#define     ll              long long
#define     pii             pair<ll,ll>
#define     vi              vector<int>
#define     vll             vector<ll>
#define     vii             vector<pair<ll,ll>>
#define     sz(x)           (int)x.size()
#define     pb              push_back
#define     endl            "\n"
#define     Endl            "\n"
#define     f               first
#define     s               second
#define     mem(dp,n)       memset(dp,n,sizeof dp)
#define     test(i)        cout<<i<<endl
int dx[] = { 1 , 0 ,-1 , 0 ,-1 ,-1 , 1 , 1 };
int dy[] = { 0 , 1 , 0 ,-1 ,-1 , 1 ,-1 , 1 };
void fast(){
    std::ios_base::sync_with_stdio(0);
    cin.tie(NULL);
    cout.tie(NULL);
}
vector<string> vec_splitter(string s) {
    s += ',';
    vector<string> res;
    while(!s.empty()) {
        res.push_back(s.substr(0, s.find(',')));
        s = s.substr(s.find(',') + 1);
    }
    return res;
}
void debug_out(
        vector<string> __attribute__ ((unused)) args,
        __attribute__ ((unused)) int idx,
        __attribute__ ((unused)) int LINE_NUM) { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(vector<string> args, int idx, int LINE_NUM, Head H, Tail... T) {
    if(idx > 0) cerr << ", "; else cerr << "Line(" << LINE_NUM << ") ";
    stringstream ss; ss << H;
    cerr << args[idx] << " = " << ss.str();
    debug_out(args, idx + 1, LINE_NUM, T...);
}
#define debug(...) debug_out(vec_splitter(#__VA_ARGS__), 0, __LINE__, __VA_ARGS__)
const ll mxN=2e2+10,oo=0x3f3f3f3f,MOD=998244353;
const double PI = 3.14159265358979323846;

void solve(){
    int k;
    cin>>k;
    int mod=0,po=1;
    loop(k*10,i,1){
        mod=((mod+7*po)%k);
        po=(po*10)%k;
        if(!mod){
            cout<<i<<endl;
            return;
        }
    }
    cout<<-1<<Endl;
}
int main() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    fast();
    solve();
}

Measured memory_bytes: 3652
#include <iostream>

using namespace std;

const int kMaxN = 1000001;
const int kM = 1000000007;

long long f[kMaxN][4];
int n;

int main() {
  cin >> n;
  f[0][0] = 1;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j <= 3; j++) {
      f[i + 1][j | 1] = (f[i + 1][j | 1] + f[i][j]) % kM;
      f[i + 1][j | 2] = (f[i + 1][j | 2] + f[i][j]) % kM;
      f[i + 1][j] = (f[i + 1][j] + f[i][j] * 8) % kM;
    }
  }
  cout << f[n][3];
  return 0;
}

Measured memory_bytes: 34880
/* Generated by powerful Codeforces Tool
 * You can download the binary file in here https://github.com/xalanq/cf-tool (win, osx, linux)
 * Author: step_by_step
 * Time: 2020-03-03 17:35:02
**/

//#pragma comment(linker, "/stack:200000000")
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#pragma GCC optimize("unroll-loops")
  
#include <iostream>
#include <stdlib.h>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <assert.h>
#include <memory.h>
#include <time.h>
#include <bitset>

#define uint unsigned int
#define ll long long
#define ull unsigned long long
#define ld long double
#define rep(i, l, r) for (int i = (l); i < (r); i++)
#define repb(i, r, l) for (int i = (r); i > (l); i--)
#define sz(a) (int)a.size()
#define fi first
#define se second
#define mp(a, b) make_pair(a, b)
#define rank qwertyuio
#define next dfghjk
#define prev fhsgfhjf
#define plus fsghsf
#define minus ytryr
#define y1 gfvtydvtd
  
using namespace std;
  
inline bool setmin(int &x, int y) { return (y < x) ? x = y, 1 : 0; }
inline bool setmax(int &x, int y) { return (y > x) ? x = y, 1 : 0; }
inline bool setmin(ll &x, ll y) { return (y < x) ? x = y, 1 : 0; }
inline bool setmax(ll &x, ll y) { return (y > x) ? x = y, 1 : 0; }
  
const int N = 100000;
const int inf = (int)1e9 + 1;
const ll big = (ll)1e18 + 1;
const int P = 239;
const int P1 = 31;
const int P2 = 57;
const int MOD = (int)1e9 + 7;
const int MOD1 = (int)1e9 + 9;
const int MOD2 = 998244353;
const ld eps = 1e-9;
const double pi = atan2(0, -1);
const int ABC = 26;

int main()
{
    //freopen("a.in", "r", stdin);
    //freopen("a.out", "w", stdout);
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.precision(20);
    cout << fixed;
    //ll TL = 10.95 * CLOCKS_PER_SEC;
    //clock_t time = clock();
    ll a, b, c;
    cin >> a >> b >> c;
    if (c - a - b < 0) {
        cout << "No\n";
    } else {
        cout << (4 * a * b < (c - a - b) * (c - a - b) ? "Yes\n" : "No\n");
    }
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const long long mod=1e9+7,INF=1e18;
#define ll long long
#define pll pair<ll,ll>
#define pii pair<int,int>
#define pb(a) push_back(a)
#define mp(a,b) make_pair(a,b)
ll h,w,n;
vector<ll> ans(10,0);
map<pll,int> mp,mpvis;
vector<pll> a;
void findans(pll p)
{
    for(ll i=max(p.first-2,1LL);i<=min(p.first,h-2LL);i++)
    {
        for(ll j=max(p.second-2,1LL);j<=min(p.second,w-2LL);j++)
        if(mpvis[{i+2,j+2}]==0)
        {
            int count=0;
            mpvis[{i+2,j+2}]=1;
            for(ll k=i;k<=i+2;k++)
            {
                for(ll l=j;l<=j+2;l++)
                {
                    if(mp[{k,l}])
                    count++;
                }
            }
            ans[count]++;
        }
    }
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll t=1;
    // cin>>t;
    while(t--)
    {
        ll tot=0;
        cin>>h>>w>>n;
        tot=(h-2)*(w-2);
        for(int i=0;i<n;i++)
        {
            ll u,v;
            cin>>u>>v;
            a.push_back({u,v});
            mp[{u,v}]=1;
        }
        for(int i=0;i<n;i++)
        {
            findans(a[i]);
        }
        for(int i=1;i<10;i++)
        tot-=ans[i];
        ans[0]+=tot;
        for(int i=0;i<10;i++)
        cout<<ans[i]<<"\n";
    }
    return 0;
}

Measured memory_bytes: 217200
#include "bits/stdc++.h"
using namespace std;
#define int long long
#define REP(i,n) for(int i = 0;i < (int)(n);i++)
#define RREP(i,n) for(int i = (int)n-1;i >= 0;i--)
#define FOR(i,s,n) for(int i = s;i < (int)n;i++)
#define RFOR(i,s,n) for(int i = (int)n-1;i >= s;i--)
#define ALL(a) a.begin(),a.end()
template<class T>inline void out(T t){cout<<t<<"\n";}
template<class T,class... Ts>inline void out(T t,Ts... ts){cout<<t<<" ";out(ts...);}
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;}
constexpr long long INF = 1e9;



signed main(){
	map<string,int>mp;
	string s,t;
	int A,B;
	cin>>s>>t>>A>>B;
	mp[s]=A;
	mp[t]=B;
	string u;
	cin >> u;
	mp[u]--;
	cout<<mp[s]<<" "<<mp[t]<<endl;
}


Measured memory_bytes: 256
#include<cassert>
#include<functional>
#include<memory>

template<typename T>
class DynamicSegmentTree {
 public:
  explicit DynamicSegmentTree(int size, const T& init = 0, const std::function<T(T, T)>& op = std::plus<T>()) : SIZE(size), INIT(init), OP(op), ROOT(std::make_unique<Node>(init)) {}
  T find(int left, int right) const {assert(left<=right); assert(0<=left); assert(right<SIZE); return find(left, right + 1, ROOT, 0, SIZE);}
  void update(int index, const T& value) {assert(0<=index && index<SIZE); update(index, value, ROOT, 0, SIZE);}

 private:
  struct Node {
    T value;
    std::unique_ptr<Node> left_child, right_child;
    Node(const T& init) : value(init) {}
  };

  T find(int a, int b, const std::unique_ptr<Node>& n, int l, int r) const {
    if(b <= l || r <= a) return INIT;
    if(a <= l && r <= b) return n->value;
    T vl = INIT, vr = INIT;
    if(n->left_child) vl = find(a, b, n->left_child, l, (l + r) / 2);
    if(n->right_child) vr = find(a, b, n->right_child, (l + r) / 2, r);
    return OP(vl, vr);
  }
  T update(int i, const T& value, const std::unique_ptr<Node>& n, int l, int r) {
    if(i < l || r <= i) return n->value;
    if(l == i && r - 1 == i) return n->value = value;
    if(not n->left_child)  n->left_child  = std::make_unique<Node>(INIT);
    if(not n->right_child) n->right_child = std::make_unique<Node>(INIT);
    auto vl = update(i, value, n->left_child, l, (l + r) / 2);
    auto vr = update(i, value, n->right_child, (l + r) / 2, r);
    return n->value = OP(vl, vr);
  }

  const int SIZE;
  const T INIT;
  const std::function<T(T, T)> OP;
  const std::unique_ptr<Node> ROOT;
};

#include<bits/stdc++.h>
using namespace std;

int main() {
  int n, q;
  cin >> n >> q;
  DynamicSegmentTree<long long> RSQ(n + 1);
  while(q--) {
    int com, x, y;
    cin >> com >> x >> y;
    if(com) cout << RSQ.find(x, y) << endl;
    else    RSQ.update(x, RSQ.find(x, x) + y);
  }
}

Measured memory_bytes: 8096
from decimal import Decimal, ROUND_HALF_UP

n = int(input())
x = list(map(int,input().split()))
a = Decimal(sum(x) / n).quantize(Decimal('0'), rounding=ROUND_HALF_UP)
ans = 0

for i in range(n):
    ans += (x[i] - a) ** 2

print(ans)

Measured memory_bytes: 10076
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < n; i++)
#define repr(i, n) for(int i = n; i >= 0; i--)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
int main()
{
  int n;
  cin >> n;
  vector<int> vec(n);
  rep(i, n) {
    cin >> vec[i];
  }
  sort(vec.begin(), vec.end());
  double ans = (vec[0] + vec[1]) / 2.0;
  for (int i = 2; i < n; i++) {
    ans = (ans + vec[i]) / 2.0 + 0.00001;
  }
  printf("%*.8f", ans);
  return 0;
}

Measured memory_bytes: 32640
n = int(input())
A = list(map(int,input().split()))
p = [0]*100000
for a in A:
    n = bin(a)[::-1]
    l = len(n)
    for i in range(l-1):
        if n[i]=='b':
            break
        if n[i] == '1':
            p[i] +=1
for a in p:
    if a%2==1:
        print("No")
        exit()
print("Yes")


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

int main(){
    string str;
    int sum;
    
    while(1){
        sum = 0;
        getline(cin, str);
        
        if(str[0] == '0') break;
        
        for(int i = 0; i < str.size(); i++){
            sum += str[i] - '0';
        }
        
        cout << sum << endl;
    }
}


Measured memory_bytes: 3164
#include <bits/stdc++.h>
#define int long long
//#define double long double
#define endre getchar();getchar();return 0
#define moder (int)(1e9+7)
#define inf (int)(3e18+7)
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<n;i++)
#define P pair<int,int>
#define all(v) v.begin(),v.end()
#define prique(T) priority_queue<T,vector<T>,greater<T>>
#define vecunique(vec) sort(vec.begin(), vec.end());decltype(vec)::iterator result = std::unique(vec.begin(), vec.end());vec.erase(result, vec.end())
using namespace std;

int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x%y);
}
int lcm(int x, int y) {
	return x * y / gcd(x, y);
}
int kai(int x) {
	if (x == 0)return 1;
	return kai(x - 1)*x;
}
int mod_pow(int x, int y, int mod) {
	int res = 1;
	while (y > 0) {
		if (y & 1) {
			res = res * x%mod;
		}
		x = x * x%mod;
		y >>= 1;
	}
	return res;
}
int comb(int x, int y) {
	return kai(x)*mod_pow(kai(x - y), moder - 2, moder) % moder*mod_pow(kai(y), moder - 2, moder) % moder;
}
/*--------Library Zone!--------*/


signed main() {
	int a, b, c;
	cin >> a >> b >> c;
	rep(i, 500000000) {
		if (a % 2 || b % 2 || c % 2) {
			cout << i << endl;
			endre;
		}
		int a1 = b / 2 + c / 2, b1 = a / 2 + c / 2, c1 = a / 2 + b / 2;
		a = a1, b = b1, c = c1;
	}
	cout << -1 << endl;
	endre;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<ll>;
using vii = vector<vi>;
using Pll = pair<ll, ll>;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(v) v.begin(), v.end()
#define sz(x) ((int) x.size())
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define F first
#define S second
const int MOD = 1000000007;
template<class T> void print(const T& t){ cout << t << endl; }
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; }

ll dp[1000001];
int main(){
  ll l;
  cin >>l ;
  double a = (double)l / (double)3;
  double ans = a * a * a;
  cout << fixed << setprecision(6) << ans << endl;
}

Measured memory_bytes: 256
r, g, b, n = map(int, input().split())
ans = 0
for i in range(n // r + 1):
    for j in range(n // g + 1):
            if (n - r * i - g * j) >= 0 and(n - r * i - g * j) % b == 0 :
                ans += 1
print(ans)

Measured memory_bytes: 40940
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
using namespace std;

int main() {
	ios_base::sync_with_stdio(false);

	string s;
	cin >> s;
	bool ok = true;
	for (int i = 0; i < s.length(); ++i) {
		if (i % 2 == 0 && s[i] != 'h') {
			ok = false;
		}
		else if (i % 2 == 1 && s[i] != 'i') {
			ok = false;
		}
	}
	if (s.length() % 2 != 0) {
		ok = false;
	}

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

Measured memory_bytes: 256