akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

using ll = long long;
using Pi = pair<int, int>;
using Pl = pair<ll, ll>;
using vint = vector<int>;
using vvint = vector<vint>;
using vvvint = vector<vvint>;
using vdouble = vector<double>;
using vvdouble = vector<vdouble>;
using vvvdouble = vector<vvdouble>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using uint = unsigned int;
using ull = unsigned long long;

template<typename T> using uset = unordered_set<T>;
template<typename T1, typename T2> using umap = unordered_map<T1, T2>;

constexpr int INF = (1 << 30) - 1;
constexpr ll LLINF = 1LL << 60;
constexpr int dy[] = {1, 0, -1, 0, 1, -1, -1, 1};
constexpr int dx[] = {0, 1, 0, -1, 1, 1, -1, -1};
constexpr char el = '\n';
constexpr int mod = 1000000007;
constexpr int mod2 = 998244353;
template<typename T> T gcd(T a, T b) { return (b ? gcd(b, a % b) : a); }
template<typename T> T lcm(T a, T b) { return (a / gcd(a, b) * b); }
template<typename T1, typename T2>
inline bool chmin(T1 &a, T2 b) { return (a > b && (a = b, true)); }
template<typename T1, typename T2>
inline bool chmax(T1 &a, T2 b) { return (a < b && (a = b, true)); }

template<typename T>
vector<T> makeVector(size_t a, T b) { return (vector<T>(a, b)); }
template<typename... Ts>
auto makeVector(size_t a, Ts... ts) { 
	return (vector<decltype(makeVector(ts...))>(a, makeVector(ts...)));
}

template<typename T>
bool isin(T y, T x, T h, T w) { return (0 <= y && 0 <= x && y < h && x < w); }
template<typename T>
bool isin1(T y, T x, T h, T w) { return (0 < y && 0 < x && y <= h && x <= w); }

template<typename T>
ostream& operator <<(ostream &os, vector<T> &v) {
	os << v[0];
	for (int i = 1; i < v.size(); i++) os << " " << v[i];
	return (os);
}

template<typename T>
istream& operator >>(istream &is, vector<T> &v) {
	for (auto &u : v) is >> u;
	return (is);
}

template<typename T1, typename T2>
istream& operator >>(istream &is, pair<T1, T2> &p) {
	return (is >> p.first >> p.second);
}


void Main() {
	ll N; cin >> N;
	ll A, B, X = 0, S, D;
	cin >> A >> B; S = A + B;
	for (int i = 2; i < N; i++) {
		ll v; cin >> v; X ^= v;
	}
	if (S-X < 0 || (S-X) % 2 == 1) {
		cout << -1 << endl;
		return;
	}
	D = (S-X) / 2;
	if ((D&X) > 0 || D > A) {
		cout << -1 << endl;
		return;
	}
	ll pos = 60;
	ll Y = D;
	while (pos >= 0) {
		if ((X>>pos)&1) {
			if (Y + (1ll<<pos) <= A) {
				Y += (1ll<<pos);
			}
		}
		pos--;
	}
	if (Y == 0) {
		cout << -1 << endl;
	} else {
		cout << A-Y << endl;
	}
}

int main() {
	cin.tie(0);
	ios::sync_with_stdio(0);
	cout << fixed << setprecision(20);
	Main();
	return (0);
}


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

using namespace std;

const int md = 998244353;

const int MX = 10000000;

int inv[MX];

int main() {
	int n;
	ignore = scanf("%d", &n);
	
	inv[1] = 1;
	for (int i = 2; i < n; i++) {
		inv[i] = md - (md / i) * 1LL * inv[md % i] % md;
	}
	
	int bad = 0;
	for (int k = 0, c = 1, p = 1; k < n / 2; k++) {
		bad += p * 1LL * c % md;
		bad %= md;
		
		p *= 2;
		p %= md;
		
		c = c * 1LL * (n - k) % md;
		c = c * 1LL * inv[k + 1] % md;
	}
	
	int ans = 1;
	for (int i = 0; i < n; i++) ans = (3LL * ans) % md;
	
	ans = (ans - 2 * bad) % md;
	if (ans < 0) ans += md;
	
	printf("%d\n", ans);
	
	return 0;
}


Measured memory_bytes: 39296
#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <queue>
#include <map>
#include <random>
#include <cstdio>
#include <cstring>
#include <cmath>

// for i in f..<t {... : as Swift
#define forin(i, f, t) for(auto i = f; i < t; i++)

using namespace std;
using ll = long long;

int main() {
    int a, b;
    cin >> a >> b;
    auto maxAB = a + b;
    maxAB = max(maxAB, a - b);
    maxAB = max(maxAB, a * b);
    cout << maxAB << endl;
    
}



Measured memory_bytes: 768
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

const (
	initialBufSize = 100000
	maxBufSize     = 10000000
)

var (
	sc = bufio.NewScanner(os.Stdin)
	wt = bufio.NewWriter(os.Stdout)
)

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	i, _ := strconv.Atoi(next())
	return i
}

func nextInt2() (int, int) {
	return nextInt(), nextInt()
}

func nextInts(n int) []int {
	slice := make([]int, n)
	for i := 0; i < n; i++ {
		slice[i] = nextInt()
	}
	return slice
}

func putf(format string, a ...interface{}) {
	fmt.Fprintf(wt, format, a...)
}

func puts(a ...interface{}) {
	fmt.Fprintln(wt, a...)
}

func main() {
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, initialBufSize), maxBufSize)
	defer wt.Flush()

	h, w := nextInt2()
	a := make([][]int, h)
	for i := range a {
		a[i] = nextInts(w)
	}

	ansN := 0
	op := make([][4]int, 0)

	for i := 0; i < h; i++ {
		for j := (i % 2) * (w - 1); 0 <= j && j < w; j += 1 - 2*(i%2) {
			if a[i][j]%2 == 0 {
				continue
			}
			var nextX, nextY int
			if (j == w-1 && i%2 == 0) || (j == 0 && i%2 == 1) {
				nextX, nextY = j, i+1
			} else {
				nextX, nextY = j+1-2*(i%2), i
			}
			if nextY >= h {
				continue
			}
			a[nextY][nextX]++
			op = append(op, [4]int{i + 1, j + 1, nextY + 1, nextX + 1})
			ansN++
		}
	}

	puts(ansN)
	for i := range op {
		puts(op[i][0], op[i][1], op[i][2], op[i][3])
	}
}


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

#define REP(i,n) for(ll i = 0;i < n;++i)
#define PB(s) push_back(s)
#define ST(n) sort(n.begin(),n.end())

using namespace std;
typedef long long ll;

int main(){
  ll N,D;
  cin >> N >> D;
  int X[N][D];
  REP(i,N)
    REP(j,D)
      cin >> X[i][j];
      int ans = 0;
  REP(i,N){
    for(int k=i+1;k<N;k++){
      int temp = 0;
      REP(j,D)
        temp+=pow(X[i][j]-X[k][j],2);
      if(sqrt(temp)==(int)sqrt(temp))
        ans++;
    }
  }
    cout << ans << endl;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define PB push_back
#define MP make_pair

#define REP(i,n) for(i=0;i<(n);++i)
#define FOR(i,l,h) for(i=(l);i<=(h);++i)
#define FORD(i,h,l) for(i=(h);i>=(l);--i)

#define max(a,b) a>b?a:b
#define min(a,b) a>b?b:a
using namespace std;
int main(){
    ios_base::sync_with_stdio(false);
  	cin.tie(NULL);
    cout.tie(NULL);
    int n;
    cin>>n;
    int a[n+2];
    int dp[n+2];
    for(int i=0;i<n;i++){
        cin>>a[i];
        dp[i] = INT_MAX;
    }
    dp[0] = 0;
    for(int i=0;i<n;i++){
        if(i+1<n) dp[i+1] = min(dp[i+1] , dp[i] + abs(a[i]-a[i+1]));
        if(i+2<n) dp[i+2] = min(dp[i+2] , dp[i] + abs(a[i]-a[i+2]));
    }
    cout<<dp[n-1];
    return 0;
}


Measured memory_bytes: 1024
#include<iostream>
#include<algorithm>
#include<cstdint>
#include<cstdlib>
template<typename T>
void fin(T const& t){ std::cout << t << std::endl; exit(0); }

// bit
#include<functional>
template<typename T, int NN>
struct bit {
  typedef std::function<T(T,T)> OP;
  T data_[NN], e_; // 0-base
  OP& op_;
  bit(OP& op, T e) : op_(op), e_(e) { std::fill_n(data_, NN, e_); }
  int lb(int i){ return i&-i; }
  T query(int i) { // 1-base
    T res = e_;
    while(i > 0) { res = op_(res, data_[i-1]); i -= lb(i); }
    return res;
  } 
  void add(int i, T const& v) { // 1-base
    while(i <= NN) { data_[i-1] = op_(data_[i-1], v); i += lb(i); }
  }
};

int const MAXN = 300;
int const MAXNN = 1<<9;
int64_t const INF = 1e18;
int64_t H[MAXN+1], Hs[MAXN+1], tos[MAXN+1], N, K;
int64_t dp[MAXN+1][MAXN+1];

int main() {
  std::cin >> N >> K;
  int pH = 0;
  H[0] = 0;
  for(int i = 1; i <= N; ++i) std::cin >> H[i];
  // dp[i][j]: i = #choosen, j = <last choice>; j >= i
  // dp[i][j] = min{ dp[i-1][k] + max(0, H[j]-H[k]) | k in [1,j) }
  //          = min( dp[i-1][k] where H[j] <= H[k],
  //                 dp[i-1][k] + H[j] - H[k] where H[j] > H[k] )
  //          = min( min{ dp[i-1][k] | H[j] <= H[k] },
  //                  min{ dp[i-1][k] - H[k] | H[j] > H[k] } + H[j] )
  // Hs[] := uniq(sort(H[])), tos[] s.t. Hs[tos[i]] = H[i]
  // H[j] < H[k] <=> tos[j] < tos[k]
  // ans = min { dp[N-K][j] | j in [1,N] }
  //
  // 
  std::copy_n(H+1, N, Hs+1);
  std::sort(Hs+1, Hs+1+N);
  int m = std::unique(Hs+1, Hs+1+N) - Hs;
  for(int i = 1; i <= N; ++i) {
    tos[i] = std::partition_point(Hs, Hs+m, [&](int j){ return j < H[i]; }) - Hs;
  }
  std::copy_n(H+1, N, dp[1]+1);
  for(int i = 2; i <= N-K; ++i) {
    std::fill_n(dp[i], N+1, INF);
    bit<int64_t, MAXNN>::OP op = [](int64_t x, int64_t y){ return std::min(x, y); };
    bit<int64_t, MAXNN> b1(op, INF), b2(op, INF);
    for(int j = i-1; j <= N; ++j) {
      if(j >= i) {
        dp[i][j] = std::min(b1.query(m-tos[j]), b2.query(tos[j]) + H[j]);
      }
      b1.add(m-tos[j], dp[i-1][j]);
      b2.add(tos[j], dp[i-1][j] - H[j]);
    }
  }
  int64_t ans = INF;
  for(int j = N-K; j <= N; ++j) ans = std::min(ans, dp[N-K][j]);
  fin(ans);
  return 0;
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
int main(){
  vector<int> high(10);
  for(int i=0;i<10;++i){
    scanf("%d",&high[i]);
  }
  sort(high.begin(),high.end(),greater<int>());
  printf("%d\n%d\n%d\n",high[0],high[1],high[2]);
  return 0;
}

Measured memory_bytes: 3268
X, Y, A, B, C = map(int, input().split())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))
a = []
for x in p:
    a.append((x,0))
for x in q:
    a.append((x,1))
for x in r:
    a.append((x,2))
a.sort(reverse=True)
xc = 0
yc = 0
cnt = 0
ans = 0
for x in a:
    if cnt == X+Y:
        break
    if x[1] == 0:
        if xc < X:
            ans += x[0]
            xc += 1
            cnt += 1
    elif x[1] == 1:
        if yc < Y:
            ans += x[0]
            yc += 1
            cnt += 1
    else:
        ans += x[0]
        cnt += 1
print(ans)

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


void solve(long long N, std::vector<long long> T, std::vector<long long> A){
    ll t=T[0], a=A[0];
    ll tnew, anew;
    for(ll i=1; i< N; i++){
        ll tmp;
        tmp = T[i];
        if(t % tmp != 0){
            tnew = (t/tmp + 1)*tmp;
        }else tnew = t;
        tnew /= T[i];

        tmp = A[i];
        if(a % tmp != 0){
            anew = (a/tmp + 1)*tmp;
        }else anew = a;
        anew /= A[i];

        t = max(tnew, anew)*T[i];
        a = max(tnew, anew)*A[i];
    }
    cout << t+a << endl;
}

int main(){
    long long N;
    scanf("%lld",&N);
    std::vector<long long> T(N);
    std::vector<long long> A(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&T[i]);
        scanf("%lld",&A[i]);
    }
    solve(N, std::move(T), std::move(A));
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
using namespace std;
int n, x, a[100009];
int main() {
	scanf("%d", &n);
	fill(a, a + n, 1 << 30);
	for(int i = 0; i < n; i++) {
		scanf("%d", &x);
		*lower_bound(a, a + n, x) = x;
	}
	printf("%d\n", lower_bound(a, a + n, 1 << 30) - a);
}

Measured memory_bytes: 3592
using System;
using System.Collections.Generic;
using System.Linq;

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            var V = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
            if (V.Sum() - V.Max() > V.Max())
            {
                Console.WriteLine("Yes");
            }
            else
            {
                Console.WriteLine("No");
            }
        }
    }
}



Measured memory_bytes: 13396
#include <bits/stdc++.h> 
using namespace std;
typedef long long ll;
//typedef pair<int,int> P;
//typedef pair<ll, ll> P;
//typedef pair<int, pair<int, int>> P;
//typedef pair<ll, pair<int, int>> P;
typedef pair<ll,pair<ll,ll>> T;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
ll INFL = 1000000000000000010;//10^18 = 2^60
int INF = 2147483600;//10^9
int INFM =100000000;
ll MOD  = 1000000007;


int main(){
    int N;
    cin >> N;
    ll ans = 0;
    for(int i = 0; i < N; i++){
        ll a;
        cin >> a;
        while(a % 2 == 0){
            ans++;
            a /= 2;
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
// khodaya khodet komak kon
#include <bits/stdc++.h>
#define pb push_back
#define ers erase
#define ins insert
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define debug(x)  cerr << #x << " = " << x << endl
#define kill(x) return cout << x, 0;
#define IOS ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#pragma GCC optimize ("Ofast")
using namespace std;

typedef long long ll;
typedef long double ld;
typedef string str;
typedef pair<ll, ll> pll;
typedef vector<ll> vl;
typedef vector<pll> vpl;

const ld Pi = 3.14159265359;
const ll MOD = 1000 * 1000 * 1000 + 7;
const ll N = 2e5 + 10;
const ll INF = 1e18;
const ll LOG = 20;
ll A, B, C;
int main(){
	IOS;
	cin >> A >> B >> C;
	ll k;
	cin >> k;
	if (k % 2 == 0) cout << A - B;
	else cout << B - A;
	
	
	
	
	
	
	return 0;
}






/*
     ,---,           ___                 ,--,
    '  .' \        ,--.'|_             ,--.'|                             ,--,
   /  ;    '.      |  | :,'            |  | :                           ,--.'|    ,---.        ,---,
  :  :       \     :  : ' :            :  : '                 .--.--.   |  |,    '   ,'\   ,-+-. /  |
  :  |   /\   \  .;__,'  /    ,--.--.  |  ' |     ,--.--.    /  /    '  `--'_   /   /   | ,--.'|'   |
  |  :  ' ;.   : |  |   |    /       \ '  | |    /       \  |  :  /`./  ,' ,'| .   ; ,. :|   |  ,"' |
  |  |  ;/  \   \:__,'| :   .--.  .-. ||  | :   .--.  .-. | |  :  ;_    '  | | '   | |: :|   | /  | |
  '  :  | \  \ ,'  '  : |__  \__\/: . .'  : |__  \__\/: . .  \  \    `. |  | : '   | .; :|   | |  | |
  |  |  '  '--'    |  | '.'| ," .--.; ||  | '.'| ," .--.; |   `----.   \'  : |_|   :    ||   | |  |/
  |  :  :          ;  :    ;/  /  ,.  |;  :    ;/  /  ,.  |  /  /`--'  /|  | '.'\   \  / |   | |--'
  |  | ,'          |  ,   /;  :   .'   \  ,   /;  :   .'   \'--'.     / ;  :    ;`----'  |   |/
  `--''             ---`-' |  ,     .-./---`-' |  ,     .-./  `--'---'  |  ,   /         '---'
                            `--`---'            `--`---'                 ---`-'
*/




Measured memory_bytes: 384
#include <iostream>
#include <algorithm>
#include <queue>
#include <set>

using namespace std;

string col = "rgb";

int main() {
  
  string worm;
  while(cin >> worm) {
    if(worm=="0") break;
    int const wsize = worm.size();
    set<string> used;
    queue<pair<int, string> > q;
    q.push(make_pair(0, worm));
    bool flg = false;
    while(!q.empty()) {
      int cost = q.front().first; worm = q.front().second; q.pop();
      if(used.count(worm)) continue;
      used.insert(worm);
      bool check = true;
      for(int i=0; i<wsize-1; i++) check = check && worm[i] == worm[i+1];
      if(check) {
        flg = true;
        cout << cost << endl;
        break;
      }
      for(int i=0; i<wsize-1; i++) {
        if(worm[i]!=worm[i+1]) {
          char next;
          for(int j=0; j<3; j++) {
            if(worm[i] == col[j]) continue;
            if(worm[i+1] == col[j]) continue;
            next = col[j];
          }
          string nworm = worm;
          nworm[i] = nworm[i+1] = next;
          if(used.count(nworm)) continue;
          q.push(make_pair(cost+1, nworm));
        }
      }
    }
    if(!flg) cout << "NA" << endl;
  }
  
  return 0;
}

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

#define ll long long
#define all(x) (x).begin(), (x).end()
const long long INF = 1LL << 60;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)  //(i, 10) i=0～i=9まで
#define repr(i, n) for (int i = n; i >= 0; i--)   // (i, 10) i=10～i=0まで
#define FOR(i, m, n) for (int i = m; i < n; i++)  // (i, 3, 10) i=3～i=9まで

// 総数を1000000007で割った余り
const long long mod = 1e9 + 7;

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

    // 入力
    int x, a, b;
    cin >> x >> a >> b;

    // 処理
    // 出力
    cout << (x - a) % b << endl;

    return 0;
}


Measured memory_bytes: 256
###==================================================
### import
#import bisect
#from collections import Counter, deque, defaultdict
#from copy import deepcopy
#from functools import reduce, lru_cache
#from heapq import heappush, heappop
#import itertools
#import math
#import string
import sys
### stdin
def input(): return sys.stdin.readline().rstrip()
def iIn(): return int(input())
def iInM(): return map(int, input().split())
def iInM1(): return map(int1, input().split())
def iInLH(): return list(map(int, input().split()))
def iInLH1(): return list(map(int1, input().split()))
def iInLV(n): return [iIn() for _ in range(n)]
def iInLV1(n): return [iIn()-1 for _ in range(n)]
def iInLD(n): return [iInLH() for _ in range(n)]
def iInLD1(n): return [iInLH1() for _ in range(n)]
def sInLH(): return list(input().split())
def sInLV(n): return [input().rstrip('\n') for _ in range(n)]
def sInLD(n): return [sInLH() for _ in range(n)]
### stdout
def OutH(lst, deli=' '): print(deli.join(map(str, lst)))
def OutV(lst): print('\n'.join(map(str, lst)))
### setting
sys.setrecursionlimit(10 ** 6)
### utils
int1 = lambda x: int(x) - 1
### constants
INF = int(1e9)
MOD = 1000000007
dx = (-1, 0, 1, 0)
dy = (0, -1, 0, 1)
###---------------------------------------------------

N = iIn()
V = iInLH()

V.sort()

ans = V[0]
for i in range(1, N):
    ans = (ans + V[i]) / 2.0
print(ans)

Measured memory_bytes: 62084
#include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
using namespace std;
const int mod = 1e9 + 7;

int main() {
    int N;
    cin >> N;
    string S[N];
    for(int i = 0; i < N; ++i) cin >> S[i];
    
    map<string,int> m;
    for(int i = 0; i < N; ++i){
        //key add
        if(m.count(S[i]) == 0) m.insert(make_pair(S[i],1));
        //value++
        else m[S[i]] = ++m[S[i]];
    }

    cout << m.size() << endl;
}

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

typedef long long LL;
typedef long double LD;

int main(void){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    
    int n, m, x;
    int c[15];
    cin >> n >> m >> x;
    vector<vector<int>> a(n, vector<int>(m));
    rep(i, n){
        cin >> c[i];
        rep(j, m){
            cin >> a[i][j];
        }
    }

    int tot[15];
    LL ans = __LONG_LONG_MAX__, ans_tmp = 0;
    bool f = true;
    for(int i = 0;i < (1 << n); i++){
        bitset<15> bs(i);
        ans_tmp = 0;
        rep(j, n){
            tot[j] = 0;
        }

        for(int j = 0; j < n; j++){
            if(bs[j] == 1){
                for(int k = 0; k < m; k++){
                    tot[k] += a[j][k];
                }
                ans_tmp += c[j];
            }
        }
        f = true;
        for(int j = 0;j < m; j++){
            if(tot[j] < x)f = false;
        }
        if(f){
            ans = min(ans, ans_tmp);
        }
    }
    if(ans == __LONG_LONG_MAX__)ans = -1;
    cout << ans << endl;
}

Measured memory_bytes: 3668
//by azidoazideazide
#include<iostream>

using namespace std;
int main() {
	ios::sync_with_stdio(0);
	int x,y; char c;
	while(cin>>x>>c>>y){
		switch(c){
			case '+':
				cout<<x+y<<endl;
				break;
			case '-':
				cout<<x-y<<endl;
				break;
			case '*':
				cout<<x*y<<endl;
				break;
			case '/':
				cout<<x/y<<endl;
				break;
			default: 
				return 0;
				break;
		}
	}
}


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

#define pb push_back


#define fi first
#define se second

typedef long long ll;


using namespace std;

void boost(){
  ios::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
}

ll x, y;

void solve(){

  cin >> x >> y;

  cout << min(max(y - x, x - y + 2), abs(x + y) + 1);
  
}

int main(){
boost();

int tt = 1;
while(tt--) {
  solve();
}

return 0;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main()
{
     int N;
     cin >> N;
     if (N==1)
     {
          cout  << "Hello World" << endl;
          return 0;
     }
     else if (N==2)
     {
          int a, b;
          cin >> a >> b;
          cout << a+b << endl;
      }
     return 0;
}

Measured memory_bytes: 256
def main():
  N = int(input())
  a = 1
  b = 1
  c = 1
  mod = (10 ** 9) + 7
  for _ in range(N):
    a = (a * 10) % mod
    b = (b * 9) % mod
    c = (c * 8) % mod
  print((a - (2*b) + c) % mod )
main()

Measured memory_bytes: 63064
n, a, b = gets.split.map(&:to_i)
s = gets.chomp
domestic_passed = 0
abroad_passed = 0
s.each_char do |c|
  case c
  when "a"
    if domestic_passed + abroad_passed < a + b
      puts "Yes"
      domestic_passed += 1
    else
      puts "No"
    end
  when "b"
    if domestic_passed + abroad_passed < a + b && abroad_passed < b
      puts "Yes"
      abroad_passed += 1
    else
      puts "No"
    end
  when "c"
    puts "No"
  end
end


Measured memory_bytes: 14432
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pp;
typedef pair<ll,ll> pll;
void read(int& x){ scanf("%d",&x); }
void read(ll& x){ scanf("%lld",&x); }
template<typename T,typename... Args>
void read(T& a,Args&... b){ read(a); read(b...); }
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define x first
#define y second

int root;
int n;
vector<int> edge[100010];
int par[100010];

void dfs(int x){
	for(int y:edge[x]) if(par[x]!=y){
		par[y]=x; dfs(y);
	}
}

bool dead[100010];
int deg[100010];

priority_queue<pp, vector<pp>, greater<pp>> pq;

int main()
{
	read(n); for(int i=1; i<n; ++i){
		int a, b; read(a, b);
		edge[a].pb(b);
		edge[b].pb(a);
		++deg[a]; ++deg[b];
	}
	if(n == 2){
		puts("Second");
		return 0;
	}
	for(int i=1; i<=n; ++i) if(edge[i].size() != 1u) root=i;
	dfs(root);
	for(int i=1; i<=n; ++i) pq.push(pp{deg[i], i});
	while(pq.size()){
		int d, i;
		tie(d, i) = pq.top(); pq.pop();
		if(deg[i] != d || dead[i]) continue;
		if(d == 0){
			puts("First");
			return 0;
		}
		assert(d == 1);
		int v = edge[i][0];
		for(int y:edge[i]) if(!dead[y]) {v=y; break;}
		auto kill = [&](int x){
			dead[x]=1;
			for(int y:edge[x]) if(!dead[y]){
				--deg[y];
				pq.push(pp{deg[y], y});
			}
		};
		kill(i); kill(v);
	}
	puts("Second");
    return 0;
}


Measured memory_bytes: 7800
#include <iostream>
#include <string>
#include <algorithm>
#include <set>
#include <cmath>
#include <vector>
#include <numeric>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <queue>

using ll = long long int;
using ul = unsigned long long int;
const ll LL_MAX (1LL<<60);
const ll MOD (1000000007);

#define rep(i,s,e) for(ll i=(s); i<(e); i++) 

using namespace std;

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

    ll a, b;
    cin >> a >> b;

    if (a==1 && b !=1)
    {
        cout << "Alice" << endl;
        return 0;
    }
    else if (a!=1 && b ==1)
    {
        cout << "Bob" << endl;
        return 0;
    }
    else if (a==1 && b ==1)
    {
        cout << "Draw" << endl;
        return 0;
    }

    if (a==b)
        cout << "Draw" << endl;
    else if (a>b) 
        cout << "Alice" << endl;
    else
        cout << "Bob" << endl;

    return 0;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main(){
    int n, i;
    cin >> n;
    int a[n];

    for(i = 0; i < n; ++i){
        cin >> a[i];
    }

    for(i = 0; i < n; ++i){
        if(i) cout << " ";
        cout << a[i];
    }
    cout << endl;
 
    for(i = 1; i < n; ++i){
        int key = a[i], j = i;
        while(j > 0 && a[j - 1] > key){
            a[j] = a[j - 1];
            --j;
        }
        a[j] = key;

        for(j = 0; j < n; ++j){
            if(j) cout << " ";
            cout << a[j];
        }
        cout << endl;
    }
}

Measured memory_bytes: 0
#include <iostream>
#include<cstdlib>
#include<queue>
#include<set>
#include<vector>
#include<string>
#include<algorithm>
#include<stack>
#include<map>
#include<deque>
#include<cstdio>
using namespace std;
#define rep(i,a) for(int i=0;i<a;i++)
#define mp make_pair
#define pb push_back
#define ll __int64
#define __int64 long long
#define P pair<int,int>


int main(){
    int a,b,c;
    cin>>a>>b>>c;
    cout<<max(0,c-(a-b))<<endl;
	return 0;
}



Measured memory_bytes: 256
package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scan(&n)

	if n%10 == 2 || n%10 == 4 || n%10 == 5 || n%10 == 7 || n%10 == 9 {
		fmt.Println("hon")
	} else if n%10 == 0 || n%10 == 1 || n%10 == 6 || n%10 == 8 {
		fmt.Println("pon")
	} else {
		fmt.Println("bon")
	}

}


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

// int bubbleSort(int A[], int N) {
//     int sw = 0;
//     bool flag = 1;
//     for(int i = 0; flag; i++) {
//         flag = 0;
//         for(int j = N - 1; j >= i + 1; j--) {
//             if(A[j] < A[j - 1]) {
//                 swap(A[j], A[j - 1]);
//                 flag = 1;
//                 sw++;
//             }
//         }
//     }
//     return sw;
// }

int bubbleSort(int A[], int N) {
    int sw = 0;
    bool flag = 1;
    for(int i = 0; flag; i++) {
        flag = 0;
        for(int j = N - 1; j >= i + 1; j--) {
            if(A[j] < A[j - 1]) {
                swap(A[j], A[j - 1]);
                sw++;
                flag = 1;
            }
        }
    }
    return sw;
}


int main() {
    int A[100], N, sw;

    cin >> N;
    for(int i = 0; i < N; i++) cin >> A[i];

    sw = bubbleSort(A, N);

    for(int i = 0; i < N; i++) {
        if(i) cout << " ";
        cout << A[i];
    }
    cout << endl;
    cout << sw << endl;

    return 0;
}


Measured memory_bytes: 3080
#pragma region Macros
#include <bits/stdc++.h>
using namespace std;
//#include <boost/multiprecision/cpp_int.hpp>
//using multiInt = boost::multiprecision::cpp_int;

using ll = long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
template <typename Q_type>
using smaller_queue = priority_queue<Q_type, vector<Q_type>, greater<Q_type>>;

const int MOD_TYPE = 2;
const ll MOD = (MOD_TYPE == 1 ? (ll)(1e9 + 7) : 998244353);
const int INF = (int)1e9;
const ll LINF = (ll)4e18;
const ld PI = acos(-1.0);
const ld EPS = 1e-11;

#define REP(i, m, n) for (ll i = m; i < (ll)(n); ++i)
#define rep(i, n) REP(i, 0, n)
#define MP make_pair
#define MT make_tuple
#define YES(n) cout << ((n) ? "YES" : "NO") << endl
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible") << endl
#define possible(n) cout << ((n) ? "possible" : "impossible") << endl
#define Yay(n) cout << ((n) ? "Yay!" : ":(") << endl
#define all(v) v.begin(), v.end()
#define NP(v) next_permutation(all(v))
#define dbg(x) cerr << #x << ":" << x << endl;

vector<int> Dx = {0, 0, -1, 1, -1, 1, -1, 1, 0};
vector<int> Dy = {1, -1, 0, 0, -1, -1, 1, 1, 0};

#pragma endregion

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

  map<char,bool> mp;
  string s;
  cin >> s;
  for (auto c : s)
    mp[c] = true;
  Yes((mp['N'] == mp['S']) && (mp['W'] == mp['E']));

  return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long x = sc.nextLong();
		sc.close();
		long f = 100L;
		long ans = 0L;
		while (f < x) {
			long p = (long)(f * 0.01);
			f += p;
			ans++;
		}
		System.out.println(ans);
	}
}

Measured memory_bytes: 27028
#!python
# -*- coding: utf-8 -*-


def main():
    N, K = map(int, input().split())
    x = list(map(int, input().split()))

    p = [0]
    m = []

    for n in x:
        if n < 0:
            m.append(-n)
        if n == 0:
            K -= 1
        if n > 0:
            p.append(n)
    m.reverse()
    m = [0] + m
    if K == 0:
        print(0)
        return

    ANS = float('inf')
    for i in range(K + 1):
        p_i = i
        m_i = K - i
        if not 0 <= p_i < len(p):
            continue
        if not 0 <= m_i < len(m):
            continue

        ANS = min(ANS, p[p_i] * 2 + m[m_i])
        ANS = min(ANS, p[p_i] + m[m_i] * 2)

    print(ANS)






if __name__ == '__main__':
    main()


Measured memory_bytes: 14480
import java.util.*;
import java.math.BigInteger;
 public class Main {
 public static void main(String args[]){
     Scanner sc=new Scanner(System.in);
     int n;
     int a[]= new int[200000+5];
     n = sc.nextInt();
     String x2 = "0";
     BigInteger sum = new BigInteger(x2);
     BigInteger temp,two = new BigInteger("2");
     BigInteger sum2 = new BigInteger(x2);
     BigInteger cha=new BigInteger("200000000000000000");
     for(int i = 1;i<=n;++i){
         a[i] = sc.nextInt();
         temp = new BigInteger(""+a[i]);
         sum = sum.add(temp);
     }
     for(int i = 1;i<=n-1;++i){
         temp = new BigInteger(""+a[i]);
         sum2 = sum2.add(temp);
         temp = sum2.multiply(two).subtract(sum);
         if(temp.abs().compareTo(cha)== -1)cha = temp.abs();
     }
     System.out.println(cha);
    }
 }

Measured memory_bytes: 93660
#include <iostream>
#include <string>
#include <vector>
#include <map>
using ll=long long;
using namespace std;

int N,K;
int check(vector<int>& A,int n){
    int cnt=0;
    for(int i=0;i<N;i++){
        if(A[i]%n==0){
            cnt+=A[i]/n-1;
        }else{
            cnt+=A[i]/n;
        }
    }
    if(cnt<=K){
        return 1;
    }else{
        return 0;
    }
}

int binary(vector<int>& A,int st,int ed){
    //cout<<st<<" "<<ed<<endl;
    if(ed-st<=1){
        return st;
    }
    int mid=(st+ed)/2;
    if(check(A,mid)){
        return binary(A,st,mid);
    }else{
        return binary(A,mid,ed);
    }
}

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

    vector<int> A(N);
    int m=0;
    for(int i=0;i<N;i++){
        cin>>A[i];
        if(m<A[i]){
            m=A[i];
        }
    }

    cout<<binary(A,0,m)+1<<endl;

    return 0;
}

Measured memory_bytes: 3980
#include <bits/stdc++.h>
using namespace std;
int main(void)
{
    int n;
    cin >> n;
    vector<int> a(n);
    vector<vector<int> > x(n, vector<int>(15)), y(n, vector<int>(15));    
    for(int i = 0; i < n; i++) {
        cin >> a[i];
        for(int j = 0; j < a[i]; j++) {
            cin >> x[i][j] >> y[i][j];
            x[i][j]--;
        }
    }
    int ans = 0;
    for(int bit = 0; bit < (1 << n); bit++) {
        bool ok = true;
        for(int i = 0; i < n; i++) {
            if (bit & (1 << i))
                for(int j = 0; j < a[i]; j++)
                    ok &= (bit >> x[i][j] & 1) == y[i][j];
        }
        if(ok)
            ans = max(ans, __builtin_popcount(bit));
    }
    cout << ans << '\n';

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <math.h>
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#define rep(i,n) for(int i=0;i<(n);i++)
// #define psortsecond(A,N) sort(A,A+N,[](const pii &a, const pii &b){return a.second<b.second;});
// #define psortfirst(A,N) sort(A,A+N,[](const pii &a, const pii &b){return a.first<b.first;});
#define All(x) (x).begin(),(x).end()
using namespace std;
// using pii  = pair<int,int>;
long long gcd(long long a, long long b){return (b == 0 ? a : gcd(b, a%b));}
long long lcm(long long a, long long b){return a*b/gcd(a,b);}
int BSearch(int key,int n,int S[]){
	int l=0,r=n;
	while(r-l>1){
		int mid=(l+r)/2;
		if(S[mid]>key)r=mid;
		else l=mid;
	}
	return S[l]==key?1:0;
}
typedef long long ll;
#define MOD 1000000007
#define EPS 10e-8

int main(){
    ll n,q,cnt=0,S[1000007],T[500007];
    cin >> n;
    rep(i,n){
        cin >> S[i];
    }
    cin >>q;
    rep(i,q){
        cin >> T[i];
    }
    sort(T,T+q);
    rep(i,q){
        ll left=0,right=n; //n-1ではなくnなのは右端に解がある時のため
        ll mid=(left+right)/2,midb=-1;
        while(mid!=midb){ //二分探索
            if(T[i]==S[mid]){
                cnt++;
                break;
            }
            else if(T[i] > S[mid]){
                left = mid+1; 
            }
            else if(T[i] < S[mid]){
                right = mid;
            }
            midb=mid;
            mid = (left+right)/2;
        }
    }
    cout << cnt << endl;
}


Measured memory_bytes: 4244
/*
Author: QAQAutomaton
Lang: C++
Code: A.cpp
Mail: lk@qaq-am.com
Blog: https://www.qaq-am.com/
*/
#include<bits/stdc++.h>
#define debug(...) fprintf(stderr,__VA_ARGS__)
#define DEBUG printf("Passing [%s] in LINE %d\n",__FUNCTION__,__LINE__)
#define Debug debug("Passing [%s] in LINE %d\n",__FUNCTION__,__LINE__)
#define all(x) x.begin(),x.end()
#define x first
#define y second
using namespace std;
typedef unsigned uint;
typedef long long ll;
typedef unsigned long long ull;
typedef complex<double> cp;
typedef pair<int,int> pii;
int inf;
const double eps=1e-8;
const double pi=acos(-1.0);
template<class T,class T2>int chkmin(T &a,T2 b){return a>b?a=b,1:0;}
template<class T,class T2>int chkmax(T &a,T2 b){return a<b?a=b,1:0;}
template<class T>T sqr(T a){return a*a;}
template<class T,class T2>T mmin(T a,T2 b){return a<b?a:b;}
template<class T,class T2>T mmax(T a,T2 b){return a>b?a:b;}
template<class T>T aabs(T a){return a<0?-a:a;}
template<class T>int dcmp(T a,T b){return a>b;}
template<int *a>int cmp_a(int x,int y){return a[x]<a[y];}
#define min mmin
#define max mmax
#define abs aabs
struct __INIT__{
	__INIT__(){
		memset(&inf,0x3f,sizeof(inf));
	}
}__INIT___;
namespace io {
	const int SIZE = (1 << 21) + 1;
	char ibuf[SIZE], *iS, *iT, obuf[SIZE], *oS = obuf, *oT = oS + SIZE - 1, c, qu[55]; int f, qr;
	// getchar
	#define gc() (iS == iT ? (iT = (iS = ibuf) + fread (ibuf, 1, SIZE, stdin), (iS == iT ? EOF : *iS ++)) : *iS ++)
	// print the remaining part
	inline void flush () {
		fwrite (obuf, 1, oS - obuf, stdout);
		oS = obuf;
	}
	// putchar
	inline void putc (char x) {
		*oS ++ = x;
		if (oS == oT) flush ();
	}
	template<typename A>
	inline bool read (A &x) {
		for (f = 1, c = gc(); c < '0' || c > '9'; c = gc()) if (c == '-') f = -1;else if(c==EOF)return 0;
		for (x = 0; c <= '9' && c >= '0'; c = gc()) x = x * 10 + (c & 15); x *= f;
		return 1;
	}
	inline bool read (char &x) {
		while((x=gc())==' '||x=='\n' || x=='\r');
		return x!=EOF;
	}
	inline bool read(char *x){
		while((*x=gc())=='\n' || *x==' '||*x=='\r');
		if(*x==EOF)return 0;
		while(!(*x=='\n'||*x==' '||*x=='\r'||*x==EOF))*(++x)=gc();
		*x=0;
		return 1;
	}
	template<typename A,typename ...B>
	inline bool read(A &x,B &...y){
		return read(x)&&read(y...);
	}
	template<typename A>
	inline bool write (A x) {
		if (!x) putc ('0'); if (x < 0) putc ('-'), x = -x;
		while (x) qu[++ qr] = x % 10 + '0',  x /= 10;
		while (qr) putc (qu[qr --]);
		return 0;
	}
	inline bool write (char x) {
		putc(x);
		return 0;
	}
	inline bool write(const char *x){
		while(*x){putc(*x);++x;}
		return 0;
	}
	inline bool write(char *x){
		while(*x){putc(*x);++x;}
		return 0;
	}
	template<typename A,typename ...B>
	inline bool write(A x,B ...y){
		return write(x)||write(y...);
	}
	//no need to call flush at the end manually!
	struct Flusher_ {~Flusher_(){flush();}}io_flusher_;
}
using io :: read;
using io :: putc;
using io :: write;
char s[100005];
signed main(){
#ifdef QAQAutoMaton 
	freopen("A.in","r",stdin);
	freopen("A.out","w",stdout);
#endif
	read(s);s[3]=0;write(s,'\n');	
	return 0;
}



Measured memory_bytes: 3648
#115C
import sys
N, K = map(int, sys.stdin.readline().split())
H = [int(sys.stdin.readline()) for _ in range(N)]

H.sort()
#print(H)
ans = H[K-1] - H[0]
for i in range(K, N):
    tmp = H[i] - H[i-K+1]
    if ans > tmp:
        ans = tmp
print(ans)

Measured memory_bytes: 7384
#include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define it ::iterator
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double ESP=1e-10;
using namespace std;
int main(){
  int map[2][6]={
    {1,-1,1,4,5,2},
    {2,3,-1,5,2,1}
  };
  string s;
  while(cin>>s,s!="#"){
    int now=0;
    rep(i,s.size()){
      now=map[s[i]-'0'][now];
      if(now==-1)break;
    }
    if(now==5)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
  }

}

Measured memory_bytes: 1176
// Created by 
// 
//  ████████╗██╗███╗   ███╗ ██████╗ ████████╗██╗  ██╗██╗   ██╗██╗  ██╗
//  ╚══██╔══╝██║████╗ ████║██╔═══██╗╚══██╔══╝██║  ██║╚██╗ ██╔╝╚██╗██╔╝
//     ██║   ██║██╔████╔██║██║   ██║   ██║   ███████║ ╚████╔╝  ╚███╔╝ 
//     ██║   ██║██║╚██╔╝██║██║   ██║   ██║   ██╔══██║  ╚██╔╝   ██╔██╗ 
//     ██║   ██║██║ ╚═╝ ██║╚██████╔╝   ██║   ██║  ██║   ██║   ██╔╝ ██╗
//     ╚═╝   ╚═╝╚═╝     ╚═╝ ╚═════╝    ╚═╝   ╚═╝  ╚═╝   ╚═╝   ╚═╝  ╚═╝
//  

#include<bits/stdc++.h>

using namespace std;

#define fastIO(); ios_base::sync_with_stdio(false); cin.tie(NULL);
#define dbg(x); cout<<"\n"<<#x<<": "<<x;
#define MOD 100000007
#define ret return
#define UC 100007
#define dt long int
#define pf printf
#define sf scanf

typedef vector<long long int> vlli;
typedef vector<long int> vli;
typedef vector<int> vi;
typedef vector<dt> vdti;
typedef vector<unsigned int> vui;
typedef unsigned int ui;    //  0 to e9
typedef long int li;    // e-18 to e18  
typedef long long int lli;  //  e-18 to e18
typedef unsigned long int uli;  // 0 to e19 
typedef unsigned long long int ulli;    //  0 to e19

int main(){
    fastIO();
    dt n;
    cin>>n;
    while(n){
        if(n%10==7){
            cout<<"Yes\n";
            break;
        }
        n/=10;
    }
    if(n==0)    cout<<"No";
	ret 0; 
}       

Measured memory_bytes: 3608
using System;

namespace atcorder
{
    class MainClass
    {
        public static void Main(string[] args)
        {
            atcorder.Ringo_s_Favorite_Numbers.Run();
        }
    }
    public class Ringo_s_Favorite_Numbers
    {
        public Ringo_s_Favorite_Numbers()
        {
        }
        public static int Pow(int a,int b){
            int k = 1;
            for (int i = 0; i < b; i++) k *= a;
            return k;
        }
        public static void Run(){
            int D, N;
            string s = Console.ReadLine();
            D = int.Parse(s.Split(' ')[0]);
            N = int.Parse(s.Split(' ')[1]);
            if (N == 100) N = 101;
            Console.WriteLine(Pow(100, D) * N);
        }
    }
}


Measured memory_bytes: 13140
#include<bits/stdc++.h>
using namespace std;
int main()
{
   int a , b, c;
   cin >> a >> b;
   c = a * b;
   if (c % 2 == 0)
   {
       cout <<"Even\n";
   }else
   {
       cout <<"Odd\n";
   }
   return 0;
}

Measured memory_bytes: 256
/// Containers Start
#include <algorithm>
#include <bitset>
#include <cstdlib>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
/// C Header Files
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <math.h>
#include <stdio.h>
/// Containers End

using namespace std;

/// Math Start
#define PI acos(-1.0)
#define Pi 3.141592653589793
#define EPS (1e-7)
#define INF (0x3f3f3f3f)
/// Math End

/// Extra Start
#define nn '\n'
#define pb push_back
#define ull unsigned long long
#define ll long long
#define MOD 1000000007
#define sz(a) int((a).size())
#define space " "
#define All(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
/// Extra End

#define rep(i, n) for (int i = 0; i < n; i++)
#define Cini(a)                                                                \
    int a;                                                                     \
    cin >> a;
#define Cinii(a, b)                                                            \
    int a, b;                                                                  \
    cin >> a >> b;
#define Ciniii(a, b, c)                                                        \
    int a, b, c;                                                               \
    cin >> a >> b >> c;
#define Cins(s)                                                                \
    string s;                                                                  \
    cin >> s;
#define Cinss(s1, s2)                                                          \
    string s1, s2;                                                             \
    cin >> s1 >> s2;
#define Cinc(c)                                                                \
    char c;                                                                    \
    cin >> c;
/// Functions End


/// Debug Start
#define deb(x) cout << #x << ": " << x << endl
#define deb2(x, y) cout << #x << ": " << x << '\t' << #y << ": " << y << endl;
#define deb3(x, y, z)                                                          \
    cout << #x << ": " << x << '\t' << #y << ": " << y << '\t' << #z << ": "   \
         << z << endl;
/// Debug End

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

/**>>>>>>>>>>>>>>>>>>> END <<<<<<<<<<<<<<<<<<**/

/// template

#define int long long

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

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

signed main(void) {
    cin.sync_with_stdio(false);
    cin.tie(0);
    Cinii(N,M);
    Cins(S); Cins(T);
    int L = lcd(N,M);
    unordered_map<int,char> m;
    // L[i * L/N + 1] = S[i]
    rep(i,N)m[i*(L/N)+1] = S[i];
    rep(i,M)
        if(m.count(i*(L/M)+1)==0)continue;
        else if(m[i*(L/M)+1]!=T[i]){
            cout << -1 << nn;
            return 0;
        }
    cout << L << nn;
    return 0;
}

Measured memory_bytes: 4260
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
using namespace std;
typedef long long unsigned int ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))


int main() {

  int N;
  cin >> N;
  vector<int> L(N);
  for( int i =0; i<N;i++){
    cin >> L[i];
  }

  sort(L.begin(),L.end());
  int sum=0;
  for( int i =0; i<N-1;i++){
    sum += L[i];
  }
  if(sum> L[N-1]){
    cout <<"Yes"<<endl;
  }else{
    cout <<"No"<<endl;
  }
  
  return 0;
  
   
}


Measured memory_bytes: 256
N = int(input())
A = list(map(int,input().split()))
A.sort()
count = 0

for i in range(N-1,0,-1):
    l = 0
    r = i -1
    while(l< r):
        if (A[l] + A[r] >A[i]):
            count += (r-l)
            r -= 1
        else:
            l += 1
print(count)


Measured memory_bytes: 3188
n = int(input())
city_score = {}
for i in range(n):
    city, score = input().split()
    city_score[city] = city_score.get(city, []) + [(int(score), i)]

for city in sorted(city_score.keys()):
  for score in sorted(city_score[city], reverse=True):
    print(score[1]+1)


Measured memory_bytes: 3060
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    l, r = list(map(int, readline().split()))
    t = 10 ** 20
    for i in range(l, r + 1):
        for j in range(i + 1, r + 1):
            t = min(t, i * j % 2019)
            if t == 0:
                break
        if t == 0:
            break
    print(t)


if __name__ == '__main__':
    solve()


Measured memory_bytes: 38896
#include <stdio.h>

#define MAX 100000

int parent(int i){
  return i/2;
}

int left(int i){
  return 2*i;
}

int right(int i){
  return 2*i+1;
}

int main(){
  int H,i,A[MAX+1];

  scanf("%d",&H);
  for(i=1;i<=H;i++){
    scanf("%d",&A[i]);
  }

  for(i=1;i<=H;i++){
    printf("node %d:",i);
    printf(" key = %d,",A[i]);
    
    if(parent(i)>=1) printf(" parent key = %d,",A[parent(i)]);
    if(left(i)<=H) printf(" left key = %d,",A[left(i)]);
    if(right(i)<=H) printf(" right key = %d,",A[right(i)]);
    printf(" \n");
  }
  return 0;
}



Measured memory_bytes: 2112
def solve():
	h,w,a,b = map(int, input().split())
	mx = max(h,w)
	mod = 10**9+7
	fac = [1]*(h+w+1)
	for i in range(1,h+w+1):
		fac[i]=fac[i-1]*i%mod
	inv = [1]*(mx+1)
	inv[-1] = pow(fac[mx], mod-2, mod)
	for i in range(mx-1, -1, -1):
		inv[i] = inv[i+1]*(i+1)%mod
	const = inv[h-a-1]*inv[a-1]%mod
	ans = sum(fac[h-a+i-1]*inv[i]*fac[a+w-2-i]*inv[w-i-1]%mod for i in range(b,w))
	print(ans*const%mod)

if __name__=="__main__":solve()

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

int main() {
  int n;
  cin >> n;
  vector<int> d(100);
  for(int i = 0; i < n; i++){
    cin >> d.at(i);
  }

  map<int, int> mp;
  for(int i = 0; i < n; i++){
    mp[d.at(i)]++;
  }
  cout << mp.size() << endl;

}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

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

		int N = sc.nextInt();

		for (int i = 0; i < 25; i++) {
			for (int j = 0; j < 15; j++) {
				if (1 <= (4 * i + 7 * j) && (4 * i + 7 * j) <= 100) {
					if (N % (4 * i + 7 * j) == 0) {
						System.out.println("Yes");
						return;
					}
				}
			}
		}

		System.out.println("No");
	}
}

Measured memory_bytes: 23764
#include <stdio.h>
using namespace std;
#define MAX 500000
#define SENTINEL 2000000000

int cnt;

void merge(int A[], int left, int mid, int right)
{
  int n1 = mid - left;
  int n2 = right - mid;
  int L[n1], R[n2];
  for (int i = 0; i < n1; i++)
  {
    L[i] = A[left + i];
  }
  for (int i = 0; i < n2; i++)
  {
    R[i] = A[mid + i];
  }
  L[n1] = SENTINEL;
  R[n2] = SENTINEL;
  int i = 0, j = 0;
  for (int k = left; k < right; k++)
  {
    if (L[i] <= R[j])
    {
      A[k] = L[i];
      i = i + 1;
    }
    else
    {
      A[k] = R[j];
      j = j + 1;
    }
    cnt++;
  }
}

void mergeSort(int A[], int left, int right)
{
  if (left + 1 < right)
  {
    int mid = (left + right) / 2;
    mergeSort(A, left, mid);
    mergeSort(A, mid, right);
    merge(A, left, mid, right);
  }
}

int main()
{
  int n;
  int s[MAX];

  scanf("%d", &n);
  for (int i = 0; i < n; i++)
  {
    scanf("%d", &s[i]);
  }

  mergeSort(s, 0, n);

  for (int i = 0; i < n - 1; i++)
  {
    printf("%d ", s[i]);
  }
  printf("%d\n", s[n - 1]);
  printf("%d\n", cnt);
  return 0;
}


Measured memory_bytes: 6464
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <vector>
#include <queue>
#include <ctime>
 
using namespace std;
 
#define FOR(i,a,b) for (ll i = (a); i < (b); i++)
#define REP(i,n) FOR(i,0,n)
 
long gcd(long a, long b){
	if (a%b==0){
		return b;
	}
	else{
		return gcd(b,a%b);
	}
}
 
long lcm(long a, long b){
	return (a*b) / gcd(a,b);
}
 
template<typename A, typename B> inline bool chmax(A &a, B b) { if (a < b) { a = b; return 1; } return 0; }
template<typename A, typename B> inline bool chmin(A &a, B b) { if (a > b) { a = b; return 1; } return 0; }
 
typedef long long ll;
 
const ll INF = 1ll<<60;
const ll MOD = 1000000007;
const double EPS = 1e-10;

int a,b;

int main(){
	cin >> a >> b;
	
	if (a%2 && b%2) cout << "Odd" << endl;
	else cout << "Even" << endl;
	
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <cmath>
#include <algorithm>
using namespace std;

int main(){
    string s,t,u;
    int a,b;
    cin>>s;
    cin>>t;
    cin>>a>>b;
    cin>>u;
    if(s==u){
        cout<<a-1<<" "<<b;
    }else{
        cout<<a<<" "<<b-1;
    }
}


Measured memory_bytes: 256