akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#include <tuple>
#include <iomanip>
#include <numeric>
#include <unordered_map>
#include <sstream>   
#include<limits.h>
#include<float.h>
#include<list>
#include <array>
#include <complex>
using namespace std;
#define i64  long long
#define int  long long
 
#define I32_MAX 2147483647
#define I64_MAX 9223372036854775807LL
#define I64_MAX2 1223372036854775807LL
#define INF I64_MAX2
#define MOD 1000000007
#define MEM_SIZE 10000
#define DEBUG_OUT true

// int DP[MEM_SIZE][MEM_SIZE] = {0};
// int GMEM[MEM_SIZE][MEM_SIZE] = {0};
template<typename T> void DEBUG(T e){if(DEBUG_OUT == false)return;std::cout << e << std::endl;}
template<class T> void DEBUG(string str, T e){if(DEBUG_OUT == false)return;std::cout <<str << ">>" << e << std::endl;}
template<typename T> void DEBUG(const std::vector<T>& v){if(DEBUG_OUT == false)return;for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void DEBUG(const std::vector<std::vector<T> >& vv){if(DEBUG_OUT == 1)return;for(const auto& v : vv){ DEBUG(v); } }
template <class T> void corner(bool flg, T hoge) {if (flg) {cout << hoge << endl; exit(0);}}
template< typename T1, typename T2 > inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template< typename T1, typename T2 > inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }
template<typename T> void SORT_(vector<int>& v,bool GREATER = 0){if(GREATER == 0)sort(v.begin(),v.end());else{sort(v.begin(),v.end(),std::greater<T>());}}


//CODE
void solve(void)
{
  string s,t;
  cin>>s>>t;
  sort(s.begin(),s.end());
  sort(t.begin(),t.end(),std::greater<char>());
  if(s < t)
  {
    cout<<"Yes"<<endl;
  }
  else
  {
    cout<<"No"<<endl;
  }
  
  
  return;
}


int32_t main(int32_t argc, const char *argv[])
{
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  std::cout << std::fixed;
  std::cout << std::setprecision(9);
  solve();

 
  return 0;
}

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

#define rep(i, n) for(int i = 0; i < (int)n; i++)
#define rep2(i, m, n) for(int i = (int)m; i < (int)n; i++)
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<vi> vii; //2次元配列
typedef vector<ll> vll;
typedef vector<string> vs;


/*FUNCs=================================================*/


/*MAIN==================================================*/
int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);   //cin cout 高速化

    int n; cin >> n;
    vll a(n+1); rep(i,n+1) cin >> a[i];
    vll b(n); rep(i,n) cin >> b[i];
    
    ll cnt = 0;
    for(int i = 0; i < n; i++){
        if(a[i] < 0) a[i] = 0;
        cnt += min(a[i]+a[i+1], b[i]);
        if(a[i] < b[i]){
            a[i+1] -= (b[i] - a[i]);
        }
    }
    cout << cnt <<'\n';
}

Measured memory_bytes: 1792
#include <iostream>
#include <cmath>
#include <stdio.h>
#include <vector>
#include <string>
#include <algorithm>
#include <numeric>
#include <iomanip>
using ll = long long;
using namespace std;

typedef std::pair<int, int> ipair;
bool lessPair(const ipair& l, const ipair& r) { return l.second < r.second; }
bool greaterPair(const ipair& l, const ipair& r) { return l.second > r.second; }

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define irep(i, n) for (int i = 0; i <= (n); ++i)
#define rrep(i, n) for (int i = (n)-1; i >= 0; --i)
#define rirep(i, n) for (int i = n; i >= 0; --i)
int factorical(int n) {
	int sum = 1;
	for (int i = 1; i <= n; ++i)
	{
		sum *= i;
	}
	return sum;
}

vector<int> divisors(int n) {
	vector<int> res;
	for (int i = 1; i * i <= n; ++i) {
		if (n % i != 0) continue;
		res.push_back(i);
		if (n / i == i) continue; // 上の行で追加済み。
		res.push_back(n / i);
	}
	return res;
}
vector<ll> divisors_ll(ll n) {
	vector<ll> res;
	for (ll i = 1; i * i <= n; ++i) {
		if (n % i != 0) continue;
		res.push_back(i);
		if (n / i == i) continue; // 上の行で追加済み。
		res.push_back(n / i);
	}
	return res;
}


void printVector(const vector<int>& vec) {
	for (int value : vec) {
		cout << value << " ";
	}
	cout << endl;
}

bool pal(string s) {
	int n = s.length() / 2;
			rep(i, n) {
			if (s[i] != s[s.length() - 1 - i]) return false;
		}
			return true;
}

int euclidean_gcd(int a, int b) {
	if (a < b) return euclidean_gcd(b, a);
	int r;
	while ((r = a % b)) {
		a = b;
		b = r;
	}
	return b;
}

vector <string> vec_sort_and_del(vector<string> s) {
	std::sort(s.begin(), s.end());
	s.erase(std::unique(s.begin(), s.end()), s.end());
	return s;
}

int GetDigit(int num) {
	int digit = 0;
	while (num != 0) {
		num /= 10;
		digit++;
	}
	return digit;
}

int main() {
	ll x, year;
	cin >> x;
	ll mo = 100;
	year = 0;

	while (mo < x) {
		mo += mo / 100;
		year += 1;
	};
	cout << year << endl;

	return 0;
}




Measured memory_bytes: 3636
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <string>
#include <vector>
#include <climits>
#include <map>
#include <math.h>

using namespace std;

typedef signed long long ll;

int main(void)
{
    int N = 0;
    cin >> N;
    
    int ret = (int)sqrt((double)N);

    cout << ret * ret << endl;
    return 0;
}


Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#include <algorithm>
#include<cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include<iostream>
#include<queue>
#include<set>
#include<string>
#include <vector>

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)   FOR(i,0,n)
#define M 1046527
#define NIL (-1)
#define L 14

char H[M][L];

using namespace std;

int getChar(char ch){
	if (ch == 'A'){
		return 1;
	}
	else if (ch == 'C'){
		return 2;
	}
	else if (ch == 'G'){
		return 3;
	}
	else if (ch == 'T'){
		return 4;
	}
	else{
		return 0;
	}
}

long long getKey(char str[]){
	long long sum = 0, p = 1;
	REP(i, strlen(str)){
		sum += p*(getChar(str[i]));
		p *= 5;
	}
	return sum;
}

int h1(int key){
	return key%M;
}
int h2(int key){
	return 1 + (key % (M - 1));
}

int find(char str[]){
	long long key, i, h;
	key = getKey(str);
	for (i = 0;; i++){
		h = (h1(key) + i*h2(key)) % M;
		if (strcmp(H[h], str) == 0){
			return 1;
		}
		else if (strlen(H[h]) == 0){
			return 0;
		}
	}
	return 0;
}

int insert(char str[]){
	long long key, i, h;
	key = getKey(str);
	for (i = 0;; i++){
		h = (h1(key) + i*h2(key)) % M;
		if (strcmp(H[h], str) == 0){
			return 1;
		}
		else if (strlen(H[h]) == 0){
			strcpy(H[h], str);
			return 0;
		}
	}
	return 0;
}

int main(){
	int n, h;
	char str[L], com[9];
	REP(i, M){
		H[i][0] = '\0';
	}
	scanf("%d", &n);
	REP(i, n){
		scanf("%s %s", com, str);
		if (com[0] == 'i'){
			insert(str);
		}
		else{
			if (find(str)){
				printf("yes\n");
			}
			else{
				printf("no\n");
			}
		}
	}

	return 0;
}


Measured memory_bytes: 17456
#include <iostream>
#include <cstring>
#include <vector>
#include <cstdio>
#include <string>
#include <cmath>
#include <queue>
#include <set>
#include <map>
#include <complex>
#include <ctime>
#include <cstdlib>
#include <bitset>
#include <algorithm>
using namespace std;
typedef long long ll;
typedef double db;
typedef pair<int,int> pii;
typedef vector<int> vi;
#define de(x) cout << #x << "=" << x << endl
#define rep(i,a,b) for(int i=a;i<(b);++i)
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define fi first
#define se second
const int N = 101010;
int n , L , x[N] , to[20][N] , Q;

int Query(int u,int v){
    int step = 0;
    for(int i=19;i>=0;--i) if(to[i][u] < v)
        step |= 1<<i , u = to[i][u];
    return step + 1;
}

int main(){
    scanf("%d",&n);
    rep(i,0,n) scanf("%d",x + i);
    scanf("%d%d",&L,&Q);
    rep(i,0,n) to[0][i] = upper_bound(x,x+n,x[i]+L)-x-1;
    rep(d,1,20) for(int i=n-1;i>=0;--i)
        to[d][i] = to[d-1][to[d-1][i]];
    rep(i,0,Q){
        int u , v;
        scanf("%d%d",&u,&v);
        if(u > v) swap(u,v);
        --u;--v;
        printf("%d\n",Query(u,v));
    }
    return 0;
}


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

int main () {
  int s;
  cin >> s;
  
  bool flag = false;
  
  if (s == 1 || s == 2) {
    cout << 4 << endl;
    return 0;
  }
  
  if (s == 4) flag = true;
  
  for (int i = 2; i < 1000001; i++) {
    if (s % 2 == 0) {
      s = s / 2;
      if (s == 4 && flag) {
        cout << i << endl;
        return 0;
      } else if (s == 4){
        flag = true;
      }
    } else {
      s = 3 * s + 1;
      if (s == 4 && flag) {
        cout << i << endl;
        return 0;
      } else if (s == 4){
        flag = true;
      }
    }
  }
  
  return -1;
}

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

int main()
{
  char a1[150],a2[150];
  char pt;
  int l1,l2,i,j;
  scanf("%s",&a1);
  scanf("%s",&a2);
  l1=strlen(a1);
  l2=strlen(a2);
  if(l1!=l2)
  {
      printf("No\n");
  }
  else
  {
      for(i=0;i<l1;i++)
      {
          if(strcmp(a1,a2)==0)
          {
              printf("Yes\n");
              break;
          }
          else
          {
              pt=a1[l1-1];
              for(j=l1-2;j>=0;j--)
              {
                  a1[j+1]=a1[j];
              }
              a1[0]=pt;
          }
      }
      if(i==l1)
      {
          printf("No\n");
      }
  }
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  int N,S=0;
  string s;
  cin>>N;
  for(int i=0;i<N;i++){
    cin>>s;
      if(s=="Y"){
        S=1;
        break;
      }
  }
  if(S==1)
    cout<<"Four"<<endl;
  
  else
    cout<<"Three"<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define i64 long long
int main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);

    int n,a,b;
    cin >>n>>a>>b;
    bool check[100];
    for(int i=1;i<=n;i++){
        check[i]=true;
    }
    check[a]=false,check[b]=false;
    int al=a,bo=b;bool m1=true,m2=false,go_left=false,go_right=false;
    while((al<=n&&al>=1) ||(bo<=n&&bo>=1)){
       // cout <<1111<<endl;
       if(!m2&& m1){//cout <<m1<<" al move "<<m2<<endl;
          if(((al-1)<(n-al))){go_right=true;}
          else{go_left=true;}
          if((check[al+1]==true&&(al+1)<=n)||(check[al-1]==true && (al-1)>=1)){
                if(go_right && check[al+1]==true){check[al]=true;
                al++;check[al]=false;//cout <<"AL+ "<<al<<endl;
                m1=false;m2=true;
                go_right=go_left=false;
                if(al>n){cout <<"Borys\n";break;}}

                else if(go_left && check[al-1]==true){
                check[al]=true;
                al--;check[al]=false;//cout <<"AL-"<<al<<endl;
                m1=false;m2=true;
                go_right=go_left=false;
                if(al<1){cout <<"Borys\n";break;}}
                else{cout <<"Borys\n";break;}

            }
           else{cout <<"Borys\n";break;}

        }
       else if(!m1&&m2){//cout <<m1<<" bo move "<<m2<<endl;
            if((bo-1)<(n-bo)){go_right=true;}
            else{go_left=true;}
            if((check[bo+1]==true && (bo+1)<=n)|| (check[bo-1]==true && (bo-1)>=1)){
                if(go_right && check[bo+1]==true){
                check[bo]=true;
                bo++;check[bo]=false;//cout <<"BO+"<<bo<<endl;
                m2=false;m1=true;
                go_right=go_left=false;
                if(bo>n){cout <<"Alice\n";break;}}

                else if(go_left && check[bo-1]==true){
                check[bo]=true;
                bo--;check[bo]=false; //cout <<"BO-"<<bo<<endl;
                m2=false;m1=true;
                go_right=go_left=false;
                if(bo<1){cout <<"Alice\n";break;}}
                else{cout <<"Alice\n";break;}

            }
            else{cout <<"Alice\n";break;}

       }

    }

	return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

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

    int n = sc.nextInt();
    int m = sc.nextInt();

    if (n == 1 && m == 1) {
      System.out.println(0);
      return;
    }

    int nSum = n > 1 ? (n * (n - 1)) / 2 : 0;
    int mSum = m > 1 ? (m * (m - 1)) / 2 : 0;
    System.out.println(nSum + mSum);
  }
}


Measured memory_bytes: 21844
#include<bits/stdc++.h>
using namespace std;
long long n,i,a[222222],b,x,b1,b2,min1,min2,min3,min4,b3;
int main()
{
    cin>>n;
    for(i=1;i<=n;i++)
    {
        cin>>a[i];
        a[i]-=i;
    }
    sort(a+1,a+n+1);
    b1=a[n/2-1];
    b=a[n/2];
    b2=a[n/2+1];
    b3=(b+b1+b2)/3;
    for(i=1;i<=n;i++)
    {
        min1+=abs(a[i]-b);
        min2+=abs(a[i]-b1);
        min3+=abs(a[i]-b2);
        min4+=abs(a[i]-b3);
    }
    cout<<min(min(min1,min2),min(min3,min4));
}


Measured memory_bytes: 1792
a = [1,3,5,7,8,10,12]
b = [4,6,9,11]
c = [2]

x,y = list(map(int,input().split(" ")))
if (x in a and y in a) or (x in b and y in b) or (x in c and y in c):
    print("Yes")
else:
    print("No")

Measured memory_bytes: 3060
#include<bits/stdc++.h>
#define rint register int
#define deb(x) cerr<<#x<<" = "<<(x)<<'\n';
using namespace std;
typedef long long ll;
using pii = pair <int,int>;
ll n, a, b; 

int main() {
	scanf("%lld%lld%lld", &n, &a, &b);
	if((b - a) & 1) {
		ll a1 = 1, b1 = b - a, ans1 = a;
		ll a2 = a + (n - b) + 1, b2 = n, ans2 = n - b + 1;
		ans1 += (b1 - a1) / 2;
		ans2 += (b2 - a2) / 2;
		printf("%lld", min(ans1, ans2));
	}
	else printf("%lld", (b - a) / 2);
	
	
}
/*

*/


Measured memory_bytes: 256
#include <cstdio>
#include <vector>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <cstdlib>
#include <iostream>

using namespace std;

int main() {
  int a[3];
  cin >> a[0] >> a[1] >> a[2];
  sort(a,a+3);
  int count = 0;
  count += a[2] - a[1];
  a[0] += count;
  a[1] += count;

  count += (a[2]-a[0])/2;
  count += (a[2]-a[0])%2==1 ? 2 : 0;

  cout << count << endl;
}


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

const int INF = 1e9;

int main() {
	int n;
	cin >> n;
	vector<vector<int>> a(n, vector<int>(n));
	rep(i, n) rep(j, n) cin >> a[i][j];
	vector<int> mn(n, INF);
	mn[0] = 0;
	vector<bool> used(n, false);
	int ans = 0;
	while (1) {
		int v = -1;
		rep(u, n) if (!used[u] && (v == -1 || mn[u] < mn[v])) v = u;
		if (v == -1) break;
		used[v] = true;
		ans += mn[v];
		rep(u, n) if (a[v][u] != -1) mn[u] = min(mn[u], a[v][u]);
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 3152
#include <iostream>
#include <string>
#include <sstream>
#include <stack>
#include <algorithm>
#include <cmath>
#include <queue>
#include <bitset>
#include <iomanip>
#include <limits>
#include <chrono>
#include <random>
#include <array>
#include <unordered_map>
#include <functional>
#include <complex>
#include <numeric>
#include <cctype>
#include <map>
#include <set>
#include <cstdlib>
#include <bitset>
#include <tuple>
#include <assert.h>
#include <deque>
#include <utility>


using namespace std;
typedef long long ll;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<typename T> T gcd(T a, T b) { a = abs(a), b = abs(b); while (b > 0) { tie(a, b) = make_pair(b, a % b); } return a; }
//mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());

constexpr long long INF = 1LL << 60;
constexpr int inf = 1000000007;
constexpr long long mod = 1000000007LL;
//constexpr long long mod = 998244353LL;

int main()
{

	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	ll n, k; cin >> n >> k;
	vector<ll> a(n); for (int i = 0; i < n; i++) cin >> a[i];
	vector<ll> mn, zr, pl;
	for (int i = 0; i < n; i++) {
		if (a[i] < 0) mn.emplace_back(-a[i]);
		if (a[i] == 0) zr.emplace_back(a[i]);
		if (a[i] > 0) pl.emplace_back(a[i]);
	}
	ll msz = mn.size(), zsz = zr.size(), psz = pl.size();
	sort(mn.begin(), mn.end());
	sort(pl.begin(), pl.end());
	if (msz * psz >= k) {
		ll lf = 0;
		ll rg = INF;
		reverse(mn.begin(), mn.end());
		while (rg - lf > 1) {
			ll mid = (lf + rg) >> 1;
			ll cur = 0;
			ll cnt = 0;
			for (auto& p : pl) {
				while (cur < msz and p * mn[cur] >= mid) {
					cur++;
				}
				cnt += cur;
			}
			if (cnt >= k) lf = mid;
			else rg = mid;
		}
		cout << -lf << "\n";
		return 0;
	}
	else k -= msz * psz;
	if (zsz * (zsz - 1) / 2 + zsz * (psz + msz) >= k) {
		cout << 0 << "\n";
		return 0;
	}
	else {
		k -= zsz * (zsz - 1) / 2 + zsz * (psz + msz);
	}
	ll lf = 0;
	ll rg = INF;
	while (rg - lf > 1) {
		ll mid = (lf + rg) >> 1;
		auto f = [&](vector<ll> &v)->ll {
			int n = v.size();
			ll cnt = 0;
			int rg = n;
			for (int lf = 0; lf + 1 < v.size(); lf++) {
				while (rg > 0 and v[lf] * v[rg - 1] > mid) {
					rg--;
				}
				cnt += max(0, rg - (lf + 1));
			}
			return cnt;
		};
		ll cnt = 0;
		cnt += f(mn);
		cnt += f(pl);
		if (cnt >= k) rg = mid;
		else lf = mid;
	}
	cout << rg << endl;
	return 0;
}


Measured memory_bytes: 7000
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
cnt = 0
for i in range(n - 1):
  if a[i + 1] - a[i] == 1:
    cnt += c[a[i] - 1]
print(cnt + sum(b))

Measured memory_bytes: 9128
#include<bits/stdc++.h>
using namespace std;
int main(){
  string t;
  cin>>t;
  for(int i=0;i<t.size();i++){
    if(t.at(i)=='?'){
      t.at(i)='D';
    }
  }
  for(int i=0;i<t.size();i++){
    cout<<t.at(i);
  }
  cout<<endl;

      

  
}

Measured memory_bytes: 3720
#include<bits/stdc++.h> 
using namespace std; 
//===================================tempelet=======================================
// set is array that maintain assending order
//unordered map is faster then ordered map
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL); 
#define endl "\n"
#define ll long long int
#define ull unsigned long long int
#define comp bool comp(ll x, ll y){return x>y;}
#define pb push_back
#define For(a,n,xx) for(long xx=a;xx<n;xx++)
#define vi vector<int>
#define vc vector<char>
#define vll vector<ll>
#define vvi vector<vi>
#define vvc vector<vc>
#define umap unordered_map
//for(auto &i:arr) cin>>i;//fast input in loop
#define mode 1000000007

//======================debug======================================================
#define parr(arr) for(auto &i:arr) cerr<<i<<" "; cerr<<endl;
#define pvar(a) cerr<<a<<endl;
#define pset(time) for(auto it=time.begin(); it!=time.end();it++) cerr<< *it <<" "; cerr<<endl;

#define pvact(v)  for (ll x : v) cerr << x << " ";
#define pmap(m)  for(auto it=m.begin();it!=m.end();it++) cerr<< it->first <<"->"<<it->second <<endl;
//=================================================================================
void solve();
ll mod(ll x)
{
	if(x<0)
		return -1*x;
	else return x;
}

bool needw(vector<int>v)
{
	for(int i=0;i<v.size()-1;i++)
	{
		if(v[i+1]>v[i])
			return true;
	}
	return false;
}
//=================================================================================
int main() 
{
	fastio
	

	int t=1; 
	// cin>>t; 
	for(int i=1;i<=t;i++) 
	{ 
		// cerr<<"=============\n";
		//ll ans=0;
		//test case

		solve() ;
		cout<<endl;
		//cout<<ans<<endl;
		//cout<<"Case #"<<i<<": "<< ans; 
	}	 
	cerr<<"time taken : "<<(float)clock()/CLOCKS_PER_SEC<<" secs"<<endl; 
	return 0; 
} 


void solve() 
{ 
	ll n;
	cin>>n;
	string s="ACL";

	for(int i=0;i<n;i++)
		cout<< s;




} 


Measured memory_bytes: 3720
#include<iostream>
using namespace std;
int main()
{
	int i, n;
	cin >> n;
	for (i = 9; i > 0; i--) {
		if ((n%i == 0) && 1 <= n / i && n / i <= 9) {
			cout << "Yes" << endl;
			return 0;
		}
	}
	cout << "No" << endl;
	return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <cmath>
#include <algorithm>
#include <functional>
#include <stack>
#include <numeric>
typedef long long ll;
using namespace std;
const int MOD = (int)1e9 + 7;
const ll INF = (ll)1e18 + 7;
#define int long long
#define vint vector<int>
#define pint pair<int,int>
#define pb(a) push_back(a)
#define all(v) v.begin(),v.end()
#define dbg(x) cerr << #x << " = " << (x) << endl
#define yn(b) cout << ((b) ? "Yes" : "No") << endl
#define YN(b) cout << ((b) ? "YES" : "NO") << endl

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

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

	int N;
	cin >> N;

	if(N==1){
		cout << "Hello World" << endl;
	}else{
		int a, b;
		cin >> a >> b;
		cout << a + b << endl;
	}

	return 0;
}

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

int	main() {
	int N;
	cin >>N;
	vector<int> F(N, 0);
	for (int i=0; i<N; i++) {
		int FF=0;
		for (int j=0; j<10; j++) {
			int FFF;
			cin >>FFF;
			FF=FF<<1;
			FF +=FFF;
		}
		F.at(i)=FF;
	}
	vector<vector<int>> P(N, vector<int> (11, 0));
	for (int i=0; i<N; i++)
		for (int j=0; j<=10; j++)
			cin >>P.at(i).at(j);
	int S=-1000000000;
	for (int i=1; i<pow(2, 10); i++) {
		int SS=0;
		for (int j=0; j<N; j++) {
			int A=i&F.at(j);
			int B=0;
			while (0!=A) {
				B +=A%2;
				A /=2;
			}
			SS +=P.at(j).at(B);
		}
		S=max(S, SS);
	}
	cout <<S <<endl;
	return 0;
};


Measured memory_bytes: 256
import sys
from math import gcd

input = sys.stdin.readline


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

    G = A[0]
    for a in A:
        G = gcd(G, a)

    if K <= max(A) and K % G == 0:
        ans = "POSSIBLE"
    else:
        ans = "IMPOSSIBLE"

    print(ans)


if __name__ == "__main__":
    main()


Measured memory_bytes: 19956
#include<bits/stdc++.h>
using namespace std;
int main()
{
   string a,b,c;
   cin>>a>>b>>c;
   if(a[a.size()-1] == b[0] && b[b.size()-1 ]== c[0])
   {
   	cout<<"YES";
   	return 0;
   }
   else
   {
   	cout<<"NO";
   	return 0;
   }
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
main(){
	int a[3];
	cin>>a[0]>>a[1]>>a[2];
	sort(a,a+3);
	int ans = INT_MAX;
	do{
    	int p = abs(a[0] - a[1]) + abs(a[1] - a[2]);
    	ans = min(ans,p);
  	}while ( std::next_permutation(a,a+3) );
	cout<<ans<<endl;
}

Measured memory_bytes: 256
package main

import (
	"fmt"
)

func main() {
	var r int
	fmt.Scan(&r)
	if r < 1200 {
		fmt.Println("ABC")
	} else if r < 2800 {
		fmt.Println("ARC")
	} else {
		fmt.Println("AGC")
	}
}

Measured memory_bytes: 1768
#include<iostream>
#include<vector>
using namespace std;
int main(){
	int s=0,n;
	vector<int> a;
	cin>>n;
	for(int i=0;i<n;i++){
		int temp;
		cin>>temp;
		a.push_back(temp);
		s+=temp;
	}
	s/=n;
//	cout<<s<<endl;
	int res=0;
	int k;
	for(int i=s;i<=s+1;i++){
//		cout<<'i'<<i<<endl;
		for(int j=0;j<n;j++){
//			cout<<'j'<<j<<endl;
			res+=(i-a[j])*(i-a[j]);
//			cout<<'r'<<res<<endl;
		}if(i==s){
			k=res;
		}else if(k<res&&i!=s){
			cout<<k;
			return 0;
		}else if(i!=s){
			cout<<res;
			return 0;
		}
		res=0;
	}
	return 0;
}

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

#define Abigail inline void
typedef long long LL;

int a,b,t,cnt;

Abigail into(){
  scanf("%d%d%d",&a,&b,&t);
}

Abigail work(){
  for (int i=a;i<=t;i+=a) cnt+=b;
}

Abigail outo(){
  printf("%d\n",cnt);
}

int main(){
  into();
  work();
  outo();
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define REP(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) REP(i, 0, n)
#define rrep(i, n) for (int i = (int)(n-1); i >= 0; i--)
#define sz(x) int(x.size())
#define bitsz(x) int(__builtin_popcount(x))
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define pb(x) push_back(x)
#define INF 1e9
#define LINF 1e18
#define mod 1000000007
template<class T> inline bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T &a, const T &b) { if (a > b) { a = b; return 1; } return 0; }
template < typename T > inline string toString( const T &a ) { ostringstream oss; oss << a; return oss.str(); };
typedef long long ll;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
const int di[4] = {1,0,-1,0};
const int dj[4] = {0,1,0,-1};


int main() {
    int h,w,m; cin >> h >> w >> m;
    vector<P> b(m);
    rep(i,m) cin >> b[i].first >> b[i].second;
    set<P> st;
    rep(i,m) st.insert(b[i]);
    map<int,int> mph, mpw;
    rep(i,m) {
        mph[b[i].first]++;
        mpw[b[i].second]++;
    }
    int nh = 0, nw = 0;
    for (auto x : mph) {
        chmax(nh, x.second);
    }
    for (auto x : mpw) {
        chmax(nw, x.second);
    }
    set<int> sth, stw;
    for (auto x : mph) {
        if (x.second == nh) sth.insert(x.first);
    }
    for (auto x : mpw) {
        if (x.second == nw) stw.insert(x.first);
    }

    for (auto x : sth) { //重複しないやつがあるか調査
        for (auto y : stw) {
            if (st.find(P(x,y)) == st.end()) {
                cout << nh + nw << endl;
                return 0;
            }
        }
    }

    cout << nh + nw - 1 << endl;

}

Measured memory_bytes: 75736
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<n;i++)
#define rev(i,n) for(int i=n-1;i>=0;i--)
#define all(v) v.begin(),v.end()
#define P pair<int,int>
#define len(s) (int)s.size()

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;
}
constexpr int mod = 1e9+7;
constexpr int inf = 3e18;


signed main(){
	int A,B,C,K;cin>>A>>B>>C>>K;
	rep(i,K+1)rep(j,K-i+1){
		int k=K-i-j;
		int a=A<<i;
		int b=B<<j;
		int c=C<<k;
		if(a<b&&b<c){
			cout<<"Yes"<<endl;return 0;
		}
	}
	cout<<"No"<<endl;
}

Measured memory_bytes: 3632
#include<bits/stdc++.h>
main(){
  int n,m;
  while(scanf("%d%d",&n,&m),n){
    int i,j,h[1501],w[1501],x;
    std::map<int,int>a;
    for(x=i=0;i<n;h[++i]=x)scanf("%d",&j),x+=j;
    for(x=i=0;i<m;w[++i]=x)scanf("%d",&j),x+=j;
    for(x=i=0;i<=n;++i)for(j=0;j<=m;++j)++a[h[i]-w[j]];
    for(auto &e:a)x+=e.second*(e.second-1)/2;
    printf("%d\n",x);
  }
}

Measured memory_bytes: 29956
def get_primes(n):
    x = [0,0]+[i for i in range(2,n+1)]
    for i in range(int(n**0.5+1)):
        e = x[i]
        if e !=0:
            for j in range(e*2, n+1,e):
                x[j] = 0
    return filter(None, x)

PRIMES = get_primes(10000)
n = int(input())
c = 0
for i in range(n):
    p = int(input())
    f = 1
    for e in PRIMES:
        if e >= p:
            break
        if p % e == 0:
            f = 0
            break
    c += f
print c

Measured memory_bytes: 4892
import std.stdio;
import std.string;
import std.conv;
import std.algorithm;
import std.math;

void main(){
	uint N;
	readf("%d\n",&N);
	for(uint i;i<N;++i){
		string[] str=readln().split;
		int[] n=[str[0].to!int,str[1].to!int,str[2].to!int];
		n.sort;
		if(n[2]*n[2]==n[0]*n[0]+n[1]*n[1]){
			writeln("YES");
		}else{
			writeln("NO");
		}
	}
}

Measured memory_bytes: 2436
import sys
s = input()
op = '+-'
for i in op:
    for j in op:
        for k in op:
            if eval(s[0]+i+s[1]+j+s[2]+k+s[3]) == 7:
                print(str(s[0]+i+s[1]+j+s[2]+k+s[3]+'=7'))
                sys.exit()


Measured memory_bytes: 2940
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,k,d,i,j,l,count=0;
	map<int ,int>mp;
	cin>>n>>k;
	for(i=1;i<=k;i++)
	{
		cin>>d;
		for(j=1;j<=d;j++)
		{
			cin>>l;
			mp[l]=1;
		}
	}
	for(i=1;i<=n;i++)
	{
		if(mp[i]==0)count++;
	}
	cout<<count<<endl;
	return 0;
}


Measured memory_bytes: 3636
#include <iostream>
struct node{int p,l,r;};
node t[25];
node ti[25];
int n,flag[25];
using namespace std;
void pr(int now){
  if(flag[now]==0){
    cout<<" "<<now;
    flag[now]=1;
  }
  if(t[now].l!=-1){
    pr(t[now].l);
    if(t[t[now].l].r!=-1) pr(t[t[now].l].r);
  }
}
void in(int now){
  if(ti[now].l!=-1) in(ti[now].l);
  cout<<" "<<now;
  if(ti[now].r!=-1) in(ti[now].r);
}
void po(int now){
  //cout<<now<<" ";
  if(t[now].l!=-1) po(t[now].l);
  if(flag[now]==0){
    cout<<" "<<now;
    flag[now]=1;
  }
  if(t[now].r!=-1) po(t[now].r);
}
int main(){

  int t1,t2,t3;
  cin>>n;
  for(int i=0;i<n;i++) t[i].p=t[i].l=t[i].r=ti[i].p=ti[i].r=ti[i].l=-1;
  for(int i=0;i<n;i++){
    cin>>t1>>t2>>t3;
    if(t2!=-1){
      ti[t1].l=t2;
      ti[t2].p=t1;
    }
    if(t3!=-1){
      ti[t1].r=t3;
      ti[t3].p=t1;
    }
    if(t2==-1){
      t2=t3;
      t3=-1;
    }
    if(t2!=-1){
      t[t2].p=t1;
      t[t2].r=t3;
    }
    if(t3!=-1) t[t3].p=t1;
    t[t1].l=t2;
  }
  int root;
  for(int i=0;i<n;i++) if(t[i].p==-1) root=i;
  cout<<"Preorder"<<endl;
  pr(root);
  cout<<endl;
  for(int i=0;i<n;i++) flag[i]=0;
  cout<<"Inorder"<<endl;
  in(root);
  cout<<endl;
  for(int i=0;i<n;i++) flag[i]=0;
  cout<<"Postorder"<<endl;
  po(root);
  cout<<endl;
  return 0;
  
}

Measured memory_bytes: 3112
#include <bits/stdc++.h>
#define fi first
#define se second
#define pii pair<int,int>
#define mp make_pair
#define pb push_back
#define space putchar(' ')
#define enter putchar('\n')
#define eps 1e-10
#define MAXN 500005
//#define ivorysi
using namespace std;
typedef long long int64;
typedef unsigned int u32;
typedef double db;
template<class T>
void read(T &res) {
    res = 0;T f = 1;char c = getchar();
    while(c < '0' || c > '9') {
    	if(c == '-') f = -1;
    	c = getchar();
    }
    while(c >= '0' && c <= '9') {
    	res = res * 10 +c - '0';
    	c = getchar();
    }
    res *= f;
}
template<class T>
void out(T x) {
    if(x < 0) {x = -x;putchar('-');}
    if(x >= 10) {
	out(x / 10);
    }
    putchar('0' + x % 10);
}
int MOD = 1000000007;
int N;
int A[MAXN],sum[MAXN],s[MAXN];
int pre[2][(1 << 20) + 5],dp[MAXN];
int inc(int a,int b) {
    return a + b >= MOD ? a + b - MOD : a + b;
}
int mul(int a,int b) {
    return 1LL * a * b % MOD;
}
void update(int &x,int y) {
    x = inc(x,y);
}
int fpow(int x,int c) {
    int res = 1,t = x;
    while(c) {
        if(c & 1) res = mul(res,t);
        t = mul(t,t);
        c >>= 1;
    }
    return res;
}
void Solve() {
    read(N);
    for(int i = 1 ; i <= N ; ++i) {
        read(A[i]);
        s[i] = s[i - 1] ^ A[i];
        sum[i] = sum[i - 1] + (s[i] == 0);
    }
    int all = 0;
    for(int i = 1 ; i <= N ; ++i) {
        if(s[i] != 0) {
            dp[i] = mul(pre[0][s[i]],sum[i - 1]) + 1;
            update(dp[i],MOD - pre[1][s[i]]);
        }
        else dp[i] = inc(all,MOD - pre[0][0]);
        update(pre[0][s[i]],dp[i]);
        update(pre[1][s[i]],mul(dp[i],sum[i]));
        update(all,dp[i]);
    }
    if(s[N] == 0) {
        update(dp[N],fpow(2,sum[N] - 1));
    }
    out(dp[N] % MOD);enter;
}
int main() {
#ifdef ivorysi
    freopen("f1.in","r",stdin);
#endif
    Solve();
    return 0;
}


Measured memory_bytes: 16256
#include <stdio.h>
#include <math.h>

int main(int argc, const char * argv[]) {
    double a, b, d, C, S, L, h;
    
    scanf("%lf %lf %lf",&a, &b, &C);
    
    C = C * M_PI / 180;
    
    h = b * sin(C);
    
    S = a * h / 2;
    
    d = sqrt(a * a + b * b - 2 * a * b * cos(C));
    
    L = a + b + d;
    
    printf("%f\n%f\n%f\n",S, L, h);
    
    
    return 0;
}

Measured memory_bytes: 648
#include <algorithm>
#include <bitset>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstring>
#include <fstream>
#include <iostream>
#include <iomanip>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std;

const int MAX = 1007;
const int MOD = 1000000007;

void solve() {
    int k, n;
    int a[MAX];
    cin >> n >> k;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    sort(a, a + n);
    int res = 0;
    for (int i = 0; i < k; i++) {
        res += a[i];
    }
    cout << res;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    //int tt; cin >> tt; for (int i = 1; i <= tt; i++) {solve(); cout << endl;}
    solve();
}

Measured memory_bytes: 3660
#include<iostream>
#include<string>
#include<cstdlib>
#include<math.h>
using namespace std;
int main(void){
    int x;
    cin >> x;
    if(x>=1000){
        printf("ABD");
    }else{
        printf("ABC");
    }
    
    return 0;
    
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <ctype.h>
using namespace std;

int main ()
{
    cin.tie(0); ios::sync_with_stdio(false);
   int N,M;
   cin >>N>>M;

   int L1 = 0;
   int R1 = N+1;
   for(int i = 0; i< M;i++)
   {
int l,r;

     cin >>l>>r;
     L1 = max(L1, l); R1 = min(R1, r);
   }



   unsigned long total=0;
    if(L1<=R1)
        total = R1-L1+1;
   cout << total <<endl;

        return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
int desc(const void *a, const void *b) {
  return *(int *)b - *(int *)a;
}
  
int main (){
    int N;
    int point=0;
    scanf("%d",&N);
    int a[N];
    for (int i = 0; i < N; i++){
        scanf("%d",&a[i]);
    }
    qsort(a, N, sizeof(int),desc);
    for (int i = 0; i < N; i++){
        if(i%2==0 ||i==0) point += a[i];
        else point -= a[i];
    }
    printf("%d",point);
}

Measured memory_bytes: 128
import java.util.Scanner;
public class Main{
	public static void main(String[]args){
	Scanner scan=new Scanner(System.in);
	String a=scan.nextLine();
	for(int i=0;i<a.length();i++) {
		if( Character.isUpperCase( a.charAt( i ) ) ) {
		    System.out.print(Character.toLowerCase(a.charAt(i)));
		}
		else {
			System.out.print(Character.toUpperCase(a.charAt(i)));
		}
	}
	System.out.println();
	}
}


Measured memory_bytes: 27064
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int x = in.nextInt();
        int bill = 0;
        while (bill < x) {
            bill += 1000;
        }
        System.out.println(bill - x);

    }
}

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

fii=min(a[0],b[0])
fij=min(a[1],b[0]-fii)
icnt=fii+fij
for i in range(1,n):
    fii=min(a[i]-fij,b[i])
    fij=min(a[i+1],b[i]-fii)
    icnt+=fij+fii

print(icnt)



Measured memory_bytes: 18476
import sys
input = sys.stdin.readline

n, w = map(int, input().split())
items = [tuple(map(int, input().split())) for _ in range(n)]

V_MAX = 10**5
dp = [[w + 1] * (V_MAX + 1) for _ in range(n + 1)]
dp[0][0] = 0

for i, (wi, vi) in enumerate(items):
    for j in range(V_MAX + 1):
        if j >= vi:
            dp[i + 1][j] = min(dp[i][j], dp[i][j - vi] + wi)
        else:
            dp[i + 1][j] = dp[i][j]

ans = 0
for j in range(V_MAX + 1):
    if dp[n][j] <= w:
        ans = max(ans, j)

print(ans)


Measured memory_bytes: 149336
import copy

def quicksort(li, ini_i, length):
    # print(li, ini_i, length)
    if ini_i < length:
        next_len = partition(li, ini_i, length)
        # print(next_len)
        quicksort(li, ini_i, next_len - 1)
        quicksort(li, next_len + 1, length)

def partition(li, ini_i, length):
    target = li[length][1]
    # print(target, li, ini_i, length)
    for i in range(ini_i, length):
        if li[i][1] <= target:
            li[ini_i], li[i] = li[i], li[ini_i]
            ini_i += 1
    # print(f"its {ini_i}")
    li[ini_i], li[length] = li[length], li[ini_i]
    return ini_i

length = int(input())
li = []
base_li = []
for i in range(length):
    t = input().split(" ")
    t[1] = int(t[1])
    base_li.append(t)
li = copy.deepcopy(base_li)

quicksort(li, 0, length - 1)

for i in range(length - 1):
    if li[i + 1][1] == li[i][1]:
        if base_li.index(li[i + 1]) < base_li.index(li[i]):
            print("Not stable")
            break
else:
    print("Stable")
for i, n in enumerate(li):
    print(*n)



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

int main(){
  int H,W;
  cin >> H >> W;
  vector<string> S(H);
  for(int i=0;i<H;i++){
    cin >> S.at(i);
  }
  
  queue<int> que_x;
  queue<int> que_y;
  int max=-1;
  
  for(int sx=0;sx<H;sx++){
    for(int sy=0;sy<W;sy++){
      vector<vector<int>> dist(H,vector<int>(W,-1));
      if(S.at(sx).at(sy)=='#')continue;
      que_x.push(sx);
      que_y.push(sy);
      dist.at(sx).at(sy)=0;

      while(!que_x.empty()&&!que_y.empty()){
        int x=que_x.front();
        int y=que_y.front();
        que_x.pop();
        que_y.pop();

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

        for(int i=0;i<4;i++){
          int nx=x+dx[i];
          int ny=y+dy[i];
          if(nx<0||nx>=H||ny<0||ny>=W)continue;
          if(dist.at(nx).at(ny)!=-1)continue;
          if(S.at(nx).at(ny)=='#')continue;
          que_x.push(nx);
          que_y.push(ny);
          dist.at(nx).at(ny)=dist.at(x).at(y)+1;
        }
      } 
      for(int i=0;i<H;i++){
        for(int j=0;j<W;j++){
          if(max<dist.at(i).at(j))max=dist.at(i).at(j);
        }
      }
    }
  }
  cout << max << endl;
}

Measured memory_bytes: 256
#include<stdio.h>

int main(){
  int rock;//石の数
  int coo; //座標
  int i;
  int num;
  
  scanf("%d %d",&rock,&coo);
  
  for(i=1;i<=2*rock-1;i++){
    num = coo - rock + i;
    printf("%d ",num);
  }
  
  return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  vector<int> vec(2);
  for(int i= 0; i < 2; i++){
    cin >> vec.at(i);
  }
  sort(vec.begin(), vec.end());
  int ans = 0, ten = 1;
  for(int i = 0; i < vec.at(1); i++){
    ans += vec.at(0) * ten;
    ten *= 10;
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
N, A, B = map(int, input().split())
X = [int(_) for _ in input().split()]

diff = [X[n + 1] - X[n] for n in range(N - 1)]

ans = 0
for n in range(N - 1):
    if diff[n] * A > B:
        ans += B
    else:
        ans += diff[n] * A
print(ans)

Measured memory_bytes: 14252
#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;

int main(){
  int n;
  cin>>n;
  int count=0;
  for(int i=1;i<=n;i++){
  	if(i%2==1){
      	int a=0;
    	for(int j=1;j<=i;j++){
        	if(i%j==0) a++;
        }
      	if(a==8) count++;
    }
  }
  cout<<count<<endl;
}

Measured memory_bytes: 3476
n = int(input())
bi = [[0]*20 for _ in range(n)]
a = list(map(int, input().split()))

right = 0
ans = 0
s = 0
for left in range(n):
  while right < n and s^a[right]==s+a[right]:
    s += a[right]
    right += 1
  ans += right-left
  if left==right: right += 1
  s -= a[left]
print(ans)

Measured memory_bytes: 73872
#include <iostream>
#include <cstring>
using namespace std;
long long dp[70][40][30][2];//n/(2^i*3^j*5^k)+l
unsigned long long er[70],san[70],wu[70];
long long ans;
inline long long A(long long x)
{
	if(x<0) return -x;
	return x;
}
int main(int argc, char** argv) {
	er[0]=san[0]=wu[0]=1;
	for(int i=1;i<=69;i++) er[i]=er[i-1]*2,san[i]=san[i-1]*3,wu[i]=wu[i-1]*5;
	int T;
	cin >> T;
	while(T--)
	{
		long long n,a,b,c,d;
		cin >> n >> a >> b >> c >> d;
		ans=1e18;
		for(int i=0;i<=69;i++)
			for(int j=0;j<=39;j++)
				for(int k=0;k<=29;k++)
					dp[i][j][k][0]=dp[i][j][k][1]=1e18;
		dp[0][0][0][0]=0,dp[0][0][0][1]=d;
		for(int i=0;i<=69;i++)
		{
			if(er[i]>n*2+10000) break;
			for(int j=0;j<=69;j++)
			{
				if(er[i]*san[j]>n*2+10000) break;
				for(int k=0;k<=69;k++)
				{
					if(er[i]*san[j]*wu[k]>n*2+10000) break;
					for(int l=0;l<=1;l++)
					{
						long long now=n/(er[i]*san[j]*wu[k])+l,N=n/(er[i]*san[j]*wu[k]);
						dp[i+1][j][k][0]=min(dp[i+1][j][k][0],dp[i][j][k][l]+A(now-N/2*2)*d+a);
						dp[i][j+1][k][0]=min(dp[i][j+1][k][0],dp[i][j][k][l]+A(now-N/3*3)*d+b);
						dp[i][j][k+1][0]=min(dp[i][j][k+1][0],dp[i][j][k][l]+A(now-N/5*5)*d+c);
						dp[i+1][j][k][1]=min(dp[i+1][j][k][1],dp[i][j][k][l]+A(now-N/2*2-2)*d+a);
						dp[i][j+1][k][1]=min(dp[i][j+1][k][1],dp[i][j][k][l]+A(now-N/3*3-3)*d+b);
						dp[i][j][k+1][1]=min(dp[i][j][k+1][1],dp[i][j][k][l]+A(now-N/5*5-5)*d+c);
					}
				}
			}
		}
		for(int i=0;i<=69;i++)
		{
			if(er[i]>n*2+10000) break;
			for(int j=0;j<=39;j++)
			{
				if(er[i]*san[j]>n*2+10000) break;
				for(int k=0;k<=29;k++)
				{
					if(er[i]*san[j]*wu[k]>n*2+10000) break;
					for(int l=0;l<=1;l++)
					{
						long long now=n/(er[i]*san[j]*wu[k])+l,N=n/(er[i]*san[j]*wu[k]);
						if(now-1000000<=ans/d)ans=min(ans,dp[i][j][k][l]+now*d);
					}
				}
			}
		}
		cout << ans << "\n";
	}
	return 0;
}

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

typedef long long ll;
const ll MOD = 1e9 + 7;




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


	char c;
	cin >> c;
	if (isupper(c))
		cout << "A" << endl;
	else
		cout << "a" << endl;


	return 0;
}

Measured memory_bytes: 3656
N=int(input())
H=list(map(int,input().split()))
hlow=[H[i]-1 for i in range(N)]
a=[hlow[0]]
flag=True
for i in range(1,N):
    if a[i-1]<=hlow[i]:
        a.append(hlow[i])
    elif a[i-1]<=H[i]:
        a.append(H[i])
    else:
        print('No')
        flag=False
        break

if flag:
    print('Yes')

Measured memory_bytes: 20836
ns = int(input())
S = list(map(int,input().split()))
nt = int(input())
T = list(map(int,input().split()))

def linear_search(lst,key):
    i = 0
    while i<len(lst):
        if lst[i] == key:
            return 1
        else:
            i+=1
    return 0

ans = 0
for key in T:
    ans += linear_search(S,key)
print(ans)


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

#define MAX 100000

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

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

  int max_cnt = 0;
  for (int i = 2; i < MAX; i++) {
    int cnt = A[i-2] + A[i-1] + A[i];
    if (max_cnt < cnt) max_cnt = cnt;
  }

  cout << max_cnt << endl;
  return 0;
}


Measured memory_bytes: 640
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <string>
#include <vector>
#include <math.h>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#define PI 3.14159265359
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pai;
typedef pair<ll, ll> pal;
const int MOD = 1e9+7;
const ll LLINF = 1e18;



int main(){
	int n;
	cin >> n;
	vector<int> f0, f1;
	for (int i = 0; i < n; i++){
		int x, y;
		cin >> x >> y;
		f0.push_back(x-y);
		f1.push_back(x+y);
	}
	sort(f0.begin(), f0.end());
	sort(f1.begin(), f1.end());
	cout << max(f0[n-1]-f0[0], f1[n-1]-f1[0]) << endl;
	return 0;
}



Measured memory_bytes: 5044
<?php
function mygets() {
    return array_map(intval, split(' ', fgets(STDIN)));
}

list($n, $x) = mygets();
$a = mygets();

$b1 = $a;
$b2 = $a;

$ans = array_sum($a);

for ($i = 1; $i < $n; $i++) {
    for ($j = 0; $j < $n; $j++) {
        $b2[$j] = min($b1[($j + $n - 1) % $n], $a[$j]);
    }
    $ans = min($ans, $i * $x + array_sum($b2));
    $sw = &$b1;
    $b1 = &$b2;
    $b2 = &$sw;
}

echo $ans, PHP_EOL;


Measured memory_bytes: 4472
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Globalization;
using System.Diagnostics;
using static System.Console;
using Pair = System.Collections.Generic.KeyValuePair<int, int>;
//using System.Numerics;

class Program
{
    static void Main()
    {
        //SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
        new Program().solve();
        Out.Flush();
    }
    Scanner cin = new Scanner();
    Random rnd = new Random();
    Stopwatch sw = new Stopwatch();
    readonly int[] dd = { 0, 1, 0, -1, 0 };
    readonly int mod = 1000000007;
    readonly string alfa = "abcdefghijklmnopqrstuvwxyz";
    readonly string ALFA = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";

    int N;
    void solve()
    {
        int N = cin.nextint;
        int K = cin.nextint;
        var L = cin.scanint;
        WriteLine(L.OrderByDescending(i => i).Take(K).Sum());
    }

}

class Scanner
{
    string[] s; int i;
    char[] cs = new char[] { ' ' };
    public Scanner() { s = new string[0]; i = 0; }
    public string[] scan { get { return ReadLine().Split(); } }
    public int[] scanint { get { return Array.ConvertAll(scan, int.Parse); } }
    public long[] scanlong { get { return Array.ConvertAll(scan, long.Parse); } }
    public double[] scandouble { get { return Array.ConvertAll(scan, double.Parse); } }
    public string next
    {
        get
        {
            if (i < s.Length) return s[i++];
            string st = ReadLine();
            while (st == "") st = ReadLine();
            s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
            i = 0;
            return next;
        }
    }
    public int nextint { get { return int.Parse(next); } }
    public long nextlong { get { return long.Parse(next); } }
    public double nextdouble { get { return double.Parse(next); } }
}

Measured memory_bytes: 11472
#define __USE_MINGW_ANSI_STDIO
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
#include <unordered_set>
#include <unordered_map>

using namespace std;

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

#define all(v)		((v).begin()), ((v).end())
#define sz(v)		((int)((v).size()))
#define endl		"\n"
#define fx(n)		fixed<<setprecision(n)
#define mk			make_pair	

void fast()
{
	ios::sync_with_stdio(NULL);
	cout.tie(NULL);
	cin.tie(NULL);
}
void File()
{
#ifndef ONLINE_JUDGE
	freopen("output.txt", "w", stdout);
	freopen("input.txt", "r", stdin);
#endif
#ifdef ONLINE_JUDGE
	/*freopen("output.txt", "w", stdout);
	freopen("story.in", "r", stdin);*/
#endif
}
const double pi = 2 * acos(0.0);
const ll oo = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
const int nn = 1e5 + 15;
int dx[8] = { 1, -1, 0, 0, 1, -1, 1, -1 };
int dy[8] = { 0, 0, 1, -1, 1, -1, -1, 1 };


double maxvolume(double s)
{
	double length = s / 3;

	s -= length;
	double breadth = s / 2;

	double height = s - breadth;

	return length * breadth * height;
}
int main()
{
	fast();
	//File();
	double l;
	cin >> l;
	cout << fx(12) <<maxvolume(l) << endl;
	return 0;
}


Measured memory_bytes: 256
s = input()
t = input()

def make_signature(str_):
    dict_ = {}
    sign = []
    cnt = 0
    for s_ in str_:
        if s_ in dict_:
            sign.append(dict_[s_])
        else:
            sign.append(cnt)
            dict_[s_] = cnt
            cnt += 1

    return sign

print('Yes' if make_signature(s) == make_signature(t) else 'No')

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

int main() {
  int n;
  cin >> n;
  map<int, int> mp;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    mp[x] += 1;
    mp[x - 1] += 1;
    mp[x + 1] += 1;
  }
  int ans = 0;
  for (auto p : mp) {
    ans = max(p.second, ans);
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 7864
#include <cstdio>
#include <utility>
#include <deque>
using namespace std;
using pii = pair<int, int>;

int main() {
    int N, L; scanf("%d%d", &N, &L);
    
    deque<pii> deq;
    for(int i=0; i<N; i++) {
        int val; scanf("%d", &val);
        int lim = i - L + 1;

        while(deq.size()) {
            pii elem = deq.front();
            if(elem.second < lim || elem.first > val) {
                deq.pop_front();
            }
            else break;
        }
        while(deq.size()) {
            pii elem = deq.back();
            if(elem.second < lim || elem.first > val) {
                deq.pop_back();
            }
            else break;
        }
        deq.push_back(make_pair(val, i));
        
        if(i+1 >= L) printf("%d%c", deq.front().first, (i+1==N ? '\n' : ' '));
    }
    return 0;
}


Measured memory_bytes: 2944