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

#define cn count
#define pb push_back
#define in insert
#define fs first
#define sc second
#define sz size
#define len length
#define forn(i, n) for (ll i = 0; i < (ll) (n); ++i)
#define forni(i, n) for (ll i = 1; i < (ll) (n); ++i)
#define IO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)

using namespace std;
using ll = long long;
const ll inf = 1e9+7; 
const double PI =  3.141592653589793;

int main(){
	IO;
	ll n;
	string s,t;
	cin>>n>>s>>t;
	forn(i,n){
		cout<<s[i]<<t[i];
	}
	cout<<"\n";
	return 0;
}


// _   .-')                .-. .-')                 .-')                                               
//( '.( OO )_              \  ( OO )               ( OO ).                                             
// ,--.   ,--.).-'),-----. ,--. ,--.  .-'),-----. (_)---\_) ,--. ,--.     .-----.  ,-.-')  .-'),-----. 
// |   `.'   |( OO'  .-.  '|  .'   / ( OO'  .-.  '/    _ |  |  | |  |    '  .--./  |  |OO)( OO'  .-.  '
// |         |/   |  | |  ||      /, /   |  | |  |\  :` `.  |  | | .-')  |  |('-.  |  |  \/   |  | |  |
// |  |'.'|  |\_) |  |\|  ||     ' _)\_) |  |\|  | '..`''.) |  |_|( OO )/_) |OO  ) |  |(_/\_) |  |\|  |
// |  |   |  |  \ |  | |  ||  .   \    \ |  | |  |.-._)   \ |  | | `-' /||  |`-'| ,|  |_.'  \ |  | |  |
// |  |   |  |   `'  '-'  '|  |\   \    `'  '-'  '\       /('  '-'(_.-'(_'  '--'\(_|  |      `'  '-'  '
// """    """     """""""" """  """"      """""""  """""""  """"""""      """"""   """         """""""



Measured memory_bytes: 3632
#include <stdio.h>
int main(void)
{
	int a,b,c,tmp;
	
	scanf("%d %d %d\n",&a,&b,&c);
	

	if(a > b)
	{
		tmp = a;
		a = b;
		b = tmp;
	}
		if(b > c)
		{
			tmp = b;
			b = c;
			c = tmp;
		}
	
	if(a > b)
	{
		tmp = a;
		a = b;
		b = tmp;
	}
	printf("%d %d %d\n",a,b,c);
	
	return 0;
}


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

int main() {
	double r;
	cin >> r;
	double a, c;
	a = pow(r, 2.0) * M_PI;
	c = double(2.0) * M_PI * r;
	printf("%.6f %.6f\n", a, c);
	return 0;
}

Measured memory_bytes: 1240
#include <bits/stdc++.h>
#define endl '\n'

//#pragma GCC optimize ("O3")
//#pragma GCC target ("sse4")

#define SZ(x) ((int)x.size())
#define ALL(V) V.begin(), V.end()
#define L_B lower_bound
#define U_B upper_bound
#define pb push_back

using namespace std;
template<class T, class T2> inline int chkmax(T &x, const T2 &y) { return x < y ? x = y, 1 : 0; }
template<class T, class T2> inline int chkmin(T &x, const T2 &y) { return x > y ? x = y, 1 : 0; }
const int MAXN = (1 << 20);

string s;

void read()
{
	cin >> s;
}

void solve()
{
	int cnt = 0;
	for(char c: s) cnt += (c == 'o');

	cnt += 15 - SZ(s);

	if(cnt >= 8) cout << "YES" << endl;
	else cout << "NO" << endl;
}

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

	read();
	solve();
	return 0;
}



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

//#define int long long
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<n;++i)
#define exrep(i, a, b) for(ll i = a; i < b; i++)
#define out(x) cout << x << endl
#define EPS (1e-7)
#define gearup ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

typedef long long int ll;
typedef long double ld;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<pair<int,int> > vpii;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<bool> > vvb;
typedef vector<vector<double> > vvd;
typedef vector<vector<string> > vvs;
typedef vector<ll> vl;
typedef vector<vector<ll> > vvl;
typedef vector<vector<vector<ll> > > vvvl;
ll MOD = 1000000007;
const long long L_INF = 1LL << 60;
const int INF = 2147483647; // 2^31-1
const double PI = acos(-1);
//cout<<fixed<<setprecision(10);

template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}
template<class T> void debug(T v){rep(i,v.size()) cout<<v[i]<<" ";cout<<endl;}
const ll dx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};

signed main()
{   
    gearup;
    ll n; cin >> n;
    vl a(n);
    ll s = 0;
    rep(i,n){
        cin>>a[i];
        s = (s ^ a[i]);
    }
    rep(i,n)out((s^a[i]));
}


Measured memory_bytes: 4752
#include <bits/stdc++.h>
using namespace std;
 
int main(){
    
    int N;
    string s;
    cin >> N >> s;
    
    long int r=0,g=0,b=0;
    
    for(int i=0; i<N; i++){
        if(s.at(i)=='R')
            r++;
        else if(s.at(i)=='G')
            g++;
        
    }
    b = N - r - g;
    
    long int ans =0;
    ans = r*g*b;
    
    for(int i=0; i<N; i++){
        for(int j=i+1; j<N && 2*j-i < N; j++){
            if(s.at(i)!=s.at(j) && s.at(i)!= s.at(2*j-i) && s.at(j)!= s.at(2*j-i))
                ans--;
        }
    }
    
    
    
    cout << ans << endl;
    
    
    
    
    
    return 0;
}

Measured memory_bytes: 3624
#include <bits/stdc++.h>
typedef long long ll;
#define rep(i,n) for(ll i=0;i<(n);i++)
#define repr(i,n) for(ll i=(n-1);i>=0;i--)
#define pb push_back
#define mp make_pair
#define all(x) x.begin(),x.end()
#define br cout << "\n";
using namespace std;
const int INF = 1e9;
const int MOD = 1e9+7;
using Graph = vector<vector<ll>>;
template<class T> inline bool chmin(T &a, T b) { if(a > b){ a = b; return true;} return false;}
template<class T> inline bool chmax(T &a, T b) { if(a < b){ a = b; return true;} return false;}

// 0 false, 1 true 
// string to int : -48
// ceil(a)  1.2->2.0
// c++17	g++ -std=c++17 a.cpp

int main() {
    std::cout << std::fixed << std::setprecision(15);
    ll n;
    cin >> n;

    vector<pair<ll,ll>> vec;
    rep(i,n){
        ll a, b;
        cin >> a >> b;
        vec.emplace_back(make_pair(b,a));
    }

    sort(all(vec));
    ll sum = 0;
    string ans = "Yes";
    rep(i,n){
        sum += vec[i].second;
        if(vec[i].first >= sum){
            continue;
        }else{
            ans = "No";
        }
    }

    cout << ans << endl;

}

Measured memory_bytes: 6384
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <set>
#include <algorithm>
#include <array>
#include <complex>
#include <string>
#include <utility>
#include <map>
int main() {
    int X, Y;
    std::cin >> X >> Y;
    if (X <= 8 && Y <= 8) {
        std::cout << "Yay!";
    }else {
        std::cout << ":(";
    }
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstring>
int n,a,b;
int main()
{
	scanf("%d",&n);
	a=b=0;
	for(int i=1,x;i<=n;i++)
	{
		scanf("%d",&x);
		if(x%4==0)a++;
		else if(x&1)a--;
		else b++;
	}
	printf("%s\n",(a>=0 || (a==-1 && !b))?"Yes":"No");
	return 0;
}


Measured memory_bytes: 256
fun main(arr:Array<String>) {
    val num = readLine()!!.toInt()
    dic.addAll((0..num).map { null })
    val ans = getAns(num)
    println(ans)
}

val dic = mutableListOf<Int?>()

fun getAns(remain:Int): Int {
    dic[remain]?.let { return it }
    if(remain == 0) {
        return 0
    }
    var ans = remain
    for(i in (1..6).reversed()) {
        val num = Math.pow(9.toDouble(), i.toDouble()).toInt()
        if(num  > remain) {
            continue
        }
        val ret = getAns(remain - num) + 1
        ans = Math.min(ret, ans)
    }
    for(i in (1..7).reversed()) {
        val num = Math.pow(6.toDouble(), i.toDouble()).toInt()
        if(num  > remain) {
            continue
        }
        val ret = getAns(remain - num) + 1
        ans = Math.min(ret, ans)
    }
    dic[remain] = ans
    return ans
}


Measured memory_bytes: 39888
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;

typedef long long ll;
typedef pair<int,int> ii;
typedef tree<ii,null_type,less<ii>,rb_tree_tag,tree_order_statistics_node_update> indexed_set;

int main() {
	cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
	string s,t,u;
	int a,b;
	cin>>s>>t>>a>>b>>u;
	if(s==u) a--;
	else if(t==u) b--;
	cout<<a<<" "<<b<<"\n";
	return 0;
}

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

using namespace std;

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

#define rep(i,n) for(int i=0;i<(n);++i)
#define repi(i,a,b) for(int i=int(a);i<(b);i++)
#define repr(i,b,a) for(int i=int(b);i>=(a);i--)
#define all(x) x.begin(),x.end()

const ll mod = 1e9+7;
const ll INF = 1e9;

ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
bool valid(int lx,int ux,int ly,int uy,int x,int y){
	return lx<=x&&x<ux&&ly<=y&&y<uy; 
}
ll power(ll x,ll p){
	if(p==0)return 1;
	ll res=power(x*x%mod,p/2);
	if(p%2==1)res=res*x%mod;
	return res;
}

int main()
{
	ll n,d,a;
	cin>>n>>d>>a;
	vector<P> p(n);
	rep(i,n)cin>>p[i].first>>p[i].second;

	sort(all(p));

	queue<P> que;
	ll sum=0,ans=0;

	rep(i,n){
		while(!que.empty()&&que.front().first<p[i].first-2*d){
			P tmp=que.front();que.pop();
			sum -= tmp.second;
		}
		p[i].second-=sum;
		if(p[i].second<=0)continue;
		ll cnt=(p[i].second+(a-1))/a;
		ans+=cnt;
		sum+=cnt*a;
		que.push(P(p[i].first, cnt*a));
	}

	cout<<ans<<endl;

	return 0;
}

Measured memory_bytes: 2688
#include <bits/stdc++.h>
using namespace std;
#define int                     long long   
#define double                  long double
#define endl                    "\n"
#define pb                      push_back
#define PI                      3.1415926535897932384626433832795l
#define F                       first
#define S                       second
#define mp                      make_pair
#define f(i,n)                  for(int i=0;i<n;i++)
#define fastio                  ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define all(v)                  (v).begin(),(v).end()
#define rall(v)                 (v).rbegin(),(v).rend()
#define gcd(a,b)                __gcd((a),(b))
#define fill(a,value)           memset(a,value,sizeof(a));
#define minn(v)                 *min_element(v.begin(), v.end());
#define maxx(v)                 *max_element(v.begin(), v.end());
#define print(x)                cout<<(x)<<endl;
#define sum(v)+x                accumulate(v.begin(), v.end(),x);
#define debug(x)                cout<<#x<<'='<<(x)<<endl;
typedef pair<int,int>           pii;
typedef vector<int>             vi;
const int mod=1e9+7; 

vector<vector<int>>graph(200005);
int vis[200005]; 
int x;
vi ans;

void dfs(int n){
    
    vis[n]=1;
    ans.pb(n);
  	
    for (auto a:graph[n]){
        if(vis[a]==0)dfs(a);
    }
   
  
  
}
signed main() 
{
    fastio;
    cout << fixed << setprecision(12);
    int n,m;
    cin>>n>>m;
    
    f(i,m)
    {
       int x,y;
       cin>>x>>y;
       graph[x].pb(y);
       graph[y].pb(x);
    }
    vi v; 
    for(int i=1;i<=n;i++)
    {
        if (vis[i]==0)
        {
            ans.clear();
            dfs(i);
            v.pb(ans.size());
        }
    }
    cout<<*max_element(all(v));
    
    
    
    return 0;
}


Measured memory_bytes: 26704
#include <bits/stdc++.h>
using namespace std;
int main(){
  int a,b,k,c=0;
  cin>>a>>b>>k;
  for(int i=a;i<=b;i++){
    c++;
    if(c<=k||c>=b-a+2-k)
      cout<<i<<endl;
  }
}


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

int main(){
  int n, m, x;
  cin >> n >> m >> x;
  vector<vector<int>> a(n, vector<int>(m));
  vector<int> c(n);
  int ans = 100000000;
  for(int i = 0; i < n; i++){
    cin >> c[i];
    for(int j = 0; j < m; j++)cin >> a[i][j];
  }
  for (int bit = 0; bit < (1<<n); ++bit){
    int cost = 0;
    vector<int> level(m, 0);
    for(int i = 0; i < n; i++){
      if(bit & (1<<i)) {
        cost += c[i];
        for(int j = 0; j < m; j++){
          level[j] += a[i][j];
        }
      }
    }
    bool ok = true;
        for(int j = 0; j < m; j++){
            if(level[j] < x) ok = false;
        }
        if(ok) ans = min(ans,cost);
  }
  if(ans == 100000000) cout << -1 << endl;
  else cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3612
S = list(input())
S_len = len(S)
S_mid = list(S[2:S_len-1])
S_head = S[0]
del S[2:S_len-1]
del S[0]
if S_head == "A":
    if S_mid.count("C") == 1:
        S = "".join(S)
        if S.islower():
            print("AC")
        else:
            print("WA")
    else:
        print("WA")
else:
    print("WA")

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

#define rep(i, n) for (int i = 0; i < int(n); i++)
#define rrep(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define reps(i, n) for (int i = 1; i <= int(n); i++)
#define rreps(i, n) for (int i = int(n); i >= 1; i--)
#define repc(i, n) for (int i = 0; i <= int(n); i++)
#define rrepc(i, n) for (int i = int(n); i >= 0; i--)
#define repi(i, a, b) for (int i = int(a); i < int(b); i++)
#define repic(i, a, b) for (int i = int(a); i <= int(b); i++)
#define each(x, y) for (auto &x : y)
#define all(a) (a).begin(), (a).end()
#define bit32(x) (1 << (x))
#define bit64(x) (1ll << (x))

using namespace std;

using i64 = long long;
using f80 = long double;
using vi32 = vector<int>;
using vi64 = vector<i64>;
using vf80 = vector<f80>;
using vstr = vector<string>;

inline void yes() { cout << "Yes" << endl; exit(0); }
inline void no() { cout << "No" << endl; exit(0); }
inline i64 gcd(i64 a, i64 b) { if (min(a, b) == 0) return max(a, b); if (a % b == 0) return b; return gcd(b, a % b); }
inline i64 lcm(i64 a, i64 b) { if (min(a, b) == 0) return max(a, b); return a / gcd(a, b) * b; }
template <typename T> class pqasc : public priority_queue<T, vector<T>, greater<T>> {};
template <typename T> class pqdesc : public priority_queue<T, vector<T>, less<T>> {};
template <typename T> inline void amax(T &x, T y) { x = max(x, y); }
template <typename T> inline void amin(T &x, T y) { x = min(x, y); }
template <typename T> inline T exp(T x, i64 n, T e = 1) { T r = e; while (n > 0) { if (n & 1) r *= x; x *= x; n >>= 1; } return r; }
template <typename T> istream& operator>>(istream &is, vector<T> &v) { each(x, v) is >> x; return is; }
template <typename T> ostream& operator<<(ostream &os, vector<T> &v) { rep(i, v.size()) { if (i) os << ' '; os << v[i]; } return os; }
void solve(); int main() { ios::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(16); solve(); return 0; }

void solve() {
  int N, M;
  cin >> N >> M;
  vi32 cost(M);
  vector<vi32> adds(N);
  vector<vi32> rems(N);
  rep(i, M) {
    int l, r, c;
    cin >> l >> r >> c;
    l--, r--;
    adds[l].emplace_back(i);
    rems[r].emplace_back(i);
    cost[i] = c;
  }
  vi64 dist(M);
  i64 ans = 0;
  set<pair<i64, int>> se;
  rep(i, N) {
    if (i != 0) {
      if (se.size() == 0) {
        cout << -1 << endl;
        return;
      }
      ans = se.lower_bound(make_pair(0, 0))->first;
    }
    each(j, adds[i]) {
      se.emplace(ans + cost[j], j);
      dist[j] = ans + cost[j];
    }
    each(j, rems[i]) {
      se.erase(make_pair(dist[j], j));
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 12288
import sys
#import string
#from collections import defaultdict, deque, Counter
#import bisect
#import heapq
#import math
#from itertools import accumulate
#from itertools import permutations as perm
#from itertools import combinations as comb
#from itertools import combinations_with_replacement as combr
#from fractions import gcd
#import numpy as np

stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)
MIN = -10 ** 9
MOD = 10 ** 9 + 7
INF = float("inf")
IINF = 10 ** 18

def solve():
    A, B, C = map(int, stdin.readline().rstrip().split())
    k = int(stdin.readline().rstrip())
    for i in range(k):
        if C > B > A:
            print("Yes")
            exit()
        elif B >= C or A >= C:
            C = C*2
        elif A >= B:
            B = B*2
    if C > B >A:
        print("Yes")
    else:
        print("No")

if __name__ == '__main__':
    solve()


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

lint n, p;
string s;

// a^n mod pを計算　O(log n)
long long pow_mod(long long a, long long n, long long p) {
    if (n == 0) return 1;
    if (n & 1) return pow_mod(a, n - 1, p) * a % p;
    long long temp = pow_mod(a, n / 2, p);
    return temp * temp % p;
}

int main() {
    cin >> s;
    n = s.length();
    p = 2019;
    if (p == 2 || p == 5) {
        lint ans = 0;
        for (int i = 0; i < n; i++) {
            lint c = s[i] - '0';
            if (c % p == 0) {
                ans += i + 1;
            }
        }
        cout << ans << endl;
        return 0;
    }
    lint sum = 0;
    map<lint, lint> count;
    count[0]++;
    for (int i = 0; i < n; i++) {
        int c = s[n - 1 - i] - '0';
        sum = sum + c * pow_mod(10, i, p);
        sum %= p;
        count[sum]++;
    }
    lint ans = 0;
    for (auto e : count) {
        lint temp = e.second;
        ans += temp * (temp - 1) / 2;
    }
    cout << ans << endl;
}

Measured memory_bytes: 3760
Scanf.scanf "%d %d" (fun n m ->
    let a = Array.init n (fun _ ->
        Array.init m (fun _ -> Scanf.scanf " %d" (fun a -> a - 1)))
    in
    let module S = Set.Make (struct type t = int let compare = compare end) in
    let check q =
        let idx = Array.make n 0 in

        let check2 set =
            let hist = Array.make m 0 in
            let rec loop i mx mv =
                if i = n then mv else
                    let c = a.(i).(idx.(i)) in
                    let () = hist.(c) <- hist.(c) + 1 in
                    if hist.(c) > mx then loop (i + 1) hist.(c) c else
                                          loop (i + 1) mx mv
            in
            let mv = loop 0 0 0 in
            let mx = hist.(mv) in
            let set = S.add mv set in
            if mx <= q then true, set else (
                for i = 0 to n - 1 do
                    while idx.(i) < m && S.mem a.(i).(idx.(i)) set do
                        idx.(i) <- idx.(i) + 1
                    done
                done;
                false, set
            )
        in

        let rec loop rest set =
            if rest = 0 then false else
                let flag, set = check2 set in
                if flag then true else loop (rest - 1) set
        in
        loop m S.empty
    in
    let rec bin left right =
        if left = right then left else
            let m = (left + right) / 2 in
            if check m then bin left m
                       else bin (m + 1) right
    in
    bin 1 (n + 1) |> Printf.printf "%d\n"
)

Measured memory_bytes: 8320
import math

def check(d):
    cut_num = 0
    for i in leng:
        cut_num += math.ceil(i / d) - 1
    if cut_num <= K:
        return True
    return False


N, K = map(int, input().split())
leng = list(map(int, input().split()))

d_min = 0
d_max = max(leng)
d = math.ceil(d_max / 2)

while d_max - d_min > 1:
    if check(d):
        d_max = d
        d = math.ceil((d_max + d_min) / 2)
    else:
        d_min = d
        d = int((d_max + d_min) / 2)
    # print(d, d_max, d_min)

print(d_max)

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

int main(){
  int n;
  cin >> n;
  int a[n];
  for (int i=0;i<n;i++){
    cin >> a[i];
  }
  for (int i=0;i<n-1;i++){
    cout << a[n-i-1] << " ";
  }
  cout << a[0];
  puts("");
  return 0;
}



Measured memory_bytes: 3080
import java.util.Scanner;
import javax.swing.tree.TreeNode;
import java.util.ArrayDeque;
import java.util.Arrays;
import java.util.Deque;
import java.util.Vector;
import static java.lang.System.*;


public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
	
		int n = sc.nextInt();
		int m = sc.nextInt();
		int x = sc.nextInt();
		int[] c = new int[n];
		int[][] a = new int[n][m];
		for(int i = 0; i < n; i++) {
			c[i] = sc.nextInt();
			for(int j = 0; j < m; j++) {
				a[i][j] = sc.nextInt();
			}
		}
		int ans = Integer.MAX_VALUE;
		
		
		
		
		int[] sum = new int[m];
		for(int i = 1; i < (1<<n); ++i) {
			Arrays.fill(sum, 0);
			int cost = 0;
			for(int j = 0; j < n; j++) {
				if((1&(i>>j)) == 1) {
					for(int k = 0; k < m; k++) {
						sum[k] += a[j][k];
					}
					cost += c[j];
				}
			}
			boolean judge = true;
			for(int j = 0; j < m; j++) {
				if(sum[j] < x) {
					judge = false;
					break;
				}
			}
			if(judge) {
				ans = Math.min(ans, cost);
			}
		}
		System.out.println(ans<Integer.MAX_VALUE? ans : -1);
	}
	
}

Measured memory_bytes: 28084
#import"bits/stdc++.h"
#define r(n) for(i=0;i<n;i++)
using namespace std;main(int N){cin>>N;int A[2*N],c[N+1]={},n,t,i;r(2*N)cin>>A[i];r(2*N)if(++c[A[i]]>N)cout<<"No",exit(0);cout<<"Yes ";queue<int>s;r(N)if(A[i]==A[N+i])s.push(i);while(s.size()){n=s.front(),t=N+rand()%N;if(A[n]^A[t]&&A[t-N]^A[n+N])swap(A[n+N],A[t]),s.pop();}r(N)cout<<A[i+N]<<" ";}

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

int main() {
  ll N,K;
  cin >> N >> K;
  vector<double> E(N);
  for(ll i=0;i<N;i++){
    ll p;
    cin >> p;
    E[i]=((double)p+1.0)/2.0;
  }
  double ans=0;
  for(ll i=0;i<K;i++){
    ans+=E[i];
  }
  double current=ans;
  for(ll i=1;i<N-K+1;i++){
    current = current -E[i-1]+E[i+K-1];
    ans=max(ans,current);
  }
  cout << fixed << setprecision(10);
  cout << ans << endl;
}

Measured memory_bytes: 4804
using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using System.Text;
using static System.Console;
using static System.Math;

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = ReadInt();
            WriteLine(Ceiling(n / 2.0));
        }

        private static string Read() { return ReadLine(); }
        private static string[] Reads() { return (Read().Split()); }
        private static int ReadInt() { return int.Parse(Read()); }
        private static long ReadLong() { return long.Parse(Read()); }
        private static double ReadDouble() { return double.Parse(Read()); }
        private static int[] ReadInts() { return Array.ConvertAll(Read().Split(), int.Parse); }
        private static long[] ReadLongs() { return Array.ConvertAll(Read().Split(), long.Parse); }
        private static double[] ReadDoubles() { return Array.ConvertAll(Read().Split(), double.Parse); }
    }
}


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

using namespace std;

typedef long long ll;

int main(){
	string s;
	cin >> s;
	map<char,int> count;

	for(int i=0; i<4; i++){
		count[s[i]]++;
	}	

	for(auto c:count){
		if(c.second!=2){
			cout << "No\n";
			return 0;
		}
	}
	
	cout << "Yes\n"	;
	
	return 0;
}

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

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

const double PI = acos(-1);
const int inf = 2e9;
const ll INF = 2e18;
const ll MOD = 1e9+7;

#define sz(s) (s).size()
#define pb push_back
#define fi first
#define se second
#define REP(i,n) for (int i = 0; i<n; i++)
#define ALL(a) begin(a), end(a)

int main (void) {
    int N;
    cin >> N;
    vector<ll> A(N);
    REP(i,N) cin>>A[i];
    ll sum = 0;
    ll m = INF;
    int num = 0;
    REP(i,N) {
        sum += abs(A[i]);
        m = min(abs(A[i]),m);
        if (A[i]<0) {
            num ++ ;
        }
    }
    ll ans = 0;
    if (num%2 == 0) {
        ans = sum;
    }
    else {
        ans = sum - 2 * m;
    }
    cout << ans <<endl;
    return 0;
}

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

#define PI acos(-1)
#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define endl '\n'
#define io  ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define file freopen ("team.in", "r", stdin),freopen ("team.out", "w", stdout);
#define fileIn freopen ("in.txt", "r", stdin);
#define all(v) ((v).begin()), ((v).end())


using namespace std;

typedef pair<int, int> pii;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, int> pli;



int main () {
  io;
  deque<int> dq;

  int n;
  cin >> n;
  bool f = 0;
  for(int i = 0; i < n; i++) {
    int x;
    cin >> x;
    if(f) {
      dq.push_back(x);
    }else {
      dq.push_front(x);
    }
    f ^= 1;
  }
  if(f) {
    while(dq.size()) {
      cout << dq.front() << " ";
      dq.pop_front();
    }
  }else {
    while(dq.size()) {
      cout << dq.back() << " ";
      dq.pop_back();
    }

  }
  cout << endl;
  return 0;
}





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

int main(){
	int n;
	cin >> n;
	vector<int> p(n);
	
	for(int i=0;i<n;i++){
		cin >> p[i];;
	}
	
	int ans=0;
	for(int i=1;i<n-1;i++){
		if((p[i-1]<=p[i] && p[i]<=p[i+1]) ||(p[i-1]>=p[i] && p[i]>=p[i+1]) ){
			ans += 1;
		}
	}
			cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
// #define LOCAL
#ifdef LOCAL
    #define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
    #define eprintf(...) 42
#endif // LOCAL
int const nax = 3e5 + 10, mod = 1e9 + 7;
void plusle(int &a,int b){a+=b;if(a>=mod)a-=mod; return;}
void minun(int &a,int b){a-=b; if(a<0)a+=mod; return;}
int add(int a,int b) {a+=b;return a>=mod?a-mod:a;}
int sub(int a,int b) {a-=b;return a<0?a+mod:a;}
int mul(int a,int b) {return (int)((long long)a*b%mod);}
int power(int a,int b) {int res=1;while (b>0) {if (b&1) {res=mul(res,a);}a=mul(a,a);b>>=1;}return res;}

int const Mx = 3e5+10;
int fac[Mx],invf[Mx];
void prefact(){
    fac[0]=1;
    for(int i=1;i< Mx;i++)
        fac[i]=mul(fac[i-1],i);
    invf[Mx-1]=power(fac[Mx -1],mod-2);
    for(int i=Mx -2 ;i>=0;i--){
        invf[i]=mul(invf[i+1],i+1);
    }

}
int ncr(int N,int R){
    if(N < 0) return 0;
    if(R > N || R < 0) return 0;
    if(N == 0 || N == R)
        return 1;
    return mul(fac[N],mul(invf[N-R],invf[R]));
}

int n, a[nax];
int c[nax];

int main(){
    prefact();
    scanf("%d", &n);
    for(int i = 1; i <= n ;i ++){
        scanf("%d", a + i);
        if(i == 1) continue;
        c[i - 1] = a[i] - a[i - 1];
    }
    int ans = 0, cur = 0;
    for(int i = 1 ;i < n ;i ++){
        plusle(cur, mul(mul(fac[n - 1], invf[i]), fac[i - 1]));
        plusle(ans, mul(c[i], cur));
    }
    printf("%d\n", ans);
}
/*
    Good Luck
        -Lucina
*/


Measured memory_bytes: 3712
import math
first_input = list(map(lambda x:int(x), input().split(" ")))
#second_input = list(map(lambda x:int(x), input().split(" ")))

N = first_input[0]
K = first_input[1]

#print(math.floor(N // K))
#print(K*math.floor(N // K))
if N>K:
    first_min_N = N - K*math.floor(N // K)
else:
    first_min_N = N

print(min(first_min_N,abs(first_min_N-K)))


Measured memory_bytes: 2940
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
	
	long double a, b;
	cin>>a>>b;
	long long res = -1;
	
	long mnad = ceil((a)/0.08), mxad = ceil((a+1)/0.08) - 1 ;
	long mnbd = ceil((b)/0.1), mxbd = ceil((b+1)/0.1) - 1 ;
	
	for(long i = mnad; i<= mxad ; i++){
		if( mnbd<=i   &&   i <= mxbd) {
			res = i; 
			break;
		}
	}
	
	cout<<res;
	
	return 0;
}

Measured memory_bytes: 256
using System;

namespace ABC139A
{
    class Program
    {
        static void Main(string[] args)
        {
            var S = Console.ReadLine().ToCharArray();
            var T = Console.ReadLine().ToCharArray();

            var ans = 0;

            for (var i = 0; i < S.Length; i++)
                if (S[i] == T[i]) ans++;

            Console.WriteLine(ans);
        }
    }
}

Measured memory_bytes: 13140
#[allow(unused_imports)]
use itertools::Itertools;
#[allow(unused_imports)]
use itertools_num::ItertoolsNum;
#[allow(unused_imports)]
use std::cmp;
#[allow(unused_imports)]
use std::iter;
#[allow(unused_imports)]
use superslice::*;

fn run() {
    let (r, w) = (std::io::stdin(), std::io::stdout());
    let mut sc = IO::new(r.lock(), w.lock());

    let a: f64 = sc.read();
    let b: f64 = sc.read();
    let x: f64 = sc.read();

    let v = a * a * b;

    let mut ok = 0.0;
    let mut ng = 90.0;
    for _ in 0..1000 {
        let m: f64 = (ok + ng) / 2.0;
        let t = 90.0 - m;
        if (b * (t * std::f64::consts::PI / 180.0).tan()) > a {
            if v > x + a * a * a * (m * std::f64::consts::PI / 180.0).tan() / 2.0 {
                ok = m;
            } else {
                ng = m;
            }
        } else {
            if x < a * b * (b * (t * std::f64::consts::PI / 180.0).tan()) / 2.0 {
                ok = m;
            } else {
                ng = m;
            }
        }
    }
    println!("{}", (ok + ng) / 2.0);
}

fn main() {
    std::thread::Builder::new()
        .name("run".into())
        .stack_size(256 * 1024 * 1024)
        .spawn(run)
        .unwrap()
        .join()
        .unwrap();
}

pub struct IO<R, W: std::io::Write>(R, std::io::BufWriter<W>);

impl<R: std::io::Read, W: std::io::Write> IO<R, W> {
    pub fn new(r: R, w: W) -> IO<R, W> {
        IO(r, std::io::BufWriter::new(w))
    }
    pub fn write<S: std::ops::Deref<Target = str>>(&mut self, s: S) {
        use std::io::Write;
        self.1.write(s.as_bytes()).unwrap();
    }
    pub fn read<T: std::str::FromStr>(&mut self) -> T {
        use std::io::Read;
        let buf = self
            .0
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b' ' || b == b'\n' || b == b'\r' || b == b'\t')
            .take_while(|&b| b != b' ' && b != b'\n' && b != b'\r' && b != b'\t')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
            .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn read_vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read()).collect()
    }
    pub fn read_pairs<T: std::str::FromStr>(&mut self, n: usize) -> Vec<(T, T)> {
        (0..n).map(|_| (self.read(), self.read())).collect()
    }
    pub fn read_pairs_1_indexed(&mut self, n: usize) -> Vec<(usize, usize)> {
        (0..n)
            .map(|_| (self.read::<usize>() - 1, self.read::<usize>() - 1))
            .collect()
    }
    pub fn read_chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
    pub fn read_char_grid(&mut self, n: usize) -> Vec<Vec<char>> {
        (0..n).map(|_| self.read_chars()).collect()
    }
    pub fn read_matrix<T: std::str::FromStr>(&mut self, n: usize, m: usize) -> Vec<Vec<T>> {
        (0..n)
            .map(|_| (0..m).map(|_| self.read()).collect())
            .collect()
    }
}


Measured memory_bytes: 3216
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		////////////////////////////////////
		
		int n = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();
		int t;
		int cnt =0 ;
		
		for (int i=0; i<n; i++) {
			t = sc.nextInt();
			if (t<a || t>=b) {
				cnt++;
			}
		}
		
		System.out.println(cnt);
		
		////////////////////////////////////
		sc.close();
	}
}

Measured memory_bytes: 10192
//teja349
#include <bits/stdc++.h>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <cstdio>
#include <cstdlib>
#include <climits>
#include <utility>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <iomanip> 
//setbase - cout << setbase (16); cout << 100 << endl; Prints 64
//setfill -   cout << setfill ('x') << setw (5); cout << 77 << endl; prints xxx77
//setprecision - cout << setprecision (14) << f << endl; Prints x.xxxx
//cout.precision(x)  cout<<fixed<<val;  // prints x digits after decimal in val

using namespace std;
#define f(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) f(i,0,n)
#define fd(i,a,b) for(i=a;i>=b;i--)
#define pb push_back
#define mp make_pair
#define vi vector< int >
#define vl vector< ll >
#define ss second
#define ff first
#define ll long long
#define pii pair< int,int >
#define pll pair< ll,ll >
#define sz(a) a.size()
#define inf (1000*1000*1000+5)
#define all(a) a.begin(),a.end()
#define tri pair<int,pii>
#define vii vector<pii>
#define vll vector<pll>
#define viii vector<tri>
#define mod (1000*1000*1000+7)
#define pqueue priority_queue< int >
#define pdqueue priority_queue< int,vi ,greater< int > >

//std::ios::sync_with_stdio(false);   
int pre[100];
int main(){
    std::ios::sync_with_stdio(false);
    string s;
    cin>>s;
    int i;
    if(s.length()<26){
    	rep(i,s.length()){
    		pre[s[i]-'a']=1;
    	}
    	rep(i,26){
    		if(!pre[i])
    			break;
    	}
    	s+=(char)(i+'a');
    	cout<<s<<endl;
    }
    else{
    	int flag=0;
    	rep(i,26){
    		if(s[i]-'a'!=25-i){
    			flag=1;
    		}
    	}
    	if(!flag){
    		cout<<-1<<endl;
    		return 0;
    	}
    	set<int> seti;
    	set<int>::iterator it;
    	seti.insert(s[25]);
    	fd(i,24,0){
    		if(s[i+1]<s[i]){
    			seti.insert(s[i]);
    		}
    		else{
    			seti.insert(s[i]);
    			break;
    		}

    	}
    	string s1="";
    	int j;
    	rep(j,i){
    		s1+=s[j];
    	}
    	it=seti.upper_bound(s[i]);
    	s1+=char(*it);
    	seti.erase(it);
    	cout<<s1<<endl;
    	return 0;
    	while(!seti.empty()){
    		it=seti.begin();
    		s[i++]=(char)*it;
    		seti.erase(*it);

    	}
    	cout<<s<<endl;
    }
    return 0;  
    
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define rrep(i,a,b) for(ll i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()

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

    ll p[n];
    ll c[n];

    rep(i, 0, n){
        cin >> p[i];
        p[i]--;
        c[p[i]] = i + 1;
    }

    ll a[n];
    ll b[n];

    rep(i, 0, n){
        a[i] = (i + 1) * 30000 + c[i];
        b[n - 1 - i] = (i + 1) * 30000;

    }

    rep(i, 0, n){
        cout << a[i] << " ";
    }
    cout << endl;

    rep(i, 0, n){
        cout << b[i] << " ";
    }
    cout << endl;
    return 0;
}


Measured memory_bytes: 1280
#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long

using namespace std;

int main() {
    //freopen("a.in", "r", stdin);
    //freopen("a.out", "w", stdout);

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

    int n;
    cin >> n;
    vector<int> v(n + 1, 0);
    for(int i = 1; i <= n; i ++)
        cin >> v[i];
    int cnt = 0;
    for(int i = 2; i < n; i ++)
        if((v[i] > v[i - 1] && v[i + 1] > v[i]) || (v[i] < v[i - 1] && v[i + 1] < v[i]))
            cnt ++;
    cout << cnt;

    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
#include<limits.h>
#include<string.h>
 
#define N 100
 
int G[N][N];
 
 
int main(){
  int i,j,n,k,v,e,t;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d%d",&v,&e);
    for(j=0;j<e;j++){
      scanf("%d",&t);
      G[i][t-1]=1;
    }
  }
  for(i=0;i<n;i++){
    for(j=0;j<n;j++){
      printf("%d",G[i][j]);
      if(j<n-1){
        printf(" ");
      }
    }
    printf("\n");
  }
  return 0;
}

Measured memory_bytes: 632
#include "bits/stdc++.h"
 
typedef long long ll;
#define int ll
#define fi first
#define se second
#define SORT(a) sort(a.begin(),a.end())
#define rep(i,n) for(int i = 0;i < (n) ; i++) 
#define REP(i,n) for(int i = 0;i < (n) ; i++) 
#define MP(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define INF LLONG_MAX/2
#define all(x) (x).begin(),(x).end()
#define debug(x) cerr<<#x<<": "<<x<<endl
#define debug_vec(v) cerr<<#v<<":";rep(i,v.size())cerr<<" "<<v[i];cerr<<endl
using namespace std;
int MOD = 1000000007;
ll bitpow(ll x,ll n){
    ll ans = 1;
    while(n > 0){
        if(n%2 == 1) ans = ans * x % MOD;
        x = x * x %MOD;
        n = n >> 1;
    }
    return ans;
}
#define N 200001
int fac[N+1];
int inv[N+1];
ll COM(ll n,ll k){
    return fac[n]*inv[k]%MOD*inv[n-k]%MOD;
}
    
signed main(){
    int n,m,k;
    cin >> n >> m >> k;
    fac[0] = 1;
    inv[0] = 1;
    for(int i = 1;i <= N;i++){
        fac[i] = fac[i-1]*i%MOD;
        inv[i] = bitpow(fac[i],MOD-2)%MOD;
    }
    int ans = 0;
    for(int i = 1;i <= n;i++){
        for(int j = 1;j <= m;j++){
            ans += (n-i+1)*(m-j+1)*(i+j-2)%MOD;
            ans %= MOD;
            if(i != 1 && j != 1){
                ans += (n-i+1)*(m-j+1)*(i+j-2)%MOD;
                ans %= MOD;
            }
        }
    }
    ans *= COM(n*m-2,k-2);
    
    
    cout << ans%MOD << endl;

    return 0;
}

// g++ -std=c++14 code1.cpp
// rm -r -f test;oj dl https://cf17-final-open.contest.atcoder.jp/tasks/cf17_final_a
// rm -r -f test;oj dl http://abc127.contest.atcoder.jp/tasks/abc127_a

Measured memory_bytes: 3328
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, [ $t:tt ]) => {
        {
            let len = read_value!($next, usize);
            (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
        }
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        w: i64,
        h: i64,
        x: i64,
        y: i64,
    }
    let multi = if x * 2 == w && y * 2 == h { 1 } else { 0 };
    let area = (w * h) as f64 / 2.0;
    println!("{} {}", area, multi);
}


Measured memory_bytes: 4352
N,Q = map(int, input().split())

Links = [[] for _ in range(N)]
for _ in range(N-1):
    a, b = map(int, input().split())
    Links[a-1].append(b-1)
    Links[b-1].append(a-1)

Ans = [0]*N
for _ in range(Q):
    p, x = map(int, input().split())
    Ans[p-1] += x

checked = [0]*N

import collections
search = collections.deque([0])
while search:
    t = search.pop()
    checked[t] = 1
    for node in Links[t]:
        if checked[node]==1:
            continue
        Ans[node] += Ans[t]
        checked[node] = 1
        search.append(node)
print(*Ans)

Measured memory_bytes: 56168
n, y = [int(i) for i in input().split()]
a, b, c, f = 0, 0, 0, 0

for i in range(n+1):
  for j in range(n+1):
    k = (y - 10000*i - 5000*j)/1000
    if k == n-i-j and k>=0:
      a, b, c = i, j, k
      f += 1
      break
      
if f == 0:
  print(-1,-1,-1)
else:
  print(int(a), int(b), int(c))

Measured memory_bytes: 3188
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <sstream>
#include <algorithm>
#include <deque>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <list>
#include <cstdio>
#include <iostream>
#include <cmath>
#include <climits>
#include <bitset>
#include <functional>
#include <numeric>
#include <ctime>
#include <cassert>
#include <cstring>
#include <fstream>
#include <iomanip>

using namespace std;

#define FOR(i, a, b) for(int (i)=(a);(i)<(b);(i)++)
#define IFOR(i, a, b) for(int (i)=(a);(i)<=(b);(i)++)
#define RFOR(i, a, b) for(int (i)=(a);(i)>=(b);(i)--)
#define REP(i, n) FOR((i), 0, (n))

using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

template<class T>
void print_container(T &container, string delim=" ") {
    bool first = true;
    for(auto &t: container){
        if(!first){
            cout << delim;
        }
        first = false;
        cout << t;
    }
    cout << endl;
}

int gcd(int a, int b){
    if(b == 0)
        return a;

    return gcd(b, a%b);
}
int main() {
    int k;
    cin >> k;
    ll ans = 0;
    IFOR(a, 1, k){
        IFOR(b, 1, k){
            IFOR(c, 1, k){
                ans += gcd(a, gcd(b, c));
            }
        }
    }

    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3168
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define SORT(x) sort(x.begin(), x.end())
#define RS(x) rsort(x.begin(),x,end()))
#define REVE(x) reverse(x.begin(), x.end())
#define ALL(x) (x).begin(), (x).end()
#define pb push_back
#define pob pop_back
#define vint(v,n) vector<int> v(n); REP(i,n) scanf("%d", &v[i]);
int INF = 1e9 + 1;
int MOD = 1e9+7;
struct initon
{
    initon()
    {
        cin.tie(0);
        ios::sync_with_stdio(false);
    };
};
signed main(){
   int  n,a,b;
cin >> n >> a >> b;
if(n==1){
cout <<"Hello World";
}else{
cout << a+b;  
}
}


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

#define REP(i, n) for(int64_t i = 0; i < n; i++)
#define REPR(i, n) for(int64_t i = n; i >= 0; i--)
#define FOR(i, m, n) for(int64_t i = m; i < n; i++)
#define FORR(i, m, n) for(int64_t i = m; i >= n; i--)
#define ALL(v) v.begin(), v.end()
typedef long long ll;
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    fill( (T*)array, (T*)(array+N), val );
}
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;}
const ll INF= 1ll << 60;
const ll MOD = 1000000007;
double EPS = 1e-10;
//----------------------------------------------------------

int N;
pair<int, int> A[100050];

int main(){
    cin >> N;
    FOR(i,1,N+1){
      int a;
      cin >> a;
      A[i]=make_pair(a,i);
    }
    sort(A+1,A+N+1);

    FOR(i,1,N+1)cout << A[i].second << " ";
    cout << endl;
    return 0;
}

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

int main()
{
    int a,b;
    cin >> a >> b;
    long long i = 1;
    long long j = a*i;
    long long ans = 0;
    
    while( 1 )
    {
        if( j % a == 0 && j % b == 0 )
        {
            ans = j;
            break;
        }
        i++;
        j = a * i;
    }
    cout << ans << endl;
    return 0;
}



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

int main() {
  string str, ans;
  cin >> str;
  for (auto s : str) {
    if (s != 'B')
      ans += s;
    else if (!ans.empty()) {
      auto it = ans.end();
      ans.erase(--it);
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef map<int,int> mii;
typedef vector<int> vi;
typedef vector<vector<int>> vii;
typedef vector<long long> vl;
typedef vector<vector<ll>> vll;
typedef vector<bool> vb;
typedef unordered_set<int> si; 
typedef queue<int> qi;
typedef stack<int> sti;
typedef priority_queue<int> pqi;
#define fori(i,a,b) for(int i = (a); i < (b); ++i)
#define rep(i,b,a) for(int i = (b); i >= (a); --i)
#define all(a) (a).begin(), (a).end()
//#define __builtin_popcountll bitCountLL
//#define __builtin_popcount bitCount
//__builtin_ctz 末尾0的个数, __builtin_clz 前导0的个数
//__builtin_ffs 最后一个1的位置
#define maxn 500050
#define Mod 1000000007
const int INF = 2e9;
const ll ML = 4e18;
int dat[maxn * 2];
int n, q;
void init() {
    memset(dat,0,sizeof(dat));
    //n++;
}
int lowbit(int x) {
    return x & -x;
}
void update(int i, int x) {
    while(i <= n) {
        dat[i] += x;
        i += lowbit(i);
    }
}
int getSum(int x) {
    int res = 0, i = x;
    while(i > 0) {
        res += dat[i];
        i -= lowbit(i);
    }
    return res;
}
int query(int l, int r) {
    return getSum(r) - getSum(l -1);
}
void solve() {
    cin >> n >> q;
    vi a(n + 1),ans(q + 1);
    fori(i,0,n) cin >> a[i + 1];
    vector<vector<pii>> vp(n + 1);
    fori(i,1,q + 1) {
        int x, y;
        cin >> x >> y;
        vp[y].push_back({x,i});
    }
    //sort(all(p));
    vi c(n + 1,-1);
    init();
    fori(i,1,n+1) {
        if(c[a[i]] != -1) update(c[a[i]], -1);
        update(i,1);
        c[a[i]] = i;
        for(pii m : vp[i]) {
            int x = m.first, id = m.second;
            ans[id] = query(x,i);
        }
    }
    fori(i,1,q+1) cout << ans[i] << "\n";
}

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
	//cout.precision(30); cout << fixed;
	//freopen("D:\\data_in.txt", "r", stdin);
   
    solve();
   
    /*
    clock_t start,finish;
    start = clock();
    
    finish = clock();
    cout << "\n" << (double)(finish - start) / (double)(CLOCKS_PER_SEC) * 1000 << "ms" << endl;
    */
    return 0;
}

/***************************************************************
 question:
 idea:
 tag:
 record:
 ***************************************************************/


Measured memory_bytes: 35104
# find-union

import sys
input = sys.stdin.readline

#木の根を求める
def find(x):
    if par[x] == x:
        return x
    else:
        return find(par[x])

#xとyの属する集合の併合
def unite(x,y):
    x = find(x)
    y = find(y)

    if x != y:
        #xとyの属している集合が異なるとき
        if rank[x] < rank[y]:
            par[x] = y
            size[y] += size[x]
        else:
            par[y] = x
            size[x] += size[y]
            if rank[x] == rank[y]:
                rank[x] += 1

#xとyが同じ集合に属するかの判定
def same(x,y):
    return find(x) == find(y)

#################################

#初期化
n,m = map(int,input().split())

par = [0]*(n+1)     #親
for i in range(n):
    par[i] = i
rank = [1]*(n+1)    #深さ
size = [1]*(n+1)    #size[i]:iを根とするグループのサイズ

edge = [tuple(map(int,input().split())) for i in range(m)]
edge = edge[::-1]

res = []
for i in range(m):
    fi = find(edge[i][0])
    se = find(edge[i][1])
    if fi == se:
        res.append(0)
    else:
        res.append(size[fi]*size[se])
        unite(fi,se)
ass  = 0
for i in range(m):
    ass += res[m-1-i]
    print(ass)

Measured memory_bytes: 24052
# coding:utf-8
import sys


def main():
    N = int(input())
    # N,M = map(int,input().split())
    coordinate = []
    for i in range(N):
        x, y = map(int, input().split())
        coordinate.append([x, y])
    coordinate.sort()
    # print(coordinate)

    ans = N
    checklist = []

    for i in range(N-1):
        x1 = coordinate[i][0]
        y1 = coordinate[i][1]
        for j in range(i+1, N):
            x2 = coordinate[j][0]
            y2 = coordinate[j][1]
            p = x2 - x1
            q = y2 - y1
            if not [p, q] in checklist:
                checklist.append([p, q])

    for templ in checklist:
        pi = templ[0]
        qi = templ[1]
        count = N
        for i in range(N):
            for j in range(i, N):
                if i == j:
                    continue
                elif coordinate[i][0] + pi == coordinate[j][0] and coordinate[i][1] + qi == coordinate[j][1]:
                    count -= 1
        if count < ans:
            ans = count

    print(ans)
    return


if __name__ == "__main__":
    main()


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

int main(){
int n,m,l,k = 0;
cin >> n >> m >> l;
long long A[n][m]{0}, B[m][l]{0},e = 0;

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

for(int i= 0;i < n;i++){
  for(int j= 0;j < l;j++){
    for(int k = 0; k < m;k++){
      e += A[i][k] * B[k][j];
    }
    if(j+1 == l){
      cout << e << endl;
    }else{
      cout << e << " ";
    }
    e = 0;
  }
} 
return 0;
}


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

int main()
{
  int a, b, c, d;

  cin >> a >> b >> c >> d;

  if ( (abs(a - c) <= d)
    || ((abs(a - b) <= d) && (abs(b - c) <= d)))
  {
    cout << "Yes" << endl;
  }
  else
  {
    cout << "No" << endl;
  }
}


Measured memory_bytes: 256