akhauriyash/Code-Regression huggingface dataset:
/* -------------------------------- */
/* Name: MD. Khairul Basar          */
/* Institute: HSTU                  */
/* Dept: CSE                        */
/* Email: khairul.basar93@gmail.com */
/* -------------------------------- */

#include <bits/stdc++.h>
/* all header files */

#define fs            first
#define sc            second
#define sp            printf(" ")
#define nl            printf("\n")
#define pb(a)         push_back(a)

#define setzero(a)    memset(a,0,sizeof(a))
#define setneg(a)     memset(a,-1,sizeof(a))
#define setinf(a)     memset(a,126,sizeof(a))

#define tc1(x)        printf("Case %d: ",x)
#define tc2(x)        printf("Case #%d: ",x)
#define tc3(x)        printf("Case %d:\n",x)
#define tc4(x)        printf("Case #%d:\n",x)

#define iin(x)        scanf("%d",&x)
#define din(x)        scanf("%lf",&x)
#define lin(x)        scanf("%lld",&x)
#define clin(x)       scanf("%I64d",&x)

#define pr1(x)        cout<<x<<"\n"
#define pr2(x,y)      cout<<x<<" "<<y<<"\n"
#define pr3(x,y,z)    cout<<x<<" "<<y<<" "<<z<<"\n"
#define pr4(w,x,y,z)  cout<<w<<" "<<x<<" "<<y<<" "<<z<<"\n"
#define fast          ios::sync_with_stdio(0)
#define read          freopen("input.txt","r",stdin)
#define write         freopen("output.txt","w",stdout)
#define prflag1(flag) printf("%s\n",(flag)?"YES":"NO")
#define prflag2(flag) printf("%s\n",(flag)?"Yes":"No")
#define prflag3(flag) printf("%s\n",(flag)?"yes":"no")
/* macro definitions */

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;
typedef pair<int, int>pii;
typedef pair<LL, LL>pll;
typedef vector<int>vi;
typedef vector<LL>vll;
typedef vector<pii>vpii;
typedef vector<pll>vpll;
/* type definitions */

LL MOD_EXPO(LL b, LL p, LL m)
{
    if(p==0) return 1;
    LL ret=MOD_EXPO(b,p/2,m)%m;
    ret=(ret*ret)%m;
    return ((p&1) ? (ret*b)%m : ret%m);
}
LL POWER(LL N, LL K)
{
    LL i,ans=1;
    for(i=1;i<=K;i++) ans*=N;
    return ans;
}
int SET(int N, int pos)
{
    return (N | (1<<pos));
}
int RESET(int N, int pos)
{
    return (N & !(1<<pos));
}
bool CHECK(int N, int pos)
{
    return (N & (1<<pos));
}
/* necessary functions */

int dx4[]= {1,-1,0,0};
int dy4[]= {0,0,1,-1};
int dx6[]= {0,0,1,-1,0,0};
int dy6[]= {1,-1,0,0,0,0};
int dz6[]= {0,0,0,0,1,-1};
int dx8[]= {1,-1,0,0,-1,1,-1,1};
int dy8[]= {0,0,1,-1,1,1,-1,-1};
int dkx8[]= {-1,1,-1,1,-2,-2,2,2};
int dky8[]= {2,2,-2,-2,1,-1,1,-1};
/* direction arrays */

int tc=1;
const double eps=1e-9;
const double pi=acos(-1.0);
const long long int mx=1e5;
const long long int mod=1e9+7;
/* global declarations */

int main()
{
    LL a,b,x,ans;
    cin>>a>>b>>x;
    ans=b/x;
    if(a) ans-=(a-1)/x;
    else ans++;
    pr1(ans);
    return 0;
}


Measured memory_bytes: 256
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author Mayank
 */



#include "bits/stdc++.h"

#define ll long long
#define rep(i, a, b) for(ll i = (a); i < (b); i++)
using namespace std;
const ll MOD = 1e9+7;

ll dp[2000];

class DRedistribution {
public:
	void solve(std::istream& cin, std::ostream& cout) {
        memset(dp, 0, sizeof(dp));
        ll s;
        cin>>s;
        rep(i, 1, s+1){
            if(i>=3)dp[i]=1;
            rep(j, 3, i){
                dp[i] = (dp[i] + dp[i-j])%MOD;
            }
        }
        cout<<dp[s];
	}
};


int main() {
    std::ios_base::sync_with_stdio(false);
    std::cin.tie(nullptr);
	DRedistribution solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


Measured memory_bytes: 3664
#include<iostream>
#include<vector>

using namespace std;

int main() {

	int N, M;
	int a = 0, b = 0, c = 0;
	int X = 0;

	cin >> N >> M;

	if (M == 0) {
		if (N == 1) {
			cout << 0;
			return 0;
		}
		else if (N == 2) {
			cout << 10;
			return 0;
		}
		else if (N == 3) {
			cout << 100;
			return 0;
		}
	}

	vector<vector<int>> SC(M, vector<int>(2, 0));

	for (int i = 0; i < M; ++i)
	{
		cin >> SC[i][0] >> SC[i][1];
	}

	switch (N)
	{
	case 1:
		a = 0; b = 0; c = 0;	
		break;
	case 2:
		a = 0; b = 1; c = 0;
		break;
	case 3:
		a = 1; b = 0; c = 0;
	default:
		break;
	}

	if (M == 1) {
		switch (N) {
		case 1:c = SC[0][1]; break;
		case 2:
			if (SC[0][0] == 1) b = SC[0][1];
			if (SC[0][0] == 2) c = SC[0][1];
			break;
		case 3:
			if (SC[0][0] == 1) a = SC[0][1];
			if (SC[0][0] == 2) b = SC[0][1];
			if (SC[0][0] ==3) c = SC[0][1];
			break;
		default:break;
		}
	}
	else if (M > 1) {
		for (int i = 0; i < M - 1; ++i)
		{
			if (SC[i][0] == SC[i + 1][0] && SC[i][1] != SC[i + 1][1]) {
				cout << -1;
				return 0;
			}
		}
	}

	if (N > 1) {
		for (int i = 0; i < M; ++i)
		{
			if (SC[i][0] == 1 && SC[i][1] == 0) {
				cout << -1;
				return 0;
			}
		}
	}

	if (M != 1) {
		for (int i = 0; i < M; ++i)
		{
			switch (N) {
			case 1:c = SC[i][1]; break;
			case 2:
				if (SC[i][0] == 1) b = SC[i][1];
				if (SC[i][0] == 2) c = SC[i][1];
				break;
			case 3:
				if (SC[i][0] == 1) a = SC[i][1];
				if (SC[i][0] == 2) b = SC[i][1];
				if (SC[i][0] == 3) c = SC[i][1];
				break;
			default:break;
			}
		}
	}

	X = 100 * a + 10 * b + c;
	cout << X;

	return 0;
}

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

using lint=long long;

lint get(lint l,lint r){ return r-l+1; }

int main()
{
   lint A,B; cin>>A>>B;
   if(A==B){ cout<<1<<endl; return 0; }

   const int LOG=60;
   lint X=0,Y=0;
   for(int i=LOG-1;i>=0;i--){
      if((A>>i&1)==(B>>i&1)){
         if(A>>i&1){
            A-=1LL<<i;
            B-=1LL<<i;
         }
      }else{
         X=Y=1LL<<i;
         bool flag=false;
         for(int j=i-1;j>=0;j--){
            if(B>>j&1) flag=true;
            if(flag) Y|=1LL<<j;
         }
         break;
      }
   }
   lint ans=get(A,X-1);
   if(Y<X+A) ans+=get(X,Y)+get(X+A,2*X-1);
   else ans+=get(X,2*X-1);
   cout<<ans<<endl;
   return 0;
}


Measured memory_bytes: 256
using System;
using System.Linq;

namespace AtCoder.ABC042
{
    class ProblemA
    {
        static void Main()
        {
            var a = ReadIntArray();
            var answer = a.Count(v => v == 5) == 2 && a.Count(v => v == 7) == 1 ? "YES" : "NO";
            Console.WriteLine(answer);
        }

        public static string ReadLine() => Console.ReadLine();

        public static int ReadInt() => int.Parse(ReadLine());

        public static int[] ReadIntArray() => ReadLine().Split(' ').Select(v => int.Parse(v)).ToArray();
    }
}


Measured memory_bytes: 13396
#include <bits/stdc++.h>
 
#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)
 
#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=(int)(a)-1;i>=(int)(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)
 
#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define getidx(ary,key) lower_bound(_all(ary),key)-begin(ary)
#define clr(a,b) memset((a),(b),sizeof(a))
#define bit(n) (1LL<<(n))
 
// #define DEBUG
 
#ifdef DEBUG
    #define dump(...) fprintf(stderr, __VA_ARGS__)
#else
    #define dump(...)
#endif
 
template<class T>bool chmax(T &a, const T &b) { return (a<b)?(a=b,1):0;}
template<class T>bool chmin(T &a, const T &b) { return (b<a)?(a=b,1):0;}
 
using namespace std;
using ll=long long;
using vi=vector<int>;
using vll=vector<ll>;
 
const double EPS = 1e-10;
const double PI = acos(-1.0);
const ll inf =1LL << 62;
const ll mod=1000000007LL;
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
 
 
ll extgcd(ll a,ll b,ll& x,ll& y){x=1,y=0;ll g=a;if(b!=0) g=extgcd(b,a%b,y,x),y-=a/b*x;return g;}
ll ADD(const ll &a, const ll &b,const ll &mod) { return (a+b)%mod;}
ll SUB(const ll &a, const ll &b,const ll &mod) { return (a-b+mod)%mod;}
ll MUL(const ll &a, const ll &b,const ll &mod) { return (1LL*a*b)%mod;}
ll DIV(const ll &a, const ll &b,const ll &mod) {ll x,y; extgcd(b,mod,x,y);return MUL(a,(x+mod)%mod,mod);}
 
random_device rd;
mt19937 mt(rd());
uniform_int_distribution<int> dice(1,6);
uniform_real_distribution<double> score(0.0,10.0);

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

    ll N; cin >> N;
    ll X; cin >> X;

    ll res = N;
    N = N - X;
    while(X > 0){
        res += 2 * X * (N / X);
        ll nx = N % X;
        if(nx == 0) res -= X;
        ll nn = X;
        N = nn, X = nx;
    }

    cout << res << endl;

    return 0;
}


Measured memory_bytes: 256
import sys
import bisect

readline = sys.stdin.readline

def main():
    n = int(readline())
    a = list(map(int, readline().split()))
    a.sort()
    if len(a) == 2:
        a.sort(reverse=True)
        print(*a)
        return
    amax = a.pop()
    mid = amax//2
    mididx = bisect.bisect_left(a, mid)
    am1 = a[mididx]; am2 = a[mididx-1]
    if abs(am1-mid) <= abs(am2-mid):
        am = am1
    else:
        am = am2
    print(amax, am)


if __name__ == "__main__":
    main()


Measured memory_bytes: 14428
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define PI 3.141592653589793
#define rep(i, n) for (int i = 0; i < (n); i++)
#define REP(i, a, n) for (int i = a; i < (n); i++)
#define rrep(i, n, k) for (int i = (n); i >= (k); i--);
#define all(x) (x).begin(), (x).end()
#define vi vector<int>
template<class T> istream &operator>>(istream&is,vector<T>&v){for(auto &elemnt:v)is>>elemnt;return is;}
template<class T,class U> istream &operator>>(istream&is,pair<T,U>&p){is>>p.first>>p.second;return is;}
template<class T>vector<T> make_vector(size_t a){return vector<T>(a);}
template<class T, class... Ts>auto make_vector(size_t a, Ts... ts){return vector<decltype(make_vector<T>(ts...))>(a, make_vector<T>(ts...));}
const int MOD = 1e9 + 7;
const int INF = 2e18;

signed main() {
    int n;
    cin >> n;
    vector<int> a(n);
    cin >> a;
    sort(a.begin(), a.end());
    int base = *a.rbegin();
    int minValue = 0, dif = INF;
    for (int i = 0; i < n; i++) {
        if (dif > abs(a[i] - base / 2)) {
            minValue = a[i];
            dif = abs(a[i] - base / 2);
        }
        if (base % 2 == 1) {
            if (dif > abs(a[i] - (base + 1) / 2)) {
                minValue = a[i];
                dif = abs(a[i] - (base + 1) / 2);
            }
        }
    }
    cout << base << " " << minValue << endl;
}

Measured memory_bytes: 1024
#include<iostream>
#include<string>
#include<vector>
#include<cmath>
using namespace std;
int main() {
	int a , b;
	cin >> a >> b;
	if (a <= 8 && b <= 8)cout << "Yay!" << endl;
	else cout << ":(" << endl;
	return 0;
}

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

int main()
{
	ios_base::sync_with_stdio(NULL);
	cin.tie(NULL);
	cout.tie(NULL);
	long long x, hp, pp, ans;
	cin >> x;
	hp = x / 500;
	x = x - (hp * 500);
	pp = x / 5;
	ans = hp * 1000 + pp * 5;
	cout << ans;
	return 0;
}

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

int main(){
	string str;
	int ans;
	int num;
	
	ans = 0;
	while(cin >> str){
		for(int i = 0; i < str.size(); i++){
			num = 0;
			while(str[i] >= 48 && str[i] <= 57 && i < str.size()){
				num *= 10;
				num += str[i] - 48;
				i++;
			}
			ans += num;
		}
	}
	
	cout << ans << endl;
	
	return 0;
}

Measured memory_bytes: 1184
#include <bits/stdc++.h>
 
typedef unsigned long long int ull;
typedef long double ldb;
typedef long long int ll;
 
#define for01(k,n)  for (ll i=k; i<n; i++)
#define for02(k,n)  for (ll j=k; j<n; j++)
#define for03(k,n)  for (ll k=k; k<n; k++)
#define for11(k,n)  for (ll i=k; i<=n; i++)
#define for12(k,n)  for (ll j=k; j<=n; j++)
#define for13(k,n)  for (ll k=k; k<=n; k++)

#define pb push_back
#define mp make_pair
#define pf push_front
#define popf pop_front
#define popb pop_back
#define vll vector<ll>
#define F first
#define S second
#define pp pair <ll, ll>
#define lb lower_bound
#define ub upper_bound
#define emp empty()
#define beg begin()
#define en end()
#define si size()
#define bk back()
#define deci(n)  fixed<<setprecision(n)

#define p0(a) cout << a << " "
#define p1(a) cout << a << "\n"

#define mem(a,n) memset(a, n, sizeof(a)); // n = 0 OR -1 only

#define MAX LLONG_MAX
#define MIN LLONG_MIN
#define MOD 1000000007
#define MOD2 998244353

using namespace std;


int main()
{
  ll a,b,x;
  cin >> a >> b >> x;
  
  ll f ;
  if(a%x == 0)
    f = a;
  else
    f = a + ( x - (a%x));
  
  //p1(f);
  if(b >= f)
  	p1(1 + (b - f) / x);
  else
    p1(0);
  
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <queue>
#include <stack>
#include <cmath>
#include <cstdio>
#include <string>
#include <sstream>

using namespace std;

#define rep(i, n) for(int i = 0; i < (int)n; ++i)
#define rep2(i, n) for(int i = 1; i <= (int)n; ++i)
#define repit(it, t) for(__typeof((t).begin()) it = (t).begin(); it != (t).end(); it++)

#define pb push_back
#define lb lower_bound
#define mp make_pair
#define ite iterator
#define ul unsigned long
#define ull unsigned long long
#define INF 1000000007
#define MOD 1000000007
#define EPS 1.0e-6
#define fs first
#define sd second

template<typename T>
bool elem(set<T> st, T val){
	return (st.find(val) != st.end());
}

template<typename T>
void printv(vector<T> vt){
    if(vt.size() == 0) return;
    rep(i, vt.size() - 1)
        cout << vt[i] << " ";
    cout << vt[vt.size() - 1] << endl;
}

typedef vector<int> vint;
typedef vector<ul> vul;
typedef vector<ull> vull;
typedef pair<int, int> pii;

int digit(int a){
    if(a == 0) return 1;
    int ret = 0;
    while(a > 0){
        a /= 10;
        ret++;
    }
    return ret;
}

int pow(int a, int n){
    int ret = 1;
    int mul = a;
    while(n > 0){
        if((n & 1) == 1)
            ret *= mul;
        mul *= mul;
        n >>= 1;
    }
    return ret;
}

int main(void){
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    vint a(n);
    rep(i, n) cin >> a[i];
    sort(a.begin(), a.end());
    vint s;
    rep(i, min(2000, n)){
        rep(j, min(2000, n)){
            if(i == j) continue;
            s.pb(a[i]* pow(10,digit(a[j])) + a[j]);
        }
    }
//  printv(s);
    sort(s.begin(), s.end());
    cout << s[2] << endl;
    return 0;
}

Measured memory_bytes: 19128
# -*- coding: utf-8 -*-
"""
Created on Sun Dec  2 20:06:38 2018

@author: Owner
"""

import collections
import scipy.misc
import sys
import numpy as np
import math
from operator import itemgetter

def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n /= i
      table.append(int(i))
    i += 1
  if n > 1:
    table.append(int(n))
  return table   

"""
N, X = map(int, input().split())

x = [0]*N
x[:] = map(int, input().split())

P = [0]*M
Y = [0]*M
for m in range(M):
    P[m], Y[m] = map(int, input().split())
"""

X = int(input())

if X == 7:
    print('YES')
    sys.exit()
elif X == 5:
    print('YES')
    sys.exit()
elif X == 3:
    print('YES')
    sys.exit()
else:
    print('NO')
    
    

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

typedef long long ll;

int N;
int A,B;
double V[100];
double ans = 0;
ll sum = 0;
int cou1 = 0,cou2 = 0;
ll C[60][60];

int main()
{
    scanf("%d%d%d",&N,&A,&B);
    for(int i = 0; i < N + 1; ++i)
    {
        for(int j = 0; j <= i; ++j)
        {
            if(j == 0 || j == i)C[i][j] = (ll)1;
            else C[i][j] = C[i - 1][j - 1] + C[i - 1][j];
        }
    }
    for(int i = 0; i < N; i++)scanf("%lf",&V[i]);
    sort(V,V + N);
    for(int i = 0; i < A; i++)
    {
        ans += V[N - 1 - i];
    }ans /= A;
    reverse(V,V + N);
    for(int i = 0; i < N; i++)
    {
        if(V[i] == V[A - 1])
        {
            cou1++;
            if(i <= A - 1)cou2++;
        }
    }
    if(V[0] == V[A - 1])
    {
        for(int i = cou2; i < B + 1; i++)
        {
            sum += C[cou1][i];
        }
    }
    else sum = C[cou1][cou2];
    printf("%lf\n",ans);
    printf("%lld\n",sum);
}


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

typedef long long ll;
typedef long double ld;
template <typename T> 
using lim = numeric_limits<T>;
template <typename T>
using indexed_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template <typename T>
using indexed_multiset = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;

struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int x; cin >> x;
    cout << (x >= 30 ? "Yes": "No") << "\n";
}

Measured memory_bytes: 3648
#include<bits/stdc++.h>
using namespace std;
#define maxn 100005
int a[maxn],n,k,b[maxn];
bool check(int x){
	for(int i=0;i<n;i++){
		b[i]=a[i]%x;
	}
	sort(b,b+n);
	int w=0,i;
	for(i=0;i<n;i++){
		w+=b[i];
		if(w>k)break;
	}
	for(w=0;i<n;i++){
		w+=x-b[i];
		if(w>k)return 0;
	}
	return 1;
}
int main()
{
	int sum=0,x;
	scanf("%d%d",&n,&k);
	for(int i=0;i<n;i++)scanf("%d",a+i),sum+=a[i];x=sqrt(sum);
	for(int i=1;i<=x;i++)
	{
		if(sum%i==0){
			if(check(sum/i)){
				printf("%d\n",sum/i);return 0;
			}
		}
	}
	for(int i=sqrt(sum);i>=1;i--){
		if(sum%i==0){
			if(check(i)){
				printf("%d\n",i);return 0;
			}
		}
	}
	return 0;
}

Measured memory_bytes: 256
#!/usr/bin/ruby
# encoding: utf-8

# input
W,H,x,y = gets.split.map(&:to_i)

w_center = W.to_f/2
h_center = H.to_f/2

ans1 = (W.to_f * H.to_f)/2

if x == w_center and y == h_center
  ans2 = 1
else 
  ans2 = 0
end

puts "#{ans1} #{ans2}"


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

using namespace std;
typedef long long int ll;
typedef pair<int, int> ii;
#define DEBUG freopen("in.txt", "r", stdin);

struct fastio {
    fastio() {
        ios::sync_with_stdio(false);
        cout << setprecision(10) << fixed;
        cin.tie(0);
    }
};

fastio _fast_io;

const int N = 1e5 + 5;
int n, m, k, ans;

int main() {
    cin >> n;
    if (n % 10 == n / 100)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
    return 0;
}


Measured memory_bytes: 3568
#include<iostream>
#include<vector>
#include<algorithm>
#include<utility>
using namespace std;


int n,m;
vector<int> l;
bool input(){
  l.clear();
  cin>>n>>m;
  if(n==0 && m==0)return false;
  for(int i=0;i<n+m;i++){
    int tmp;
    cin>>tmp;
    l.push_back(tmp);
  }
  return true;
}

int solve(){
  l.push_back(0);
  sort(l.begin(),l.end());
  int ans = 0;
  for(int i=1;i<l.size();i++){
    ans = max(ans,abs(l[i-1]-l[i]));
  }
  return ans;
}


int main(){
  while(input()){
    cout<<solve()<<endl;
  }
}

Measured memory_bytes: 1344
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <mutex>
#include <cmath>
#include <set>
#include <climits>
#include <bitset>
#include <stack>
#include <queue>

#define mod 1e9+7
#define mp make_pair
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define _GLIBCXX_DEBUG
#define _LIBCPP_DEBUG 0

using namespace std;
using ll = long long;
using pii = pair<int, int>;


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll a, b;
    ll ans = 0;
    string S,T;
    cin >> S >> T;
    cin >> a >> b;
    string U;
    cin >> U;
    if(U==S) a--;
    else b--;
    cout << a << " " << b;
    return 0;
}

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

score = 0 
order = -1
for i in range(n):
  score += b[i]
  _order = a[i]
  if order+1 == _order:
    score += c[order - 1]
  order = _order
  

print(score)

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

using namespace std;
#define int long long
#define inf 9999999999
#define N 666666
int arr[N];int f[N];
map<int,int> mp;
int check(string s){
	string t=s;
	reverse(t.begin(),t.end());
	return (s==t);
}
signed main(){
	string s;
	cin>>s;
	
	if(s[0]!=s[s.size()-1]){
		if((s.size()-2)%2) cout<<"First";
		else cout<<"Second";
	}else{
		if((s.size()-2)%2) cout<<"Second";
		else 	cout<<"First";
		
	}

    return 0;
}
/*
xabsb
1
xabab
1
xszs
2
abda
1


*/

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

    #define ll long long
    #define ff first
    #define ss second
    #define pb push_back
    #define vll vector<ll>
    #define mll map<ll,ll>
    #define MOD 1000000007
    #define pll pair<ll,ll>
constexpr ll INF = 1999999999999999997; 
    #define fastio ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)
    int main() {
      fastio;

      char ch;
      cin>>ch;
      if(ch>='A'&&ch<='Z')
        cout<<'A'<<endl;
      else
        cout<<'a'<<endl;
    }

Measured memory_bytes: 3584
"use strict"
function main(arg) {
    if (arg.trim().split("\n")[0].split(" ").map(Number).sort((a,b) => a-b).join('') == '557') {
        console.log('YES')
    } else {
        console.log('NO')
    }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

Measured memory_bytes: 7500
o = str(input())
e = str(input())

ans = ''
if len(o) == len(e):
    for i in range(len(o)):
        ans += o[i]
        ans += e[i]
else:
    for i in range(len(e)):
        ans += o[i]
        ans += e[i]
    ans += o[-1]

print(ans)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
int main(){
    int n;
    cin >> n;
   vector<string> w(n);
   map<string,int>count;
   bool hantei=true;
   char zenkai,ima;
   rep(i,n) {
       cin >> w.at(i);
       string a=w.at(i);
       count[a]++;
       if(count[a]>1) hantei=false;
        
        ima = a.at(0);
        if(i != 0){
        if(zenkai != ima) hantei = false;
        }
        zenkai = a.at(a.size()-1);
   }

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

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
#include<vector>
#define REP(i,m,n) for(int i=(int)(m);i<(int)(n);i++)
#define rep(i,n) REP(i,0,n)
#define ll long long

using namespace std;

int n, m;
bool ok = true;

int main() {
	cin >> n >> m;
	vector<pair<int, int>>p(m);
	rep(i, m) {
		cin >> p[i].first >> p[i].second;
	}
	rep(x, 1000) {
		int keta = 1;
		int nx = x / 10;
		vector<int>d(1, x % 10);
		while (nx) {
			keta++;
			d.push_back(nx % 10);
			nx /= 10;
		}
		reverse(d.begin(), d.end());
		if (keta == n) {
			ok = true;
			rep(i, m) {
				if (d[p[i].first - 1] != p[i].second) {
					ok = false;
				}
			}
			if (ok) {
				cout << x << endl;
				return 0;
			}
		}
	}
	cout << -1 << endl;
	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 REP(i, a, b) for (int i = (int)a; i < (int)b; ++i)
#define each(i,c) for(__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define all(v) v.begin(), v.end()
#define mset(a, n) memset(a, n, sizeof(a))

typedef long long ll;

const int INF = 1000000000;
const int MOD = 1000000007;

int main(int argc, char *argv[]) {
    // cin.tie(0);
    // ios::sync_with_stdio(false);
    int N; cin >> N;
    vector<int> p(N);
    rep(i, N) cin >> p[i];

    bool ans = false;
    rep(i, N-1) {
        bool flg;
        REP(j, i, N) {
            int t = p[i];
            p[i] = p[j];
            p[j] = t;

            flg = true;
            REP(k, 1, N) if (p[k] < p[k-1]) flg = false;
            p[j] = p[i];
            p[i] = t;
            if (flg) break;
        }
        ans = flg;
        if (ans) break;
    }
    cout << (ans ? "YES" : "NO") << endl;
    return 0;
}

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

ct = [0 for _ in range(m)]
for i in range(n):
    a = list(map(int,input().split()))
    for j in range(1,len(a)):
        ct[a[j]-1] += 1

ans = 0
for i in range(m):
    if ct[i] == n:
        ans += 1
print(ans)


Measured memory_bytes: 3060
import java.util.ArrayList;
import java.util.Arrays;
import java.util.PriorityQueue;
import java.util.Scanner;

//suppose that every capacity is in the domaion of integer.
public class Main {
	public static void main(String[] args) {
		new Main().solver();
	}

	@SuppressWarnings("unchecked")
	void solver() {
		Scanner sc = new Scanner(System.in);
		int V = sc.nextInt();
		int E = sc.nextInt();
		ArrayList<Edge>[] g = new ArrayList[V];
		for (int i = 0; i < V; i++) {
			g[i] = new ArrayList<>();
		}
		for (int i = 0; i < E; i++) {
			int u = sc.nextInt();
			int v = sc.nextInt();
			int c = sc.nextInt();
			g[u].add(new Edge(u, v, c));
		}
		Preflow_Relabel pr = new Preflow_Relabel(0, V - 1, g);
		System.out.println(pr.calc());
	}

	class Preflow_Relabel {
		int n;
		int s;
		int t;
		ArrayList<Edge>[] g;
		int[][] flow;
		int[][] capacity;
		int[] excess;
		int[] height;
		PriorityQueue<Vertice> que = new PriorityQueue<>();

		public Preflow_Relabel(int s, int t, ArrayList<Edge>[] g) {
			this.g = g;
			this.s = s;
			this.t = t;
			n = g.length;
			flow = new int[n][n];
			capacity = new int[n][n];
			height = new int[n];
			height[s] = n;
			excess = new int[n];

			for (int i = 0; i < n; i++) {
				for (Edge e : g[i]) {
					if (e.weight > 0) {
						g[e.dst].add(new Edge(e.dst, e.src, 0));
						capacity[e.src][e.dst] += e.weight;
					} else if (e.weight == 0) {
						continue;
					}
				}
			}
		}

		int calc() {
			for (Edge e : g[s]) {
				excess[s] += e.weight;
				push(s, e.dst);
			}
			while (!que.isEmpty()) {
				Vertice v = que.poll();
				if (excess[v.id] == 0 || v.id == t || height[v.id] != v.height) {
					continue;
				}
				for (Edge e : g[v.id]) {
					if (height[e.src] == height[e.dst] + 1) {
						if (residue(e.src, e.dst) > 0) {
							push(e.src, e.dst);
							if (excess[v.id] == 0)
								break;
						}
					}
				}
				if (excess[v.id] > 0) {
					int min = 1 << 30;
					for (Edge e : g[v.id]) {
						if (residue(e.src, e.dst) > 0) {
							min = Math.min(min, height[e.dst]);
						}
					}
					height[v.id] = min + 1;
					que.add(new Vertice(v.id, height[v.id]));
				}
			}
			return excess[t];
		}

		int residue(int s, int t) {
			return capacity[s][t] - flow[s][t];
		}

		void push(int u, int v) {
			int delta = Math.min(excess[u], residue(u, v));
			flow[u][v] += delta;
			flow[v][u] -= delta;
			excess[v] += delta;
			excess[u] -= delta;
			if (v != t && v != s) {
				que.add(new Vertice(v, height[v]));
			}
		}

		class Vertice implements Comparable<Vertice> {
			int id;
			int height;

			public Vertice(int id, int height) {
				this.id = id;
				this.height = height;
			}

			@Override
			public int compareTo(Vertice o) {
				return -Integer.compare(this.height, o.height);
			}
		}
	}

	class Edge {
		int src;
		int dst;
		int weight;

		Edge(int src, int dst, int weight) {
			this.src = src;
			this.dst = dst;
			this.weight = weight;
		}
	}

	void tr(Object... o) {
		System.out.println(Arrays.deepToString(o));
	}
}

Measured memory_bytes: 36000
#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 a;
    cin >> a;
    mp[a]++;
  }

  int ans = 0;
  for(auto m:mp){
    if(m.first>m.second) ans+=m.second;
    if(m.first<m.second) ans+=m.second-m.first;
  }

  cout << ans << endl;
}

Measured memory_bytes: 4736
#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define ALL(x) (x).begin(),(x).end() //sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x)) //最大値を求める
#define MIN(x) *min_element(ALL(x)) //最小値を求める
typedef long long ll;

int main(){
    int n;
    cin >>n;
    vector<int> kuku;
    FOR(i,1,10){
        FOR(j,1,10){
            kuku.push_back(i*j);
        }
    }
    bool is=false;
    REP(i,81){
        if(n==kuku[i]){
            is=true;
            break;
        }
    }
    if(is){
        cout<<"Yes";
    }else{
        cout<<"No";
    }
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define lli long long int
int main(){
	long long int i,j,k,l,n,q,count2=0;
	char d;
	cin >> d;
	i=d;
	if(i<97)cout << "A" << '\n';
	else cout <<"a" << '\n';
	return 0;
}

Measured memory_bytes: 3616
a,b=map(int,input().split())
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    return divisors

p=make_divisors(a)
q=make_divisors(b)
x=set(p)&set(q)
x=list(x)
cnt=0
import math

def is_prime(n):
    if n == 1: return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True
for i in range(len(x)):
	if is_prime(x[i])==True:
		cnt+=1
print(cnt+1)

Measured memory_bytes: 5248
#include <iostream>
#include <algorithm>

using namespace std;

int mp[91][91];
int W, H;
int dx[4] = {0, 0, 1, -1};
int dy[4] = {1, -1, 0, 0};


int dfs(int x, int y, int d)
{

    int cnt = d;

    for (int i = 0; i < 4; i++)
    {
        int mx = x + dx[i];
        int my = y + dy[i];

        if (my >= 0 && mx >= 0 && my < H && mx < W && mp[my][mx])
        {
            mp[my][mx] = 0;
            cnt = max(cnt, dfs(mx, my, d+1));
            mp[my][mx] = 1;
        }
    }


    return cnt;
}

int main()
{

    while (cin >> W >> H, W || H)
    {
        for (int y = 0; y < H; y++)
        {
            for (int x = 0; x < W; x++)
            {
                cin >> mp[y][x];
            }
        }

        int ans = 0;

        for (int y = 0; y < H; y++)
        {
            for (int x = 0; x < W; x++)
            {
                if (mp[y][x])
                {
                    mp[y][x] = 0;
                    ans = max(ans, dfs(x, y, 1));
                    mp[y][x] = 1;
                }
            }
        }

        cout << ans << endl;
    }

    return 0;
}


Measured memory_bytes: 3116
#include <iostream>
#include <bitset>
#include <iomanip>
#include <string>
#include <vector>
#include <cmath>
#include <queue>
#include <algorithm>
#include <sstream>

using namespace std;

#define ll long long
#define vecll vector<long long>
#define vec2ll vector<vector<long long>>
#define vecbool vector<bool>
#define vecpairll vector<pair<long long,long long>>
#define forll(s,a,b) for(long long s = a;s < b;s++)
#define forllde(s,a) for(long long s = a;s >= 0;s--)

int main()
{
	ll n,k,ans=0;
	string s;

	cin >> n >> k;

	vecll d(k);

	vec2ll x;

	vecbool check(n, false);

	forll(i, 0, k)
	{
		cin >> d[i];
		vecll buf(d[i]);
		forll(j, 0, d[i])
		{
			cin >> buf[j];
		}
		x.push_back(buf);
	}

	forll(i, 0, k)
	{
		forll(j, 0, d[i])
		{
			if (check[x[i][j] - 1] == false)
				check[x[i][j] - 1] = true;
		}
	}

	forll(i, 0, n)
	{
		if (!check[i])
			ans++;
	}

	cout << ans;

}


Measured memory_bytes: 3628
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++)
#define VL vector<ll>
#define VS vector<string>
#define VB vector<bool>
#define VP vector<pair<ll,ll>>
#define VVL vector<vector<ll>>
#define VVP vector<vector<pair<ll,ll>>>
#define PL pair<ll,ll>
#define ALL(v) (v).begin(), (v).end()
ll d1[4] = {1, -1, 0, 0};
ll d2[4] = {0, 0, 1, -1};

vector<VVL> dp(5, VVL(3010, VL(3010, 0)));
ll tbl[3010][3010];

void init() {
    /*
    rep(k, 0, 5) rep(i, 0, 3010) rep(j, 0, 3010) {
        dp[k][i][j] = 0;
    }
    */
    rep(i, 0, 3010) rep(j, 0, 3010) tbl[i][j] = 0;
}


int main(){

    init();

    // input
    ll R, C, K;
    cin >> R >> C >> K;
    VL r(K), c(K), v(K);
    rep(i, 0, K){
        cin >> r[i] >> c[i] >> v[i];
        tbl[r[i]-1][c[i]-1] = v[i];
    }

   
    rep(i, 0, R+1){
        rep(j, 0, C+1) {
            // (i, j) -> (i+1, j)
            if(i < R){
                // i, j で取らない
                rep(k, 0, 4) dp[0][i+1][j] = max(dp[0][i+1][j], dp[k][i][j]);
                // i, j で取る
                rep(k, 0, 3) dp[0][i+1][j] = max(dp[0][i+1][j], dp[k][i][j] + tbl[i][j]);
            }
            // (i, j) -> (i, j+1)
            if(j < C){
                // i, jで取らない
                rep(k, 0, 4) dp[k][i][j+1] = max(dp[k][i][j+1], dp[k][i][j]);
                // i, jで取る 
                rep(k, 0, 3) dp[k+1][i][j+1] = max(dp[k+1][i][j+1], dp[k][i][j] + tbl[i][j]);
            }
        }
    }
    
    ll ans = 0;
    rep(i, 0, 4) ans = max(dp[i][R][C], ans);
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 499288
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <math.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <string>
#include <sstream>
#include <iostream>
#include <time.h>
#include <queue>
#include <list>
#include <map>
#include <set>
#include <vector>
#include <stack>
#include <string.h>
#define sf scanf
#define pf printf
#define lf double
#define ll long long
#define p123 printf("123\n");
#define pn printf("\n");
#define pk printf(" ");
#define p(n) printf("%d",n);
#define pln(n) printf("%d\n",n);
#define s(n) scanf("%d",&n);
#define ss(n) scanf("%s",n);
#define ps(n) printf("%s",n);
#define sld(n) scanf("%lld",&n);
#define pld(n) printf("%lld",n);
#define slf(n) scanf("%lf",&n);
#define plf(n) printf("%lf",n);
#define sc(n) scanf("%c",&n);
#define pc(n) printf("%c",n);
#define gc getchar();
#define re(n,a) memset(n,a,sizeof(n));
#define len(a) strlen(a)
using namespace std;
//https://codeforces.com/contest/1228/problems
//https://codeforces.com/contest/1228/submit

int main() {
    int a,b,c,d;
    int n;
    s(n)
    ll x,y;
    sld(x)
    for(int i = 1; i< n; i ++){
        sld(y)
        x = x/__gcd(x,y)*y;
    }
    pld(x) pn
    return 0;
}
/*

2
3 1 2
4 1 10


*/



Measured memory_bytes: 256
#include <iostream>
#include <cassert>
#include <climits>
#include <bitset>
#include <stack>
#include <queue>
#include <iomanip>
#include <limits>
#include <string>
#include <cmath>
#include <set>
#include <map>
#include <math.h>
#include <algorithm>
#include <vector>
#include <string.h>

using namespace std;

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

long long int INF = 3e18;
long long int mod = 1000000007;
double Pi = 3.1415926535897932384626;

vector<ll> G[500005];
vector<P> tree[500010];
priority_queue <ll> pql;
priority_queue <P> pqp;
//big priority queue
priority_queue <ll,vector<ll>,greater<ll> > pqls;
priority_queue <P,vector<P>,greater<P> > pqps;
//small priority queue
//top pop

int dx[8]={1,0,-1,0,1,1,-1,-1};
int dy[8]={0,1,0,-1,1,-1,-1,1};
char dir[] = "DRUL";
ll bit[500005];
//↓,→,↑,←

#define p(x) cout<<x<<endl;
#define el cout<<endl;
#define pe(x) cout<<x<<" ";
#define ps(x) cout<<fixed<<setprecision(15)<<x<<endl;
#define pu(x) cout<<x;
#define re(i,n) for(i=0;i<n;i++);
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define deba(x) cout<< #x << " = " << x <<endl

ll rui(ll abc,ll bed){
    //abcのbed乗を計算する
    if(bed==0){return 1;}
    else{
        ll ced = rui(abc,bed/2);
        ced *= ced;
        ced %= mod;
        if(bed%2==1){ced*=abc; ced%=mod;}
        return ced;
    }
}
ll gcd(ll number1,ll number2){
    if(number1 > number2){
        swap(number1,number2);
    }
    if(number1 == 0 || number1 == number2){
        return number2;
    }else{
        return gcd(number2 % number1,number1);
    }
}

ll i,j,k,ii,jj;
ll l[500005],r[500005];
ll n,m,num,sum;
ll ans;
ll a,b,c,e,g,h,w,ok,ng;
ll x[500005],y[500005],z[500005];
ll d[500005],cost[500005];
bool flag,dame;
char s[5005];



void dfs(ll v){
    for(int i=0;i<tree[v].size();i++){
        ll to = tree[v][i].first;
        ll from = v;
        ll edge = tree[v][i].second;
       // pe(to);p(from);
        if(cost[to] == INF){
            cost[to] = cost[from] + edge;
            dfs(to);
        }else{
            if(cost[to] != cost[from] + edge){
              //  p("OUT");
                dame = true;
                return;
            }
        }
    }
    return;
}


int main(){
    cin >> n >> m;
    for(i=0;i<m;i++){
        cin >> l[i] >> r[i] >> d[i];
        tree[l[i]].pb(P(r[i],d[i]));
        tree[r[i]].pb(P(l[i],-d[i]));
    }
    for(i=1;i<=n;i++){
        cost[i] = INF;
    }
    for(ll i=1;i<=n;i++){
        if(cost[i] == INF){
            cost[i] = 0;
            dfs(i);
        }
    }
    if(dame){
        p("No");
    }else{
        p("Yes");
    }
    //p(ans);
    return 0;
}


Measured memory_bytes: 52480
#include <iostream>
#include <cstdio>
using namespace std;
const int MAX = 10005;
int c[MAX];
int main(void)
{
	int n;
	int *a, *b;
	scanf("%d", &n);
	a = new int[n + 1];
	b = new int[n + 1];
	for (int i = 0; i < n; ++i)
	{
		scanf("%d", &a[i]);
		++c[a[i]];
	}
	int i;
	bool flag = false;
	for (i = 0; i <= MAX; ++i)
	{
		while (c[i])
		{
			--c[i];
			if (flag)
				putchar(' ');
			printf("%d", i);
			flag = true;
		}
	}
	putchar('\n');
	return 0;
}

Measured memory_bytes: 11052
// AUTHOR: ROSHAN SRIVASTAVA
// WEBSITE: https://www.youtube.com/channel/UC6uQdd7kLLOdlHSVklhV7Cw

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007

int n;


int main(){

#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	cin>>n;
	vector<int> arr(n);
	int val = 0;
	for(int i = 0; i < n; i ++) {
		cin>>arr[i];
		val ^= arr[i];
	}
	
	for(int i = 0; i < n; i ++){
		cout<<(arr[i] ^ val)<<" ";
	}cout<<endl;

}

Measured memory_bytes: 3992
#include <iostream>
#include<algorithm>
#include<string>
#include<vector>
#include <math.h>
#include <iomanip>
#include <ctype.h>

using namespace std;

int main()
{
	string s;
	int n,k;
	cin >> n >> k >> s;
	s[k-1] += 32;
	cout << s << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
using namespace std;
int main(){
    int N;
    cin >> N;
    vector<long long> A(N);
    for(int i = 0; i < N; i++) cin >> A[i];
    long long ma = 0, mi = 0, idma = 0, idmi = 0;
    for(int i = 0; i < N; i++){
        if(ma < A[i]){
            ma = A[i];
            idma = i;
        }
        if(mi > A[i]){
            mi = A[i];
            idmi = i;
        }
    }
    vector<int> l, r;
    if(ma < abs(mi)){
        for(int i = 0; i < N; i++){
            l.push_back(idmi + 1);
            r.push_back(i + 1);
        }
        for(int i = N - 2; i >= 0; i--){
            l.push_back(i + 2);
            r.push_back(i + 1);
        }
    }
    else{
        for(int i = 0; i < N; i++){
            l.push_back(idma + 1);
            r.push_back(i + 1);
        }
        for(int i = 0; i < N - 1; i++){
            l.push_back(i + 1);
            r.push_back(i + 2);
        }
    }
    int n = (int) l.size();
    cout << n << endl;
    for(int i = 0; i < n; i++){
        cout << l[i] << ' ' << r[i] << endl;
    }
}

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

int main(){
  string s; cin >> s;
  int count0 = 0, count1 = 0;
  for(int i = 0; i < s.size(); i++){
    if(i%2 == 0){
      if(s[i] == '1') count0++;
    }
    if(i%2 == 1){
      if(s[i] == '0') count0++;
    }
  }
  for(int i = 0; i < s.size(); i++){
    if(i%2 == 1){
      if(s[i] == '1') count1++;
    }
    if(i%2 == 0){
      if(s[i] == '0') count1++;
    }
  }
  cout << min(count0, count1) << endl;
}

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

int main() {
    int A, B, ans;
    char op;
    cin >> A >> op >> B;
    
    if ( op == '+' ) {
         ans = A + B;
       } else {
         ans = A - B;
      }  
    cout << ans << endl;
}

Measured memory_bytes: 256
import math

a,b,h,m=map(int,input().split())
h%=12
ah=h*30+m*0.5
am=m*6
angle=abs(ah-am)
if angle>180:
    angle-=(angle-180)*2
if angle>90:
    bh=b*math.sin(math.radians(angle-90))
    bw=b*math.cos(math.radians(angle-90))
    print(((a+bh)**2+bw**2)**0.5)
else:
    bh=b*math.sin(math.radians(90-angle))
    bw=b*math.cos(math.radians(90-angle))
    print(((a-bh)**2+bw**2)**0.5)

Measured memory_bytes: 9536
fun main(args: Array<String>) {
    var H = readLong()
    var t = 1L
    var ans = 0L

    while (H > 0) {
        ans += t
        H /= 2
        t *= 2
    }
    println(ans)
}

fun readString() = readLine()!!
fun readStringList() = readLine()!!.split(" ")
fun readInt() = readLine()!!.toInt()
fun readLong() = readLine()!!.toLong()
fun readIntList() = readLine()!!.split(" ").map(String::toInt)
fun readLongList() = readLine()!!.split(" ").map(String::toLong)

Measured memory_bytes: 32008
import java.util.*;
import java.util.function.*;
import java.math.*;
public class Main {
    public static void main(String[] args){
		Scanner s = new Scanner(System.in);
		int N = Integer.valueOf(s.next());
		int M = Integer.valueOf(s.next());
		long K = Long.valueOf(s.next());
		long[] A = new long[N+2];
		long[] B = new long[M+2];
		long[] dp = new long[M+2];
		int ret = 0;
		for(int i = 1; i <= N; i++) {
			A[i] = A[i-1] + Long.valueOf(s.next());
		}
		for(int i = 1; i <= M; i++) {
			B[i] = B[i-1] + Long.valueOf(s.next());
		}
		
		int index = M;
		for(int i = 0; i <= N; i++) {
			long target = K - A[i];
			for(int j = index; j >= 0; j--) {
				if(target >= B[j]) {
					ret = Integer.max(ret, i+j);
					break;
				}else {
					index = j;
				}
			}
		}
		
		System.out.println(ret);
	}
}

Measured memory_bytes: 65352
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <stack>
#include <queue>
#include <map>
#include <numeric>
#include <type_traits>
#include <limits>
#include <random>
#include <iomanip>

using namespace std;

using ll = long long;

typedef pair<ll, ll> P;

#define rep(i,N) for(long long i = 0;i < (long long)N; ++i)

static int mod = 1000000007;
static int large_int = 1000000000;
static ll large_ll = 1000000000000000000;

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

int N;
double x;
double ans;
string str;


int main() {
	cin >> N;
	rep(i, N) {
		cin >> x;
		cin >> str;
		if (str == "BTC") {
			ans += x * 380000;
		}
		else {
			ans += x;
		}
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
n, m, l = map(int, input().split())
A = [list(map(int, input().split())) for i in range(n)]
B = [list(map(int, input().split())) for j in range(m)]
c = [[0] * l for i in range(n)]
for i in range(n):
  for j in range(l):
    for k in range(m):
      c[i][j] += A[i][k] * B[k][j]
  print(*c[i])


Measured memory_bytes: 7032
/*
      author  : nishi5451
      created : 14.08.2020 13:16:06
*/

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


int main(){
    int n;
    cin >> n;
    vector<int> d(n);
    rep(i,n) cin >> d[i];
    sort(d.begin(),d.end());
    cout << d.back()-d.front() << endl;
    return 0;
}

Measured memory_bytes: 3612
#include<bits/stdc++.h>
using namespace std;
int n,a[101]={0,
0,0,0,0,0,0,0,0,0,1,
1,1,1,2,2,3,3,3,3,8,
8,11,11,11,11,14,14,32,32,35,
35,35,35,42,42,42,42,49,49,49,
49,49,49,75,75,86,86,86,86,86,
86,123,123,131,131,131,131,148,148,153,
153,170,170,170,170,170,170,227,227,227,
227,227,227,250,250,323,323,324,324,324,
324,354,354,354,354,384,384,384,384,384,
391,491,491,529,529,529,529,529,529,543
};
int main()
{   
    cin>>n;
    cout<<a[n]<<endl;
}

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

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

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

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

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

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

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

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

fn main(){

    input!{
        s: chars,
    }

    let mut ans: Vec<char> = Vec::new();
    for i in 0..3{
        ans.push(s[i]);
    }
    
    let ss: String = ans.into_iter().collect();
    println!("{}", ss);

}

Measured memory_bytes: 2084
using System;
using System.Collections.Generic;

class Program
{
	static void Main(string[] args)
	{
		string[] input = Console.ReadLine().Split(' ');
		int h1 = int.Parse(input[0]);
		int m1 = int.Parse(input[1]);
		int h2 = int.Parse(input[2]);
		int m2 = int.Parse(input[3]);
		int k = int.Parse(input[4]);

		int start = h1*60 + m1;
		int end = h2*60 + m2;
		if(start > end) end += 24*60;

		Console.WriteLine(end-start-k);

	}

}



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

namespace MyProject
{
    class Program
    {
        static void Main(string[] args)
        {
#if Local
            var sw = new Stopwatch();
            sw.Start();
            Console.SetIn(new StreamReader("input.in"));
#endif

            var solver = new Solver();
            solver.Solve();
#if Local
            Console.WriteLine($"{sw.ElapsedMilliseconds}ms");
#endif
        }
    }

    class Solver
    {
        private int N;
        private int M;
        private int Q;

        private List<QueryItem> queries = new List<QueryItem>();
        private int answer;
        private List<List<int>> list = new List<List<int>>();

        private void Calc(List<int> cur)
        {
            if (cur.Count == this.N)
            {
                list.Add(cur.Select(elem => elem).ToList());
            }
            else
            {
                var min = cur.Count() > 0 ? cur.Last() : 1;
                for (var i = min; i <= this.M; i++)
                {
                    cur.Add(i);
                    Calc(cur);
                    cur.Remove(cur.Last());
                }
            }
        }

        public class QueryItem
        {
            public int a { get; set; }
            public int b { get; set; }
            public int c { get; set; }
            public int d { get; set; }
        }

        public void Solve()
        {
            var items1 = Console.ReadLine().Split().Select(elem => int.Parse(elem)).ToArray();
            this.N = items1[0];
            this.M = items1[1];
            this.Q = items1[2];
            foreach (var i in Enumerable.Range(0, Q))
            {
                var items2 = Console.ReadLine().Split().Select(elem => int.Parse(elem)).ToArray();
                var a = items2[0];
                var b = items2[1];
                var c = items2[2];
                var d = items2[3];
                this.queries.Add(new QueryItem { a = a, b = b, c = c, d = d });
            }

            this.Calc(new List<int>());

            foreach (var current in list)
            {
                var score = 0;
                foreach (var query in queries)
                {
                    if (current[query.b - 1] - current[query.a - 1] == query.c)
                    {
                        score += query.d;
                    }
                }

                this.answer = Math.Max(this.answer, score);
            }

            Console.WriteLine(this.answer.ToString());
        }
    }
}


Measured memory_bytes: 46844