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

#define NDEBUG
#ifdef DEBUG
#include "../cout11.h"
#undef NDEBUG
#endif
#include <cassert>

typedef long long ll;
typedef long double Double;
typedef unsigned long long ull;
typedef pair<int,int> ii;
typedef pair<ll,ll> llll;
typedef pair<double,double> dd;

typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<ii> vii;
typedef vector<vector<ii>> vvii;
typedef vector<ll> vll;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<long double> vD;

#define sz(a)  int((a).size())
#define pb  push_back
#define FOR(var,from,to) for(int var=(from);var<=(to);++var)
#define rep(var,n)  for(int var=0;var<(n);++var)
#define rep1(var,n)  for(int var=1;var<=(n);++var)
#define repC2(vari,varj,n)  for(int vari=0;vari<(n)-1;++vari)for(int varj=vari+1;varj<(n);++varj)
#define ALL(c)  (c).begin(),(c).end()
#define RALL(c)  (c).rbegin(),(c).rend()
#define tr(i,c)  for(auto i=(c).begin(); i!=(c).end(); ++i)
#define found(s,e)  ((s).find(e)!=(s).end())
#define mset(arr,val)  memset(arr,val,sizeof(arr))
#define mid(x,y) ((x)+((y)-(x))/2)
#define IN(x,a,b) ((a)<=(x)&&(x)<=(b))
#define cons make_pair


ll gcd(ll a, ll b) { while(a) swap(a, b%=a); return b; }

const ll MOD=1000000007LL;

ll ADD(ll x, ll y) { return (x+y) % MOD; }
ll SUB(ll x, ll y) { return (x-y+MOD) % MOD; }
ll MUL(ll x, ll y) { return x*y % MOD; }
ll POW(ll x, ll e) { ll v=1; for(; e; x=MUL(x,x), e>>=1) if (e&1) v = MUL(v,x); return v; }
ll DIV(ll x, ll y) { /*assert(y%MOD!=0);*/ return MUL(x, POW(y, MOD-2)); }
// ll comb(ll n, ll k) { ll v=1; for(ll i=1; i<=k; i++) v = DIV(MUL(v, n-i+1),i); return v; }
//

#define INTSPACE 12
char _buf[INTSPACE*1000000 + 3];

int loadint() {
    if (fgets(_buf, INTSPACE+3, stdin)==NULL) return 0;
    return atoi(_buf);
}

int loadvec(vector<int>& v, int N=-1) {
    if (N == -1) {
        N = loadint();
        if (N==0) return 0;
    }
    int bufsize = INTSPACE*N + 3;
    if (fgets(_buf, bufsize, stdin)==NULL) return 0;
    v.resize(N);

    int i=0;
    bool last = false;
    for (char *p=&_buf[0]; ;) {
        char *q = p;
        while (*q > ' ') ++q;
        if (*q == 0x0D || *q == 0x0A) last = true;
        *q = 0;
        v[i++] = atoi(p);
        if (last || i == N) break;
        p = q+1;
    }
    // assert(i <= N);
    return i;
}
void read_cr() {
    fgets(_buf, 256, stdin);
}

int solve(int N, vi& a) {
    int cnt = 0;
    int P = 1; rep(i,N) P *= 3;
    rep(p,P) {
        bool even = false;
        for (int i=0,x=p; i<N; ++i,x/=3) {
            int r = (x%3) - 1;
            if ((a[i]+r) % 2 == 0) { even = true; break; }
        }
        if (even) ++cnt;
    }
    return cnt;
}

int main() {
    vi a;
    int N = loadvec(a);
    cout << solve(N,a) << endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define all(c) (c).begin(),(c).end()
#define pb push_back
#define dbg(...) do{cerr<<__LINE__<<": ";dbgprint(#__VA_ARGS__, __VA_ARGS__);}while(0);

using namespace std;

namespace std{template<class S,class T>struct hash<pair<S,T>>{size_t operator()(const pair<S,T>&p)const{return ((size_t)1e9+7)*hash<S>()(p.first)+hash<T>()(p.second);}};template<class T>struct hash<vector<T>>{size_t operator()(const vector<T> &v)const{size_t h=0;for(auto i : v)h=h*((size_t)1e9+7)+hash<T>()(i)+1;return h;}};}
template<class T>ostream& operator<<(ostream &os, const vector<T> &v){os<<"[ ";rep(i,v.size())os<<v[i]<<(i==v.size()-1?" ]":", ");return os;}template<class T>ostream& operator<<(ostream &os,const set<T> &v){os<<"{ "; for(const auto &i:v)os<<i<<", ";return os<<"}";}
template<class T,class U>ostream& operator<<(ostream &os,const map<T,U> &v){os<<"{";for(const auto &i:v)os<<" "<<i.first<<": "<<i.second<<",";return os<<"}";}template<class T,class U>ostream& operator<<(ostream &os,const pair<T,U> &p){return os<<"("<<p.first<<", "<<p.second<<")";}
void dbgprint(const string &fmt){cerr<<endl;}template<class H,class... T>void dbgprint(const string &fmt,const H &h,const T&... r){cerr<<fmt.substr(0,fmt.find(","))<<"= "<<h<<" ";dbgprint(fmt.substr(fmt.find(",")+1),r...);}
typedef long long ll;typedef vector<int> vi;typedef pair<int,int> pi;const int inf = (int)1e9;const double INF = 1e12, EPS = 1e-9;

int main(){
	cin.tie(0); cin.sync_with_stdio(0);
	
	string s; cin >> s;
	rep(i, s.size()){
		if(i + 1 < s.size() && s[i] == s[i + 1]){
			cout << i+1 << " " << i+2 << endl;
			return 0;
		}
		if(i + 2 < s.size() && s[i] == s[i + 2]){
			cout << i+1 << " " << i+3 << endl;
			return 0;
		}
	}
	cout << -1 << " " << -1 << endl;
	
	return 0;
}

Measured memory_bytes: 512
n, k = map(int, input().split())

MOD = int(1e+9+7)

max_zero_num = min(n-1, k)
kai = [1]*(n+1)
gyaku_kai = [1]*(n+1)

for i in range(n):
    kai[i+1] = kai[i]*(i+1) % MOD
    gyaku_kai[i+1] = pow(kai[i+1], MOD-2, MOD)%MOD
        
answer = 0
for zero_num in range(max_zero_num+1):
    answer = (answer + kai[n]*gyaku_kai[n-zero_num]*gyaku_kai[zero_num]*\
    kai[n-1]*gyaku_kai[n-1-zero_num]*gyaku_kai[zero_num]) %MOD

print(answer)


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

using namespace std;

int main()
{
    string x;
    string y;
    int len1,len2,i,flag=0,cheak=0;
    cin>>x;
    cin.ignore();
    cin>>y;
    len1=x.size();
    len2=y.size();
    if(len2>len1)
    {
        cheak=1;
    }
    for(i=0;i<len1;i++)
    {
        if(x[i]!=y[i])
        {
            flag=2;
            break;
        }
    }
    if(flag==0&&cheak==1)
    {
        cout<<"Yes\n";
    }
    else{
        cout<<"No\n";
    }
    return 0;
}



Measured memory_bytes: 3596
#include <iostream>
#include <cstdio>
#include <string.h>
#include <vector>
using namespace std;

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

    char a[n + 1];
    a[0] = ' ';
    for(int i = 1; i <= n; i++){
        cin >> a[i];
    }

    vector<int> w(n + 2, 0);
    vector<int> e(n + 2, 0);

    for(int i = 0; i <= n; i++){
        if(a[i] == 'W'){
            w[i + 1] = w[i] + 1;
            e[i + 1] = e[i];

        }
        else if(a[i] == 'E') {
            e[i + 1] = e[i] + 1;
            w[i + 1] = w[i];
        }
    }

    
    int minv = 10000000;
    for(int k = 1; k <= n; k++){
        minv = min(minv, w[k] + e[n + 1] - e[k + 1]);
    }

    printf("%d\n", minv);

    return 0;

}

Measured memory_bytes: 2816
#include <iostream>
using namespace std;
int main(void){
    int n,i;

  cin >> n;
  long max,min,sum=0;
  int a;
  if( n ==0 )return 0;

  for ( i = 0 ; i < n ; i++){
    cin >> a;
    sum = sum + a;
    if( i == 0)max=min=a;
    if ( max <= a){
      max = a;
    }
    if ( min >= a){
      min = a;
    }
  }
  
  cout << min << " " << max << " " << sum <<endl;
}



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

#define int long long
using ll = long long;
using ld = long double;
using intpair = pair<int, int>;
using intmap = map<int, int>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
const int MOD = 1e9 + 7;
inline int mod (ll a, int m = MOD) { return (a % m + m) % m; }
inline bool bit (ll b, ll i) { return b & (1 << i); }
inline ll ceiv (ll a, ll b) { return (a + b - 1) / b; }
//struct Fast {Fast(){cin.tie(0);ios::sync_with_stdio(0);}} fast;

#define debug(x) cerr << #x << ": " << x << '\n'
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define reps(i, n, m) for (int i = (int)(n); i <= (int)(m); i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()

inline int f(int x, int y, int X, int Y){
    return abs(x - X) + abs(y - Y);
}

signed main(){
    int n;
    cin >> n;
    vi x(n), y(n);
    rep(i,n) cin >> x[i] >> y[i];
    int ans = 0;
    
    for(int a : {-1, 1})for(int b : {-1, 1}){
        int minidx = 0;
        rep(i,n){
            if(a * x[i] + b * y[i] < a * x[minidx] + b * y[minidx]){
                minidx = i;
            }
        }
        rep(i,n){
            ans = max(ans, f(x[minidx], y[minidx], x[i], y[i]));
        }
    }
    
    cout << ans << endl;
}

Measured memory_bytes: 6428
t = gets.to_i

def rec(n, memo, a, b, c, d)
  return 0 if n==0
  return d if n==1
  return memo[n] if memo[n]
  
  min = n*d
  if n%2==0
    tmp = rec(n/2, memo, a, b, c, d)+a
    min = tmp if min > tmp
  else
    m = n%2
    l = 2-m
    tmp1 = rec((n-m)/2, memo, a, b, c, d)+a+(d*m)
    tmp2 = rec((n+l)/2, memo, a, b, c, d)+a+(d*l)
    min = tmp1 if min > tmp1
    min = tmp2 if min > tmp2
  end
  
  if n%3==0
    tmp = rec(n/3, memo, a, b, c, d)+b
    min = tmp if min > tmp
  else
    m = n%3
    l = 3-m
    tmp1 = rec((n-m)/3, memo, a, b, c, d)+b+(d*m)
    tmp2 = rec((n+l)/3, memo, a, b, c, d)+b+(d*l)
    min = tmp1 if min > tmp1
    min = tmp2 if min > tmp2
  end
  
  if n%5==0
    tmp = rec(n/5, memo, a, b, c, d)+c
    min = tmp if min > tmp
  else
    m = n%5
    l = 5-m
    tmp1 = rec((n-m)/5, memo, a, b, c, d)+c+(d*m)
    tmp2 = rec((n+l)/5, memo, a, b, c, d)+c+(d*l)
    min = tmp1 if min > tmp1
    min = tmp2 if min > tmp2
  end
  
  #p [n,min]
  memo[n] = min if !memo[n]
  return min
end

t.times{
  n,a,b,c,d = gets.split.map(&:to_i)
  memo = {}
  p rec(n, memo, a, b, c, d)
}

Measured memory_bytes: 17252
import java.util.*;
class Main
{
  public static void main(String[] args)
  {
    Scanner sc = new Scanner(System.in);
    
    int n = sc.nextInt();
    long sum = 0;
    
    for(int i=1 ; i<=n ; i++){
      
      if( (i%3!=0)&&(i%5!=0)){
      if(i%3!=0) {
      	if(i%5!=0){
      		
      	sum+=i;
      	
      	
      	}
      }
    }
}
System.out.println(sum);
  }
}

Measured memory_bytes: 27184
#include <stdio.h>

#define N 500000
#define S 1000000000

int merge(int *,int,int,int);
void mergeSort(int *,int,int);

int n,s[N],count=0,tmp[N],x[N];

int main()
{

  int i,x;

  scanf("%d",&n);

  for(i=0;i<n;i++){

    scanf("%d",&s[i]);

  }

  mergeSort(s,0,n-1);

  for(i=0;i<n-1;i++){

    printf("%d ",s[i]);

  }
  printf("%d\n",s[n-1]);

  printf("%d\n",count);

  return 0;

}



void mergeSort(int A[],int left,int right){

  int mid,i,j,k;

  if(left>=right) return;

    mid=(left+right)/2;

    mergeSort(A,left,mid);
    mergeSort(A,mid+1,right);

    for(i=left;i<=mid;i++){
      tmp[i]=A[i];}

    for(i=mid+1,j=right;i<=right;i++,j--){
      tmp[i]=A[j];
    }

    i=left;
    j=right;

    for(k=left;k<=right;k++){

      if(tmp[i]<=tmp[j]) A[k]=tmp[i++];
      else A[k]=tmp[j--];  

      count++;
}
}

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

int main() {
  int N;
  cin >> N;
  int a[N];
  for (int i = 0; i < N; i++) cin >> a[i];
  bool colors[8] = {false};
  int target = 0;
  for (int i = 0; i < N; i++) {
    int rate = 0;
    for (int j = 0; j < 8; j++) {
      rate += 400;
      if (a[i] < rate) {
        colors[j] = true;
        break;
      }
    }
    if (a[i] >= rate) target++;
  }
  int ans = 0;
  for (int i = 0; i < 8; i++) {
    if (colors[i]) ans++;
  }
  // 解答
  cout << (ans == 0 ? 1 : ans) << " " << ans + target << endl;
  return 0;
}


Measured memory_bytes: 256
///cREATED bY BERNARB.01
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef tree<int,null_type,less<int>,rb_tree_tag, tree_order_statistics_node_update> indexed_set;
typedef priority_queue<int,vector<int>,greater<int>> pqil;
typedef priority_queue<int> pqig;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef pair<int, pii> piii;
typedef priority_queue<pii> pqiig;
typedef vector<pii> vii;
typedef vector<piii> viii;
typedef vector<vi> vvi;
typedef vector<vii> vvii;
typedef map<int, int> mii;
#define mid ((l+r)/2)
#define PB push_back
#define PP pop_back
#define PF push_front
#define DF pop_front
#define F first
#define S second
#define MP make_pair
#define C continue
#define B break
#define R return
#define sz(v) (int)(v).size()
#define len(s) (int)(s).length()
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define clr(arr, x) memset((arr), (x), sizeof (arr))
#define loop(n) for(int i=0; i<(n); i++)
#define jloop(n) for(int j=0; j<(n); j++)
#define rloop(n) for(ll i=(n)-1; i>=0; i--)
const ll N = 2e5+9;
const ll INF = 2e17+423;
const ll mod = 1e9+7; //998244353;
const ld pi = acos(-1.0);
const ld cmpf = 1e-9;
//__int128_t
#define endl '\n'
ll po(ll,ll);















int main() {
  /*#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  #endif // ONLINE_JUDGE*/
  ios::sync_with_stdio(0);
  cin.tie(0);
  int h, w, n, ans =0;;
  cin >> h >> w >> n;
  if(h > w) swap(h, w);
  while(w*ans<n){
    ans++;
  }
  cout << ans;
  R 0;
}
/*

*/



































ll po(ll x, ll n){
  if(n==0) R 1;
  ll y = po(x, n/2);
  y = ((y)*(y));
  if(n%2) y = (y*(x));
  R y;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        int w=sc.nextInt();
        int n=sc.nextInt();
        int[] a=new int[w];
        for(int i=0;i<a.length;i++){
            a[i]=i+1;
        }
        for(int j=0;j<n;j++){
            String str=sc.next();
            String[] bc=str.split(",");
            int b=Integer.parseInt(bc[0])-1;
            int c=Integer.parseInt(bc[1])-1;
            int x=a[b];
            a[b]=a[c];
            a[c]=x;
        }
        for(int k=0;k<a.length;k++){
            System.out.println(a[k]);
        }
    }
}


Measured memory_bytes: 26028
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
using namespace std;

int n, pos;
vector<int> pre, in, post;

void rec(int l,int r){
	if(l >= r) return;
	int root = pre[pos++];
	int m = distance(in.begin(), find(in.begin(), in.end(), root));
	rec(l,m);
	rec(m + 1, r);
	post.push_back(root);
}

void solve(){
	pos = 0;
	rec(0, pre.size());
	for(int i = 0; i < n; i++){
		if(i)cout << " ";
		cout << post[i];
	}
	
	cout << endl;
}


int main(){
	int k;
	cin >> n;
	
	for(int i = 0; i < n; i++){
		cin >> k;
		pre.push_back(k);
	}
	
	for(int i=0; i<n; i++){
		cin >> k;
		in.push_back(k);
	}
	
	solve();
	
	return 0;
}




	
	


Measured memory_bytes: 3156
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h> 
using namespace std;
using ll=long long;
typedef pair<ll,ll> P;
typedef pair<P,long double> Pi;
typedef pair <long double,int> Pd;
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
const ll inf=(1e18);
const ll mod=1000000007;
//ios_base::sync_with_stdio(false);
//cin.tie(NULL);
ll gcd(ll a,ll b) {return b ? gcd(b,a%b):a;}
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
int main(){
double a,b;
cin>>a>>b;
double x;
cin>>x;
if(x==a*a*b){
    cout<<0<<endl;
    return 0;
}
double tmp;
if (x<=a*a*b/2) tmp=x/a;
else  tmp=(a*a*b-x)/a;
double m;
tmp*=2.0;
if (x>a*a*b/2)b=tmp/a;
m=tmp/(long double)b;
 tmp=atan(b/m);

tmp=tmp/M_PI*180.0;
printf("%.12f\n",tmp);

}


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

int main(){
#ifndef ONLINE_JUDGE
	freopen("C:\\Users\\User\\Documents\\input.txt","r",stdin);
#endif
	int T,i,j,x;

	cin>>x;
	printf("%d\n",!x);
		
		
	return 0;
}

Measured memory_bytes: 3760
#include <bits/stdc++.h>
using namespace std;
 
long GCD(long m, long n);

int main() {
  long A, B, C, D;
  cin >> A >> B >> C >> D;
  long Cmul_num = (B/C) - ((A-1)/C);
  long Dmul_num = (B/D) - ((A-1)/D);

  long LCM = C * D / GCD(C, D);
  long LCM_num = (B/LCM) - ((A-1)/LCM);

  long solution = B - A +1 - Cmul_num - Dmul_num + LCM_num;

  cout << solution << endl;
  return 0;
}

long GCD(long m, long n)
{
  if(m%n == 0) return n;
  else if(n%m == 0) return m;

  else if(m>n) return GCD(n, m%n);
  else return GCD(m, n%m);
}


Measured memory_bytes: 3600
S=list(input())

T=list(reversed(S))
SS=S[:len(S)//2]
TT=list(reversed(S[:len(S)//2]))
SSS=S[len(S[:len(S)//2])+1:]
TTT=list(reversed(S[:len(S)//2]))
#print(SSS)
if S==T and SS==TT and SSS==TTT:
      print('Yes')
else:
      print('No')

Measured memory_bytes: 38384
#include<bits/stdc++.h>
using namespace std;
//#define int long long
#define fo(a,b) for(int a=0;a<b;a++)
#define Sort(a) sort(a.begin(),a.end())
#define rev(a) reverse(a.begin(),a.end())
#define fi first
#define se second
#define co(a) cout<<a<<endl
#define sz size()
#define bgn begin()
#define en end()
#define pb(a) push_back(a)
#define pop pop_back
#define V vector
#define P pair
#define V2(a,b,c) V<V<int>> a(b,V<int>(c))
#define V2a(a,b,c,d) V<V<int>> a(b,V<int>(c,d))
#define incin(a) int a; cin>>a
//#define min min<int>
//#define max max<int>
template<class T>
 void cou(vector<vector<T>> a){
  int b=a.size();
  int c=a[0].size();
  fo(i,b){
    fo(j,c){
      cout<<a[i][j];
      if(j==c-1)
        cout<<endl;
      else
        cout<<' ';
    }
  }
}
/*template<>
 void cou(vector<vector<char>> a){
  int b=a.size();
  int c=a[0].size();
  fo(i,b){
    fo(j,c){
      cout<<a[i][j];
      if(j==c-1)
        cout<<endl;
      else
        cout<<' ';
    }
  }
}*/
 int wari(int a,int b) {
   if(a%b==0)
     return a/b;
   else
     return a/b+1;
 }
 int keta(int a){
  double b=a;
  b=log10(b);
  int c=b;
  return c+1;
 }
 int souwa(int a){
  return a*(a+1)/2;
 }
 int lcm(int a,int b){
  int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return d*e/f;
    }
  int gcm(int a,int b){
      int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return f;
  }
 bool prime(int a){
   if(a<2)
     return false;
   else if(a==2)
     return true;
   else if(a%2==0)
     return false;
   double b=sqrt(a);
    for(int i=3;i<=b;i+=2){
      if(a%i==0){
        return false;
      }
    }
   return true;
 }
struct Union{
  vector<int> par;
  Union(int n){
	par= vector<int>(n, -1);
  }
  int find(int x){
    if(par[x]<0)
      return x;
    else
      return par[x]=find(par[x]);
  }
  bool same(int a,int b){
    return find(a)==find(b);
  }
  int Size(int a){
    return -par[find(a)];
  }
  void unite(int a,int b){
    a=find(a);
    b=find(b);
    if(a==b)
      return;
    if(Size(b)>Size(a))
      swap<int>(a,b);
    par[a]+=par[b];
    par[b]=a;
  }
};
int ketas(int a){
  string b=to_string(a);
  int c=0;
  fo(i,keta(a)){
    c+=b[i]-'0';
  }
  return c;
}
/*struct aa{
	vector<int> gt;
  aa(int n){
	gt= vector<int>(n, 1);
  }
	void c(V<int> d,int b){
	if(d[b]==0){
		gt[d[b]-1]++;
		gt[gt.sz-1]++;
	}
	else{
		gt[d[b]-1]++;
		c(d,d[d[b]]-1);
	}
}
void cok(int a){
	cout<<gt[a-1]<<endl;
	fo(i,a-1)
	cout<<gt[i]<<endl;
}
};
*/
signed main(){
	string a;
	cin>>a;
	if(a[0]==a[1]||a[2]==a[1]||a[2]==a[3])
		cout<<"Bad"<<endl;
	else
		cout<<"Good"<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int k,n,a[1000005];
int num;
int maxh=0;
int i;
int main(){
	cin>>k>>n;
	cin>>a[0];
	for (i=1;i<n;i++){
		cin>>a[i];
		maxh=max(maxh,a[i]-a[i-1]);
	}
	int gg=k-a[i-1]+a[0];
	maxh=max(maxh,gg);
	cout<<k-maxh<<endl;
	return 0;
} 

Measured memory_bytes: 1024
import scala.io.{StdIn => in}

object Main extends App {
  val s = in.readLine
  val t = in.readLine

  def rec(cnt:Int, s1:String, s2:String):Boolean = {
    if(cnt == s1.size) s1 == s2
    else if(s1 == s2) true
    else rec(cnt+1, s1.last+s1.init,s2)
  }

  val ans = if(rec(0,s,t)) "Yes" else "No"
  println(ans)
}

Measured memory_bytes: 25548
#include <iostream>
#include <algorithm>
#include <string>
#include <cmath>
#include <ctype.h>
#include <map>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <cctype>
#include <queue>
#include <set>
#include <list>
#define PI 3.141592653
#define rep(i,a,n) for(int i=a;i<(int)n;++i)
#define SZ(x) ((int)(x).size())	//size() unsigned -> int
#define DescSort(a) sort(a.begin(),a.end(),std::greater<int>())

using namespace std;
typedef long long ll;
const ll INF=1e9+7;

int main(void) {
	string sa, sb, sc;
	cin >> sa >> sb >> sc;
	int idx_sa, idx_sb, idx_sc;
	idx_sa = 1; idx_sb = idx_sc = 0;
	char tar = sa[0], ans;
	while (1) {
		if (tar == 'a') {
			if (idx_sa == sa.size()) { ans = 'A';break;}
			else { tar = sa[idx_sa]; idx_sa++; }
		}
		else if (tar == 'b') { 
			if (idx_sb == sb.size()) { ans = 'B';break; }
			else { tar = sb[idx_sb]; idx_sb++; }
		}
		else if (tar == 'c') { 
			if (idx_sc == sc.size()) { ans = 'C';break; }
			else { tar = sc[idx_sc]; idx_sc++; }
		} 
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] b = new int[n - 1];
        for(int i = 0; i < n - 1; i++) b[i] = scan.nextInt();
        int out = b[0] + b[b.length - 1];
        for(int i = 0; i < n - 2; i++){
            out += Math.min(b[i], b[i + 1]);
        }
        System.out.println(out);
        scan.close();
    }
}

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

long long N, M, Q;

long long ans[15];

long long a[55];
long long b[55];
long long c[55];
long long d[55];

long long maxi;

long long dfs(long long pa, long long dep) {
	if(dep == N) {
		long long tmp = 0;
		for(long long i = 0; i < Q; i++) {
			if(ans[b[i]] - ans[a[i]] == c[i]) {
				tmp += d[i];
			}
		}
		maxi = max(maxi, tmp);
		return 0;
	}

	for(int i = pa; i <= M; i++) {
		ans[dep] = i;
		dfs(i, dep+1);
	}
	return 0;
}


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

	for(long long i = 0; i < Q; i++) {
		cin >> a[i] >> b[i] >> c[i] >> d[i];
		a[i]--;b[i]--;
	}

	dfs(1, 0);
	cout << maxi << endl;
	return 0;
}

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

int main(){
    ll l[100];
    l[0]=2;
    l[1]=1;
    for(int i=2;i<=86;i++){
        l[i]=l[i-1]+l[i-2];
    }
    int n; cin>>n;
    cout<<l[n]<<endl;
}


Measured memory_bytes: 256
n, m, p = map(int,input().split())
A = [list(map(int,input().split())) for i in range(m)]

for i in range(m):
    A[i][2] = - (A[i][2]-p)

#import numpy as np
# A = np.full(np.inf, (n+1, n+1))

# scipy.sparse.csgraph.bellman_ford


S = [[float('inf'), 0, 0] for i in range(n+1)]

S[1][0]=0
S[1][1]=1
S[n][2]=1

for i in range(m):
    if A[i][0] == 1:
        S[A[i][1]][0] = A[i][2]

for j in range(n-1):
    for i in range(m):
        S[A[i][1]][0] = min(S[A[i][1]][0], S[A[i][0]][0] + A[i][2])
        S[A[i][1]][1] = max(S[A[i][1]][1], S[A[i][0]][1])
        S[A[i][0]][2] = max(S[A[i][1]][2], S[A[i][0]][2])

ANS0 = [S[i][0] for i in range(len(S))]

for j in range(1):
    for i in range(m):
        S[A[i][1]][0] = min(S[A[i][1]][0], S[A[i][0]][0] + A[i][2])
        # S[A[i][1]][1] = max(S[A[i][1]][1], S[A[i][0]][1])
        # S[A[i][0]][2] = max(S[A[i][1]][2], S[A[i][0]][2])


#print(ANS0, ANS1)

imp = 0

for i in range(len(S)):
    if S[i][1] == 1 and S[i][2] == 1:
        if ANS0[i] != S[i][0]:
            imp = 1

if imp == 1:
    print(-1)
else:
    print(max(0, -ANS0[n]))

Measured memory_bytes: 67800
#include "iostream"
#include "vector"
#include "array"
#include "string"
#include "algorithm"
#include "functional"

using namespace std;
#define rep(p,q) for(int i = p;i < q;i++)

//A

int main(void) {
	int n = 0;
	cin >> n;
	if (n % 2 == 0) {
		cout << (n / 2) * (n / 2) << endl;
	}
	else {
		int x = (n - 1) / 2;
		cout << x * (x + 1) << endl;
	}
}

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

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

    double number = N;
    rep(i, N) {  // 最大でN回繰り返す
        double numberSqrt = sqrt(number);
        if (floor(numberSqrt) * floor(numberSqrt) == number) break;
        number--;
    }

    cout << std::fixed << std::setprecision(0) << number << endl;

    return 0;
}

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

#define ll long long
#define mod 1000000007
#define pb push_back
#define pi pair<int,int>
#define vi vector<int>
#define vpi vector< pi > 
#define IOS ios_base::sync_with_stdio(false),cin.tie(NULL)
const int N=100002,M=11;
int a[N],h[N];
vi v[N];
int main()
{
	int n,m,x,y;
	cin>>n>>m;
	for(int i=1;i<=n;i++) cin>>h[i];
	while(m--)
	{
		cin>>x>>y;
		if(h[x]<=h[y]) a[x]=1;
		if(h[y]<=h[x]) a[y]=1;
	}
	int r=0;
	for(int i=1;i<=n;i++) r+=(a[i]==0);
cout<<r;
	return 0;
}

Measured memory_bytes: 6708
s=str(input())

l=[0]*len(s)

for i in range(len(s)):
        a=s.find('L',i)
        b=s.rfind('R',0,i)
        if s[i]=='R' and (a-i)%2==0:
                l[a]+=1
        elif s[i]=='R' and (a-i)%2==1:
                l[a-1]+=1
        elif s[i]=='L' and (i-b)%2==0:
                l[b]+=1
        elif s[i]=='L' and (i-b)%2==1:
                l[b+1]+=1
print(' '.join(map(str,l)))
        

Measured memory_bytes: 10612
import sys
a=[True]*500000
for i in range(3,999,2):
 if a[i//2]:a[(i*i)//2::i]=[False]*len(a[(i*i)//2::i])
for e in map(int,sys.stdin):print([e-1,sum(a[:(e+1)//2])][e>3])


Measured memory_bytes: 15016
alpha_dict = {chr(c):i+1 for i,c in enumerate(range(ord('A'),ord('Z')+1))}
#print(alpha_dict)
num2alpha = lambda c: chr(c+64)

N = int(input())
S = input()
for s in S:
    num = (alpha_dict[s] + N)
    if num > 26:
        num -= 26
    print(num2alpha(num),end="")




Measured memory_bytes: 4468
#include<iostream>
#include<iomanip>
#include<math.h>
#include<algorithm>
#include<utility>
#include<queue>
#include<string.h>
#include<string>
#include<set>
#include<map>
#include<unordered_map>
#include<functional>
#include<vector>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
const ll INF=2e18;
const ll MOD=1e9+7;
const ll ARG_MAX=1e6;

ll N;
ll a[ARG_MAX];
ll second1Place[30][ARG_MAX]={};
int main(){
    cin>>N;
    for(ll i=0;i<N;i++){
        cin>>a[i];
    }
    for(ll bit=0;bit<=20;bit++){
        bool nowBit=a[0]&(1<<bit);
        ll start=0;
        ll first1place=0;
        for(ll i=1;i<N;i++){
            if(a[i]&(1<<bit) ){
                if(nowBit){
                    for(ll j=start;j<=first1place;j++){
                        second1Place[bit][j]=i;
                    }
                    start=first1place+1;
                    first1place=i;
                }else{
                    nowBit=true;
                    first1place=i;
                }
            }
        }
    }
    ll ans=0;
    for(ll i=0;i<N;i++){
        ll minPlace=N;
        for(ll bit=0;bit<=20;bit++){
            if(second1Place[bit][i]==0)continue;
            minPlace=min(minPlace,second1Place[bit][i]);
        }
        ans+=(minPlace-i);
        
    }
    cout<<ans<<endl;
    return 0;
}

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

#define endl "\n"
#define int int64_t
#define ll long long

void solve()
{
	int n, m;
	cin >> n >> m;
	vector<string> str;
	for (int i = 0; i < n; i++)
	{
		string s;
		cin >> s;
		str.push_back(s);
	}
	sort(str.begin(), str.end());
	for (int i = 0; i < n; i++)
	{
		cout << str[i];
	}
}

int32_t main()
{

	// int test;
	// cin >> test;
	// while (test--)
	{
		solve();
	}
	return 0;
}

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

using namespace std;

using ll = long long;

bool check(vector<ll> &va, vector<ll> &vf, ll x, ll k) {
  for (int i = 0; k >= 0 && i < va.size(); ++i) {
    k -= max(0ll, va[i] - x / vf[i]);
  }

  return k >= 0;
}

int main(int argc, const char *argv[]) {
  int n;
  ll k;
  cin >> n >> k;

  vector<ll> va(n), vf(n);
  for (int i = 0; i < n; ++i) {
    cin >> va[i];
  }

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

  sort(va.begin(), va.end());
  sort(vf.begin(), vf.end(), greater<ll>());

  ll max_n = va.front() * vf.front();
  for (int i = 1; i < n; ++i) {
    max_n = max(max_n, va[i] * vf[i]);
  }

  ll left = 0, right = max_n;
  while (left < right) {
    ll mid = (left + right) / 2;
    if (check(va, vf, mid, k)) {
      right = mid;
    } else {
      left = mid + 1;
    }
  }

  cout << right << '\n';

  return 0;
}

Measured memory_bytes: 3456
#include<bits/stdc++.h>
#define int long long
#define fi first
#define se second
#define pii pair<int,int>
#define mp make_pair
using namespace std;

const int N=2e5+5;
int n,k,a[N];

int calc(int lim)
{
    int res=0;
    for(int i=1;i<=n;i++)
    {
        res+=a[i]/lim-1;
        if(a[i]%lim) res++;
    }
    return res;
}

void solve()
{
    cin>>n>>k;
    for(int i=1;i<=n;i++) cin>>a[i];
    int l=1,r=1e9,res;
    while(l<=r)
    {
        int mid=(l+r)/2;
        if(calc(mid)>k) l=mid+1;
        else
        {
            res=mid;
            r=mid-1;
        }
    }
    cout<<res;
}

main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    //int t;
    //cin>>t;
    //while(t--)
        solve();
}


Measured memory_bytes: 5212
N,K=list(map(int,input().strip().split(' ')))

Value=list(map(int,input().strip().split(' ')))

MAX=0

def find(a,b,K,N):
    negative=[]
    sum_up=0
    for i in range(a):
        sum_up+=Value[i]
        if Value[i]<0:
            negative+=[Value[i]]
    
    for i in range(1,b+1):
        sum_up+=Value[-i]
        if Value[-i]<0:
            negative+=[Value[-i]]
    negative=sorted(negative)
    sum_up-=sum(negative[:K-a-b])
    return sum_up



for a in range(min(N,K)+1):
    for b in range(min(N,K)+1-a):
        sum_up=find(a,b,K,N)
        MAX=max(MAX,sum_up)

print(MAX)



Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
#define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++)
#define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++)
#define MOD 1000000007
#define int long long
#define ALL(a) (a).begin(),(a).end()
#define vi vector<int>
#define vii vector<vi>
#define pii pair<int,int>
#define priq priority_queue<int>
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(int)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(int)(key)))
#define tii tuple<int,int,int>
signed main(){
  int H,W; cin>>H>>W;
  rep(i,0,H){
    string S; cin>>S;
    cout<<S<<endl;
    cout<<S<<endl;
  }
  }


Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
	"strings"
)

func abs(a int) int {
	if a < 0 {
		return -a
	} else {
		return a
	}
}

func min(a, b int) int {
	if a < b {
		return a
	} else {
		return b
	}
}

func main() {
	r := bufio.NewReader(os.Stdin)
	s, _ := r.ReadString('\n')
	s = strings.TrimRight(s, " \t\n")
	slice := strings.Split(s, " ")
	a1 := string(slice[0])
	a2 := string(slice[1])
	a3 := string(slice[2])
	A1, _ := strconv.Atoi(a1)
	A2, _ := strconv.Atoi(a2)
	A3, _ := strconv.Atoi(a3)

	a1a2a3 := abs(A2-A1) + abs(A3-A2)
	a1a3a2 := abs(A3-A1) + abs(A2-A3)
	a2a1a3 := abs(A1-A2) + abs(A3-A1)
	a2a3a1 := abs(A3-A2) + abs(A1-A3)
	a3a1a2 := abs(A1-A3) + abs(A2-A1)
	a3a2a1 := abs(A2-A3) + abs(A1-A2)

	answer := math.MaxInt64
	answer = min(a1a2a3, a1a3a2)
	answer = min(answer, a2a1a3)
	answer = min(answer, a2a3a1)
	answer = min(answer, a3a1a2)
	answer = min(answer, a3a2a1)

	fmt.Println(answer)
}


Measured memory_bytes: 1772
#include<bits/stdc++.h>
#define int long long
using namespace std;
const int maxn=1005;
int n,m,mx=0;
int x[maxn][3];
main()
{
	cin>>n>>m;
	for(int i=0;i<n;i++)
		for(int j=0;j<3;j++)
			cin>>x[i][j];
	for(int mask=0;mask<8;mask++)
	{
		vector<int> all;
		for(int i=0;i<n;i++)
		{
			int t=mask,val=0;
			for(int j=0;j<3;j++)
			{
				if(t&1)
					val+=x[i][j];
				else
					val-=x[i][j];
				t/=2;
			}
			all.push_back(val);
		}
		sort(all.begin(),all.end());
		reverse(all.begin(),all.end());
		int cur=0;
		for(int i=0;i<m;i++)
			cur+=all[i];
		mx=max(mx,cur);
	}
	cout<<mx<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#define rep(i, n) for(int i = 0; i < (n); i++)
typedef long long ll;
using namespace std;

int main()
{
    int A, B;
    cin >> A >> B;

    if ((A > 9) || (B > 9)) {
        cout << -1 << endl;
        return 0;
    }

    cout << A * B << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <cmath>
#include <deque>
#include <iterator>
#include <map>
#include <queue>
#include <string>
#include <tuple>
#include <utility>
#include <limits>
#include <iomanip>
using namespace std;

using ll=long long;
template<class T> using V = vector<T>;
// template<class T, class U> using P = pair<T, U>;
using vll = V<ll>;
using vvll = V<vll>;
#define rep(i, k, n) for (ll i=k; i<(ll)n; ++i)
#define REP(i, n) rep(i, 0, n)
template<class T> inline bool chmax(T& a, T b) {if (a<b) {a=b; return true;} return false;}
template<class T> inline bool chmin(T& a, T b) {if (a>b) {a=b; return true;} return false;}

const ll MOD = 1000000007;
const ll HIGHINF = 1e18;

class Node {
public:
  ll location;
  ll p, l, r;
  Node() {}
};

class Point {
public:
  ll id, x, y;
  Point() {}
  Point(ll id, ll x, ll y): id(id), x(x), y(y) {}
  bool operator < (const Point &p) const {
    return id < p.id;
  }

  void print() {
    printf("%d\n", id);
  }
};

static const ll MAX = 1000000;
static const ll NIL = -1;

ll n;
Point P[MAX];
Node T[MAX];
ll np;

bool lessX(const Point &p1, const Point &p2) { return p1.x < p2.x; }
bool lessY(const Point &p1, const Point &p2) { return p1.y < p2.y; }

ll makeKDTree(ll l, ll r, ll depth) {
  if (!(l<r)) return NIL;
  ll mid = (l + r) / 2;
  ll t = np++;
  if (depth % 2 == 0) {
    sort(P+l, P+r, lessX);
  } else {
    sort(P+l, P+r, lessY);
  }
  T[t].location = mid;
  T[t].l = makeKDTree(l, mid, depth+1);
  T[t].r = makeKDTree(mid+1, r, depth+1);
  return t;
}

void find(ll v, ll sx, ll tx, ll sy, ll ty, ll depth, V<Point> &ans) {
  ll x = P[T[v].location].x;
  ll y = P[T[v].location].y;

  if (sx <= x && x <= tx && sy <= y && y <= ty) ans.push_back(P[T[v].location]);

  if (depth % 2 == 0) {
    if (T[v].l != NIL) {
      if (sx <= x) find(T[v].l, sx, tx, sy, ty, depth+1, ans);
    }
    if (T[v].r != NIL) {
      if (x <= tx) find(T[v].r, sx, tx, sy, ty, depth+1, ans);
    }
  } else {
    if (T[v].l != NIL) {
      if (sy <= y) find(T[v].l, sx, tx, sy, ty, depth+1, ans);
    }
    if (T[v].r != NIL) {
      if (y <= ty) find(T[v].r, sx, tx, sy, ty, depth+1, ans);
    }
  }
}

int main() {
  ll x, y;
  scanf("%lld", &n);
  REP(i, n) {
    scanf("%lld %lld", &x, &y);
    P[i] = Point(i, x, y);
    T[i].l = T[i].r = T[i].p = NIL;
  }
  np = 0;
  ll root = makeKDTree(0, n, 0);

  ll q;
  scanf("%lld", &q);
  ll sx, tx, sy, ty;
  V<Point> ans;
  REP(i, q) {
    scanf("%lld %lld %lld %lld", &sx, &tx, &sy, &ty);
    ans.clear();
    find(root, sx, tx, sy, ty, 0, ans);
    sort(ans.begin(), ans.end());
    REP(j, ans.size()) ans[j].print();
    printf("\n");
  }
  return 0;
}



Measured memory_bytes: 29784
// Problem : B - Mix Juice
// Contest : AtCoder - AtCoder Beginner Contest 171
// URL : https://atcoder.jp/contests/abc171/tasks/abc171_b
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

//Macros

#define ll long long
#define db long double
#define pb push_back
#define eb emplace_back
#define pii pair<int,int>
#define vi vector<int>
#define vii vector<pii>
#define mi map<int,int>
#define mii map<pii,int>
#define fi first
#define se second
#define all(a) (a).begin(),(a).end()
#define sz(x) (int)x.size()
#define mod 1000000007
#define EPS 1e-9
#define io ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define inf 1e10
#define PI acos(-1.0)
#define int long long
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define N 100005

//Solution

void solve(){
    int n,k;
    cin>>n>>k;
    int a[1002];
    for(int i=0;i<n;i++) cin>>a[i];
    sort(a,a+n);
    int ans = accumulate(a,a+k,0LL);
    cout<<ans<<endl;
}

signed main(){
    io;
    //freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
    int tests;
    //cin>>tests;
    tests = 1;
    while(tests--){
        solve();
    }
    return 0;
}

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

N = int(input())
XL = []
for _ in range(N):
    tmp = [int(x) for x in input().split()]
    XL.append(tmp)
LR = []
for i in XL:
    LR.append([i[0] - i[1], i[0] + i[1]])
LR.sort()
ans = N
last = LR[0][1]
for i in range(1, N):
    if last > LR[i][0]:
        if last > LR[i][1]:
            last = LR[i][1]
        ans -= 1
    else:
        last = LR[i][1]
print(ans)


Measured memory_bytes: 38280
#include<bits/stdc++.h>
using namespace std;
char a[52],b[52];
int main()
{
    cin>>a;
    cin>>b;
    int la=strlen(a),lb=strlen(b);
    int l=min(la,lb),ll=max(la,lb);
    for(int i=0;i<=l-1;i++)
    {
    	cout<<a[i]<<b[i];
	}
    if(la>lb)
    {
    	for(int i=l;i<=ll-1;i++)
        {
        	cout<<a[i];
		}
	}
    else
    {
    	for(int i=l;i<=ll-1;i++)
        {
        	cout<<b[i];
		}
	}
    return 0;
}

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

using namespace std;

int main( void )
{
	int n, k;
	int map[100];
	while(cin >> n >> k, n | k) {
		for(int i=0; i < n; ++i) cin >> map[i];
		int point1 = map[0];
		int nn = n - k + 1;
		for(int i=0; i < nn; ++i) {
			int mul = 1, nnn = i + k;
			for(int j=i; j < nnn; ++j) {
				mul *= map[j];
			}
			point1 = max(point1, mul);
		}
		int point2 = point1;
		for(int i=0; i < nn; ++i) {
			int nnn = i + k, max_num = 0;
			for(int j=0; j < n; ++j) {
				if(i <= j && j < nnn) continue;
				max_num = max(max_num, map[j]);
			}
			int mul = 1, min_num = 16;
			for(int j=i; j < nnn; ++j) {
				mul *= map[j];
				min_num = min(min_num, map[j]);
			}
			point2 = max(point2, mul / min_num * max_num);
		}
		cout << point2 - point1 << endl;
	}

	return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
using namespace std;
int main()
{
  int64_t a,b,x,tmp,r;
  scanf("%ld%ld",&a,&b);
  x=a*b;
  if(a<b){
    tmp=a; a=b; b=tmp;
  }
  r=a%b;
  while(r!=0){
    a=b; b=r; r=a%b;
  }
  printf("%ld",x/b);
  return 0;
}




Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main() {
  string s, t;
  cin >> s >> t;
  if (s[0] == t[2] && s[1] == t[1] && s[2] == t[0]) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}


Measured memory_bytes: 3024
#include <bits/stdc++.h>
#define rep(i, a, n) for (int i = a; i < n; i++)
#define repr(i, a, n) for (int i = n - 1; i >= a; i--)
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <typename T> void chmin(T &a, T b) { a = min(a, b); }
template <typename T> void chmax(T &a, T b) { a = max(a, b); }

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

  vector<int> v(3);
  cin >> v[0] >> v[1] >> v[2];
  sort(v.rbegin(), v.rend());

  int k;
  cin >> k;
  rep(i, 0, k) v[0] *= 2;

  cout << v[0] + v[1] + v[2] << endl;
}


Measured memory_bytes: 256
#include"bits/stdc++.h"
using namespace std;
int main(){

    int a,b,c;
    cin>>a>>b>>c;
    int mx=INT_MIN;
    int mn=INT_MAX;
    mx=max(a,max(b,c));
    mn=min(a,min(b,c));
    cout<<mx-mn;
}


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

#define ll long long int
 
int main() {
    ll t, n, sum = 0;
    unordered_map<ll, ll> mp;
    cin >> n;
    for(int i = 0; i < n - 1; i++) {
        ll x;
        cin >> x;
        mp[x]++;
    }
    for(int i = 1; i <= n; i++) {
        cout << mp[i] << endl;
    }
}

Measured memory_bytes: 11468
// Confessions of a Dangerous Mind

#include <bits/stdc++.h>

using namespace std;
using ll = long long;

const int N = 2e5 + 3;
const int M = 1e6 + 7;
const long long MOD = 1e9 + 7;
const long long INF = 1e18 + 9;
const int SM = 2e3 + 5;
const int logN = 22, BL = 400;
const double EPS = 3e-16;

/*
	Keep moving forward. Take the Leap of Faith
*/

int main(){
//  freopen(".in", "r", stdin);
//  freopen(".out", "w", stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
	
    long long a, b, c; cin >> a >> b >> c;
    
    swap(a, b);
    swap(a, c);
    
    cout << a << " " << b << " " << c;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <utility>
#include <vector>

using namespace std;

int left(int i) { return i * 2; }

int right(int i) { return i * 2 + 1; }

void max_heapify(vector<int>& heap, int index) {
    int left_idx = left(index);
    int right_idx = right(index);

    int max_idx = index;
    if (left_idx < heap.size() && heap[max_idx] < heap[left_idx])
        max_idx = left_idx;
    if (right_idx < heap.size() && heap[max_idx] < heap[right_idx])
        max_idx = right_idx;

    if (max_idx != index) {
        swap(heap[index], heap[max_idx]);
        max_heapify(heap, max_idx);
    }
}

void build_heap(vector<int>& heap) {
    for (int i = (heap.size() - 1) / 2; i > 0; --i)
        max_heapify(heap, i);
}

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

    vector<int> heap(n + 1);
    for (int i = 1; i <= n; ++i)
        cin >> heap[i];

    build_heap(heap);

    for (int i = 1; i <= n; ++i)
        cout << ' ' << heap[i];
    cout << '\n';
}



Measured memory_bytes: 4540
#include <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
#define MOD 1000000007
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3f
#define EPS (1e-10)
using namespace std;
typedef long long ll;
typedef pair<int,int>P;

signed main(){
	int n;
	double t,a;cin>>n>>t>>a;
	double Min=LLONG_MAX;
	int id=-1;
	rep(i,n){
		int h;scanf("%d",&h);
		double d=abs(a-(t-0.006*h));
		if(Min>d){
			Min=d;
			id=i;
		}
	}
	cout<<id+1<<endl;
}

Measured memory_bytes: 256
import java.util.Scanner;

class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		
		while(true) {
			int n = sc.nextInt();
			int x = sc.nextInt();
			int a = 0;
			
			if(n == 0 && x == 0) {
				break;
			}
			
			for(int i1 = 1; i1 < x/3; i1++) {
				for(int i2 = i1+1; i2 < x/2; i2++) {
					if(x-i1-i2 > i2 && x-i1-i2 <= n) {
						a++;
					}
				}
			}
			
			System.out.println(a);
		}
	}
}



Measured memory_bytes: 26256
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main(void)
{
  vector<int> a(5);
  int k;
  
  for(int i=0;i<5;i++){
    cin >> a[i];
  }
  
  cin >> k;
  
  if(a[4]-a[0]<=k){
    cout << "Yay!\n";
  }
  else {
    cout << ":(\n";
  }
  
  return 0;
}


Measured memory_bytes: 256
# ARC059D - アンバランス / Unbalanced (ABC043D)
def main():
    S = input().rstrip()
    N = len(S)
    if N == 2:
        flg = S[0] == S[1]
        print("1 2" if flg else "-1 -1")
        return
    for i in range(N - 2):
        if len({S[i], S[i + 1], S[i + 2]}) == 2:
            print(i + 1, i + 3)
            return
    print(-1, -1)


if __name__ == "__main__":
    main()

Measured memory_bytes: 3188
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>

#include <queue>

#define Min(a,b) ((a)<(b)?(a):(b))
#define Max(a,b) ((a)>(b)?(a):(b))
#define Mabs(a,b) ((a)>(b)?(a)-(b):(b)-(a))
#define Abs(a) (a)>0?(a):(-(a))
template <typename QvQ> inline QvQ Min2(QvQ a,QvQ b){if(a<b) return a;return b;}
template <typename QvQ> inline QvQ Max2(QvQ a,QvQ b){if(a>b) return a;return b;}
template <typename QvQ> inline QvQ Abs2(QvQ a){if(a>0) return a;return -a;}

#define n1kw 10000000
#define inf 0x7f7f7f7f
#define dinf 0x3f3f3f3f
#define llinf 0x7f7f7f7f7f7f7f7f
#define lldinf 0x3f3f3f3f3f3f3f3f

#define ll long long
#define rei register int
#define inv inline void
#define inb inline bool
#define ini inline int

#define bl putchar(' ')
#define ed putchar('\n')
#define test std::cout<<"this:"
#define card system("pause")

#define read2(a,b) read(a),read(b)
#define write2(a,b) write(a),bl,write(b)
#define read3(a,b,c) read(a),read(b),read(c)
#define write3(a,b,c) write(a),bl,write(b),bl,write(c)

//char buf[1<<23],*p1=buf,*p2=buf,obuf[1<<23],*O=obuf;
//#define getchar() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++)

template <typename QvQ>inv read(QvQ &x)
{
	x=0;int f=1;
	char c=getchar();
	for(;c<'0'||c>'9';c=getchar()) if(c=='-') f=-1;
	for(;c>='0'&&c<='9';c=getchar()) x=(x<<1)+(x<<3)+(c^48);
	x=x*f;
}
template <typename QvQ>inv write(QvQ x)
{
	if(x<0) x=-x,putchar('-');
	if(x>9) write(x/10);
	putchar(x%10+48);
}
using namespace std;
#define MAXN 100005
#define MAXM 200005
char a[MAXN];
int ans[MAXN];
int stk[MAXN],top;
int main()
{
	scanf("%s",a+1);
	int len=strlen(a+1);
	if(len==2)
	{
		write(1),bl,write(1);
		return 0;
	}
	for(rei i=1;i<len;++i)
	 if(a[i]=='R'&&a[i+1]=='L') stk[++top]=i;
	for(rei i=1;i<=len;++i)
	{
		if(a[i]=='R')
		{
			int pos=lower_bound(stk+1,stk+top+1,i)-stk;
			pos=stk[pos];
			int step=pos-i;
			if(step&1) ++ans[pos+1];
			else ++ans[pos];
		}
		else
		{
			int pos=lower_bound(stk+1,stk+top+1,i)-stk;
			pos=stk[pos-1]+1;
			int step=i-pos;
			if(step&1) ++ans[pos-1];
			else ++ans[pos];
		}
	}
	for(rei i=1;i<=len;++i) write(ans[i]),bl;
	return 0;
}

Measured memory_bytes: 1152
N=int(input())
List = list(map(int, input().split()))
sumList = [0]*8
mid = 0
for i in range(N):
  if 1<=List[i]<=399:
    sumList[0] += 1
  elif 400<= List[i] <=799:
    sumList[1] += 1
  elif 800 <= List[i] <= 1199:
    sumList[2] += 1
  elif 1200<= List[i] <=1599:
    sumList[3] += 1
  elif 1600<= List[i] <=1999:
    sumList[4] += 1
  elif 2000 <= List[i] <= 2399:
    sumList[5] += 1
  elif 2400 <= List[i] <= 2799:
    sumList[6] += 1
  elif 2800 <= List[i] <= 3199:
    sumList[7] += 1
  elif 3200 <= List[i]:
    mid += 1
res1 = 8 - sumList.count(0)
res2 = res1 + mid
if res1 == 0 and mid > 0:
  res1 = 1
print(res1,res2)

Measured memory_bytes: 9224
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define sqr(a) ((a) * (a))
#define io() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define co() cout.precision(10);
#define F for(li i=0;i<n;i++)
#define fo(i,a,n) for(i=a;i<n;i++)
#define ne cout<<"\n";
#define nec cout<<'\n';continue;
#define all(v) v.begin(),v.end()
#define allr(v) v.rbegin(),v.rend()
#define test int t;cin>>t;while(t--)
//#define oj #ifndef ONLINE_JUDGE freopen("input.txt","r",stdin); freopen("output.txt","w",stdout); #endif
//memset(arr, 0, sizeof arr);
typedef long long li;
typedef long double ld;

const li mod = 1000000007;

int main()
{
    io();
    li n;
    cin>>n;
    if(n)
    cout<<0;
    else
    cout<<1;
}


Measured memory_bytes: 3652
#include<iostream>
#include<algorithm>
#include<utility>

using namespace std;

int main(){

	int x, y;

	for (int i = 0;; i++){
		cin >> x >> y;
		if (x == 0 && y == 0) break;
		if(x > y) swap(x, y);
		cout << x << " " << y << "\n";
	}
}

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

const int Nmax=200010;

int main() {
	int H,W,D;
	cin >> H >> W >> D; //H×W D移動幅
	int A[300][300],Ax[Nmax]={},Ay[Nmax]={}; //(x,y) に書かれている整数
	for(int i=0;i < H;i++){
		for(int j=0;j < W;j++){
			cin >> A[i][j];
			Ax[A[i][j]]=i; //A[i][j]の値が書かれているマスのx座標
			Ay[A[i][j]]=j; //A[i][j]の値が書かれているマスのy座標
		}
	}
	int Q,L[Nmax],R[Nmax]; //L i回目の初期位置 R i回目のgoal Q実技試験数
	cin >> Q;
	int d[Nmax]={};
	for(int i=D+1;i <= H*W;i++)
		d[i]=d[i-D]+abs(Ax[i]-Ax[i-D])+abs(Ay[i]-Ay[i-D]);
	for(int i=0;i < Q;i++){
		cin >> L[i] >> R[i];
		cout << d[R[i]] - d[L[i]] << endl;
	}
	return 0;
}

Measured memory_bytes: 5120
import sys
input = lambda: sys.stdin.readline().rstrip()

def main():
    o = input()
    e = input()
    ans = []
    for i in range(max(len(o), len(e))):
        if i < len(o):
            ans.append(o[i])
        if i < len(e):
            ans.append(e[i])
    print(''.join(ans))

if __name__ == '__main__':
    main()


Measured memory_bytes: 61944
import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String O = sc.next();
		String E = sc.next();
		for (int i = 0; i < O.length(); i++) {
			System.out.print(O.charAt(i));
			if (i < E.length()) {
				System.out.print(E.charAt(i));
			}
		}
	}
}


Measured memory_bytes: 21588