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

using namespace std;

namespace mp = boost::multiprecision;

#define INF 100000000
#define YJ 1145141919
#define INF_INT_MAX 2147483647
#define INF_LL 9223372036854775
#define INF_LL_MAX 9223372036854775807
#define EPS 1e-10
#define MOD 1000000007
#define MOD9 998244353
#define Pi acos(-1)
#define LL long long
#define ULL unsigned long long
#define LD long double

#define int long long

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(a)  begin((a)), end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())

const int MAX_N = 22;

int N;
int A[MAX_N][MAX_N];
vector<int> aa[MAX_N];

int dp[MAX_N][1 << MAX_N];

signed main()
{
  cin >> N;
  REP(i,N) {
    REP(j,N) {
      cin >> A[i][j];
      if(A[i][j] == 1) {
        aa[i].emplace_back(j);
      }
    }
  }

  dp[0][0] = 1;

  REP(n,N) {
    REP(j,1<<N) {
      if(__builtin_popcount(j) != n) {
        continue;
      }
      for(int next : aa[n]) {
        if((j >> next) & 1) {
          continue;
        }
        dp[n+1][j | (1 << next)] += dp[n][j];
        dp[n+1][j | (1 << next)] %= MOD;
      }
    }
  }

  cout << dp[N][(1<<N)-1] << endl;

  return 0;
}

Measured memory_bytes: 323840
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(),(v).end()
typedef pair<int,int> pii;
const int mod = (int) 1000000007;
const int inf = (int) 2e18;

int32_t main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
  cout << fixed << setprecision(9);
	#ifdef LOCAL_DEFINE
		freopen("in.txt", "rt", stdin);
	#endif
  // code
  string s;
  cin >> s;
  int n = sz(s);
  if(s[n-1] == 's')
      cout << s + "es" << "\n";
  else
      cout << s + "s" << "\n";
  return 0;
}


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

namespace ABC073
{
    class C
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            //int[] A = new int[N];

            Dictionary<int, int> dict = new Dictionary<int, int>();
            int a = 0;
            for (int i = 0; i < N; i++)
            {
                a = int.Parse(Console.ReadLine());
                if (!dict.ContainsKey(a)) { dict.Add(a, 0); }
                if (dict.ContainsKey(a)) { dict[a]++; }
            }
            Console.WriteLine(dict.Count(x => (x.Value) % 2 != 0));
        }
    }
}


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

int main(){
  int N; long long T; cin >> N >> T;
  long long result=0, t, end=0;
  for(int i=0; i<N; i++){
    cin >> t;
    if(t<end){
      result-=(end-t);
    }
    result+=T;
    end=t+T;
  }
  cout << result << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin>>N;
  vector<int>P(N);
  for(int i=0;i<N;i++){
    cin>>P.at(i);
  }
  int count=0;
  for(int i=1;i<N-1;i++){
    if(P.at(i-1)<P.at(i)&&P.at(i)<P.at(i+1)){
      count=count+1;
    }
    else if(P.at(i-1)>P.at(i)&&P.at(i)>P.at(i+1)){
      count=count+1;
    }
  }
  cout<<count<<endl;
}
    

Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <algorithm>
#include <tuple>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#define REP(i, n) for(LL i = 0;i < n;i++)
#define REPR(i, n) for(LL i = n;i >= 0;i--)
#define FOR(i, m, n) for(LL i = m;i < n;i++)
#define FORR(i, m, n) for(LL i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define pb(a) push_back(a)
#define all(x) (x).begin(),(x).end()
#define INF 999999999
#define MOD 1000000007
using namespace std;
typedef long long LL;
typedef pair<int, int> P;
typedef pair<LL, LL> LP;
typedef pair<int, P> PP;
typedef pair<LL, LP> LPP;
int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

/*************** using variables ***************/
int n;
vector<int> a, b, c;
LL ans = 0;
/**********************************************/

int main(){
    cin >> n;

    REP(i, n){
        int x;
        cin >> x;
        a.pb(x);
    }
    REP(i, n){
        int x;
        cin >> x;
        b.pb(x);
    }

    REP(i, n){
        int x;
        cin >> x;
        c.pb(x);
    }
    VSORT(a);
    VSORT(c);
    
    REP(i, n){
        vector<int>::iterator it = lower_bound(all(a), b[i]);
        //
        LL ab = LL(it - a.begin());
        //cout << "ab: " << ab << endl;
        it = upper_bound(all(c), b[i]);
        LL bc = n - LL(it - c.begin());
        //cout << "bc: " << bc << endl;
        ans += ab * bc;
    }
    
    cout << ans << endl;
    
}


Measured memory_bytes: 1784
#define _CRT_SECURE_NO_WARNINGS

#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <cstring>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <list>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <unordered_set>
#include <unordered_map>
#include <array>
#include <cassert>
#include <bitset>
using namespace std;
using LL = long long;

struct edge {
	int to;
	long long cost;
	edge(int to_, long long cost_) :
		to(to_), cost(cost_) {}
};
const long long INF = 123456789012345;
using P = pair<long long, int>;
void dijkstra(vector<edge>graph_[], long long dist[], int n_, int s_) {
	priority_queue<P, vector<P>, greater<P>>que;
	que.push({ 0,s_ });
	fill(dist, dist + n_, INF);
	dist[s_] = 0ll;
	while (!que.empty()) {
		auto q = que.top();
		que.pop();
		long long thd = q.first;
		int thv = q.second;
		if (thd > dist[thv])
			continue;
		for (auto ed : graph_[thv]) {
			if (dist[ed.to] > ed.cost + thd) {
				dist[ed.to] = ed.cost + thd;
				que.push({ dist[ed.to],ed.to });
			}
		}
	}
}

int H, W;
int A[1234][1234];
inline bool ok(int i, int j) {
	return 0 <= i && i < H && 0 <= j && j < W;
}
inline int id(int i, int j) {
	return i * W + j;
}
vector<edge>G[1234567];
const int dx[] = { 0,1,0,-1 };
const int dy[] = { 1,0,-1,0 };
LL dist[1234567];

int main() {
	cin >> H >> W;
	for (int i = 0; i < H; ++i) {
		string S;
		cin >> S;
		for (int j = 0; j < W; ++j) {
			//A[i][j] = S[j] == '#';
			if (S[j] == '#') {
				G[H * W].push_back({ id(i,j),0 });
			}
			for (int d = 0; d < 4; ++d) {
				int ii = i + dx[d];
				int jj = j + dy[d];
				if (ok(ii, jj)) {
					G[id(i, j)].push_back({ id(ii,jj),1 });
				}
			}
		}
	}
	dijkstra(G, dist, H * W + 1, H * W);
	LL ans = 0;
	for (int x = 0; x <= H * W; ++x) {
		ans = max(ans,dist[x]);
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 160228
use proconio::input;
use num::Integer;

fn main() {
    input! {
        K : u32
    };
    let mut res = 0;
    for i in 1..=K {
        for j in 1..=K {
            for k in 1..=K {
                res += i.gcd(&j).gcd(&k);
            }
        }
    }
    println!("{}", res);
}


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

int main() {
    int n; cin >> n;
    int flag = 0;
    for(int i = 0; i < n; i++) {
        char s; cin >> s;
        if(s == 'Y') flag = 1;
    }
    if(flag) cout << "Four" << endl;
    else cout << "Three" << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define CYES cout << "Yes" \
                  << "\n"
#define CNO cout << "No" \
                 << "\n"
#define CFS           \
    cin.tie(nullptr); \
    ios::sync_with_stdio(false);
#define CST(x) cout << fixed << setprecision(x)
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
template <class T>
using MaxHeap = priority_queue<T>;
template <class T>
using MinHeap = priority_queue<T, vector<T>, greater<T>>;
const int IINF = 1 << 30;
const ll LINF = 1LL << 60;
const int MOD = (int)1e9 + 7;
const string MM = " ";

int main()
{
    ll a, b, k;
    cin >> a >> b >> k;
    if (k <= a) {
        cout << a - k << MM << b << "\n";
    }
    else if (k <= a + b) {
        cout << 0 << MM << b - (k - a) << "\n";
    }
    else {
        cout << 0 << MM << 0 << "\n";
    }
}

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

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

    vector <vector <char> > a(n,vector <char>(n));
    vector <vector <char> > b(m,vector <char>(m));
    rep(i,n){
        string s;
        cin >> s;
        rep(j,n){
            a[i][j] = s[j];
        }
    }
    rep(i,m){
        string s;
        cin >> s;
        rep(j,m){
            b[i][j] = s[j];
        }
    }

    bool ans = false;

    for(int i=0; i<=n-m ; i++){     //スタート位置
        for(int j=0; j<=n-m; j++){
            bool ok = true;
            for(int k=0; k<=m-1; k++){
                for(int l=0; l<=m-1; l++){
                    if(a[i+k][j+l] != b[k][l]){
                        ok = false;
                        break;
                    }
                }
                if(!ok){
                    break;
                }
            }

            if(ok) ans = true;
        }
    }

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

Measured memory_bytes: 3616
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define debug(x) cerr << "[(" << __LINE__ << ") " << (#x) << "]: " << x << endl;

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

    int n;
    cin >> n;

    int a[n];
    for (int& e : a) cin >> e;

    vector<int> dp(n, 1e9);
    dp[0] = 0;

    for (int i=1; i<n; i++) {
        dp[i] = min(dp[i], dp[i-1] + abs(a[i]-a[i-1]));
        
        if (i > 1) 
            dp[i] = min(dp[i], dp[i-2] + abs(a[i]-a[i-2]));
    }
    cout << dp[n-1] << "\n";
}


Measured memory_bytes: 1024
#include <stdio.h>
#include <iostream>
using namespace std;

int A,B,C,D,E,F;
bool v[3005];
int ans1,ans2;

int main()
{
    scanf ("%d %d",&A,&B);
    scanf ("%d %d",&C,&D);
    scanf ("%d %d",&E,&F);
    v[0]=1;
    for (int i=1;i<=F;i++)
        {
        if (i>=C && v[i-C]) v[i]=1;
        if (i>=D && v[i-D]) v[i]=1;
        }
    for (int i=0;100*A*i<=F;i++)
        for (int j=0;100*B*j<=F;j++)
            {
            int V;
            V=100*A*i+100*B*j;
            if (V==0) continue;
            if (V>=F) continue;
            for (int k=F-V;k>=0;k--)
                {
                if (v[k]==0) continue;
                if (k>V/100*E) continue;
                if (ans2==0 || k*ans2>(V+k)*ans1)
                    {
                    ans1=k;
                    ans2=k+V;
                    }
                }
            }
    printf ("%d %d",ans2,ans1);
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
vector<ll> v[100000];
bool used[100000] = {};
const ll INF = 1145148931919810;
map<ll, ll> a;
pair<ll, ll> dfs(ll now){
	used[now] = 1;
	pair<ll, ll> ret = pair<ll, ll>(a[now], now);
	for(ll next : v[now]){
		if(used[next]) continue;
		pair<ll, ll> tmp = dfs(next);
		if(tmp.first < ret.first) ret = tmp;
	}
	return ret;
}
int main(){
	ll n, m; cin >> n >> m;
	for(ll i = 0; i < n; i++){
		ll po; cin >> po;
		a[i] = po;
	}
	for(ll i = 0; i < m; i++){
		ll x, y; cin >> x >> y;
		v[x].push_back(y);
		v[y].push_back(x);
	}
	ll ans = 0;
	ll ren = 0;
	for(ll i = 0; i < n; i++){
		if(used[i]) continue;
		pair<ll, ll> tmp = dfs(i);
		ren++;
		ans += tmp.first;
		a.erase(tmp.second);
	}
	if(ren == 1){
		cout << 0 << endl;
		return 0;
	}
	if(2 * ren - 2 > n){
		cout << "Impossible\n";
		return 0;
	}
	vector<ll> po;
	for(auto ite = a.begin(); ite != a.end(); ite++) po.push_back(ite->second);
	sort(po.begin(), po.end());
	for(ll i = 0; i + ren < 2 * ren - 2; i++) ans += po[i];
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 13816
#include <stdio.h>

int cnt[100001];

int main()
{
  int n,a,q,b,c;
  long long s=0;
  scanf("%d",&n);
  for(int i=0;i<n;i++){
    scanf("%d",&a);
    cnt[a]++;
    s+=a;
  }
  scanf("%d",&q);
  for(int i=0;i<q;i++){
    scanf("%d%d",&b,&c);
    s+=(c-b)*cnt[b];
    cnt[c]+=cnt[b];
    cnt[b]=0;
    printf("%lld\n",s);
  }
  return 0;
}


Measured memory_bytes: 3576
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Main main = new Main();
		main.run();
	}

	public void run() {
		Scanner sc = new Scanner(System.in);
		long a=sc.nextLong();
		long b=sc.nextLong();
		long ans = lcm(a,b);
		System.out.println(ans);
		sc.close();
	}

	public long gcd(long a, long b) {
		if(b==0) {
			return a;
		}
		long ans = gcd(b, a%b);
		return ans;
	}
	public long lcm(long a, long b) {
		long g = gcd(a,b);
		return a*b/g;
	}
}


Measured memory_bytes: 25044
list = []
list.append(int(input()))

def f(x):
    if x%2 == 0:
        return x/2
    else:
        return 3*x+1

i = 0
while True:
    next = f(list[i])
    if list.count(next) == 1:
        print(i + 2)
        break
    else:
        list.append(next)
        i+=1

Measured memory_bytes: 2940
import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Main
{
 public static void main(String args[])
  {
    Scanner sc=new Scanner(System.in);
    int n=sc.nextInt(),x=sc.nextInt(),t=sc.nextInt();
    int a;
    if(n%x==0) a=n/x;
    else a=n/x+1;
    System.out.println(a*t);
  }
}


Measured memory_bytes: 27020
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<ll>;
#define all(x) (x).begin(), (x).end()

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, capacity;
    cin >> n >> capacity;
    vll dp(capacity+1);
    while (n--) {
        int w, val;
        cin >> w >> val;
        for (int i=capacity; i>=w; i--) {
            dp[i] = max(dp[i], dp[i-w]+val);
        }
    }
    cout << *max_element(all(dp)) << '\n';
}


Measured memory_bytes: 1024
#include <iostream>
using namespace std;
#define rep(i,n) for((i)=0;(i)<(n);(i)++)
#define max(a,b) ((a)>(b) ? (a) : (b))
#define min(a,b) ((a)<(b) ? (a) : (b))
#define sankaku(x) (((x)*(x)+(x))/2)
typedef long long ll;
int main(){
  ll i,n,result=0;
  cin >> n;
  for(i=1;i<=n;i++){
    result += i * sankaku(n/i);
  }
  cout << result << endl;
  return 0;
}

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

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

clock_t time_p = clock();

void rtime() {
    time_p = clock() - time_p;
    cerr << "Time Taken : " << (float) 1000 * (time_p) / CLOCKS_PER_SEC << "\n";
}

#define int long long
#define IOS ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

const int INF=1e15;
const int MOD=1e9+7;
const int N=2e5+10;

void solve() {
    map<int,int> have;
    for(int i=-1000;i<=1000;i++) {
        have[(i*i*i*i*i)]=i;
    }
    int x;
    cin>>x;
    for(int i=1;i<=1000;i++) {
        int a=i*i*i*i*i;
        if(have.find(a-x)!=have.end()) {
            cout<<i<<" "<<have[a-x]<<"\n";
            return;
        }
    }
}

signed main() {
//#ifndef ONLINE_JUDGE
//    freopen("input.txt", "r", stdin);
//    freopen("output.txt", "w", stdout);
//#endif
    IOS;
    int t = 1;
//    cin >> t;
    for(int i=1;i<=t;i++) {
//        cout<<"Case #"<<tc<<": ";
        solve();
    }
    return 0;
}

Measured memory_bytes: 3808
#include<stdio.h>

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

    int a[n][m];
    int b[m][l];
    int i,j;
    for(i=0;i<n;i++){
        for(j=0;j<m;j++) {
            scanf("%d",&a[i][j]);
        }
    }
    for(i=0;i<m;i++){
        for(j=0;j<l;j++) {
            scanf("%d",&b[i][j]);
        }
    }
    int k;
    long int sum = 0;
    for(i=0;i<n;i++){
        for(j=0;j<l;j++) {
            for(k=0;k<m;k++){
                sum += a[i][k]*b[k][j];
            }
            printf("%ld",sum);
            if(j!=l-1){
                printf(" ");
            }  
            sum = 0;
        }
            printf("\n");    
    }
    return 0;
}


Measured memory_bytes: 2100
#include<iostream>
#include<algorithm>
#include<numeric>
#include<vector>
#include<set>
#include<map>
#include <string>
#include <math.h>
#include <queue>
#include <stack>
#define cinf(n,x,y) for(int i=0;i<(n);i++) cin >> x[i] >>y[i];
typedef long long int ll;
using namespace std;

int main(){
  int n,l; cin >>n>>l;
  int sum=0;
  for(int i=0;i<n;i++){
    sum+=(l+i);
  }
  int dif=1e9;
  int ans=0;
  for(int i=0;i<n;i++){
    int m=sum-(l+i);
    if(abs(sum-m)<dif){
      ans=m;
      dif=abs(sum-m);
    }
  }
  cout << ans << endl;
}

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

int main(){
  int n,m,a[1000],b,hyou[1000] = {};
  cin >> n >> m;
  for(int i = 0;i < n;i++) cin >> a[i];
  for(int i = 0;i < m;i++){
    cin >> b;
    for(int j = 0;j < n;j++){
      if(a[j] <= b) {
	hyou[j]++;
	break;
      }
    }
  }
  int maxcnt = 0,maxnum;
  for(int i = 0;i < n;i++){
    if(maxcnt < hyou[i]){
      maxcnt = hyou[i];
      maxnum = i;
    }
  }
  cout << maxnum + 1 << endl;
  return 0;
}

Measured memory_bytes: 3116
#include <iostream>
#include <iomanip>
#include <sstream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <cassert>
#include <climits>
#include <queue>
#include <set>
#include <map>
#include <valarray>
#include <bitset>
#include <stack>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
typedef long long ll;
typedef pair<int,int> pii;
const int INF = 1<<29;
const double PI = acos(-1);
const double EPS = 1e-8;

typedef complex<double> P;
namespace std {
  bool operator < (const P& a, const P& b) {
    return real(a) != real(b) ? real(a) < real(b) : imag(a) < imag(b);
  }
}
double cross(const P& a, const P& b) {
  return imag(conj(a)*b);
}
double dot(const P& a, const P& b) {
  return real(conj(a)*b);
}
struct L : public vector<P> {
  L(const P &a, const P &b) {
    push_back(a); push_back(b);
  }
  L() {}
};
bool operator<(const L &a, const L &b) {
  return min(a[0].real(), a[1].real()) < min(b[0].real(), b[1].real());
}

P projection(const L &l, const P &p) {
  double t = dot(p-l[0], l[0]-l[1]) / norm(l[0]-l[1]);
  return l[0] + t*(l[0]-l[1]);
}
bool intersectSP(const L &s, const P &p) {
  return abs(s[0]-p)+abs(s[1]-p)-abs(s[1]-s[0]) < EPS; // triangle inequality
}
int ccw(P a, P b, P c) {
  b -= a; c -= a;
  if (cross(b, c) > 0)   return +1;       // counter clockwise
  if (cross(b, c) < 0)   return -1;       // clockwise
  if (dot(b, c) < 0)     return +2;       // c--a--b on line
  if (norm(b) < norm(c)) return -2;       // a--b--c on line
  return 0;
}

double distanceSP(const L &s, const P &p) {
  const P r = projection(s, p);
  if (intersectSP(s, r)) return abs(r - p);
  return min(abs(s[0] - p), abs(s[1] - p));
}
bool intersectSS(const L &s, const L &t) {
  return ccw(s[0],s[1],t[0])*ccw(s[0],s[1],t[1]) <= 0 &&
         ccw(t[0],t[1],s[0])*ccw(t[0],t[1],s[1]) <= 0;
}
double distanceSS(const L &s, const L &t) {
  if (intersectSS(s, t)) return 0;
  return min(min(distanceSP(s, t[0]), distanceSP(s, t[1])),
             min(distanceSP(t, s[0]), distanceSP(t, s[1])));
}

L l[100000];

int main() {
  int N;
  cin >> N;
  REP(i, N) {
    int x1,y1,x2,y2;
    cin >>x1>>y1>>x2>>y2;
    l[i] = L(P(x1,y1),P(x2,y2));
  }
  if (N > 5200) {
    printf("%.10f\n",0.0);
    return 0;
  }
  sort(l, l+N);
  double ans = INF;
  // REP(i, N) {
  //   cout << l[i][0] << " - " << l[i][1] << endl;
  // }
  REP(i, N) {
    double nowx = max(l[i][0].real(), l[i][1].real());
    for (int j=i+1; j<N; ++j) {
      if (ans < min(l[j][0].real(), l[j][1].real()) - nowx) break;
      ans = min(ans, distanceSS(l[i], l[j]));
    }
  }
  printf("%.10f\n", ans);
}

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

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

    vector<int> a(N);
    for (int &elem : a)
    {
        cin >> elem;
    }

    int ans = 0;
    for (int i = 1; i < N; i++)
    {
        if (a[i - 1] == a[i])
        {
            ans++;
            a[i] = -1;
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
// This is an independent project of an individual developer. Dear PVS-Studio, please check it.
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com

#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <cmath>

using namespace std;

int main() {
    long long n, N;
    cin >> n;
    N = n+1;
    if (n == 1) {
        cout << 0;
    } else {
        long long cnt = 0;
        long long divisor = 2;

        while (n > 1) {
            if (divisor*divisor > n) {
                break;
            }

            if (n % divisor == 0) {
                long long divisors = 0;
                while (n % divisor == 0) {
                    ++divisors;
                    n /= divisor;
                }
//                cout << "divisor " << divisor << ", power = " << divisors << endl;

                long long num = 1;
                while (divisors >= num) {
                    divisors -= num;
                    ++num;
                    ++cnt;
                }

//                cout << n << endl;
            } else {
                if (divisor == 2) {
                    divisor = 3;
                } else {
                    divisor += 2;
                }
            }
        }

        if (n > 1) {
            cnt += 1;
        }
        cout << cnt;
    }

    return 0;
}


Measured memory_bytes: 3672
#include <algorithm>
#include <iostream>
#include <queue>
#include <string>
#include <vector>
#include <math.h>
#include <utility>
#include <map>
#include <queue>
#include <stack>

using namespace std;

#define INF 210000000
#define int long long

int gcd(int a, int b) {
  int amari = a % b;
  int c = b;
  if (amari == 0) {
    return b;
  } else {
    return gcd(b, amari);
  }
}

int lcm(int a, int b) { return a * b / gcd(a, b); }

signed main() {
		int a,b,c;
		cin >> a >> b >> c;
		if(a > b + c){
				cout << 0;
		}else{
				cout << c - a + b;
		}
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a),i##formax=(b);i<i##formax;i++)
#define FORR(i,a,b) for(int i=(a),i##formax=(b);i>=i##formax;i--)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define pcnt __builtin_popcount
#define sz(x) (int)(x).size()
#define maxs(x,y) x=max(x,y)
#define mins(x,y) x=min(x,y)
#define show(x) cout<<#x<<" = "<<x<<endl;
#define all(a) (a.begin()),(a.end())
#define each(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define perm(c) sort(all(c));for(bool c##p=1;c##p;c##p=next_permutation(all(c)))
#define bitComb(a,n,k) for(int a##x,a##y,a=(1<<k)-1;a<(1<<n);a##x=a&-a,a##y=a+a##x,a=(((a&~a##y)/a##x)>>1)|a##y)
#define uniq(v) sort(all(v));v.erase(unique(all(v)), v.end())
#define bit(n) (1LL<<(n))
#define randInt(l,r) (uniform_int_distribution<ll>(l,r)(rnd))
#define randDouble(l,r) (uniform_real_distribution<double>(l,r)(rnd))
#define dout(d) printf("%.12f\n",d)

typedef long long ll;
typedef __int128_t lll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
template<class T>using V=vector<T>;
template<class T>using VV=V<V<T>>;
template<class T,class Y>ostream& operator<<(ostream& o,const pair<T,Y>& p){return o<<"("<<p.fi<<", "<<p.se<<")";}
template<typename A,size_t N,typename T>void Fill(A (&array)[N],const T&v){fill((T*)array,(T*)(array+N),v);}
lll gcd(lll a,lll b,lll &x,lll &y){if(!b){x=1;y=0;return a;}lll d=gcd(b,a%b,y,x);y-=a/b*x;return d;}
ll gcd(ll a,ll b){lll x=0,y=0;return gcd(a,b,x,y);}
ll modInv(ll a,ll m){lll x,y;gcd(a,m,x,y);return (x%m+m)%m;}
ll modPow(lll a,lll n,ll m){if(!a)return a;lll p=1;for(;n>0;n>>=1,a=a*a%m)if(n&1)p=p*a%m;return(ll)p;}
bool isPrime(ll n){if(n<2||n%2==0)return n==2;lll t=n-1,d=t/(t&-t);for(lll a:{2,325,9375,28178,450775,9780504,1795265022})if(a%n){for(t=d,a=modPow(a,t,n);t!=n-1&&a!=1&&a!=n-1;a=a*a%n,t=t*2%n);if(a!=n-1&&t%2==0)return 0;}return 1;}
const int IINF = 1e9+6;
const ll LINF = 1e18;
const int MOD = 1e9+7;
const double PI = acos(-1);
const double EPS = 1e-10;
static random_device rd;
static mt19937 rnd(rd());

const int N = 1e5;
int a, e, k;
main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> a;
  FOR(i, 0, 4) cin >> e;
  cin >> k;
  cout << (e-a > k ? ":(" : "Yay!") << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,count1=0,count2=0,c=0;
  string s,a;
  cin >> n;
  for(int i=0; i<n; i++){
	cin >> s;
	if(i==0) if(s == "Un") {
	  count1 = 100;
	  break;
	}
	if(s == "A") {
	  count1++;
	  a = s; c++;
	}
	if(s == "Un" && a == "A"){
	  count2++;
	  c--;
	  if(c<0) break;
	}
  }
  if(count1 == count2) cout << "YES" << endl;
  else cout << "NO" << endl;

  return 0;
}
	



Measured memory_bytes: 3164
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define P pair<int,int>
#define fi first
#define se second
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1000000000000000000
#define MOD 1000000007
#define all(v) v.begin(),v.end()
#define pb push_back
int dx[]={0,1,0,-1},dy[]={1,0,-1,0};
int kaijo[2000010];
struct edge{int to,cost;};
int gcd(int a,int b){
    if(b==0)return a;
    return gcd(b,a%b);
}
int lcm(int a,int b){
    return a/gcd(a,b)*b;
}
bool prime(int a){
    if(a==1)return false;
    for(int i=2;i*i<=a;i++){
        if(a%i==0)return false;
    }
    return true;
}
void init_fact(){
    kaijo[0]=1;
    for(int i=1;i<=2000000;i++){
        kaijo[i]=kaijo[i-1]*i;
        kaijo[i]%=MOD;
    }
}
int modpow(int a,int b){
    if(b==0)return 1;
    if(b%2)return modpow(a,b-1)*a%MOD;
    int memo=modpow(a,b/2);
    return memo*memo%MOD;
}
int comb(int a,int b){
    if(!kaijo[0])init_fact();
    return kaijo[a]*modpow(kaijo[a-b],MOD-2)%MOD*modpow(kaijo[b],MOD-2)%MOD;
}
int inv(int x){
    x=modpow(x,MOD-2);
    return x;
}
bool kosa(double ax,double ay,double bx,double by,double cx,double cy,double dx,double dy){
    double ta=(cx-dx)*(ay-cy)+(cy-dy)*(cx-ax);
    double tb=(cx-dx)*(by-cy)+(cy-dy)*(cx-bx);
    double tc=(ax-bx)*(cy-ay)+(ay-by)*(ax-cx);
    double td=(ax-bx)*(dy-ay)+(ay-by)*(ax-dx);
    return tc*td<0&&ta*tb<0;
}
double dist(double ax,double ay,double bx,double by){
    return sqrt((bx-ax)*(bx-ax)+(ay-by)*(ay-by));
}
int n,x[100010];
vector<int>v;
signed main(){
    cin>>n;
    rep(i,n){
        cin>>x[i];
        if(i)v.pb(x[i]-x[i-1]);
    }
    init_fact();
    int ans=0;
    int A=kaijo[n-1];
    int memo=1;
    rep(i,n-1){
        ans+=A*memo%MOD*v[i]%MOD;
        ans%=MOD;
        int now=inv(i+2)%MOD;
        memo+=now;
        memo%=MOD;
    }
    cout<<ans%MOD<<endl;
    return 0;

}

Measured memory_bytes: 17524
"use strict"
const create = () => {
    const input = require("fs").readFileSync("/dev/stdin", "utf8").trim().split("\n");
    const res = {
        "list": input, "index": 0, "max": input.length,
        "hasNext": function() {return this.index < this.max},
        "next": function() { if (!this.hasNext()) {throw "ArrayIndexOutOfBoundsException";}else{return this.list[this.index++];}}
    };
    return res;
}
const o = create();
const next = () => o.next()
const nextInt = () => parseInt(o.next())
const nextStrArray = () => o.next().split(" ")
const nextIntArray = () => o.next().split(" ").map(el => parseInt(el))
const nextCharArray = () => o.next().split("")
const hasNext = () => o.hasNext()
const myout = (...x) => console.log(...x)
const Main = () => {
    let n = nextInt()
    let a = nextIntArray()
    let ans = 0
    for(let i = 0; i<a.length;i++){
        if((i+1) % 2 !== 0 && a[i] % 2 !== 0) ans++
    }
    console.log(ans)

}
Main()



Measured memory_bytes: 29700
#include<bits/stdc++.h>
#define FAST ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;
//long long int countt[200003];
#include<ext/pb_ds/assoc_container.hpp> // include the associative containers or group of templates such as set, multimap, map etc.
#include<ext/pb_ds/tree_policy.hpp> // include the tree_order_statistics_node update
using namespace __gnu_pbds; //necessary for the GNU based Policy based data structures.
typedef tree<pair<int,int> ,null_type,less<pair<int,int>>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;

#define int long long
#define f first
#define s second
signed main()
{
    FAST;
    
    int i=0,j=0,k=0,n=0,m=0,count=0,temp=0,z;
    int temp1=0,temp2=0,temp3=0,x=0,l=0,y=0,sum=0;
    int ans=0;
    
    
    cin>>n;
    int a[n];
    map<int,int> mp;
    for(i=0;i<n;i++)
    {
        cin>>a[i];
        mp[a[i]]++;
        
    }
    ans=0;
    for(auto it : mp)
    {
        temp = it.second;
        ans = ans + (((temp)*(temp-1))/2);
    }
    
    
    map<int,int> mp1;
    
    for(auto it: mp)
    {
        temp = it.second;
        sum=0;
        if(temp>=2)
        {
        sum = ans - (((temp)*(temp-1))/2);
        
        sum = sum + (((temp-1)*(temp-2))/2);
        
        mp1[it.first]=sum;
        }
        
        else
        {
            mp1[it.first]=ans;
        }
    }
    
    
    for(i=0;i<n;i++)
    {
        cout<<mp1[a[i]]<<endl;
    }
    
    
    
    
}

Measured memory_bytes: 20224
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>

using namespace std;

#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)

using ll = long long;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;

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

    int X;
    cin >> X;
    int kingaku[6] = {100, 101, 102, 103, 104, 105};
    int dp[6][100010] = {{0}};
    dp[0][0] = 1;
    

    for (int i = 0; i < 6; i++)
    {
        for (int j = 0; j < kingaku[i]; j++) {
            if (i > 0) {
                dp[i][j] = dp[i-1][j];
            }
        }
        for (int j = kingaku[i]; j <= X; j++)
        {
            if (i > 0) {
                dp[i][j] = dp[i][j - kingaku[i]] + dp[i-1][j];
            } else {
                dp[i][j] = dp[i][j - kingaku[i]];
            }
            
        }
        
    }



    if (dp[5][X]) {
        cout << 1 << "\n";
    } else {
        cout << 0 << "\n";
    }
    
}

Measured memory_bytes: 2560
#include <bits/stdc++.h>
using namespace std;
int main() {
    string s;
    cin >> s;

    int price = 700;

    if (s[0] == 'o') price += 100;
    if (s[1] == 'o') price += 100;
    if (s[2] == 'o') price += 100;

    cout << price << endl;
}

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

const int MOD = 1e9 + 7;
const int MAX_N = 1e5;

long long fac[MAX_N], finv[MAX_N], inv[MAX_N];

void COMBinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX_N; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

long long COMB(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}


int main() {
    int N, K; cin >> N >> K;
    COMBinit();
    for (int i = 1; i <= K; i++) {
        if (K-1 < i-1 || N-K+1 < i) {
            cout << 0 << endl;
        } else {
            cout << (COMB(K-1, i-1) * COMB(N-K+1, i))% MOD << endl;
        }
    }
}


Measured memory_bytes: 2560
# coding=utf-8

while True:
    try:
        number_list = list(map(float, input().split()))
    except EOFError:
        break
    det = number_list[0]*number_list[4] - number_list[1]*number_list[3]
    inverse_list = [number_list[4] / det, -number_list[1] / det, -number_list[3] / det, number_list[0] / det]

    x = inverse_list[0]*number_list[2] + inverse_list[1]*number_list[5]
    y = inverse_list[2]*number_list[2] + inverse_list[3]*number_list[5]

    print('{0:.3f} {1:.3f}'.format(x, y))

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

using namespace std;
using ll = long long int;

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

    ll k;
    cin >> k;
    ll s = 0;
    for(ll a=1; a<=k; a++)
    for(ll b=1; b<=k; b++)
    for(ll c=1; c<=k; c++) {
        ll g = __gcd(__gcd(a, b), c);
        s += g;
    }
    cout << s << endl;
}


Measured memory_bytes: 3652
/**
 * @Author:      H S-J
 * @DateTime:    2018-01-07 20:01:27
 * @Description: 
 */
#include <bits/stdc++.h>
using namespace std;
#define MST(a, b) memset(a, b, sizeof(a));
#define CLR(a) MST(a, 0);
#define DBG(x) cout << '#' << " = " << (x) << endl;
#define ALL(x) x.begin(), x.end()
#define INS(x) inserter(x, x.begin())
#define lson(x) (x) << 1
#define rson(x) (x) << 1|1
#define pb push_back
#define rep(x, y, z) for (int x = y; x < z; ++x)
#define ech(x, y, z) for (auto x = z.begin(), y = z.end(); x != y; ++x)
#define lowbit(x) (x & (-x))
#define opr operator
#define _st first
#define _nd second
#define prior_q1(x) priority_queue<x>
#define prior_q2(x) priority_queue<x, vector<x>, greater<x> >
typedef long long LL;
typedef stringstream strstm;
struct FastIO {
    static const int S = 1310720;
    int wpos;
    char wbuf[S];
    FastIO() : wpos(0) {}
    inline int xchar() {
        static char buf[S];
        static int len = 0, pos = 0;
        if (pos == len)
            pos = 0, len = fread(buf, 1, S, stdin);
        if (pos == len) return -1;
        return buf[pos ++];
    }
    inline int xuint() {
        int c = xchar(), x = 0;
        while (c <= 32) c = xchar();
        for (; '0' <= c && c <= '9'; c = xchar()) x = x * 10 + c - '0';
        return x;
    }
    inline int xint() {
        int s = 1, c = xchar(), x = 0;
        while (c <= 32) c = xchar();
        if (c == '-') s = -1, c = xchar();
        for (; '0' <= c && c <= '9'; c = xchar()) x = x * 10 + c - '0';
        return x * s;
    }
    inline LL xlongint() {
        LL s = 1, c = xchar(), x = 0;
        while (c <= 32) c = xchar();
        if (c == '-') s = -1, c = xchar();
        for (; '0' <= c && c <= '9'; c = xchar()) x = x * 10 + c - '0';
        return x * s;
    }
    inline void xstring(char *s) {
        int c = xchar();
        while (c <= 32) c = xchar();
        for (; c> 32; c = xchar()) * s++ = c;
        *s = 0;
    }
    inline void wchar(int x) {
        if (wpos == S) fwrite(wbuf, 1, S, stdout), wpos = 0;
        wbuf[wpos ++] = x;
    }
    inline void wint(LL x) {
        if (x < 0) wchar('-'), x = -x;
        char s[24];
        int n = 0;
        while (x || !n) s[n ++] = '0' + x % 10, x /= 10;
        while (n--) wchar(s[n]);
    }
    inline void wstring(const char *s) {
        while (*s) wchar(*s++);
    }
    ~FastIO() {
        if (wpos) fwrite(wbuf, 1, wpos, stdout), wpos = 0;
    }
} io;
const LL maxn = 1e6 + 111;
LL a[maxn], b[maxn];
int main(int argc, char const *argv[]) {
    ios::sync_with_stdio(0);cin.tie(0);
    int n, h; cin >> n >> h;
    rep(i, 0, n) cin >> a[i] >> b[i];
    LL max_a = *max_element(a, a + n);
    sort(b, b + n, [](LL vala, LL valb) {
        return vala > valb;
    });
    LL ans = 0;
    rep(i, 0, n) if(max(a[i], b[i]) >= max_a) {
        if(h <= 0) goto nest;
        h -= max(a[i], b[i]);
        ++ans;
    }
    if(h > 0) ans += (h/max_a) + (h%max_a != 0);
    nest:
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 7168
#include<iostream>
int main(){
  int a,b;
  //std::cin
  std::cin>>a;
  std::cin>>b;
  int c = a * b;
  c = c % 2;
  if(c==0){
    std::cout<<"Even"<<std::endl;
  }else{
    std::cout<<"Odd"<<std::endl;
  }
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef long double ld;
const int inf=1e9+7;
const ll longinf=1LL<<60;

const int mx=100010;
const ll mod=1e9+7;

int n,p[mx];
P a[mx],b[mx];

int main(){
  cin >> n;
  for(int i=0; i<n; i++){cin >> a[i].first; a[i].second=i;}
  for(int i=0; i<n; i++){cin >> b[i].first; b[i].second=i;}
  sort(a,a+n);
  sort(b,b+n);

  for(int i=0; i<n; i++){
    if(a[i].first<=b[i].first){
      continue;
    } else {
      cout << "No" << endl;
      return 0;
    }
  }
  
  for(int i=0; i<n-1; i++){
    if(a[i+1].first<=b[i].first){
      cout << "Yes" << endl;
      return 0;
    }
  }
  
  for(int i=0; i<n; i++){p[a[i].second]=b[i].second;}
  int cnt=0,x=1;
  cnt++;
  x=p[x];
  while(x!=1){x=p[x];cnt++;}
  
  cout << (cnt!=n?"Yes":"No") << endl;
  return 0;
}

Measured memory_bytes: 2176
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;

const int INF = 1 << 28;
int N, M, R;
int r[8];
int A[40000], B[40000], C[40000];
int dis[210][210];

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  
  cin >> N >> M >> R;
  for (int i = 0; i < R; i++) {
    cin >> r[i];
    r[i]--;
  }
  sort(r, r + R);
  fill_n((int*)dis, 210 * 210, INF);
  for (int i = 0; i < N; i++) {
    dis[i][i] = 0;
  }
  for (int i = 0; i < M; i++) {
    cin >> A[i] >> B[i] >> C[i];
    A[i]--; B[i]--;
    dis[A[i]][B[i]] = dis[B[i]][A[i]] = C[i];
  }
  for (int k = 0; k < N; k++) {
    for (int i = 0; i < N; i++) {
      for (int j = 0; j < N; j++) {
        dis[i][j] = min(dis[i][j], dis[i][k] + dis[k][j]);
      }
    }
  }
  int ans = INF;
  do {
    int sum = 0;
    for (int i = 0; i + 1 < R; i++) {
      sum += dis[r[i]][r[i + 1]];
    }
    ans = min(ans, sum);
  } while (next_permutation(r, r + R));
  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 640
A,B,C,D = map(int,input().split())

MOD = 998244353

dp = [[1]*C for _ in [0]*D]

if B<D:
    dp[B][A-1] = A
for i in range(B+1,D):
    j = A-1
    dp[i][j] = dp[i-1][j]*A %MOD
if A < C:
    dp[B-1][A] = B
for j in range(A+1,C):
    i = B-1
    dp[i][j] = dp[i][j-1]*B %MOD

for i in range(B,D):
    for j in range(A,C):
        dp[i][j] = dp[i-1][j]*(j+1) + dp[i][j-1]*(i+1) -dp[i-1][j-1]*i*j
        dp[i][j] %= MOD

print(dp[-1][-1])

Measured memory_bytes: 133728
#include<iostream>
#include<math.h>
using namespace std;

int get_num_of_under_n(int n) {
	bool* numbers = new bool[n + 1];
	for (int i = 2; i < n + 1; i++) {
		numbers[i] = true;
	}
	for (int i = 2; i <= sqrt(n); i++) {
		if (numbers[i] == true) {
			for (int j = 0; i*(j + 2) <= n; j++) {
				numbers[i*(j + 2)] = false;
			}
		}
	}
	int ans = 0;
	for (int i = 2; i < n + 1; i++) {
		if (numbers[i] == true)ans++;
	}
	return ans;
}
int main() {
	int n;
	while (cin>>n) {
		cout << get_num_of_under_n(n)<<endl;
	}
}

Measured memory_bytes: 17352
//QWsin
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define rep(i,x,y) for(int i=x;i<=y;++i)
#define out(i,u) for(int i=first[u];i!=-1;i=next[i])
#define repvc(i,vc) for(int i=0,Sz=vc.size();i<Sz;++i)
inline int read()
{
	char ch=getchar();int ret=0,f=1;
	while(ch<'0' || ch>'9') {if(ch=='-')f=-1;ch=getchar();}
	for(;ch>='0' && ch<='9';ch=getchar()) ret=ret*10+ch-'0';
	return ret*f;
}
using namespace std;

const int INF=1<<30;

int main()
{
	int n;cin>>n;
	if(n==1) puts("Hello World");
	else {
		int a,b;cin>>a>>b;
		cout<<a+b<<endl;	
	}
	return 0;
}


Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#include"bits/stdc++.h"
#define INF         1e9
#define EPS         1e-9
#define REP(i,n)    for(ll i=0,i##_len=(n);i<i##_len;++i)
#define REP1(i,n)   for(ll i=1,i##_len=(n);i<=i##_len;++i)
#define REPR(i,n)   for(ll i=(n)-1;i>=0;--i)
#define REPR1(i,n)  for(ll i=(n);i>0;--i)
#define REPC(i,obj) for(auto i:obj)
#define R_UP(a,b)   (((a)+(b)-1)/(b))
#define ALL(obj)    (obj).begin(),(obj).end()
#define SETP        cout << fixed << setprecision(8)
using namespace std;
using ll = long long;
template<typename T = ll>inline T in() { T x; cin >> x; return x; }

int height(int x, int y, int cx, int cy, int H)
{
	return max(H - abs(x - cx) - abs(y - cy), 0);
}
signed main()
{
	int n = in();
	vector<tuple<int, int, int>>t(n);
	REP(i, n) {
		int x = in(), y = in(), h = in();
		t[i] = make_tuple(x, y, h);
	}
	REP(cx, 101) {
		REP(cy, 101) {
			bool is_ok = true;
			int H;
			REPC(i, t) {
				if (get<2>(i) > 0) {
					H = get<2>(i) + abs(get<0>(i) - cx) + abs(get<1>(i) - cy);
					break;
				}
			}
			REPC(i, t) {
				is_ok &= get<2>(i) == height(get<0>(i), get<1>(i), cx, cy, H);
			}
			if (is_ok) {
				cout << cx << ' ' << cy << ' ' << H << endl;
				return 0;
			}
		}
	}
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define int long long
using namespace std;
const int Maxn=1e2+10,Maxw=1e5+10;
int N,W;
int w[Maxn],v[Maxn];
int Dp[Maxn][Maxw]; 
signed main()
{
	cin>>N>>W;
	for(int i=1;i<=N;i++) cin>>w[i]>>v[i];
	for(int i=1;i<=N;i++) for(int j=0;j<=W;j++)
	{
		Dp[i][j]=Dp[i-1][j];
		if(w[i]<=j) Dp[i][j]=max(Dp[i][j],Dp[i-1][j-w[i]]+v[i]);
	}
	cout<<Dp[N][W]<<endl;
	return 0;
}


Measured memory_bytes: 79360
#define DEBUG(...) cerr << __VA_ARGS__ << endl;

#ifndef CDEBUG
#undef DEBUG
#define DEBUG(...) ((void)0);
#define NDEBUG
#endif

#define ran(i, a, b) for (auto i = (a); i < (b); i++)

#include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
using namespace std;
const int mod = 1e9 + 7;
#ifndef M_PI
const double M_PI = acos(-1.0);
#endif

ll mod_pow(ll x, int n){
  ll r = 1;
  for(int i=1; i<=n; i <<= 1){
    if(i & n){
      r *= x;
      r %= mod;
    }
    x *= x;
    x %= mod;
  }
  return r;
}

ll mod_inv(ll x){
  return mod_pow(x, mod-2);
}

const int nmax = 5005;

int par[nmax];
int sze[nmax];
ll dp[nmax];
ll dps[nmax];

int anc(int i){
  if(par[i]){
    par[i] = anc(par[i]);
    return par[i];
  }
  return i;
}

int main() {
  int n;
  cin>>n;
  vector<int> unknown;
  int cycle_cnt = 0;
  for(int i=1; i<=n; ++i){
    int p;
    cin>>p;
    if(p==-1){
      unknown.push_back(i);
    } else {
      //i is root;
      int v = anc(p);
      if( v != i){
        par[i] = v;
      } else {
        ++cycle_cnt;
      }
    }
  }
  for(int i=1; i<=n; ++i){
    ++sze[anc(i)];
  }
  vector<int> sizes;
  for(int i : unknown){
    sizes.push_back(sze[i]);
  }
  dps[0] = 1;
  for(int m : sizes){
    dps[0] *= n-1;
    dps[0] %= mod;
  }
  ll mult = mod_inv(n-1);
  ll res = dps[0]*(n-cycle_cnt)%mod;
  for(int m : sizes){
    dp[1] = m*dps[0]%mod*mult%mod;
    res += dps[0]*mult%mod;
    res %= mod;
    for(int j=1; j<sizes.size(); ++j){
      dp[j+1] = m*j*dps[j]%mod*mult%mod;
    }
    for(int j=0; j<sizes.size(); ++j){
      dps[j+1] += dp[j+1];
      dps[j+1] %= mod;
    }
  }
  for(int j=0; j<sizes.size(); ++j){
    res -= dps[j+1];
  }
  res %= mod;
  res += mod;
  res %= mod;
  cout<<res<<endl;
  return 0;
}


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

int main(){
  long long N;
  cin >> N;
  vector<long long> a(N);
  for (int i=0; i<N; i++){
    cin >> a[i];
  }
  for (int i=0; i<N; i++){
    if (a[i]!=0) break;
    if (i==N-1){
      cout << "Yes" << endl;
      return 0;
    }
  }
  if (N%3!=0){
    cout << "No" << endl;
    return 0;
  }
  else {
    for (int i=0; i<32; i++){
      long long tmpcnt = 0;
      for (int j=0; j<N; j++){
        if (a[j]&1){
          tmpcnt++;
        }
        a[j]>>=1;
      }
      if (tmpcnt!=0&&tmpcnt!=2*N/3){
        cout << "No" << endl;
        return 0;
      }
    }
  }
  cout << "Yes" << endl;
}


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

#define rep(i, n) for (int i = 0; i < n; ++i)
#define ALL(a) (a).begin(), (a).end()
#define rALL(a) (a).rbegin(), (a).rend()
#define SZ(x) ((int)(x).size())
using ll = long long;
using ull = unsigned long long;
using P = pair<int, int>;
using llP = pair<ll, ll>;
using DoP = pair<double, double>;
const int di[] = {0, 1, 0, -1, 1, 1, -1, -1};
const int dj[] = {1, 0, -1, 0, 1, -1, 1, -1};
const int INF = 1 << 28;
const ll INF64 = 1ll << 55;
const int mod = 1000000007;
//const int mod = 998244353;

template <class T>inline bool chmin(T &a, const T b)
{
  if (a > b)
  {
    a = b;
    return true;
  }
  return false;
}
template <class T>inline bool chmax(T &a, const T b)
{
  if (a < b)
  {
    a = b;
    return true;
  }
  return false;
}
template <class T>inline void line_out(const vector<T> vec) {
  int n = SZ(vec);
  rep(i, n) {
    cout << vec[i];
    if(i < n-1) cout << " ";
  }
  cout << endl;
  return;
}

struct mint
{
  ll x; // typedef long long ll;
  mint(ll x = 0) : x((x % mod + mod) % mod) {}
  mint operator-() const { return mint(-x); }
  mint &operator+=(const mint a)
  {
    if ((x += a.x) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator-=(const mint a)
  {
    if ((x += mod - a.x) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator*=(const mint a)
  {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const
  {
    mint res(*this);
    return res += a;
  }
  mint operator-(const mint a) const
  {
    mint res(*this);
    return res -= a;
  }
  mint &operator++()
  {
    if ((x += 1) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator--()
  {
    if ((x += mod - 1) >= mod)
      x -= mod;
    return *this;
  }
  mint operator*(const mint a) const
  {
    mint res(*this);
    return res *= a;
  }
  mint pow(ll t) const
  {
    if (!t)
      return 1;
    mint a = pow(t >> 1);
    a *= a;
    if (t & 1)
      a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const
  {
    return pow(mod - 2);
  }
  mint &operator/=(const mint a)
  {
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const
  {
    mint res(*this);
    return res /= a;
  }
};

int main()
{
  int n; cin >> n;
  vector<P> p1(n), p2(n);
  rep(i, n) cin >> p1[i].first >> p1[i].second;
  rep(i, n) cin >> p2[i].first >> p2[i].second;
  sort(ALL(p1), [&](P x, P y) {return x.second > y.second;});
  sort(ALL(p2));
  int ans = 0;
  for(auto x : p2) {
    for(auto it = p1.begin(); it != p1.end(); ++it) {
      if(it->first < x.first && it->second < x.second) {
        ++ans;
        p1.erase(it);
        break;
      }
    }
  }
  cout << ans << endl;
}

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

#define rep(X,N) for(ll X = 0; X < (N); X++)
#define PI (acos(-1.0))
#define pback push_back
#define mpair make_pair
#define MODN 1000000007
#define ALL(V) (V).begin(),(V).end()
#define INT_MAX_HALF (INT_MAX / 2)
#define EPS (1e-10)

using namespace std;
typedef long long ll;

map<string, int> m;


int main(){

    int n,m;
    cin >> n >> m;

    cout << n * (n - 1) / 2 + m * (m - 1) / 2 << endl;

    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
int main(){
  int a,c=0,p=0,i,n,m,b[100010]={};
  char s[3];
  scanf("%d %d",&n,&m);
  for(i=0;i<m;i++){
    scanf("%d %s",&a,s);
    if(b[a]<0)continue;
    if(s[0]=='W')b[a]++;
    else{
      p+=b[a];
      b[a]=-1;
      c++;
    }
  }
  printf("%d %d\n",c,p);
  return 0;
}


Measured memory_bytes: 512