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

#define pii  pair<int, int>
#define vi vector<int >
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define x first
#define y second
#define sz(x) (x).size()
#define all(x) (x).begin(), (x).end() //Forward traversal
#define rall(x) (x).rbegin, (x).rend() //reverse traversal
#define M_PI		3.14159265358979323846

#define ll long long
#define ld long double

const ld EPS = 10e-9;
const int INF = 1e9 + 5;
const long long INFLL = (ll)INF * (ll)INF;
const ll MOD = 1e9 + 7;

template <typename T>
ostream& operator<<(ostream& os, const vector<T>& v)
{
    os << "[";
    for (int i = 0; i < (int)v.size(); ++i) {
        os << v[i];
        if (i != (int)v.size() - 1)
            os << ", ";
    }
    os << "]\n";
    return os;
}

template <typename T>
ostream& operator<<(ostream& os, const set<T>& v)
{
    os << "{";
    for (const auto& it : v) {
        os << it;
        if (it != *v.rbegin())
            os << ", ";
    }
    os << "}\n";
    return os;
}

template <typename T>
ostream& operator<<(ostream& os, const unordered_set<T>& v)
{
    os << "{";
    for (const auto& it : v) {
        os << it;
        if (it != *v.rbegin())
            os << ", ";
    }
    os << "}\n";
    return os;
}

template <typename T, typename S>
ostream& operator<<(ostream& os, const map<T, S>& v)
{
    os << "{";
    for (const auto& it : v) {
        os << it.first << " : "
           << it.second;

        if( it != *v.rbegin())
            os  << ", ";
    }

    os << "}\n";
    return os;
}

template <typename T, typename S>
ostream& operator<<(ostream& os, const unordered_map<T, S>& v)
{
    os << "{";
    for (const auto& it : v) {
        os << it.first << " : "
           << it.second;

        if( it != *v.rbegin())
            os  << ", ";
    }

    os << "}\n";
    return os;
}

template <typename T, typename S>
ostream& operator<<(ostream& os, const pair<T, S>& v)
{
    os << "(";
    os << v.first << ", "
       << v.second << ")";
    os << "\n";
    return os;
}

#define DEBUG

#ifdef DEBUG
#define debug(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    cerr << name << " : " << arg1;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define debug(...)
#endif


// __gcd(x, y)
// c++ trig functions are in radians
// rad = deg * pi / 180

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

    double a, b, h, m;

    cin >> a >> b >> h >> m;

    double ang1 = h * 360.0 / 12.0;
    double ang2 = m * 360.0 / 60.0;

    double ang = ang1 + ang2 / 12.0 - ang2;

    double c = sqrt(a*a + b*b - 2 * a * b * cos(M_PI * ang / 180.0));

    cout << setprecision(11) << c << endl;
    return 0;
}



Measured memory_bytes: 4184
#include <bits/stdc++.h>
 using namespace std;
 #define rep(i,n) for(int i=0;i<n;i++)
 #define REP(i,n) for(int i=1;i<=n;i++)
 typedef long long ll;
 
 int main(){
 	string S;
 	cin >> S;
 	
 	ll ans = 0;
 	rep(i,S.size()-1){
 		if(S[i] != S[i+1]){
		    ans++;
	    }
 	}
 	
 	cout << ans << endl;
  	return 0;
 }



Measured memory_bytes: 512
#include <bits/stdc++.h>
#include <boost/range/algorithm.hpp>
#include <boost/range/numeric.hpp>
#include <boost/integer/common_factor.hpp>
#include <boost/integer/common_factor_rt.hpp>
#include <boost/multiprecision/cpp_dec_float.hpp>

using std::string;
using std::vector;
using std::set;
using std::multiset;
using std::unordered_set;
using std::map;
using std::multimap;
using std::unordered_map;
using std::pair;
using std::cin;
using std::cout;

typedef uintmax_t    ull;
typedef intmax_t     ll;
typedef uint64_t     ul;
typedef uint32_t     ui;
typedef uint8_t      uc;

typedef boost::multiprecision::number<boost::multiprecision::cpp_dec_float<1000>> cpp_dec_float_1000;

constexpr char CRLF  = '\n';
constexpr char SPACE = ' ';
constexpr char VECTOR_COUT_SEPARATOR = SPACE;
constexpr ll INF = 1000'000'007;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> std::ostream& operator<< (std::ostream& os, const std::vector<T>& vc) { for(auto it = vc.begin(); it != vc.end(); ++it) { if (std::next(it) == vc.end()) os << *it; else os << *it << VECTOR_COUT_SEPARATOR; } return os; }
template<class T1, class T2> inline std::ostream & operator<< (std::ostream & os, const std::pair<T1, T2> & p) { return os << p.first << ' ' << p.second; }

constexpr int GENTEN = 80 * 80 * 2 + 1;
constexpr int LEN = GENTEN * 2;

using Bitset = std::bitset<LEN>;
template <class T>
using Row = vector<T>;
template <class T>
using Table = vector<Row<T>>;

void solve(void)
{
  int H, W; cin >> H >> W;
  Table<int> A(H + 1, Row<int>(W + 1));
  Table<int> B(H + 1, Row<int>(W + 1));
  for (int row = 0; row < H; ++row) {
    for (int column = 0; column < W; ++column) {
      cin >> A[row][column];
    }
  }
  for (int row = 0; row < H; ++row) {
    for (int column = 0; column < W; ++column) {
      cin >> B[row][column];
    }
  }

  Table<Bitset> dp(H + 1, Row<Bitset>(W + 1));
  dp[0][0] |=  Bitset(1) << (GENTEN + A[0][0] - B[0][0])
            |  Bitset(1) << (GENTEN + B[0][0] - A[0][0]);

  for (int row = 0; row < H; ++row) {
    for (int column = 0; column < W; ++column) {
      dp[row][column + 1] |=
        (dp[row][column] << A[row][column + 1]) >> (B[row][column + 1])
      | (dp[row][column] << B[row][column + 1]) >> (A[row][column + 1]);

      dp[row + 1][column] |=
        (dp[row][column] << A[row + 1][column]) >> (B[row + 1][column])
      | (dp[row][column] << B[row + 1][column]) >> (A[row + 1][column]);

    }
  }

  const Bitset& res = dp[H - 1][W - 1];
  for (int i = 0; i < GENTEN; ++i) {
    if (res[GENTEN + i]) {
      cout << i << CRLF;
      return;
    }
  }
  assert(false);
  return;
}

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

  solve();

  return 0;
}


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

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m, t[100], a[100] = {};
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> t[i];
  }
  cin >> m;       
  for (int i = 0; i < m; i++) {
    int p, x;
    cin >> p >> x;        
    for (int j = 0; j < n; j++) {
      a[i] += j == p - 1 ? x : t[j];
    }                        
  }
  for (int i = 0; i < m; i++) {
    cout << a[i] << '\n';
  }
  return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>	
#include<cmath>
#include<map>
#include<vector>
#include<math.h>
#define int long long
using namespace std;
char aa[123456];
signed main() {
	int n, d, a = 1, ans = 0; cin >> n;
	for (int h = 0; h < n; h++) {
		cin >> d;
		if (a == d) { a++; ans++; }
	}
	if (ans != 0) {
		cout << n - ans << endl;
	}
	else {
		cout << -1 << endl;
	}
}

Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>
int main()
{
  char n[4];
  scanf("%s",n);
  int i;
  for(i=0;i<3;i++)
  {
    if(n[i]=='1')
      n[i]='9';
    else
      n[i]='1';
  }
  printf("%s",n);
  return 0;
}

Measured memory_bytes: 128
import sys
fin = sys.stdin.readline


N, K = [int(elem) for elem in fin().split()]
A_list = [int(elem) for elem in fin().split()]
assert len(A_list) == N

n_digits_K = 0
cur_K = K
while cur_K > 0:
    n_digits_K += 1
    cur_K >>= 1


# count_1_by_digit = [0] * max(n_digits_K, n_digits_max_A)
count_1_by_digit = [0] * n_digits_K
for A in A_list:
    i = 0
    while A > 0 and i < len(count_1_by_digit):
        count_1_by_digit[i] += A & 1
        i += 1
        A >>= 1

# print(count_1_by_digit)
X = 0
for i in reversed(range(len(count_1_by_digit))):
    count = count_1_by_digit[i]
    if count <= (N - 1) // 2:  # should set to 1
        X += (1 << i)
        if X > K:
            X -= (1 << i)
# print(X)
# calculate
f = 0
for A in A_list:
    f += A ^ X
print(f)



Measured memory_bytes: 63760
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse2")

    /*
    ||||||||||||||||||||||||||||||||||||||||||||||||
       |      |||         |      ||||    ||||  |   |
      | |     |   |      | |     |   |  |      |   |
     |   |    |    |    |   |    |   |  |      |   |
    |||||||   |    |   |||||||   |||     |||   |||||
    |     |   |   |    |     |   | |        |  |   |
    |     |   |||      |     |   |  ||  ||||   |   |
    ||||||||||||||||||||||||||||||||||||||||||||||||

    */
    using namespace std;
    //#include "testlib.h"
    #define ff first
    #define ss second
    #define mp make_pair
    #define all(v) v.begin(),v.end()
    #define int long long
    #define ll long long
    #define M 1000000007

    #define mii  map<ll ,ll >
    #define msi  map<string,ll >
    #define mis  map<ll int, string>
    #define rep(a,b)    for(ll i=a;i<b;i++)
    #define rep0(n)    for(ll i=0;i<n;i++)
    #define repi(i,a,b) for(ll i=a;i<b;i++)
    #define pb push_back
    #define vi vector<ll>
    #define mp make_pair
    #define vs vector<string>
    #define ppb pop_back
    #define endl '\n'
    #define asdf ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    #define r0 return 0;
    #define FORD(i, a, b) for (int i = (int) (a); i >= (int) (b); --i)
    #define FORE(it, c) for (__typeof((c).begin()) it = (c).begin(); it != (c).end(); ++it)
    #define inputoutput freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);
    #define input freopen("input.txt", "r", stdin);
    #define Set(a, s) 4(a, s, sizeof (a))
    #define FOR repi
    #define pii pair<int,int>
    //#define float long double
    ll max(ll a, ll b) { return (a > b)? a : b;}
    int min(int a, int b) { return (a < b)? a : b;}


     int solve()
     {
        string s;
        cin>>s;
        rep(1,s.size())
        if(s[i]==s[i-1]) return cout<<"Bad",0;
        cout<<"Good";
         
     }
    signed main()
    {   
        asdf
        int t=1;
        //cin>>t;
        while(t--)
        {
            solve();
        }     
        
}

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

int a[100100];

int main() {
    int N;
    cin >> N;
    for (int i = 1; i <= N; i++) cin >> a[i];

    set<int> st;
    st.insert(1);

    int light = 1, ans = 0;
    for (int i = 0; i < N; i++) {
        ans++;
        light = a[light];
        if (light == 2) break;
        if (st.count(light)) {
            ans = -1;
            break;
        } else {
            st.insert(light);
        }
    }

    cout << ans << endl;
}

Measured memory_bytes: 5376
#include<bits/stdc++.h>
using namespace std;
using ld=long double;
int main(){
  ld N;
  cin>>N;
  priority_queue<ld,vector<ld>,greater<ld>>data;
  for(ld i=0;i<N;i++){
    ld v;
    cin>>v;
    data.push(v);
  }
  ld tmp;
  while(true){
    tmp=data.top();
    data.pop();
    tmp+=data.top();
    data.pop();
    tmp=tmp/2;
    data.push(tmp);
    if(data.size()==1){
      break;
    }
  }
  cout<<fixed<<setprecision(12)<<tmp<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <map>

using namespace std;
int main(){
	map<int,int> mp;
	int i,n,ans=0;
	cin >> n;
	for(i=0;i<n;i++){
		int a;
		cin >> a;
		mp[a]++;
	}
	for(auto& x : mp){
		if(x.second%2==1){
			ans++;
		}
	}
	cout << ans << endl;
}

Measured memory_bytes: 4864
#include <stdio.h>
int main(){
	int i,j,n,num;
	bool prime[1000000];
	bool flag=true;
	for(i=0;i<999999;i++) prime[i]=true;
	while(scanf("%d",&n)!=EOF){
		num=0;
		for(i=2;i<n+1;i++){
				for(j=i*2;j<n+1;j=j+i) prime[j]=false;
		}
		for(i=2;i<n+1;i++){
			if(prime[i]==true) num++;
		}
		printf("%d\n",num);
	}
}

Measured memory_bytes: 2000
#include <iostream>
#include <string>

using namespace std;

const long long INF = 1LL << 60;

long long dp[100010];


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;
}

int main() {
    // でかい値で初期化
    //for (long long & i : dp)
    //    i = INF;

    // 初期条件
    dp[0] = 0;

    int n;
    cin >> n;

    int h[n];
    for (int i=0; i<n; i++)
        cin >> h[i];

    for (int i=1; i<n; i++) {
        dp[i] = INF;
        chmin(dp[i], dp[i-1] + abs(h[i] - h[i-1]));
        if (i >= 2) {
            chmin(dp[i], dp[i-2] + abs(h[i] - h[i-2]));
        }
    }

    cout << dp[n-1] << endl;
}


Measured memory_bytes: 1408
import java.util.*;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] h = new int[n];
        for (int i=0;i<n;i++)h[i]=sc.nextInt();
        boolean b = true;

        for (int i=n-1;i>=0&&b;i--){
            while (i>0&&h[i-1]<=h[i])i--;
            if (i>0)h[i-1]--;
            if (i>0&&h[i-1]>h[i])b=false;
        }
        if (b)System.out.println("Yes");
        else System.out.println("No");
    }
}


Measured memory_bytes: 59844
#include<stdio.h>
#include<stdlib.h>
int cmp(const void *a,const void *b){
	return((int*)a)[0]-((int*)b)[0];
}

int main(){
	int i, n, t;
	scanf("%d%d", &n, &t);
	int a[n][2];
	for(i = 0; i < n; ++i){
		scanf("%d%d", &a[i][0], &a[i][1]);
	}
	qsort(a, n, sizeof(int)*2, cmp);
	for(i = 0; i < n; ++i){
		if(a[i][1] <= t){
			printf("%d\n", a[i][0]);
			break;
		}
		if(i == n-1){
			printf("TLE\n");
			break;
		}
	}
	return 0;
}

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

int main(void){
    int a;
    int b;
    
    std::cin >> a >> b;
    
    if(a < b) {
        std::cout << "a < b" << std::endl;
    } else if(a > b) {
        std::cout << "a > b" << std::endl;
    } else if(a == b) {
        std::cout << "a == b" << std::endl;
    }
    
}

Measured memory_bytes: 3112
/*~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=
*$* WRITER:kakitamasziru/OxOmisosiru *$*
~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=*/
#ifdef LOCAL_JUDGE
#define _GLIBCXX_DEBUG //FOR THE DEBUG! COMMENT OUT THIS WHEN SUBMITTING!
#endif
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <iomanip>
#include <limits>//setprecision
//#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
//#include <unordered_set> //unordered_set
#include <stack> // stack
#include <deque> // deque
#include <math.h>//pow,,,
#include <cmath>//abs,,,
#include <bitset> // bitset
//It is so troublesome that I include bits/stdc++.h !
using namespace std;

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; }
const long long INF = 10010010010010;
const long long MOD = 1000000007;
typedef pair<int,int> P;

//Solve N^M. This, mod_pow use Iterative Square Method.
long long mod_pow(long long N, long long M) {
    if (M == 0) return 1;
    long long res = mod_pow((N * N) % MOD, M / 2);
    //最下位ビット(*N)が1の時は単独でNをかける
    if (M & 1) res = (res * N) % MOD;

    return res %= MOD;
}

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

int main() {
    int N;cin >> N;
    vector<string> retu(N);
    int A = 0,B = 0;
    for(int i = 0;i<N;i++) cin >> retu.at(i);
    int ans = 0;
    int special = 0;
    for(int i = 0;i<N;i++){
        string T = retu.at(i);
        for(int j = 0;j<T.size()-1;j++){
            if(T.at(j) == 'A' && T.at(j+1) == 'B') ans++;
        }
        if(T.back() == 'A' && T.front() != 'B') A++;
        if(T.front() == 'B' && T.back() != 'A') B++;
        if(T.front() == 'B' && T.back() == 'A') special++;
    }
    if(N == 1){
        cout << ans << endl;
        return 0;
    }
    int bonus = min(A,B);
    if(special == 0){
        cout << ans + bonus << endl;
    }
    else{
        if(A == 0 && B == 0){
            cout << ans + special-1 << endl;
        }
        else{
            cout << ans + bonus + special << endl;
        }
    }
}


Measured memory_bytes: 768
#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>
#include <time.h>
 
using namespace std;
 
typedef long long ll;
typedef pair<ll,ll> P;
 
long long int INF = 1e18;
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";
//↓,→,↑,←
 
#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 hoge cout << hoge << endl;
#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,r,l;
ll n,m,num,sum,ans;
ll a,b,c,d,e,f,g,h,w;
ll x[1000005],y[1000005],z[1000005];
ll dp[8000][6000];
bool flag,dame;
 
int main(){
	cin >> n;
	pe("Christmas");
	while(n != 25){
		pe("Eve");
		n++;
	}
	el;
	return 0;
}

Measured memory_bytes: 24832
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <math.h>
#include <iomanip>
using namespace std;
#define int long long

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

    int n; cin >> n;
    n --;

    vector<int> v(0);

    while(n >= 0){
        v.push_back(0);
        v.at(v.size()-1) = n % 26;
        n /= 26;
        n --;
    }

    for(int i = v.size()-1;i >= 0;i --){
        cout << char('a' + v.at(i)) ;
    }
    cout << endl;

}

Measured memory_bytes: 3592
#define debug_interval ','
#define dump_interval ' '
#define debug_toggle 1

//{
#pragma GCC optimize ("O3")
#pragma GCC target ("avx")
#include<bits/stdc++.h>
using namespace std;
#define hi cerr<<"hi"<<endl;
#define int long long
#define INT_MAX LLONG_MAX
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep1(i,n) for(int i=1;i<=(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define fi first
#define se second
#define mp make_pair
#define rev reverse
#define dans dump(ans)
//#define MOD 1000000007
#define amp(v,n) (v).count(n)?v[n]++:v[n]=1
#define sysp system("pause")
#define PI acos(-1)
#define ins insert
#define aer(v) (v).erase((v).begin(),(v).end()) 

//{
inline int toInt(string s){int v;istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x){ostringstream sout;sout<<x;return sout.str();}
template<class...A> inline void dump(){cout<<endl;}
template<class...A> inline void dump_rest() {cout<<endl;}
template<class T, class...A> inline void dump_rest(const T& first, const A&... rest){cout<<dump_interval<<first;dump_rest(rest...);}
template<class T,class...A> inline void dump(const T&first,const A&...rest){cout<<first;dump_rest(rest...);}
template<class...A> inline void debug(){cerr<<endl;}
template<class...A> inline void debug_rest() {cerr<<endl;}
template<class T, class...A> inline void debug_rest(const T& first, const A&... rest){cerr<<debug_interval<<first;debug_rest(rest...);}
template<class T,class...A> inline void debug(const T&first,const A&...rest){if(debug_toggle)cerr<<first,debug_rest(rest...);}
//}

typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;

template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}
template<int m>class mint{private:int i;public:mint() : i(0){}mint(int i): i((i%m+m)%m){}mint operator+(const mint& o){return o.i+i;}mint operator*(const mint& o){return o.i*i;}mint operator-(){return -i;}operator int() {return i;}};

//}

main(){
	int n;cin>>n;
	string s;
	cin>>s;
	int a=0,b=0;
	rep(i,s.size()){
		if(s[i]=='R')a++;
		else b++;
	}
	if(a>b)dump("Yes");
	else dump("No");
}






Measured memory_bytes: 256
#include <stdio.h>
int main(){
    int a,b;
    scanf("%d %d",&a,&b);
    if(a==1 || a==3 || a==5 || a==7 || a==8 || a==10 || a==12){
        if(b==1 || b==3 || b==5 || b==7 || b==8 || b==10 || b==12){
            printf("Yes\n");
        }
        else printf("No\n");
    }
    else if(a==4 || a==6 || a==9 || a==11){
        if(b==4 || b==6 || b==9 || b==11){
            printf("Yes\n");
        }
        else printf("No\n");
    }
    else if(a==2){
        if(b==2){
            printf("Yes\n");
        }
        else printf("No\n");
    }
    return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define int long long int
mt19937 rng(chrono::duration_cast<chrono::nanoseconds>(chrono::high_resolution_clock::now().time_since_epoch()).count());
#define mp make_pair
#define pb push_back
#define F first
#define S second
const int N = 100005;
#define M 998244353
#define double long double
#define BINF 10000000000001
#define MAXN 500005
#define init(arr,val) memset(arr,val,sizeof(arr))
#define deb(x) cout << #x << " " << x << "\n";
const int LG = 22;



#undef int 
int main() {
#define int long long int
ios_base::sync_with_stdio(false); 
cin.tie(0); 
cout.tie(0);


    int n;
    cin >> n;
    int a[n], b[n];
    for(int i = 0; i < n; i++){
        int x, y;
        cin >> x >> y;
        a[i] = x, b[i] = y;
    }
    sort(a, a + n);
    sort(b, b + n);
    if(n & 1){
        cout << b[n / 2] - a[n / 2] + 1 << endl;
    }else{
        cout << b[n / 2] + b[n / 2 - 1] - a[n / 2] - a[n / 2 - 1] + 1 << endl;
        
    }

return 0;
}


Measured memory_bytes: 6788
#include "bits/stdc++.h"

using namespace std;

void solve(void)
{
	int n, r, g, b;
	cin >> r >> g >> b >> n;
	int ans = 0;
	for (int x = 0; x*r <= n; x++)
		for (int y = 0; y*g <= n; y++)
		{
			int z = n - x*r - y*g;
			if (z >= 0 && z % b == 0)
			{
				ans++;
			}
		}
	cout << ans << endl;
}

int main()
{
	solve();
	//cout << "yui(*-v・)yui" << endl;
	return 0;
}


Measured memory_bytes: 256
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif


using namespace std;

// #define int long long
struct Fast {Fast(){std::cin.tie(0);ios::sync_with_stdio(false);}} fast;

inline bool inside(int y, int x, int H, int W) {return y >= 0 && x >= 0 && y < H && x < W;}
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

const int MOD = 1e9 + 7;
const int INF = INT_MAX;

signed main() {
    Fast();

    int n;
    cin >> n;

    double ans;
    while(n--){
        double x;
        string u;
        cin >> x >> u;
        ans += x * (u == "BTC" ? 380000.0 : 1);
    }
    
    cout << ans << endl;
    
    return 0;
}



Measured memory_bytes: 640
#include <bits/stdc++.h>
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(), (v).end()
using namespace std;
typedef long long lint;
typedef long double llf;
typedef pair<lint, lint> pi;
const int MAXN = 530000;
const int mod = 1e9 + 7;

struct mint {
    int val;
    mint() { val = 0; }
    mint(const lint& v) {
        val = (-mod <= v && v < mod) ? v : v % mod;
        if (val < 0) val += mod;
    }

    friend ostream& operator<<(ostream& os, const mint& a) { return os << a.val; }
    friend bool operator==(const mint& a, const mint& b) { return a.val == b.val; }
    friend bool operator!=(const mint& a, const mint& b) { return !(a == b); }
    friend bool operator<(const mint& a, const mint& b) { return a.val < b.val; }

    mint operator-() const { return mint(-val); }
    mint& operator+=(const mint& m) { if ((val += m.val) >= mod) val -= mod; return *this; }
    mint& operator-=(const mint& m) { if ((val -= m.val) < 0) val += mod; return *this; }
    mint& operator*=(const mint& m) { val = (lint)val*m.val%mod; return *this; }
    friend mint ipow(mint a, lint p) {
        mint ans = 1; for (; p; p /= 2, a *= a) if (p&1) ans *= a;
        return ans;
    }
    friend mint inv(const mint& a) { assert(a.val); return ipow(a, mod - 2); }
    mint& operator/=(const mint& m) { return (*this) *= inv(m); }

    friend mint operator+(mint a, const mint& b) { return a += b; }
    friend mint operator-(mint a, const mint& b) { return a -= b; }
    friend mint operator*(mint a, const mint& b) { return a *= b; }
    friend mint operator/(mint a, const mint& b) { return a /= b; }
    operator int64_t() const {return val; }
};

int n, a[MAXN];

struct foo{
	mint asum, bsum, tot;
}dp[MAXN];

foo merge(foo a, foo b, int v){
	foo ret;
	ret.asum = mint(v) * (a.asum + b.asum);
	ret.bsum = mint(v) * (a.bsum + b.bsum);
	ret.tot = a.tot + b.tot + mint(v) * (a.asum * b.bsum + a.bsum * b.asum);
	return ret;
}

void setDP(int x, mint p, mint q){
	x += (1<<(n-1)) - 1;
	dp[x] = (foo){p * mint(x), q * mint(x), 0};
	while(x > 1){
		x >>= 1;
		dp[x] = merge(dp[2*x], dp[2*x+1], x);
	}
}

mint getPath(int x, int y){
	mint ret = 1;
	while(x > y){
		ret *= mint(x);
		x /= 2;
	}
	assert(x == y);
	return ret;
}

mint solve(int s, int e, int p){
	if(s == e) return mint(0);
	int m = (s+e)/2;
	mint ret = solve(s, m, 2*p) + solve(m + 1, e, 2*p+1);
	for(int i=s; i<=m; i++){
		setDP(a[i], getPath(i + (1<<(n-1)) - 1, p) * mint(p), mint(0));
	}
	for(int i=m+1; i<=e; i++){
		setDP(a[i], mint(0), getPath(i + (1<<(n-1)) - 1, p));
	}
	ret += dp[1].tot;
	for(int i=s; i<=e; i++) setDP(a[i], mint(0), mint(0));
	return ret;
}

int main(){
	scanf("%d",&n);
	for(int i=1; i<=(1<<(n-1)); i++) scanf("%d",&a[i]);
	cout << solve(1, (1<<(n-1)), 1) << endl;
}


Measured memory_bytes: 10488
#include<iostream>
using namespace std;
int main(){
  int a;
  int b;
  int c;
  cin>>a;
  cin>>b;
  cin>>c;
  if(a==b & b!=c){
    cout<<"Yes"<<endl;
  }
  else if(a==c & b!=c){
    cout<<"Yes"<<endl;
  }
  else if(b==c & a!=c){
    cout<<"Yes"<<endl;
  }
  else{
    cout<<"No"<<endl;
  }
  return 0;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
 
int main(){
    int n;
    int a[1000];
    cin >> n;
    for(int i=0;i < n;i++){
        cin >> a[i];
    }
    cout << a[n-1];
    for(int i=1;i < n;i++){
        cout << " " << a[n-i-1];
    }
    cout << endl;
}


Measured memory_bytes: 3080
#define _ijps 0
#define _ALLOW_RTCc_IN_STL
#define _CRT_SECURE_NO_DEPRECATE
//#pragma comment(linker, "/STACK:667772160")
#include <iostream>
#include <cmath>
#include <time.h>
#include <map>
#include <set>
#include <deque>
#include <cstdio>
#include <cstdlib>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <algorithm>
#include <string>
#include <fstream>
#include <assert.h>
#include <list>
#include <cstring>
#include <queue>

using namespace std;

#define name "pail"

typedef long long ll;

struct __isoff {
	__isoff() {
		if (_ijps)
			freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout);//, freopen("test.txt", "w", stderr);
		//else freopen(name".in", "r", stdin), freopen(name".out", "w", stdout);
		//ios_base::sync_with_stdio(0);
		//srand(time(0));
		srand('C' + 'T' + 'A' + 'C' + 'Y' + 'M' + 'B' + 'A');
	}

	~__isoff() {
		//if(_ijps) cout<<times<<'\n';
	}
} __osafwf;

const int mod = 1e9 + 7;

int mul(int a, int b) {
	return static_cast<ll>(a) * b % mod;
}

int bp(int a, int b) {
	if (b == 0) {
		return 1;
	}
	if (b % 2 == 1) {
		return static_cast<ll>(bp(a, b - 1)) * a % mod;
	}
	a = bp(a, b / 2);
	return static_cast<ll>(a) * a % mod;
}

int inv(int a) {
	return bp(a, mod - 2);
}

int divs(int a, int b) {
	return mul(a, inv(b));
}

const int dd = 2e5;
int TeF[dd];

int Fac(int x) {
	if (x < 0) {
		return 0;
	}
	return TeF[x];
}

int cnk(int n, int m) {
	if (m > n || m < 0) {
		return 0;
	}
	return divs(Fac(n), mul(Fac(m), Fac(n - m)));
}

int main() {
	TeF[0] = 1;
	for (int i = 1; i < dd; i++) {
		TeF[i] = mul(TeF[i - 1], i);
	}
	int n;
	cin >> n;
	n++;
	map<int, int> M;
	int l = 0, r = 0;
	for (int i = 0; i < n; i++) {
		int t;
		cin >> t;
		if (M.count(t)) {
			l = M[t];
			r = i;
		}
		M[t] = i;
	}
	int a = l;
	int b = r - l - 1;
	int c = n - r - 1;
	for (int i = 1; i <= n; i++) {
		ll res = 0;

		res += cnk(n, i) - cnk(a + c + 2, i);
		res += cnk(a + c, i - 2);
		res += cnk(a + c, i);
		res += cnk(a + c, i - 1);

		res %= mod;
		res += mod;
		res %= mod;
		cout << res << '\n';
	}
}


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

bool kaibun(string s) {
    for (int i = 0; i <= (s.size() - 1) / 2; i++) {
        if (s.at(i) != s.at(s.size() - 1 - i))
            return false;
    }
    return true;
}

int main() {
    string s;
    cin >> s;
    int n = s.size();
    bool ans = false;
    if (kaibun(s)) {
        if (kaibun(s.substr(0, (n - 1) / 2))) {
            if (kaibun(s.substr((n + 3) / 2 - 1, n))) {
                ans = true;
            }
        }
    }
    cout << (ans ? "Yes" : "No") << endl;
}

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

int main(){
    while(1){
    int x=0,y=0,p=0,f[30][30]={0},j[30][30]={0};
    cin>>x>>y;
    if(x==y && x==0)break;
    cin>>p;
    for(int i=0;i<p;i++){
        int a,b;
        cin>>a>>b;
        j[a][b]=-1;
    }
    f[1][1]=1;
    for(int i=1;i<=x;++i){
        for(int k=1;k<=y;++k){
            f[i][k]+=f[i-1][k]+f[i][k-1];
        if(j[i][k]==-1)f[i][k]=0;
        }
    }
    cout<<f[x][y]<<endl;

    }
    return 0;
}

Measured memory_bytes: 1164
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

    class Program
    {
        static void Main(string[] args)
        {
            var a = int.Parse(Console.ReadLine());
            var b = int.Parse(Console.ReadLine());
            var c = int.Parse(Console.ReadLine());
            Console.WriteLine((a + b) * c / 2);
        }
    }


Measured memory_bytes: 2648
#include<bits/stdc++.h>
using namespace std;
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define int long long
#define mod 1000000007
#define pb push_back  
#define endl "\n"
#define fi first
#define se second 
#define ll long long
#define inf 9000000000000000000
#define PI 3.14159265359

int power(int a,int b,int m=mod)
{
     if(b==0)	return 1;
     if(b==1)	return a;
	 int res=power(a,b/2,m);
	 res=(res*res)%m;
     if(b&1)	res=(res*a)%m;
     return res;
}
int modinv(int a,int m=mod){ return power(a,m-2,m);}
int add(int a,int b,int m=mod){	int c=(a%m+b%m);	if(c>=m)	c-=m;	return c;}
int sub(int a,int b,int m=mod){	int c=(a%m-b%m);	if(c<0)		c+=m;	return c;}
int mul(int a,int b,int m=mod){	return (a*b)%m;}


int32_t main()
{
   IOS
   
   int a,b,c,d;
   cin>>a>>b>>c>>d;
    
    cout<<max({a*c,a*d,b*c,b*d})<<endl;
	
	
}

Measured memory_bytes: 3648
n = int(input())
a, b = map(int, input().split())
p = list(map(int, input().split()))
ans = 0
c = 0
d = 0
e = 0
for i in range(n):
  if p[i] <= a:
    c += 1
  elif a + 1 <= p[i] <= b:
    d += 1
  elif p[i] >= b + 1:
    e += 1
ans = min(c, d, e)
print(ans)

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

switch = [[] for _ in range(m)]

for i in range(m):
    ks = list(map(int, input().split()))
    switch[i] = ks[1:]


p = list(map(int, input().split()))

ans = 0
#print(switch)

for i in range(2 ** n):
    flag = [False] * n
    for j in range(n):  # このループが一番のポイント
        if ((i >> j) & 1):  # 順に右にシフトさせ最下位bitのチェックを行う
            flag[j] = True

    #print(flag)
    f = True    
    for k in range(m):
        c = 0
        for j in switch[k]:
            if flag[j-1]:
                c += 1
        if c % 2 != p[k]:
            f = False
            break
        
    if f:
            ans += 1

print(ans)



Measured memory_bytes: 73840
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.PriorityQueue;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.util.Comparator;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author anand.oza
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        DPatisserieABC solver = new DPatisserieABC();
        solver.solve(1, in, out);
        out.close();
    }

    static class DPatisserieABC {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int m = in.nextInt();

            long[] x = new long[n];
            long[] y = new long[n];
            long[] z = new long[n];

            for (int i = 0; i < n; i++) {
                x[i] = in.nextLong();
                y[i] = in.nextLong();
                z[i] = in.nextLong();
            }

            long answer = Long.MIN_VALUE;
            for (int X = -1; X <= 1; X += 2) {
                for (int Y = -1; Y <= 1; Y += 2) {
                    for (int Z = -1; Z <= 1; Z += 2) {
                        PriorityQueue<Long> scores = new PriorityQueue<>(Comparator.reverseOrder());
                        for (int i = 0; i < n; i++) {
                            scores.add(x[i] * X + y[i] * Y + z[i] * Z);
                        }
                        long candidate = 0;
                        for (int i = 0; i < m; i++) {
                            candidate += scores.poll();
                        }

                        answer = Math.max(answer, candidate);
                    }
                }
            }

            out.println(answer);
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

    }
}



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

int main()
{
  int ans=0;
  string s;
  cin>>s;
  for(int i=0;i<s.size();i++)
  {
    ans+=s.at(i)-48;
  }
  if(ans%9==0)
    cout<<"Yes"<<endl;
  else
    cout<<"No"<<endl;
}

Measured memory_bytes: 3744
from collections import Counter
S = input()
N = len(S)
ctr = Counter(S)
if len([1 for v in ctr.values() if v%2]) > 1:
    print(-1)
    exit()

M = None
for k,v in ctr.items():
    if v%2:
        M = k
    ctr[k] //= 2

def ctoi(c):
    return ord(c) - ord('a')
from collections import deque
idxs = [deque() for _ in range(26)]
for i,c in enumerate(S):
    idxs[ctoi(c)].append(i)

A = ''
P = []
i = 0
while len(A) < N//2:
    c = S[i]
    if ctr[c] > 0:
        ctr[c] -= 1
        A += c
        P.append(idxs[ctoi(c)].popleft())
    i += 1
if M:
    P.append(idxs[ctoi(M)].popleft())
for c in A[::-1]:
    P.append(idxs[ctoi(c)].popleft())

def inversion(inds):
    bit = [0] * (N+1)
    def bit_add(x,w):
        while x <= N:
            bit[x] += w
            x += (x & -x)
    def bit_sum(x):
        ret = 0
        while x > 0:
            ret += bit[x]
            x -= (x & -x)
        return ret
    inv = 0
    for ind in reversed(inds):
        inv += bit_sum(ind + 1)
        bit_add(ind + 1, 1)
    return inv

print(inversion(P))

Measured memory_bytes: 14816
#include<stdio.h>
#define N 100

void trace(int a[], int n){
  int i;
  for ( i = 1; i <= n; i++ ){
    if ( i > 1 ) printf(" ");
    printf("%d", a[i]);
  }
  printf("\n");
}

int main(void){
  int n,i,j,sw,co=0,a[N];
  
  scanf("%d",&n);  
  for ( i = 1; i <= n; i++ ) scanf("%d", &a[i]);

  for(i=1;i<n+1;i++){
    for(j=n; j>i; j--){
      if(a[j]<a[j-1]){
	sw=a[j];
	a[j]=a[j-1];
	a[j-1]=sw;
	co++;
      }
    }
  }
  trace(a,n);
  printf("%d\n",co);

  return 0;
}

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

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

  int h[n+1][3];

  for(int i=1;i<=n;i++){
      for(int j=0;j<3;j++){
          cin >> h[i][j];
      }
  }

  int ans[n+1][3];
  for(int i=0;i<3;i++){
      ans[1][i] = h[1][i];
  }

  for(int i=2;i<=n;i++){
      for(int j=0;j<3;j++){
         ans[i][j] = h[i][j] + max(ans[i-1][(j+1)%3],ans[i-1][(j+2)%3]);

      }
  }


int answer = max(max(ans[n][1],ans[n][2]),ans[n][0]);
      cout << answer<< endl;

  }


Measured memory_bytes: 2560
import java.util.Arrays;
import java.util.Scanner;

//Goldbach's Conjecture II
public class Main{

	public static void main(String[] args) {
		boolean[] p = new boolean[1000001];
		Arrays.fill(p, true);
		p[0]=p[1]=false;
		for(int i=2;i<1000001;i++)if(p[i])for(int j=i*2;j<1000001;j+=i)p[j]=false;
		Scanner sc = new Scanner(System.in);
		while(true){
			int n = sc.nextInt();
			if(n==0)break;
			int c = 0;
			for(int i=2;i<=n/2;i++)if(p[i]&&p[n-i])c++;
			System.out.println(c);
		}
	}
}

Measured memory_bytes: 13000
b =int(input())
a = [int(a) for a in input().split()]
aa=[]
for ii in range (b):
  aa.append(0)
for i in range (b):
  az=a[i]
  ax=i+1
  aa[az-1]=ax
print(( " ".join( repr(e) for e in aa ) ))

Measured memory_bytes: 17932
#include <stdio.h>
int at,ah,f;
void add(int a[],int b[],int n,int m,int i,int j	){
	int st=0,sh=0,x;
	for(x=0;x<n;x++){
		if(x==i){
			st+=b[j];
		}
		else{
			st+=a[x];
		}
	}
	for(x=0;x<m;x++){
		if(x==j){
			sh+=a[i];
		}
		else{
			sh+=b[x];
		}
	}
	if(st==sh&&at+ah>st+sh){
		at=a[i];
		ah=b[j];
		f=1;
	}
}
int main(void){
	int t[100],h[100],i,j,n,m;
	while(1){
		scanf("%d %d",&n,&m);
		if(!n)
		break;
		for(i=0;i<n;i++){
			scanf("%d",&t[i]);
	    }
	    for(i=0;i<m;i++){
	    	scanf("%d",&h[i]);
	    }
	    at=ah=114514;
	    f=0;
	    for(i=0;i<n;i++){
	    	for(j=0;j<m;j++){
	    		add(t,h,n,m,i,j);
	    	}
	    }
	    if(f){
	    	printf("%d %d\n",at,ah);
	    }
	    else{
	    	puts("-1");
	    }
	 }
	 return 0;
}
			

Measured memory_bytes: 612
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#define lol(i,n) for(int i=0;i<n;i++)
#define mod 1000000007
typedef long long ll;
using namespace std;
 
ll Pmod(ll n,ll k){
	ll r=k,ret=1;
	while(true){
		if(n==0)break;
		if(n%2==1){
			ret=ret*r%mod;
		}
		n/=2;
		r=r*r%mod;
	}
	return ret;
}
 
vector<pair<ll,ll> > v;
int main(){
	ll n,k;
	cin>>n>>k;
	for(ll i=1;i*i<=n;i++){
		if(n%i==0){
			v.push_back(make_pair(i,-1));
			if(i!=n/i)v.push_back(make_pair(n/i,-1));
		}
	}
	sort(v.begin(),v.end());
	ll ans[2]={0,0};
	for(int i=0;i<v.size();i++){
		ll x=v[i].first;
		ll tmp=Pmod((x+1)/2,k);
		for(int j=0;j<i;j++){
			if(x%v[j].first==0){
				tmp=(mod+tmp-v[j].second)%mod;
			}
		}
		v[i].second=tmp;
		ans[x%2]+=tmp*x%(mod*(ll)10);
	}
	//cout<<ans[0]<<" "<<ans[1]<<endl;
	cout<<(ans[0]/2+ans[1])%mod<<endl;
	return 0;
}


Measured memory_bytes: 256
function main(input)
{
  const args = input.split(' ');
  const a = parseInt(args[0], 10);
  const b = parseInt(args[1], 10);
  
  if ((a*b) % 2 === 0) {
    console.log('Even');
  }
  else
  {
    console.log('Odd');
  }
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));


Measured memory_bytes: 7372
#include<iostream>
#include<algorithm>
#include<vector>

#define SIZE_OF_ARRAY(array) (sizeof(array)/sizeof(array[0]))

using namespace std;

struct Info{
  long A;
  int B;
  
  Info(long a, int b){
    A = a;
    B = b;
  }
  
  bool operator<(const Info &another) const{
    return A < another.A;
  };
};

int main(){
  int N, M;
  cin >> N >> M;
  
  vector<Info> info;
  int A, B;
  for (int i=0; i < N; ++i){
    cin >> A >> B;
    info.push_back(Info(A, B));
  }
  
  sort(info.begin(), info.end());
  
  int count = 0;
  long price = 0;
  for (int i = 0; i < N; ++i){
    if (info[i].B + count <= M){
      count += info[i].B;
      price += info[i].A * info[i].B;
    }
    else{
      price += info[i].A * (M - count);
      break;
    }
  }
  cout << price << endl;

  return 0;
}

Measured memory_bytes: 2420
#include <iostream>
#include <string>
#include <vector>

using namespace std;

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

    int n, k;
    cin >> n >> k;

    int c = 1;
    for (int i = 0; i < n; i++) {
        if (c < k) {
            c += c;
        }
        else {
            c += k;
        }
    }

    cout << c << "\n";
    
    int a;
    cin >> a;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>
#include<ctype.h>

int main (void)
{
	int turn,tp,hp;
	char tc[100],hc[100];
	int i;
	
	tp = 0;
	hp = 0;
	
	scanf("%d",&turn);
	
	for(i = 0 ; i < turn ; i++)
	{
		scanf("%s %s",tc,hc);
		if(strcmp(tc,hc) > 0)
		{
			tp += 3;
		}
		else if(strcmp(tc,hc) == 0)
		{
			tp++;
			hp++;
		}
		else
		{
			hp += 3;
		}
	}
	
	printf("%d %d\n",tp,hp);
	
	return 0;
}


Measured memory_bytes: 2116
#include <iostream>
#include <string>
#include<string.h>
#include <cstdio>

using namespace std;
#define size 100005

typedef struct pu {
	int time;
	string name;
}P;

P Q[size];
int head, tail, n;//先頭尻尾、要素数
void enqueue(P x) {
	Q[tail] = x;
	tail = (tail + 1) % size;
}
P dequeue() {
	P x = Q[head];
	head = (head + 1) % size;
	return x;
}

int min(int a, int b) { return a < b ? a : b; }

int main()
{
	int elps = 0, re_time;//経過時間と残り時間
	int q;
	cin >> n>>q;
	head = 1;
	tail = n + 1;
	for (int i = 1; i <= n; i++) {
		cin >> Q[i].name >> Q[i].time;
	}

	while (head!=tail) {
		P u = dequeue();
		re_time=min(q, u.time);
		u.time -= re_time;
		elps += re_time;
		if (u.time > 0) {
			enqueue(u);
		}
		else {
			cout << u.name << " " << elps << endl;
		}

	}

    return 0;
}



Measured memory_bytes: 7040
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i=0; i<n; i++)
#define pb push_back
#define int long long
typedef pair<int, int> P;
typedef tuple<string, int, int> T;

signed main() {
    //cin.tie(0); ios::sync_with_stdio(false);
    string S; cin >> S;
    for (int i=S.size()-3; i>=0; i-=2) {
        int s = (i+1)/2;
        if (S.substr(0, s)==S.substr(s, s)) {
            cout << i+1 << endl;
            exit(0);
        }
    }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define lvector vector<ll> 
#define P pair<ll,ll>
#define rep(i,n) for(ll (i)=0; (i)<(n); ++(i))
#define print(a) cout << (a) << endl

ll n;
lvector layer(n+1),pat(n+1);

ll f(ll a,ll b) {
  if(a==0) return (b<=0)?0:1;
  else if(b<=1+layer[a-1]) return f(a-1,b-1);
  else return pat[a-1]+1+f(a-1,b-2-layer[a-1]);
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll n,x;cin>>n>>x;
  layer.resize(n+1),pat.resize(n+1);
  layer[0]=1,pat[0]=1;
  for(ll i=1;i<=n;++i) {
    layer[i]=1+layer[i-1]+1+layer[i-1]+1;
    pat[i]=pat[i-1]+1+pat[i-1];
  }
  ll ans=f(n,x);
  print(ans);
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <utility>
#include <tuple>
#include <algorithm>
#include <numeric>
#include <cstdio>
#include <cmath>
#define rep(i, n) for(int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

int main(){
  int N;
  string S;
  cin >> N >> S;
  vector<vector<int>> dp(N+1, vector<int>(N+1));
  for(int i=N-1; i>=0; i--) {
    for(int j=N-1; j>=0; j--) {
      if(S[i] == S[j])
        dp[i][j] = dp[i+1][j+1]+1;
    }
  }
  int ans = 0;
  rep(i, N+1) rep(j, N+1)
    chmax(ans, min(dp[i][j], abs(i-j)));
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 98176