akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define pii pair<int, int>
#define pli pair<ll, int>
#define pil pair<int, ll>
#define pll pair<ll, ll>
#define eb emplace_back
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep3(i, l, n) for (int i = l; i < (n); ++i)
#define sz(v) (int)v.size()
#define endl '\n'
const int inf = 1000000007;
const ll INF = 1e18;
// int mod = 998244353;
int mod = 1000000007;
const double eps = 1e-8;
#define abs(x) (x >= 0 ? x : -(x))
#define lb(v, x) (int)(lower_bound(all(v), x) - v.begin())
#define ub(v, x) (int)(upper_bound(all(v), x) - v.begin())
template<typename T1, typename T2> inline bool chmin(T1 &a, T2 b) { if (a > b) { a = b; return 1; } return 0; }
template<typename T1, typename T2> inline bool chmax(T1 &a, T2 b) { if (a < b) { a = b; return 1; } return 0; }
ll gcd(ll a, ll b) { if (b == 0) return a; return gcd(b, a % b); }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
template<typename T, typename U> T pow_(T a, U b) { return b ? pow_(a * a, b / 2) * (b % 2 ? a : 1) : 1; }
ll modpow(ll a, ll b, ll _mod) { return b ? modpow(a * a % _mod, b / 2, _mod) * (b % 2 ? a : 1) % _mod : 1; }
template<class T, class U> ostream& operator << (ostream& os, const pair<T, U>& p) { os << p.F << " " << p.S; return os; }
template<class T> ostream& operator << (ostream& os, const vector<T>& vec) { rep(i, sz(vec)) { if (i) os << " "; os << vec[i]; } return os; }
template<class T> ostream& operator << (ostream& os, const set<T>& s) { for (auto si : s) os << si << " "; return os; }
template<typename T> inline istream& operator >> (istream& is, vector<T>& v) { rep(j, sz(v)) is >> v[j]; return is; }
template<class T, class T2> inline void add(T &a, T2 b) { (a += (b % mod + mod)) %= mod; }
template<class T> void operator += (vector<T>& v, vector<T> v2) { rep(i, sz(v2)) v.eb(v2[i]); }

void solve();

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cout << fixed << setprecision(12);
    int T;
    T = 1;
    while (T--) solve();
}

void solve() {
    string s, t;
    cin >> s >> t;
    
    int ans = inf;
    rep(i, sz(s)) {
        int cnt = 0;
        rep(j, sz(t)) {
            if (i + j >= sz(s)) break;
            if (s[i + j] != t[j]) ++cnt;
            if (j == sz(t) - 1) chmin(ans, cnt);
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 3660
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 1000000000000000000LL
#define MOD 1000000007
#define writeln(n) cout<<n<<endl;
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;
//vector<tuple<long long, long long, long long>>vec;

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

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


int main()
{ 
    int h,w;
    cin>>h>>w;
    for (int i = 0; i < w + 2; i++)
    {
        cout << "#";
    }
    cout << "\n";
    for (int i = 0; i < h; i++)
    {
        cout << "#";
        string s;
        cin >> s;
        cout << s;
        cout << "#" << "\n";
    }

    for (int i = 0; i < w + 2; i++)
    {
        cout << "#";
    }
    cout << "\n";
}

Measured memory_bytes: 256
N = int(input())
A = list(map(int, input().split()))
ans = 0
for i in range(N):
  #x = bin(A[i])[2:]
  if i == 0:
    ans = A[i]
  else:
    ans = ans ^ A[i]
    
for i in range(N):
  print(ans ^ A[i], end = " ")





Measured memory_bytes: 105532
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> pp;
typedef tree<pp,null_type,less<pp>,rb_tree_tag,tree_order_statistics_node_update> super_set;

#define x1 dfds
#define y1 dsfdsfe
#define pb push_back
#define forn(i,n) for(ll i = 1;i<=n;++i)
#define fi first
#define sc second
#define endl '\n'
#define po(x) (1ll<<x)
#define log sdfdsfdsf

const ll DIM = 1E5+7;
const ll MOD = 1e9+7;
const ll M1 = 1e9+7;
const ll INF = 1E17;
const ld eps = 0.00000000000001;
const ld PI = 3.14159265358979323846;
int getInt(int a = 0, int b = INT_MAX){
	static mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
	return uniform_int_distribution <int> (a, b)(rng);
}

ll gi(char ch){
    return ch-'0';
}
int main(){
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);


    string s;
    cin>>s;
    ll res = 0;
    for(char to:s){
        res = (res+gi(to));
    }
    res%=9;
    if (!res)cout<<"Yes\n";
    else cout<<"No\n";


    return 0;
}


Measured memory_bytes: 3784
#include <bits/stdc++.h>
using namespace std;
int main()
{
  int N;
  cin >> N;
  int count= 0;
  
  vector<int> p(N);
  for (int i=0 ;i <N ;i++) {
    cin >> p[i];
    if (p[i] != i+1) {
      count++;
    }
  } 
    if (count == 0 || count == 2) {
        cout << "YES";
      }
      else {
        cout << "NO";
     }
  
    
    
  
  
  
}


Measured memory_bytes: 256
# coding: utf-8
# Your code here!
N, M = map(int, input().split())
A = list(map(int, input().split()))
s = sum(A)
judge = s / (4*M)
count =0

for i in range(N):
    if A[i] >= judge:
        count += 1
    else:
        continue

if count >= M:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, a, b) for (int i = a; i < (int)b; i++)
#define all(v) v.begin(), v.end()
const int MOD = 1e9 + 7;
const int INF = 1e9;
//'A' = 65, 'Z' = 90, 'a' = 97, 'z' = 122

int main() {
    int n, k;
    cin >> n >> k;
    double p[n];
    rep(i, 0, n) {
        cin >> p[i];
        p[i] = (1 + p[i]) / 2;
    }
    double sum[n + 1] = {};
    rep(i, 0, n) {
        sum[i + 1] = sum[i] + p[i];
    }
    double ans = 0;
    rep(i, 0, n - k + 1) {
        ans = max(ans, sum[i + k] - sum[i]);
    }
    cout << fixed << setprecision(10);
    cout << ans << endl;
    return 0;
}


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

int main(){
  int n;

  while (cin >> n) {
    int cnt = 0;
    for (int i = 0; i <= 9; i++) {
      for (int j = 0; j <= 9; j++) {
        for (int k = 0; k <= 9; k++) {
          for (int l = 0; l <= 9; l++) {
            if (i + j + k + l == n) {
              cnt++;
            }
          }
        }
      }
    }
    cout << cnt << endl;
  }
}



Measured memory_bytes: 3072
#!/usr/bin/python3
# -*- coding: utf-8 -*-
n = int(input())
n = n - 1
mozi_list = []
while True:
    k = n % 26
    n = n // 26 - 1
    chr_s = chr(97 + k)
    mozi_list.append(chr_s)
    if n == -1:
        break
for i in range(len(mozi_list)):
    print(mozi_list[len(mozi_list)-i-1], end="")

Measured memory_bytes: 9048
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <vector>
#include <string>
#include <queue>
#include <deque>
#include <list>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <bitset>
#include <random>
#include <complex>
#include <assert.h>

using namespace std;
typedef long long ll;
#define endl '\n'

template<typename T>
inline bool chmin(T& x, T a) {
	if (x >= a) { x = a; return true; }
	return false;
}

template<typename T>
inline bool chmax(T& x, T a) {
	if (x <= a) { x = a; return true; }
	return false;
}

ll gcd(ll a, ll b) {// 最大公約数
	a = abs(a);
	b = abs(b);
	if (a == 0) { return b; }
	if (b == 0) { return a; }

	ll c;
	if (a < b) { c = a; a = b; b = c; }
	while (1) {
		a %= b;
		if (a == 0) { return b; }
		c = a; a = b; b = c;
	}
}

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

	ll X; cin >> X;

	ll g = gcd(360, X);

	cout << 360 / g << endl;

	return 0;
}

Measured memory_bytes: 3180
#include <bits/stdc++.h>
#define ll long long
#define MODV 1000000007
#define INF INT_MAX // 2147483647
#define INFLL LLONG_MAX // 9223372036854775807
#define rep(i, n) for(ll i=0, i##_len=(ll)(n); i<i##_len; i++)
#define repf(i, n) for(ll i=1, i##_len=(ll)(n+1); i<i##_len; i++)
#define per(i, n) for(ll i=((ll)(n))-1; i>=0; i--)
#define perf(i, n) for(ll i=((ll)(n)); i>0; i--)
#define all(v) v.begin(), v.end()
#define endl "\n"
#define vi vector<ll>
#define vvi vector<vector<ll>>
#define Yes() cout << "Yes" << endl
#define YES() cout << "YES" << endl
#define No() cout << "No" << endl
#define NO() cout << "NO" << endl
#define Init() std::ios::sync_with_stdio(false); std::cin.tie(0); std::cout<<fixed<<setprecision(0);
template<class T>bool chmax(T &a, const T &b){ if(a<b){ a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b){ if(b<a){ a=b; return 1; } return 0; }
using namespace std;

int main(){
    Init();
    ll a; cin >> a;
    double b; cin >> b;
    cout << (a*(ll)(b*100+0.5))/100 << endl;
}

Measured memory_bytes: 3740
#include <bits/stdc++.h>
 
#ifdef __LOCAL
#define DBG(X) cout << #X << "=" << (X) << endl;
#else
#define DBG(X)
#endif
 
using namespace std;

using ll = long long int;
using ull = unsigned long long int;
using ld  = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

const int INT_INF = (int)(2e9);
const ll  LL_INF  = (ll)(2e18);

const ll mod = 998244353LL;
static mt19937 _g(time(nullptr));

inline ll randint(ll a, ll b) { ll w = (_g() << 31LL) ^ _g(); return a + w % (b - a + 1); }
inline void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); };
template<typename T> inline T sign(T x) { return T(x > 0) - T(x < 0); }
template<typename T> inline ostream& operator<<(ostream& os, const vector<T>& v) { for(auto el: v) cout << el << " "; return os; }

ll binpow(ll x, int y)
{
	if(y == 0)
		return 1;

	ll ret = binpow(x, y >> 1);
	ret = (ret * ret) % mod;

	if(y & 1)
		ret = (ret * x) % mod;

	return ret;
}

inline ll inv(ll x)
{
	return binpow(x, mod - 2);
}

const int MAX_N = 307;
ll dp[MAX_N * MAX_N], dp2[MAX_N * MAX_N], old_dp[MAX_N * MAX_N], old_dp2[MAX_N * MAX_N]; // sm, sz
int arr[MAX_N];
int n;

void solve()
{
	cin >> n;
	int fsum = 0;

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

	dp[0] = 1;
	dp2[0] = 1;

	for(int i = 0; i < n; ++i)
	{
		memcpy(old_dp, dp, sizeof(dp));
		memcpy(old_dp2, dp2, sizeof(dp));
		memset(dp, 0, sizeof(dp));
		memset(dp2, 0, sizeof(dp2));

		for(int sm = 0; sm < MAX_N * MAX_N; ++sm)
		{
			dp[sm] = old_dp[sm];
			dp2[sm] = old_dp2[sm];
			dp2[sm] = (2 * dp2[sm]) % mod;

			if(sm - arr[i] >= 0)
			{
				dp[sm] = (dp[sm] + old_dp[sm - arr[i]]) % mod;
				dp2[sm] = (dp2[sm] + old_dp2[sm - arr[i]]) % mod;
			}
		}

	}

	ll answ = binpow(3, n);
	ll cnt = 0;

	for(int sm = 1; sm < MAX_N * MAX_N; ++sm)
	{
		if(2 * sm >= fsum && dp[sm] > 0)
		{
			ll dlt = (3 * dp2[sm]) % mod;
			answ = (mod + answ - dlt) % mod;

			cnt = (cnt + (2 * sm == fsum) * dp[sm]) % mod;
		}
	}

	answ = (answ + (6 * (cnt * inv(2))) % mod) % mod;

	cout << answ << endl;
}

int main()
{
	fast_io();
	solve();

	return 0;
}


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

const int N = 100010;

int n, m;
vector<int> G[N];
bool vis[N];
int d[N];
vector < pair<int,int> > e;

void dfs(int u) {
	vis[u] = 1;
	for (int v : G[u]) if (!vis[v]) {
		d[v] = d[u] + 1;
		dfs(v);
	}
}

int main() {
	ios_base::sync_with_stdio(false); cin.tie(0);
	cin >> n >> m;
	while(m--) {
		int u, v; cin >> u >> v; e.push_back(make_pair(u, v));
		G[u].push_back(v);
		G[v].push_back(u);
	}
	dfs(1);

	int k[2] = {0, 0};
	for (int i = 1; i <= n; ++i) k[d[i] % 2]++;
	long long ans = 1LL * k[0] * k[1];

	for (auto &edge : e) {
		if (d[edge.first] % 2 != d[edge.second] % 2) --ans;
	}

	for (auto &edge : e) {
		if (d[edge.first] % 2 == d[edge.second] % 2) {
			ans += 1LL * k[0] * (k[0] - 1) / 2;
			ans += 1LL * k[1] * (k[1] - 1) / 2;
			for (auto p : e) {
				if (d[p.first] % 2 == d[p.second] % 2) --ans;
			}
			break;
		}
	}

	cout << ans << endl;
}

Measured memory_bytes: 7416
#include <iostream>
#include <vector>
#include <cstdlib>
#include <algorithm>
#define ll long long
#define ull unsigned long long
using namespace std;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    ll n, W;
    cin >> n >> W;
    vector<vector<ll>> dp(n, vector<ll>(W + 1));
    ll weight, value;
    cin >> weight >> value;
    fill(dp[0].begin() + weight, dp[0].end(), value);
    for (ll items = 1; items < n; items++){
        cin >> weight >> value;
        for (ll i = 0; i <= W; i++){
            if (i >= weight) dp[items][i] = max(dp[items - 1][i - weight] + value, dp[items - 1][i]);
            else dp[items][i] = dp[items - 1][i];
        }
    }
    cout << dp.back().back();
    return 0;
}

Measured memory_bytes: 79488
#include <iostream>
#include <cmath>
#include <string>
#include <numeric>
#include <algorithm>
#include <iomanip>
#include <queue>
#include <limits>
using namespace std;
#define MOD 1000000007
#define INF 1000000009
#define ll long long
#define rep(i_, start, end) for(ll i_=(ll)start; i_<(ll)end; i_++)
#define print(a) cout << a << endl;
#define printarray(a, len) rep(ii,0,len) cout << a[ii] << " ";
#define printarray2(aa, len) rep(ij,0,len) printarray(aa[ij], aa[ij].size()); print("");
 
int main()
{
  ll a, b, k;
  cin >>a>>b>>k;
  if ( a < k ){
    k -= a;
    a = 0;
    if ( b < k ){
      b = 0;
    }else{
      b -= k;
    }
  }else{
    a -= k;
  }
  cout << a << " " << b;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define INF 2000000000
typedef long long int ll;
typedef pair<ll,ll> ii;
typedef vector<ll> vi;
typedef vector<ii> vii;
#define getbit(n,i) (((n)&(1<<(i)))!=0)
#define setbit0(n,i) ((n)&(~(1<<(i))))
#define setbit1(n,i) ((n)(1<<(i)))
#define togglebit(n,i) ((n)^(1<<(i)))
#define lastone(n) ((n)&(-(n)))
#define read freopen("debug\\in.txt","r",stdin)
#define write freopen("debug\\out.txt","w",stdout)
#define fi first
#define se second
#define getI(a) scanf("%d",&a)
#define getII(a,b) scanf("d",&a,&b)
#define PI (acos(-1))
#define fastread ios_base::sync_with_stdio(false);cin.tie(NULL)
#define mod (1000000007)
#define asz 500005

ll BIGMOD ( ll a, ll p, ll m )
{
    ll result = 1;
    ll x = a;

    while ( p )
    {
        if ( p & 1 ) //p is odd
        {
            result = ( result * x ) % m;
        }
        x = ( x * x ) % m;
        p = p >> 1;
    }

    return result;
}

int main()
{
  // fastread;
  int a,b;
  cin>>a>>b;
  if((b+b)>a) cout<<0<<endl;
  else cout<<(a-(b+b))<<endl;

  return 0;
}


Measured memory_bytes: 256
import sys
N,K = map(int, input().split())

if N <= K:
    ans = abs(N-K)
    lis = []

    for i in range(3):
        ans = abs(ans - K)
        lis.append(ans)
    
    print(min(lis))
    sys.exit()

if N % K != 0:
    print(abs(N-(((N//K) + 1)*K)))
if N % K == 0:
    print(abs(N-((N//K)*K)))

Measured memory_bytes: 3064
#!/usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#A
def A():
    n, a = IR(2)
    n %= 500
    if a >= n:
        print("Yes")
    else:
        print("No")
    return

#B
def B():
    n = II()
    a = LI()
    a.sort(reverse=True)
    op = 0
    ans = 0
    for ai in a:
        ans += -ai * op or ai
        op ^= 1
    print(ans)
    return

#C
def C():
    return

#D
def D():
    return

#Solve
if __name__ == '__main__':
    B()


Measured memory_bytes: 38512
#define _USE_MATH_DEFINES

#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>

using namespace std;

typedef pair<long long int, long long int> P;
long long int INF = 1e18;

int main(){
	
	int A, B;
	cin >> A >> B;
	
	if(A <= 8 && B <= 8){
		cout << "Yay!" << endl;
	}else{
		cout << ":(" << endl;
	}
	
	return 0;
}

Measured memory_bytes: 256
import sys
x,y,nums = map(int,input().split())
points = [0] *nums
x1,y1 = 0,0
x2,y2 = x,y

for i in range (nums):
    points[i] = list(map(int,input().split()))

for i in range (nums):

    if points[i][2] == 1:
        if x1 < points[i][0]:
            x1 = points[i][0]

    elif points[i][2] == 2:
        if x2 > points[i][0]:
            x2 = points[i][0]

    elif points[i][2] == 3:
        if y1 < points[i][1]:
            y1 = points[i][1]

    elif points[i][2] == 4:
        if y2 > points[i][1]:
            y2 = points[i][1]

if  (x1 + (x - x2)) >= x or (y1 + (y - y2)) >= y:
    print(0)
    sys.exit()

result = (x - (x1 + ( x - x2))) * (y -(y1 + (y - y2)))
print(result)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define rep(i,n)for(long long i=0;i<(n);i++)
using namespace std;
typedef long long ll;
const int MOD=1e9+7;
const int MAX = 1000000;
const int INF = 1e9;
const double pi=acos(-1);

int main(){
  string s;
  cin >> s;
  if(s.size()%2!=0){
    cout <<"No"<<endl;
    return 0;
  }
  bool ok=true;
  rep(i,s.size()){
    if(i%2==0 && s[i]!='h')ok=false;
    if(i%2==1 && s[i]!='i')ok=false;
  }
  if(ok)cout << "Yes"<<endl;
  else cout<<"No"<<endl;
  return 0;
}


Measured memory_bytes: 256
n = gets(chomp:true).to_i
x = gets.split.map(&:to_i)
y = gets.split.map(&:to_i)
d, p1, p2, p3, p4 = 0.0, 0.0, 0.0, 0.0, 0.0

n.times do |n_n|
  d = (x[n_n] - y[n_n]).abs
  p1 += d
  p2 += d * d
  p3 += d * d * d
  p4 = d if d > p4
end

puts p1.round(6)
puts Math.sqrt(p2).round(6)
puts (p3 ** (1/3r)).round(6)
puts p4.round(6)


Measured memory_bytes: 6952
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    
    int p, q, r;
    cin >> p >> q >> r;

    int ans = 1000;
    ans = min(p+q, ans);
    ans = min(q+r, ans);
    ans = min(r+p, ans);

    cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;

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

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

	if (n == 1){
		cout << "Hello World" << endl;
		return 0;
	}

	int a, b;
	cin >> a >> b;

	cout << a + b << endl;
}


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

int main() {
	long long int N, P, count = 1;
	cin >> N >> P;
	if (N == 1) {
		cout << P;
	}
	else {
		long long int Fac[100000] = {}, p = P;
		for (int i = 2; i < 100000 && i <= p; i++) {
			if (p % i == 0) {
				Fac[i]++;
				p /= i;
				i = 1;
			}
		}
		for (int i = 2; i < 100000 && i <= P; i++) {
			count *= pow(i, Fac[i] / N);
		}
		cout << count;
	}
}

Measured memory_bytes: 1152
#include <stdio.h>
#include <cctype>
#include <limits.h>
#include <math.h>
#include <complex>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <cstring>
#include <string>
#include <sstream>
#include <algorithm>
#include <iomanip>
#include <iostream>

#define VARIABLE(x) cerr << #x << "=" << x << endl
#define BINARY(x) static_cast<bitset<16> >(x);
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define REP(i,m,n) for (int i=m;i<(int)(n);i++)
#define if_range(x, y, w, h) if (0<=(int)(x) && (int)(x)<(int)(w) && 0<=(int)(y) && (int)(y)<(int)(h))

const int INF = 1000000000;
const double EPS = 1e-8;
const double PI = 3.14159;
int dx[4]={0, 1, 0, -1}, dy[4]={-1, 0, 1, 0};
using namespace std;
typedef pair<int, int> P;

/** Problem2102 : Rummy **/

int main()
{
	int N; cin>>N;
	vector<P> card(9);

	rep(z, N) {
		rep(i, 9) cin>>card[i].first;
		rep(i, 9) {
			char a; cin>>a;
			if (a=='R') card[i].second=0;
			if (a=='G') card[i].second=1;
			if (a=='B') card[i].second=2;
		}
		
		bool ok=false;
		sort(card.begin(), card.end());
		do {
			bool tmp=true;
			rep(i, 3) {
				if (card[i*3].second == card[i*3+1].second && card[i*3+1].second == card[i*3+2].second) {
					if ((card[i*3].first == card[i*3+1].first && card[i*3+1].first == card[i*3+2].first) ||
						(card[i*3].first+1 == card[i*3+1].first && card[i*3+1].first+1 == card[i*3+2].first))
						;
					else
						tmp=false;
				} else tmp=false;
			}
			if (tmp) ok=true;
		} while (next_permutation(card.begin(), card.end()));
		
		cout << ok << endl;
	}
}

Measured memory_bytes: 1196
fun main(args: Array<String>) {
    val (n,r) = readIntegerList()
    if (n >= 10) {
        println(r)
    } else {
        val ans = r + 100 * (10 - n)
        println(ans)
    }
}

fun readInteger() = readLine()!!.toInt()
fun readLong() = readLine()!!.toLong()
fun readStringList() = readLine()!!.split(" ")
fun readIntegerList() = readStringList().map(String::toInt)
fun readLongList() = readStringList().map(String::toLong)


Measured memory_bytes: 35980
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define rep(i,n) for (int i=0; i<(n); ++i)
using namespace std;
typedef long long ll;
const int INF = 1001001001;

int main() {
    int X, N, mn=10000, tmp;
    auto ans = 1000;

    cin >> X >> N;

    if(N==0) {
        ans = X;
    } else {
        vector<int> p(N);
        set<int> a;
        for(int i=-100; i<=150; i++) {
            a.insert(i);
        }
        rep(i, N) {
            cin >> p[i];
            a.erase(p[i]);
        }
        for(auto itr = a.begin(); itr != a.end(); ++itr) {
            tmp = abs(*itr-X);
            if(tmp<mn) {
                mn = tmp;
                ans = *itr;
            }
        }
    }

    cout << ans << endl;

    return 0;
    
}

Measured memory_bytes: 3632
#include<cstdio>
#include<cstring>
#include<vector>
using namespace std;

const int maxn=100;
int n,m,dfs_clock=0;
vector<int> G[maxn];
int dfn[maxn],low[maxn];
int ans;

void tarjan(int u,int fa){
	dfn[u]=low[u]=++dfs_clock;
	for(int i=0;i<G[u].size();i++){
		int v=G[u][i];
		if(v==fa)	continue;
		if(dfn[v]==0){
			tarjan(v,u);
			low[u]=min(low[u],low[v]);
			if(low[v]>dfn[u])	ans++;
		}
		else	low[u]=min(low[u],dfn[v]);
	}
}

int main(){
	while(scanf("%d%d",&n,&m)==2){
		memset(dfn,0,sizeof(dfn));
		memset(low,0,sizeof(low));
		dfs_clock=0;
		for(int i=1;i<=n;i++)	G[i].clear();
		for(int i=0;i<m;i++){
			int u,v;	scanf("%d%d",&u,&v);
			G[u].push_back(v);
			G[v].push_back(u);
		}
		ans=0;
		tarjan(1,-1);
		printf("%d\n",ans);
	}
	return 0;
}


Measured memory_bytes: 256
using System;
class Program
{
    static void Main(string[] args)
    {
        int K = int.Parse(Console.ReadLine());
        string S = Console.ReadLine();
        if (S.Length > K)
        {
            S = S.Substring(0,K) + "...";
        }
            Console.WriteLine(S);
    }
}


Measured memory_bytes: 17536
#include<stdio.h>
int main(void)
{
	int A,B,sum1,sum2,sum3,max;
	scanf("%d",&A);
	scanf("%d",&B);
	
	sum1=A+B;
	sum2=A-B;
	sum3=A*B;
	
	max=sum1;
	if(max<sum2)
		max=sum2;
	if(max<sum3)
		max=sum3;
	
	printf("%d",max);
	
	return 0;
}


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

int main() {
  int a,b,A,B;
  cin >> a >> b >> A >> B;
  if((a+B-1)/B>=(A+b-1)/b){
    cout << "Yes" << endl;  
  }
  else{
    cout << "No" << endl;  
  }
}

Measured memory_bytes: 3624
using System;
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Linq;
using System.Collections.Generic;

class Program
{
    const string Yes = "Yes";
    const string No = "No";
    const long Mod = 1000000007;
    static void Main(string[] args) {
#if DEBUG
        MyDebugger.Test(process, "../TextFile1.txt");
        //MyDebugger.Test(process, "../TextFile2.txt");
        //MyDebugger.MakeTestCase("../TextFile2.txt");
#else
        object ret = process(new StreamReader(Console.OpenStandardInput()));
        Console.WriteLine(ret);
#endif
    }

    static int[] days;

    static object process(TextReader input) {
        var s = input.ReadLine().Trim();

        if (s[0] == '7') return Yes;
        if (s[1] == '7') return Yes;
        if (s[2] == '7') return Yes;
        return No;
    }
}


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

const ll MOD = 1e9+7;

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

  sort( A , A + N);

  if(N%2){
    for (int i = 0; i < N; i++){
      if (A[i] != (i+1)/2 * 2 ){
        cout << 0 << endl;
        return 0;
      }
    }
  }
  else{
    for (int i = 0; i < N;i++){
      if (A[i] != i/2 * 2 + 1) {
        cout << 0 << endl;
        return 0;
    }
  }
}

ll ans = 1;
for (int i=0; i<N/2; i++) {
  ans *= 2;
  ans %= MOD;
}
cout << ans << endl;
return 0;


}


Measured memory_bytes: 640
#include<stdio.h>

int main(void){
  long long int n;
  long long int a;
  long long int b;
  long long int c;
  long long int d;
  long long int e;
  scanf("%lld", &n);
  scanf("%lld", &a);
  scanf("%lld", &b);
  scanf("%lld", &c);
  scanf("%lld", &d);
  scanf("%lld", &e);
  long long int min = a;
  if(b<min){
    min = b;
  }
  if(c<min){
    min = c;
  }
  if(d<min){
    min = d;
  }
  if(e<min){
    min = e;
  }
  long long int ans = 0;
  if(n%min==0){
    ans = n/min + 4;
  }
  if(n%min!=0){
    ans = n/min + 1 + 4;
  }
  printf("%lld", ans);
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
int main () {
    int N, K;
    cin >> N >> K;
    int ans = 0;
    for (int i = 1; i <= N; i++) {
        int x;
        cin >> x;
        ans += min(abs(x), abs(x-K))*2;
    }
    cout << ans << endl;
}

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

string getWinner(vector<int> pickOptions,int stones) {
	vector<vector<bool>> dp(stones+1,vector<bool>(2,false));
	for(int i=1;i<=stones;i++) {
		for(int stone:pickOptions) {
			if(i-stone>=0) {
				if(dp[i-stone][0]==false) {
					dp[i][0]=true;
					dp[i][1]=false;
					break;
				}
			}
		}
		if(dp[i][0]==false) {
			dp[i][1]=true;
		}
	}
	/*
	for(vector<int> row:dp) {
		for(int val:row) {
			cout<<val<<" ";
		}
		cout<<endl;
	}
	*/
	if(dp[stones][0]!=false)return "First";
	else return "Second";
}

int main() {
	int setSize=0,stones=0;
	cin>>setSize>>stones;
	vector<int> pickOptions(setSize,0);
	for(int i=0;i<setSize;i++)cin>>pickOptions[i];
	cout<<getWinner(pickOptions,stones)<<endl;
	return 0;
}

Measured memory_bytes: 10392
/*
  AUTHOR:SOURABH
  CREATED:01:05:20
*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define ordered_set tree<pll , null_type, less< pll >, rb_tree_tag, tree_order_statistics_node_update>
#define ll long long int
#define ld long double
#define fi first
#define se second
#define pb push_back
#define pob pop_back
#define W while
#define fn(i,x) for(i=0;i<x;i++)
#define fs(i,s,x) for(i=s;i<x;i++)
#define fr(i,x) for(i=x;i>=0;i--)
#define fit(it,s) for(it=s.begin();it!=s.end();it++)
#define mp make_pair
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vii vector<int>
#define vll vector<ll>
#define mii map<int,int>
#define mll map<ll,ll>
#define mod 1000000007
#define MAX 100005
#define M 32

using namespace std;
using namespace __gnu_pbds;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    //freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);

    ll t,i,x,j;
    //string s;
    t=1;
    //cin>>t;
    W(t--)
    {
        cin>>x;
        for(i=-1000;i<=1000;i++)
        {
            for(j=-1000;j<=1000;j++)
            {
                if(i*i*i*i*i-j*j*j*j*j==x)
                {cout<<i<<" "<<j;return 0;}
            }
        }
    }
    return 0;
}





















Measured memory_bytes: 3652
#include <stdio.h>
#include <math.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

int main(){
	long long int n, k, i, j, p, q, ans=0;
	scanf("%lld%lld", &n, &k);
	// k=0
	if(k==0){
		printf("%lld\n", n*n);
	}
	else{
		// k>0
		// a<b
		for(i=n; i>k; i--){
			ans+=i-k;
		}
		// printf("%lld\n", ans);
		// a>b
		for(i=n-k; i>k; i--){
			p=n%i;
			q=n/i;
			if(p>=k && q==0){
				ans+=p-k+1;
			}
			else if(p>=k){
				ans+=(i-k)*(q-1)+p-k+1;
			}
			else{
				ans+=(i-k)*(q-1);
			}
		}
		printf("%lld\n", ans);
	}
	return 0;
}

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

int main() {
    int n;
    cin >> n;
    int a[n];
    stack<int> s;
    long long result = 0, count[n];
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        while (!s.empty() && a[s.top()] > a[i]) {
            s.pop();
        }
        if (s.empty()) {
            count[i] = i + 1;
        } else {
            count[i] = i - s.top();
        }
        s.emplace(i);
    }
    while (!s.empty()) {
        s.pop();
    }
    for (int i = n - 1; i >= 0; i--) {
        while (!s.empty() && a[s.top()] > a[i]) {
            s.pop();
        }
        if (s.empty()) {
            count[i] = (n - i) * count[i];
        } else {
            count[i] = (s.top() - i) * (count[i]);
        }
        result += a[i] * count[i];
        s.emplace(i);
    }
    cout << result;
    return 0;
}

Measured memory_bytes: 3456
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
printV = lambda x: print(*x, sep="\n")
printH = lambda x: print(" ".join(map(str,x)))
def IS(): return sys.stdin.readline()[:-1]
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LII(rows_number): return [II() for _ in range(rows_number)]
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]

def main():
	n = II()
	x = LI()
	ans = 10**9
	for i in range(max(x)+1):
		tot=0
		for j in range(n):
			tot += (x[j]-i)**2
		ans = min(ans, tot)
	print(ans)

if __name__ == '__main__':
	main()

Measured memory_bytes: 3064
#include <iostream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <cmath>
#include <limits>
#include <climits>
#include <utility>
#include <algorithm>
#include <numeric>

using namespace std;

using ll = long long;
using ull = unsigned long long;

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

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

    int ans = 1e+9;

    for (int i = 1; i <= 100; ++i) {
        int sum = 0;

        for (int j = 0; j < N; ++j) {
            sum += (x[j] - i) * (x[j] - i);
        }

        ans = min(ans, sum);
    }

    cout << ans << endl;

    return 0;
}


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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> PII;
typedef pair<ll , ll> PLL;
typedef long double ld;

#define pb push_back
#define all(c) c.begin(),c.end()
#define allr(c) c.rbegin(),c.rend()
#define mod 1000000007
#define PI 3.14159265
#define endl '\n'
#define MAX

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    ll a, b, c;
    cin >> a >> b >> c;
    ll ans = 0;
    if (c) ans = 1, c -= 1;
    ans += min(c, b) * 2;
    ll tb = b;
    b -= min(b, c);
    c -= min(tb, c);
    ans += min(c, a);
    ans += b;
    cout << ans << endl;

    return 0;
}


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

int main(){
    int n;
    string operation;
    int sum;
    int current_num;
    while(cin >> n){
        if(n==0)return 0;
        sum = 1;
        current_num = 1;
        int deme[] = {2,5,4,3};
        for(int i = 0; i < n; i++){
           cin >> operation;
           if (operation == "North"){
                int d = deme[0];
                sum += deme[0];
                deme[0] = 7 - current_num;
                deme[1] = current_num;
                current_num = d;
           }
           else if (operation == "South"){

                int d  = deme[1];
                sum += deme[1];
                deme[0] = current_num;
                deme[1] = 7 - current_num;
                current_num = d;
           }
           else if (operation == "East"){
                int d = deme[2];
                sum += deme[2];
                deme[2] = 7 - current_num;
                deme[3] = current_num;
                current_num = d;
           }
           else if (operation == "West"){
                int d = deme[3];
                sum += deme[3];
                deme[2] = current_num;
                deme[3] = 7 - current_num;
                current_num = d;
           }
           else if (operation == "Right"){
                int swap_n = deme[0];
                int swap_s = deme[1];
                deme[0] = deme[3];
                deme[1] = deme[2];
                deme[2] = swap_n;
                deme[3] = swap_s;
                sum += current_num;
           }
           else if (operation == "Left"){
                int swap_n = deme[0];
                int swap_s = deme[1];
                deme[0] = deme[2];
                deme[1] = deme[3];
                deme[2] = swap_s;
                deme[3] = swap_n;
                sum += current_num;
            }
        }
        cout << sum << endl;
    }
    return 0;
}

Measured memory_bytes: 1208
#include<stdio.h>
int main()
{
    int a[10000],b[10000],i=0,n=0;
    while(1)
    {
        scanf("%d %d",&a[i],&b[i]);
        if(a[i]==0 && b[i]==0){
            break;
        }
        i++;
        n++;
    }
    for(i=0;i<n;i++){
        if(a[i]>b[i]){
             printf("%d %d\n",b[i],a[i]);
        }
    else{
            printf("%d %d\n",a[i],b[i]);
        }
    }
    return 0;
}



Measured memory_bytes: 1956
N = int(input())
X = [int(x) for x in input().split()]
sum = 0
X.insert(0,0)
X.append(0)

for n in range(N+1):
    sum += abs(X[n] - X[n+1])


for n in range(N):
    l = abs(X[n] - X[n+1])
    r = abs(X[n+1] - X[n+2])

    if X[n] < X[n+1] and X[n+1] < X[n+2]:
        print(sum)
    elif X[n] > X[n+1] and X[n+1] > X[n+2]:
        print(sum)

    elif l < r:
        sep = 2*abs(X[n] - X[n+1])
        print(sum - sep)
    else:
        sep = 2*abs(X[n+2] - X[n+1])
        print(sum - sep)




Measured memory_bytes: 14172
#include <bits/stdc++.h>
#include <math.h>
#define REP(i, n) for(int i = 0; i < (n); i++)
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1001001001;
const int mINF = -1001001001;


int main() {
  string s;
  int sum;
  while(getline(cin,s)&&s!="0") {
    sum=0;
    for(char x:s) {
      sum += x - '0';
    }
    cout << sum << endl;
  }
  
  return 0;
}



Measured memory_bytes: 3180
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<n; ++i)
using namespace std;
using ll = int64_t;
using vi = vector<int>;
using vvi = vector<vi>;

vi color;

void dfs(int v, vector<vector<pair<int, int> > > &edge, int x) {
    if(color[v] != -1) {
        return;
    }
    color[v] = x%2;
    for(auto next:edge[v]){
        if(next.second){
            dfs(next.first, edge, 1+x);
        } else {
            dfs(next.first, edge, x);
        }
    }
    return;
}


int main() {
    int N, M;
    cin >> N;
    M = N-1;
    vector<vector<pair<int, int> > > edge(N,vector<pair<int, int> >());
    rep(i, M) {
        int u, v, w;
        cin >> u >> v >> w;
        edge[u-1].push_back(make_pair(v-1, w%2));
        edge[v-1].push_back(make_pair(u-1, w%2));
    }
    color.assign(N, -1);
    dfs(0, edge, 0);
    rep(i, N) {
        cout << color[i] << '\n';
    }
}

Measured memory_bytes: 8192
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <queue>
#include <tuple>
#include <cstring>
#include <cctype>
#include <ctype.h>
#include <ios>
#include <iomanip>

#define INF 200000000
#define MOD 1000000007

using namespace std;

int main()
{
    int n;
    cin >> n;
    int h[n];
    int ans = 0;
    int maxh = -1;
    for (int i = 0; i < n; i++)
    {
        cin >> h[i];

        if (maxh <= h[i])
        {
            maxh = max(h[i], maxh);
            ans++;
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#![allow(non_snake_case)]

use std::str::FromStr;

fn main() {
    {
        let mut buf = String::new();
        std::io::stdin().read_line(&mut buf).unwrap();
    }
    {
        let mut buf = String::new();
        std::io::stdin().read_line(&mut buf).unwrap();
        let iter = buf.split_whitespace();
        let A = iter.map(|x| isize::from_str(x).unwrap()).collect::<Vec<_>>();
        println!("{} {} {}"
            , A.iter().min().unwrap()
            , A.iter().max().unwrap()
            , A.iter().sum::<isize>());
    }
}



Measured memory_bytes: 5036
from collections import deque

N, M = map(int, input().split())
G = [deque() for i in range(N+1)]
x = [0] * (N+1)
visited = [True] * (N+1)

for i in range(M):
    L, R, D = map(int, input().split())
    G[L].append((R, D))
    G[R].append((L, -D))
    visited[L] = False
    visited[R] = False
    
for i in range(1, N+1):
    if not visited[i]:
        q = G[i]
        visited[i] = True
        
        while q:
            u, d = q.pop()
            
            for v, d_ in G[u]:
                if visited[v]:
                    if x[v] != d+d_:
                        print('No')
                        exit()
                else:
                    visited[v] = True
                    x[v] = d+d_
                    q.append((v, d+d_))
print('Yes')      

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

int main() {
  char c;
  cin >> c;
  
  if(c=='a'||c=='e'||c=='i'||c=='u'||c=='o'){
    cout << "vowel" << endl;
  }
  else{
    cout << "consonant" << endl;
  }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
#define fastio() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define pb push_back
#define F first
#define S second
//cout<<fixed<<setprecision(11);
const string nl="\n";
const ll MOD=1e9+7;
const ll ARR_MAX = 1e5+1;
const ll VAL_MAX = 1e5+1;
const ll INF=1e14;

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

void solve(){
    ll a,b;cin>>a>>b;
    cout<<(a*b)/gcd(a,b)<<nl;
}

int main(){
    fastio();
    int t=1;
    // cin>>t;
    while(t--){
        solve();
    }
    return 0;
}

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

#define ll  long long
#define PII pair<ll,ll>
#define VI  vector<ll>
#define VB  vector<bool>
#define VC vector<char>
#define VVI vector<vector<ll>>
#define VVC vector<vector<char>>
#define VS  vector<string>
#define VP  vector<PII>
#define lf(i,a,b) for(ll i=a;i<=b;i++)
#define lr(i,a,b) for(ll i=a;i>=b;i--)
#define lfl(i,v) for(ll i=0;i<v.size();i++)
#define lrl(i,v) for(ll i=(ll)(v.size())-1;i>=0;i--)
#define chk2(a,b) cout<<"check :  "<<a<<" "<<b<<endl
#define chk3(a,b,c) cout<<"check :  "<<a<<" "<<b<<" "<<c<<endl
#define chk4(a,b,c,d) cout<<"check :  "<<a<<" "<<b<<" "<<c<<" "<<d<<endl
#define chk5(a,b,c,d,e) cout<<"check :  "<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl
#define l_b(v,k)  lower_bound(v.begin(),v.end(),k)-v.begin()
#define u_b(v,k)  upper_bound(v.begin(),v.end(),k)-v.begin()
#define mod 1000000007
#define sort(v) sort(v.begin(),v.end())
#define p_b push_back
#define p_f push_front
#define m_p make_pair
#define ff first
#define ss second
#define sz size()

int main()
{   int n,k;cin>>n>>k;
    if(k>((n-1)*(n-2))/2)
    {    cout<<-1<<endl;return 0;
    }
    int left=((n-1)*(n-2))/2-k;
    int m=n-1;
    VP edges;
    for(int i=2;i<=n;i++)
    {   PII p=m_p(1,i);
        edges.p_b(p);
    }
    lf(i,2,n)
        lf(j,i+1,n)
        {   if(left>0)
            {   PII p=m_p(i,j);
                edges.p_b(p);   
                left--;
                m++;
            }
            else
                break;
        }
    cout<<m<<endl;
    for(auto e:edges)
    {   cout<<e.ff<<" "<<e.ss<<endl;
    }
}

Measured memory_bytes: 3696
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = 1LL << 60;
ll MOD = 1000000000 + 7;

int main() {
    string s;
    cin >> s;
    int n = s.size();
    if (s[n - 1] == 's') {
        s += "es";
    } else {
        s += "s";
    }
    cout << s;
}

Measured memory_bytes: 3628
n, m = map(int, input().split())
s = input()
t = input()

def gcd(a, b):
    if b == 0:
        return abs(a)
    else:
        return gcd(b, a % b)


l = n * m // gcd(n, m)

ok = True
nn = l // n
mm = l // m

i = 0
j = 0

while True:
    if i < j:
        i += nn
    elif j < i:
        j += mm
    else:
        if i // nn < n and j // mm < m:
            if s[i // nn] != t[j // mm]:
                ok = False
        else:
            break
        i += nn
    #print(i, j, nn, mm)

print(l if ok else -1)


Measured memory_bytes: 3316
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    final int price = new PriceReader().read();
    final int balance = new BalanceCalculator().pay(price);
    new BalancePrinter().write(balance);
  }
  
}

class BalanceCalculator {
  private static final int AMOUNT_PER_BILL = 1_000;
  public int pay(int price) {
    int bills = price / AMOUNT_PER_BILL;
    if (bills * AMOUNT_PER_BILL < price) {
      bills++;
    }
    return bills * AMOUNT_PER_BILL - price;
  }
}

class PriceReader {
  public int read() {
    Scanner scanner = new Scanner(System.in);
    return scanner.nextInt();
  }
}

class BalancePrinter {
  public void write(int balance) {
    System.out.println(balance);
  }
}


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

int main() {
    int A, B, C;
    cin >> A >> B >> C;
    cout << max(C - A + B, 0) << endl;

  return 0;
}


Measured memory_bytes: 256
n = int(input())
a = list(map(int,input().split()))

if n <= 2:
    print(1)
    exit()

f = 0
cnt = 0
if a[0] < a[1]:
    f = 1
elif a[0] > a[1]:
    f = 2
tmp = a[1]

for i in range(2,n):
    if tmp < a[i]:
        if f == 2:
            cnt += 1
            f = 0
        elif f == 0:
            f = 1
    elif tmp > a[i]:
        if f == 1:
            cnt += 1
            f = 0
        elif f == 0:
            f = 2
    tmp = a[i]
cnt += 1

print(cnt)

Measured memory_bytes: 84896
# -*- coding: utf-8 -*-
from sys import stdin
# import numpy as np
# import sys
# sys.setrecursionlimit(10**4)

def _li(): return list(map(int, stdin.readline().split()))
def _li_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def _lf(): return list(map(float, stdin.readline().split()))
def _ls(): return stdin.readline().split()
def _i(): return int(stdin.readline())
def _f(): return float(stdin.readline())
def _s(): return stdin.readline()[:-1]


N, K = _li()
S = _s()

ans = S[:K-1] + S[K-1].lower() + S[K:]
print(ans)



Measured memory_bytes: 3064
#include <bits/stdc++.h>
 
#define rep(i, n) for (ll i=0;i<(n); i++)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
#define ALL(x) (x).begin(),(x).end()
 
using namespace std;
//using ll=long long;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pi;

const long double PI=3.14159265358979323846;

ll h,w;
ll ans;
//vector<char> masu;

template<class T> bool contain(const std::string& s, const T& v) {
   return s.find(v) != std::string::npos;
}


int main(){
  ll h,w,d,n;
  cin>>n;

  vector<ll> v(n);
  vector<ll> vc(n);
  rep(i, n){
    cin>>v[i];
    vc[i] = v[i];
  }

  sort(ALL(v));

  ll m = v[n/2];
  rep(i, n){
    if(vc[i]<m) cout<<m<<endl;
    else cout << v[n/2-1]<<endl;
  }
  
}


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

int main(){
    long long N;
    cin >> N;
    long long sum = 0;
    int i;
    for(i=1;i<=N; i++){
        if(i%3 != 0 && i%5 != 0){
            sum += i;
        }
    }

    cout << sum << endl;
}

Measured memory_bytes: 3636
n = int(input())
for i in range(n):
    x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split())    
    if abs( (x2 - x1) * (y4 - y3) - (y2 - y1) * (x4 - x3) ) < 1e-10:
        print('YES')
    else:
        print('NO')

Measured memory_bytes: 7664
#include <iostream>
#include <vector>
#include <algorithm>
#include <utility>
#include <map>
#include <queue>
#include <stack>
#include <string>
#include <sstream>
#include <cstring>
#include <cstdlib>

using namespace std;

#define ALL(c) c.begin(),c.end()
#define RALL(c) c.rbegin(),c.rend()
#define REP(i,x,y) for(int i=(x);i<(y);++i)
#define MP(a,b) make_pair((a),(b))
#define F_ first
#define S_ second

typedef long long int lli;
typedef pair<int,int> Pi;

const int INF=100000000;
const long long int INF_=1000000000000000000;

int solve(int c,int a,int n){
	int result=0;
	int x=min(c,min(a,n));
	c-=x;
	a-=x;
	n-=x;
	int y=min(c/2,a);
	c-=2*y;
	a-=y;
	n-=y;
	int z=c/3;
	result=x+y+z;
	return result;
}

int main(){
	int Q;
	cin >> Q;
	REP(i,0,Q){
		int C,A,N;
		cin >> C >> A >> N;
		cout << solve(C,A,N) << endl;
	}
	return 0;
}

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

void solve(){

	int n ;
	cin>>n ;

	unordered_map<int,int> mp ;

	rep(i,n){
		
		int x ;
		cin>>x ;

		mp[x]++ ;
		
		x=x-1 ;
		mp[x]++ ;
		
		x=x+2 ;
		mp[x]++ ;

	}

	int max_second=0 ;

	for(auto x:mp){
		if(x.second>max_second){
			max_second=x.second ;
		
		}
	}
	
	cout<<max_second ;
}


int main(){

	

		int y ;

		y=1 ;
		//cin>>y ;

		while(y--){
 
			solve() ;

		}

}

Measured memory_bytes: 6864
n = int(input())
h = list(map(int, input().split()))

x = []

for i in range(n-1):
  x.append(h[i+1] - h[i])

x += [5]

ans = 0
temp = 0

for i in x:
  if i <= 0:
    temp += 1
  else:
    ans = max(ans, temp)
    temp = 0

print(ans)

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



int main() {
  string s;
  cin >> s;
  int ans;
  if(s=="RRR") ans=3;
  else if(s[0]=='R' && s[1]=='R') ans=2;
  else if(s[1]=='R' && s[2]=='R') ans=2;
  else if(s[0]=='R' || s[1]=='R' || s[2]=='R') ans=1;
  else ans=0;
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 3620
import sys

sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return list(map(int, sys.stdin.readline().split()))
def II(): return int(sys.stdin.readline())
def LS(): return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]

def main():
    a, b = LI()
    c = (a + b) / 2
    if c % 1 == 0:
        print(int(c))
    else:
        print("IMPOSSIBLE")

if __name__ == '__main__':
    main()

Measured memory_bytes: 3316