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

const ll mod = 1e9 + 7;

int main() {
  int sx, sy, tx, ty;
  cin >> sx >> sy >> tx >> ty;
  string ans = "D";
  for (int i = 0; i < (tx - sx) + 1; i++) ans += "R";
  for (int i = 0; i < (ty - sy) + 1; i++) ans += "U";
  ans += "LU";
  for (int i = 0; i < (tx - sx) + 1; i++) ans += "L";
  for (int i = 0; i < (ty - sy) + 1; i++) ans += "D";
  ans += "R";
  
  for (int i = 0; i < (ty - sy); i++) ans += "U";
  for (int i = 0; i < (tx - sx); i++) ans += "R";
  for (int i = 0; i < (ty - sy); i++) ans += "D";
  for (int i = 0; i < (tx - sx); i++) ans += "L";
  cout << ans << '\n';
  return 0;
}


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

int64_t sum(int64_t x) {
  int64_t S=0;
  for (int64_t i=0; i<=x; i++) {
    S += pow(26, i);
  }
  return S;
}

int main() {
  int64_t N;
  cin >> N;
  char C;
  int64_t ccc, keta=0;
  for (int i=0; i<11; i++) {
    if (N >= sum(i) && N < sum(i+1)) {
      keta = i+1;
    }
  }
  //cout << keta << endl;
  
  vector<char> name(keta);
  N -= (sum(keta-1));
  
  for (int i=0; i<keta; i++) {
    ccc = N - N / 26 * 26 + 97;
    N = N/26;
    C = (char)ccc;
    name.at(i) = C;
  }
  
  for (int i = keta-1; i>=0; i--) {
    cout << name.at(i);
  }
  cout << endl;
}

Measured memory_bytes: 4092
#include<bits/stdc++.h>
using lint=long long;
int main(){
    std::cin.tie(nullptr);std::ios_base::sync_with_stdio(false);
    std::cout.setf(std::ios_base::fixed);std::cout.precision(15);
    lint a,b,k;std::cin>>a>>b>>k;
    for(lint i=0;i<k;i++){
        if(a&1)a--;
        b+=a/2;
        a/=2;
        std::swap(a,b);
    }
    if(k&1)std::swap(a,b);
    std::cout<<a<<" "<<b<<'\n';
}


Measured memory_bytes: 256
#include <vector>
#include <iostream>
#include <algorithm>
#include <utility>
#include <cstring>
using namespace std;
typedef long long int lli;
typedef pair<int,int> P;
const int INF=100000000;
const long long int INF_=1000000000000000000;
 
int N;
vector<int> T[20];
int Cost[20][20];
int Count[20];
bool Done[20];


/*
void dfs(int v,int cost,int count){
    if(ANS<=cost) return;
    if(count==N-1){
        ANS=cost;
        return;
    }
    for(int i=0; i<T[v].size(); ++i){
        if(Cost[v][T[v][i]]!=INF){
			int tmp=Cost[v][T[v][i]];
            Cost[v][T[v][i]]=Cost[T[v][i]][v]=INF;
            dfs(v,cost,count+1);
            Cost[v][T[v][i]]=Cost[T[v][i]][v]=tmp;
			if(!Done[v][T[v][i]]){
                Done[v][T[v][i]]=true;
                dfs(T[v][i],cost+Cost[v][T[v][i]],count);
                Done[v][T[v][i]]=false;
            }
        }
    }
}
 
int main(){
	cin.tie(0);
    ios::sync_with_stdio(0);
    while(cin >> N&&N!=0){
		ANS=INF;
		for(int i=0; i<N; ++i) T[i].clear();
        memset(Done,0,sizeof(Done));
        memset(Count,0,sizeof(Count));
        fill_n((int*)Cost,20*20,INF);
        for(int i=0; i<N-1; ++i){
            int a,b,t;
            cin >> a >> b >> t;
            --a; --b;
            T[a].push_back(b);
            T[b].push_back(a);
            Cost[a][b]=Cost[b][a]=t;
            ++Count[a];
            ++Count[b];
        }
        for(int i=1; i<N; ++i){
			if(Count[i]<=1){
				for(int j=0; j<T[i].size(); ++j){
					Done[i][T[i][j]]=Done[T[i][j]][i]=true;
				}
			}
		}
        dfs(0,0,0);
        cout << ANS << endl;
    }
    return 0;
}
*/

int dfs(int v){
	int result=0;
	Done[v]=true;
	for(int i=0; i<T[v].size(); ++i){
		if(Count[T[v][i]]>1&&!Done[T[v][i]]&&Cost[v][T[v][i]]!=INF){
			int tmp=Cost[v][T[v][i]];
			Cost[v][T[v][i]]=INF;
			result=max(result,tmp+dfs(T[v][i]));
		}
	}
	return result;
}

int main(){
	cin.tie(0);
    ios::sync_with_stdio(0);
    while(cin >> N&&N){
		for(int i=0; i<N; ++i) T[i].clear();
        memset(Done,0,sizeof(Done));
        memset(Count,0,sizeof(Count));
        fill_n((int*)Cost,20*20,INF);
        int sum=0;
        for(int i=0; i<N-1; ++i){
            int a,b,t;
            cin >> a >> b >> t;
            --a; --b;
            T[a].push_back(b);
            T[b].push_back(a);
            Cost[a][b]=Cost[b][a]=t;
            ++Count[a];
            ++Count[b];
        }
        for(int i=1; i<N; ++i){
			if(Count[i]>1){
				//cout << i << endl;
				for(int j=0; j<T[i].size(); ++j){
					if(Count[T[i][j]]>1||j==0){
						sum+=Cost[i][T[i][j]];
					}
				}
			}
		}
		
		for(int i=0; i<T[0].size(); ++i){
			//cout << Cost[0][T[0][i]] << endl;
			if(Count[T[0][i]]>1) sum+=Cost[0][T[0][i]];
		}
		//cout << sum << endl;
		//cout << dfs(0) << endl;
        cout << sum-dfs(0) << endl;
    }
    return 0;
}

Measured memory_bytes: 1224
#include <bits/stdc++.h>
using namespace std;
#define REP(i, s, n) for (int i = s; i < n; ++i)
#define rep(i, n) REP(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())
#define IINF INT_MAX
#define LLINF LLONG_MAX
#define DEBUG false
// sort(a.begin(), a.end(), std::greater<int>());

/*
std::vector<std::string> split(const std::string &input, char delimiter)
{
    std::istringstream stream(input);

    std::string field;
    std::vector<std::string> result;
    while (std::getline(stream, field, delimiter))
    {
        result.push_back(field);
    }
    return result;
}
*/
/*
int dfs(int foo, int timer)
{
    //foo is node number
    if (finds[foo].first != -1)
        return timer;
    finds[foo].first = ++timer;
    int result = timer;
    if (data[foo].size() != 0)
    {
        rep(i, data[foo].size())
        {
            result = dfs(data[foo][i], result);
        }
    }
    finds[foo].second = ++result;
    return result;
}
*/

int main()
{
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    cout << a + b + c + d << endl;
    return 0;
}


Measured memory_bytes: 3116
#include <iostream>
#include <iomanip>
#include <vector>
#include <utility>
#include <map>
#include <algorithm>
#include <queue>
#include <cmath>
#include <numeric>
#include <set>

using namespace std;
struct aaa{aaa(){cin.tie(nullptr); ios::sync_with_stdio(false); cout<<fixed<<setprecision(20);};}aaa;
template <class T>ostream &operator<<(ostream &o,const vector<T>&v){o<<"{";for(int i=0;i<(int)v.size();i++)o<<(i>0?", ":"")<<v[i];o<<"}";return o;}
#define debug(v) {cerr<<"\033[1;36m[debug]\033[m "<<#v<<" : "<<v<<endl;}

using int64 = long long;

int main() {
    int n;
    cin >> n;
    vector<int> div = {0,0,0,0,0};

    for (int i=0; i<n; i++) {
        int a;
        cin >> a;
        if (a % 4 == 0) div[4]++;
        else if (a % 2 == 0) div[2]++;
        else div[0]++;
    }

    if (div[2] == 0) div[0]--;
    bool ans = (div[2]==n) || (div[4] >= div[0]);
    cout << (ans? "Yes" : "No") << endl;
}

/*
 * 1 4 1
 * 1 4 1
 * 1 4 1 4 2 2
 * 1 4 1 4 1
 */

Measured memory_bytes: 888
#include<iostream>

int main(){
    int N;
    std::cin >> N;
    int sum = 0;
    for(int i = 0; i < N; i++){
        int l, r;
        std::cin >> l >> r;
        sum += r - l + 1;
    }
    std::cout << sum << std::endl;
    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;
import java.util.Arrays;
import java.util.Collections;

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

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

        Integer[] l = new Integer[n];
        for(int i=0; i<n; i++) {
            l[i] = sc.nextInt();
        }
        sc.close();

        Arrays.sort(l, Collections.reverseOrder());

        int out = 0;
        for(int i=0; i<k; i++) {
            out += l[i];
        }

        System.out.println(out);
    }
}


Measured memory_bytes: 21844
#include<iostream>
#include<cstdio>
#include<cmath>
#include<vector>
#include<queue>
#include<map>
#include<algorithm>
#include<set>
#include<complex>
#include<string>
#include<cstring>
using namespace std;
#define rep2(x,from,to) for(int x=(from);(x)<(to);(x)++)
#define rep(x,to) rep2(x,0,to)
#define INF 100000000
#define debug(x) cout<<#x<<": "<<x<<endl

#define all(x) x.begin(),x.end()
typedef pair<int,int> P;
typedef pair<int,P> PP;

string s;
string ss;
string ks;
int t;
int flag;
int ans;
int kans;
char c;
char p[27];
int main()
{
	cin>>s;
	t=s.size();
	rep(i,26)
	{
		p[i]=(char)('a'+i);
	}
	rep(i,t-1)
	{
		if(s[i]!=s[i+1])flag=1;
	}
	if(!flag)
	{
		cout<<0<<endl;
		return 0;
	}
	rep(i,26)
	{
		c=p[i];
		flag=0;
		rep(j,t)
		{
			if(s[j]==c)flag=1;
		}
		if(flag==0)continue;
		kans=1;
		ss=s;
		ks.clear();
		while(1)
		{
			//cout<<ss<<endl;
			rep(j,ss.size()-1)
			{
				if(ss[j]==c||ss[j+1]==c)
				{
					ks+=c;
				}
				else ks+='#';
			}
			flag=1;
			rep(j,ks.size())
			{
				if(ks[j]!=c)flag=0;
			}
			if(flag)
			{
				if(ans==0)ans=kans;
				else ans=min(ans,kans);
				break;
			}
			ss=ks;
			ks.clear();
			kans++;
			//getchar();
		}
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
// Enjoy your stay.

#include <bits/stdc++.h>

#define EPS 1e-9
#define INF 1070000000LL
#define MOD 1000000007LL
#define fir first
#define foreach(it,X) for(auto it=(X).begin();it!=(X).end();it++)
#define ite iterator
#define mp make_pair
#define mt make_tuple
#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(int i=m;i<(n);i++)
#define pb push_back
#define sec second
#define sz(x) ((int)(x).size())

using namespace std;

typedef istringstream iss;
typedef long long ll;
typedef pair<ll,ll> pi;
typedef stringstream sst;
typedef vector<ll> vi;

int n,w;

int main(){
	cin.tie(0);
	ios_base::sync_with_stdio(0);
	
	while(cin>>n>>w && n){
		int c[11]={};
		rep(i,n){
			int v;
			cin>>v;
			c[v/w]++;
		}
		int H=0,W=-1;
		rep(i,11){
			H = max(H, c[i]);
			if(c[i] > 0) W = i;
		}
		double ans = 0.01;
		rep(i,11){
			ans += 1.*(W-i)/W*c[i]/H;
		}
		cout<<fixed<<setprecision(16)<<ans<<endl;
	}
}

Measured memory_bytes: 1264
#include<stdio.h>
int main(void)
{
  char str[3];
  scanf("%s",str);
  int i,cnta=0,cntb=0,cntc=0;
  for(i=0; i<3; i++)
  {
    if(str[i]=='a') cnta=1;
    else if (str[i]=='b') cntb=1;
    else cntc=1;
  }
  if(cnta==1 && cntb==1 && cntc==1) printf("Yes");
  else printf("No");
  return 0;
}

Measured memory_bytes: 128
package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func scanInt() int {
	sc.Scan()
	iv, _ := strconv.Atoi(sc.Text())
	return iv
}

func init() {
	sc.Split(bufio.ScanWords)
}

func max(x, y int) int {
	if x > y {
		return x
	}
	return y
}

func main() {
	n := scanInt()
	a := make([]int, n)
	for i := range a {
		a[i] = scanInt()
	}
	sort.Ints(a)

	m := (n + 1) / 2
	x := a[m]
	if n%2 == 0 {
		x -= a[m-1]
	} else {
		x += a[m-1]
	}
	for i := 0; i < m-1; i++ {
		x -= a[i] * 2
	}
	for i := m + 1; i < n; i++ {
		x += a[i] * 2
	}
	if n%2 == 0 {
		fmt.Println(x)
		return
	}

	m = (n - 1) / 2
	y := -a[m]
	if n%2 == 0 {
		y += a[m-1]
	} else {
		y -= a[m-1]
	}
	for i := 0; i < m-1; i++ {
		y -= a[i] * 2
	}
	for i := m + 1; i < n; i++ {
		y += a[i] * 2
	}
	fmt.Println(max(x, y))
}


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

using namespace std;
using ll = long long;
#define MOD 1000000007

#define MAX 10000
long long fac[MAX], finv[MAX], inv[MAX];

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

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

int main() {
  ll N, K;
  cin >> N >> K;
  COMinit();
  for (ll i = 1; i <= K; ++i)
    cout << COM(N - K + 1, i) * COM(K - 1, i - 1) % MOD << endl;
  return 0;
}

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

#define fi first
#define se second
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define INF  (1<<30)
#define INFL (1LL<<60)
#define MOD 1000000007
#define EPS ((ld)(1e-9))

#define sz(x) ((int)(x).size())
#define setz(x) memset(x, 0, sizeof(x))
#define all(x) (x).begin(), (x).end()
#define rep(i, x)  for (int i = 0, _##i = (x); i < _##i; i++)
#define repp(i, s, e) for (int i = (s), _##i = (e); i < _##i; i++)
#define repr(i, s, e) for (int i = (s)-1, _##i = (e); i >= _##i; i--)
#define repi(i, x) for (auto &i : (x))


using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ld, ld> pdd;
typedef pair<ll, ll> pll;

template<typename T, typename V>
ostream &operator<<(ostream &os, const pair<T, V> pai) { 
    return os << '(' << pai.first << ' ' << pai.second << ')';
}

template<typename T>
ostream &operator<<(ostream &os, const vector<T> v) {
    cout << '[';
    rep(i, sz(v)) cout << v[i] << ",";
    cout << "]";
    return os;
}

template<typename T>
ostream &operator<<(ostream &os, const set<T> v) {
    cout << "{";
    for (auto p : v) cout << p << ",";
    cout << "}";
    return os;
}

template<typename T, typename V>
ostream &operator<<(ostream &os, const map<T, V> v) {
    cout << "{";
    for (auto p : v) cout << p << ",";
    cout << "}";
    return os;
}

#ifndef __SOULTCH
#define debug(...) 0
#define endl '\n'
#else
#define debug(...) cout << " [-] ", _dbg(#__VA_ARGS__, __VA_ARGS__)
template<class TH> void _dbg(const char *sdbg, TH h){ cout << sdbg << '=' << h << endl; }
template<class TH, class... TA> void _dbg(const char *sdbg, TH h, TA... a) {
    while(*sdbg != ',') cout << *sdbg++;
    cout << '=' << (h) << ','; 
    _dbg(sdbg+1, a...);
}
#endif

template<typename T> void get_max(T &a, T b) {a = max(a, b);}
template<typename T> void get_min(T &a, T b) {a = min(a, b);}


int main(void) {
    iostream::sync_with_stdio(false);
    cin.tie(nullptr), cout.tie(nullptr);

    int W, H, x, y; cin >> W >> H >> x >> y;
    cout << fixed << setprecision(15) << (ld)W*H*0.5 << ' ';
    cout << (x*2==W&&y*2==H?1:0) << endl;
}


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

inline int read()
{
	char c=getchar();
	int x=0,f=1;
	while (c<'0'||c>'9') {if (c=='-') f=-1;c=getchar();}
	while (c>='0'&&c<='9') {x=(x<<3)+(x<<1)+c-'0';c=getchar();}
	return x*f;
}

int a[3];

int main()
{
	a[0]=read(),a[1]=read(),a[2]=read();
	sort(a,a+3);
	printf("%d\n",a[2]-a[0]);
	return 0;
}

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

int main(){
    ll n, k, q;
    cin>>n>>k>>q;
    ll a[q];
    for(ll i=0; i<q; i++){
        cin>>a[i];
    }
    ll p[n];
    for(ll i=0; i<n; i++) p[i] = k;

    for(ll i=0; i<q; i++){
        p[a[i]-1]+=1;
    }
    for(ll i=0; i<n; i++){
        if(p[i]-q>0){
           cout<<"Yes"<<endl;
        }
        else{
            cout<<"No"<<endl;
        }
    }


return 0;
}


Measured memory_bytes: 2176
#include<vector>
#include<cmath>
#include<map>
#include<cstdlib>
#include<iostream>
#include<sstream>
#include<fstream>
#include<string>
#include<algorithm>
#include<cstring>
#include<cstdio>
#include<set>
#include<stack>
#include<bitset>
#include<functional>
#include<ctime>
#include<queue>
#include<deque>
#include<complex>
#include<cassert>
using namespace std;
#define pb push_back
#define pf push_front
typedef long long lint;
typedef complex<double> P;
#define mp make_pair
#define fi first
#define se second
typedef pair<int,int> pint;
#define All(s) s.begin(),s.end()
#define rAll(s) s.rbegin(),s.rend()
#define REP(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
//問題文および制約はちゃんと確認しよう！
//サイズは10^5じゃなくて2×10^5とかかもしれないし、重要な制約・条件を見落としているかも
//とりあえずサンプルを読んでから解法を考えよう？
int main()
{
	char c;cin>>c;c++;
	cout<<c<<endl;
}


Measured memory_bytes: 256
#include<stdio.h>

int main()
{
  int count =0;
  int n;
  int d[51];
  int hp[1226];
  scanf("%d",&n);
  for(int i=0;i<n;i++)
    {
      scanf("%d",&d[i]);
    }
  int a=0;//インデックス用
  int b=1;//n-bでどんどん回数を減らしていく
  int c=0;//基準用
  int e=0;//
  int e2=0;
  int k =(n*(n-1))/2;
  while(n>0){
    //printf("n-b:%d\n",n-b);
    for(int i=0;i<n-b;i++){
      hp[a]= d[c]*d[e+1];
      // printf("hp:%d\n",hp[a]);
      a++;
      e++;
    }
    //   printf("e:%d\n",e);
    // b++;
    c++;
    e2++;
    e=e2;
    // printf("e :%d\n",e);
    n-=1;
  }
  int sum=0;
  for(int i= 0;i<k;i++)
    {
      sum+=hp[i];
      //   printf("%d:%d\n",i,hp[i]);
    }
  

  printf("%d\n",sum);
  return 0;
}


Measured memory_bytes: 128
import java.util.*;

public class Main {
	
	private void doit(){
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()){
			int h = sc.nextInt();
			int w = sc.nextInt();
			int n = sc.nextInt();
			int [] data = new int[n];
			for(int i = 0; i < n; i++){
				data[i] = sc.nextInt();
			}
			
			int [][] ans = new int[h][w];
			int ind = 0;
			for(int i = 0; i < n; i++){
				for(int j = 0; j < data[i]; j++){
					ans[ind / w][ind % w] = i+1;
					ind++;
				}
			}
			for(int i = 1; i < h; i+=2){
				for(int j = 0; j < w/2; j++){
					int temp = ans[i][j];
					ans[i][j] = ans[i][w-1-j];
					ans[i][w-1-j] = temp;
				}
			}
			
			
			for(int i = 0; i < h; i++){
				for(int j = 0; j < w-1;j++){
					System.out.print(ans[i][j] + " ");
				}
				System.out.println(ans[i][w-1]);
			}
		}
	}


	private void debug(Object... o) {
		System.out.println("debug = " + Arrays.deepToString(o));
	}

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

}


Measured memory_bytes: 33464
#include<stdio.h>
#include<string.h>
 
int main(void){
    int i, j, k;
    char map[8][9];
    char cmap[8][9];
 
    for (i = 0; i < 8; ++i){
        scanf("%s", map[i]);
    }

    for (i = 1; i < 4; ++i){
        memcpy(cmap, map, sizeof(map));
 
        for (j = 0; j < 8; ++j){
            for (k = 0; k < 8; ++k){
                map[j][k] = cmap[7 - k][j];
            }
        }
 
        printf("%d\n", i * 90);
 
        for (j = 0; j < 8; ++j){
            printf("%s\n", map[j]);
        }
    }
 
    return 0;
}

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

const long long INF = 1LL<<61;
long long N, K;
vector<long long> A;

long long solve() {
    sort(A.begin(), A.end());
    long long left = -INF, right = INF;
    while (right - left > 1) {
        long long x = (left + right) / 2;
        long long S = 0, T = 0;
        for (int i = 0; i < N; ++i) {
            if (A[i] > 0) {
                int l2 = -1, r2 = N;
                while (r2 - l2 > 1) {
                    int m = (l2 + r2) / 2;
                    if (A[i] * A[m] <= x) l2 = m;
                    else r2 = m;
                }
                S += r2;
            }
            else if (A[i] < 0) {
                int l2 = -1, r2 = N;
                while (r2 - l2 > 1) {
                    int m = (l2 + r2) / 2;
                    if (A[i] * A[m] <= x) r2 = m;
                    else l2 = m;
                }
                S += N - r2;
            }
            else if (x >= 0) S += N;
            if (A[i] * A[i] <= x) ++T;
        }
        long long num = (S - T) / 2;
        if (num >= K) right = x;
        else left = x;
    }
    return right;
}

int main() {
    cin >> N >> K;
    A.resize(N);
    for (int i = 0; i < N; ++i) cin >> A[i];
    cout << solve() << endl;
}

Measured memory_bytes: 4780
N=int(input())
A,B=[],[]
W=[]
for i in range(N):
    a,b=map(int,input().split())
    A.append(a)
    B.append(b)
    W.append((a,b))

W=sorted(W,key=lambda x:x[1])
#print(W)
#print('==================')
total = 0
can = True
for (need, limit) in W:
#    print(str(total)+' '+str(need)+' '+str(limit))
    total += need
    if total > limit:
        can = False
        break
if can:
    print('Yes')
else:
    print('No')


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

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

#define FOR(k,m,n) for(ll (k)=(m);(k)<(n);(k)++)
#define REP(i,n) FOR((i),0,(n))
#define WAITING(str) int str;std::cin>>str;
#define DEBUGING(str) cout<< #str << " " str<<endl

constexpr int INF = (1 << 28);
constexpr ll INFL = (1ll << 60);
constexpr ll MOD = 1000000007;// 10^9+7



int main()
{
	int N,A,B;
	cin>>N>>A>>B;
	if(A*N<B){
		cout<<A*N<<endl;
	}else{
		cout<<B<<endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define pii pair <int, int>
#define fi first
#define sc second
#define ALL(x) x.begin(), x.end()
#define RALL(X) x.begin(), x.end()
#define FOR(i, n, k) for(i=0; i<n; i+=k)
#define FO(i, n, k) for(i=1; i<=n; i+=k)
#define CLEAR(a, b) memset(a, b, sizeof(a))
#define N 100005
#define mid ((l+r)/2)
#define dbg(x) (cerr << #x << " : " << x << endl)
#define endl "\n"
#define MOD 100000009

using namespace std;

typedef long long int lli;

int main(){
	ios_base::sync_with_stdio(false);
	string s;
	cin >> s;
	int res = 0;
	int ctr = 0;
	for(int i=0; i<s.size(); i++){
		if(s[i] == 'A' or s[i] == 'C' or s[i] == 'G' or s[i] == 'T'){
			ctr++;
			res = max(res, ctr);
		}else{
			ctr = 0;
		}
	}	
	cout << res;
	
	return 0;
}

Measured memory_bytes: 256
let () = Scanf.scanf "%d\n" @@ fun n ->
  Array.init n (fun _ ->
    Scanf.scanf "%d %d %d\n" @@ fun t x y -> t, x, y)
  |> Array.fold_left (fun (acc, txy') txy -> ((txy', txy) :: acc, txy)) ([], (0, 0, 0))
  |> fst
  |> List.for_all (fun ((t, x, y), (t', x', y')) ->
      let d = abs (x - x') + abs (y - y') in
      let dt = t' - t in
      d <= dt && (d - dt) mod 2 = 0)
  |> (function true -> "Yes" | false -> "No")
  |> print_endline

Measured memory_bytes: 11008
#include<stdio.h>

int main(void){
        int x = 0;
    
        scanf("%d",&x);
    

            if(1 <= x && x <= 100){
                x=x*x*x;
            }else{
                printf("整数xは1 ? x ? 100です。もう一度入力して下さい\n");
            }
            
            printf("%d",x);
    printf("\n");
    return 0;
}

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

#define REP(i, x) REPI(i, 0, x)
#define REPI(i, a, b) for (int i = int(a); i < int(b); ++i)
#define ALL(x) (x).begin(), (x).end()

typedef long long ll;
using namespace std;

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

  int A, B, C, K;
  cin >> A >> B >> C >> K;

  int max_v = max(max(A, B), C);
  int sum1 = A + B + C - max_v;
  int sum2 = max_v * pow(2, K);

  cout << sum1 + sum2 << endl;

  return 0;
}


Measured memory_bytes: 256
n = int(input())         
import numpy as np

open = np.array([list(map(int,input().split())) for i in range(n)])
p  = np.array([list(map(int,input().split())) for i in range(n)])

max_p = -999999999999
                     
for j in range(1,2**10):  
  store = [0,0,0,0,0,0,0,0,0,0] 
  flag = True          
  for k in range(10):  
    if j %2 ==1 : 
      store[k] = 1 
    j = int(j/2)                           
#store = np.array([1,0,1,0,0,0,0,0,0,0]) 
  days = [sum(i) for i in store * open] 
  score = 0                            
  for i in range(n):                   
          score += p[i][days[i]]
  if score > max_p: 
    max_p = score            
print(max_p)

Measured memory_bytes: 14260
import sys
input = sys.stdin.readline
n = int(input())
info = [0] * n
for i in range(n):
    x, l = map(int, input().split())
    info[i] = [x+l, x, l]

info.sort()
ans = 1
right = info[0][1] + info[0][2]
for i in range(1, n):
    if right <= info[i][1] - info[i][2]:
        ans += 1
        right = info[i][1] + info[i][2]
print(ans)

Measured memory_bytes: 23272
import java.util.Scanner;

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

			String op = "";
			while( !(op.equals("?")) ){

				int a = sc.nextInt();
				op = sc.next();
				int b = sc.nextInt();
				if( op.equals("+")){
					System.out.println((a + b));
				}
				if( op.equals("-")){
					System.out.println((a - b));
				}
				if( op.equals("*")){
					System.out.println((a * b));
				}
				if( op.equals("/")){
					System.out.println((a / b));
				}

			}
	}

}




Measured memory_bytes: 26252
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define drep(i,n) for(int i = (n-1); i >= 0; i--)
#define all(v) (v).begin(),(v).end()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
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 (b < a) { a = b; return 1; } return 0; }
template <class T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }
template <class T> T lcm(T a, T b) { return a/gcd(a,b)*b; }
typedef pair<int, int> P;
typedef long long ll;
const int INF = 1001001001;
const ll LINF = 1001002003004005006ll;
const ll MOD = 1e9+7;

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
	int n, x, t;
	cin >> n >> x >> t;
    int ans = (n+x-1)/x * t;
	cout << ans << "\n";
	return 0;
}


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

int main() {
  size_t n;
  std::cin >> n;
  std::vector<std::pair<int, int>> task;
  for (size_t i = 0; i < n; ++i) {
    int64_t a, b;
    std::cin >> a >> b;
    task.push_back(std::make_pair(b, a));
  }

  std::sort(task.begin(), task.end());
  int now = INT32_MAX;
  for (auto itr = task.rbegin(), end = task.rend(); itr != end; ++itr) {
    if (itr->first < now) {
      now = itr->first;
    }

    now -= itr->second;
  }

  std::string result = "Yes";
  if (now < 0) {
    result = "No";
  }

  std::cout << result << std::endl;
  return 0;
}


Measured memory_bytes: 2420
#include<iostream>

using namespace std;

void BubbleSort(int N, int L[]){
    bool flag = 1;
    for(int i = 0; flag; i ++){
        flag = 0;

        for(int j = N - 1; j > i; j --){
            if(L[j] > L[j - 1])swap(L[j], L[j - 1]);
            flag = 1;
        }
    }
}

int main(){
    int N, L[103], sum = 0;

    cin >> N;
    for(int i = 0; i < N; i ++)cin >> L[i];

    BubbleSort(N, L);

    for(int i = 1; i < N; i ++)sum += L[i];

    if(sum > L[0]){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }

    return 0;
}

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

#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

#define M 998244353

#define ll long long
#define ld long double
#define vi vector<ll>
#define pi pair<ll, ll>
#define vii vector<pi>
#define vvi vector<vi>
#define pb push_back

#define REP(i, s, e) for (ll i = s; i < e; i++)
#define RREP(i, s, e) for (ll i = s; i > e; i--)

#define all(v) v.begin(), v.end()
#define part(v, s, e) v.begin() + s, v.begin() + e
#define print(v) for (auto i: v) cout << i << " ";

int main() {
    fast;
    string s;
    cin >> s;
    string a(s.begin(), s.begin() + 2), b(s.begin()+2, s.end());
    ll x = stoll(a), y = stoll(b);
    if (x <= 12 && x > 0 && y <= 12 && y > 0)
        cout << "AMBIGUOUS\n";
    else if (x <= 12 && x > 0)
        cout << "MMYY\n";
    else if (y <= 12 && y > 0)
        cout << "YYMM\n";
    else
        cout << "NA\n";
    return 0;
}


Measured memory_bytes: 256
#include <vector>
#include <list>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <utility>
#include <functional>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <cassert>
using namespace std;
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();}
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define EACH(t,i,c) for(t::iterator i=(c).begin(); i!=(c).end(); ++i)
const double EPS = 1e-10;
const double PI  = acos(-1.0);

int search(int y,int x,int w,int h,vvi &v){
	int dx[] = {-1,0,1,1,1,0,-1,-1};
	int dy[] = {-1,-1,-1,0,1,1,1,0};
	if(v[y][x] == 1){
		v[y][x] = 0;
		for(int i=0;i<8;i++){
			if(y+dy[i] >= 0 && y+dy[i] < h && x+dx[i] >= 0 && x+dx[i] < w){
				search(y+dy[i],x+dx[i],w,h,v);
			}
		}
		return 1;
	}
	return 0;
}

int main(){
	int w,h;
	while(1){
		cin >> w >> h;
		if(w == 0 && h == 0){
			break;
		}
		vector<vector<int> > v(h,vector<int>(w));
		for(int i=0;i<h;i++){
			for(int j=0;j<w;j++){
				cin >> v[i][j];
			}
		}
		int cnt = 0;
		for(int i=0;i<h;i++){
			for(int j=0;j<w;j++){
				cnt += search(i,j,w,h,v);
			}
		}
		cout << cnt << endl;
	}
}

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

using namespace std;

const int N = 1e5 + 5;
int color[N];
vector<int> G[N];

void dfs(int u, int c) {
    color[u] = c;
    for (int i = 0; i < G[u].size(); i++) {
        int v = G[u][i];
        if (color[v] == -1) dfs(v, c);
    }
}

int main() {
    int n, m;
    cin >> n >> m;
    for (int i = 0; i < m; i++) {
        int s, t;
        cin >> s >> t;
        G[s].push_back(t);
        G[t].push_back(s);
    }

    memset(color, -1, sizeof(color));
    int c = 0;
    for (int u = 0; u < n; u++) {
        if (color[u] == -1) {
            dfs(u, c);
            c++;
        }
    }

    int q;
    cin >> q;
    for (int i = 0; i < q; i++) {
        int s, t;
        cin >> s >> t;
        if (color[s] == color[t]) cout << "yes" << endl;
        else cout << "no" << endl;
    }
    return 0;
}


Measured memory_bytes: 12120
#include <cstdio>
#include <cstring>
#include <algorithm>
#define ll long long
#define inf 1<<30
#define il inline 
#define in1(a) read(a)
#define in2(a,b) in1(a),in1(b)
#define in3(a,b,c) in2(a,b),in1(c)
#define in4(a,b,c,d) in2(a,b),in2(c,d)
il int max(int x,int y){return x>y?x:y;}
il int min(int x,int y){return x<y?x:y;}
il int abs(int x){return x>0?x:-x;}
il void swap(int &x,int &y){int t=x;x=y;y=t;}
il void readl(ll &x){
    x=0;ll f=1;char c=getchar();
    while(c<'0'||c>'9'){if(c=='-')f=-f;c=getchar();}
    while(c>='0'&&c<='9'){x=x*10+c-'0';c=getchar();}
    x*=f;
}
il void read(int &x){
    x=0;int f=1;char c=getchar();
    while(c<'0'||c>'9'){if(c=='-')f=-f;c=getchar();}
    while(c>='0'&&c<='9'){x=x*10+c-'0';c=getchar();}
    x*=f;
}
using namespace std;
/*===================Header Template=====================*/
#define N 100010
int a[4];
int main(){
	in3(a[1],a[2],a[3]);
	sort(a+1,a+4);
	int ans=0;
	for(int i=2;i<=3;i++)ans+=a[i]-a[i-1];
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <cmath>
#include <iomanip>

#include <vector>
#include <array>
#include <map>
#include <set>
#include <stack>
#include <queue>

#define int64 long long
using namespace std;

int main()
{
	int64 h1, m1, h2, m2, kk;
	cin >> h1 >> m1 >> h2 >> m2 >> kk;
	int64 hh, mm;
	hh = h2 - h1;
	mm = m2 - m1;
	int64 time;
	time = 60 * hh + mm;
	time -= kk;
	cout << time << endl;
	return 0;
}

Measured memory_bytes: 3636
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LINF = 1e18;
inline ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
inline ll lcm(ll a, ll b) { return a / gcd(a, b)*b; }
template<class S,class T> ostream& operator << (ostream& out,const pair<S,T>& o){ out << "(" << o.first << "," << o.second << ")"; return out; }
template<class T> ostream& operator << (ostream& out,const vector<T>& V){ for(int i = 0; i < V.size(); i++){ out << V[i]; if(i!=V.size()-1) out << " ";} return out; }
template<class T> ostream& operator << (ostream& out,const vector<vector<T> >& Mat){ for(int i = 0; i < Mat.size(); i++) { if(i != 0) out << endl; out << Mat[i];} return out; }
template<class S,class T> ostream& operator << (ostream& out,const map<S,T>& mp){ out << "{ "; for(auto it = mp.begin(); it != mp.end(); it++){ out << it->first << ":" << it->second; if(mp.size()-1 != distance(mp.begin(),it)) out << ", "; } out << " }"; return out; }
template<typename T>vector<T> make_v(size_t a){return vector<T>(a);}
template<typename T,typename... Ts>auto make_v(size_t a,Ts... ts){return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));}
template<typename T,typename V> typename enable_if<is_class<T>::value==0>::type fill_v(T &t,const V &v){t=v;}
template<typename T,typename V> typename enable_if<is_class<T>::value!=0>::type fill_v(T &t,const V &v){for(auto &e:t) fill_v(e,v);}
/*
 <url:https://atcoder.jp/contests/abc155/tasks/abc155_c>
 問題文============================================================
 C - Poll
 =================================================================
 解説=============================================================
 ================================================================
 */

template<class Type>
Type solve(Type res = Type()){
    ll N; cin >> N;
    map<string,int> mp;
    int max_cnt = 0;
    for(int i = 0; i < N;i++){
        string S; cin >> S;
        mp[S]++;
        max_cnt = max(max_cnt,mp[S]);
    }
    
    vector<string> s;
    for(auto p:mp){
        if(p.second != max_cnt) continue;
        s.emplace_back(p.first);
    }
    sort(s.begin(),s.end());
    for(auto ss:s){
        cout << ss << endl;
    }
    
    return res;
}
int main(void) {
    cin.tie(0); ios_base::sync_with_stdio(false);
    solve(0);
    // cout << fixed << setprecision(15) << solve<ll>() << endl;
    return 0;
}


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

int main() {
  
  int a, n;
  cin >> n;
  
  a = n /  1.08;
  
  if(a * 1.08 >= n && a * 1.08 < n + 1){
    cout << a << endl;
  }
  
  else if((a + 1) *1.08 >= n && 
          (a + 1) * 1.08 < n + 1){
    cout << a + 1 << endl;
  }
  
  else{
    cout << ":(" << endl;
  }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include <boost/rational.hpp>
#include <boost/multiprecision/cpp_int.hpp>
#define ll long long
#define ALL(v) (v).begin(),(v).end()
#define REP(i,p,n) for(int i=p;i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define dump(a) (cerr << #a << "=" << (a) << endl)
#define DUMP(list) cout << "{ "; for(auto nth : list){ cout << nth << " "; } cout << "}" << endl;
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; }

using namespace std;

int main(){
    ll N, K;
    cin >> N >> K;
    ll ans = 0;
    if (N == 0) {
        cout << 1 << endl;
        return 0;
    }
    while(N > 0) {
        N /= K;
        ans++;
    }
    cout << ans << endl;
}

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


typedef long long       ll;
struct edge { ll to; ll cost; };
typedef vector<int>     vi;
typedef vector<ll>      vll;
typedef vector<double>  vd;
typedef vector<bool>    vb;
typedef vector<string>  vs;
typedef vector<char>    vc;
typedef vector<edge>    ve;
typedef pair<int, int>  pii;
typedef pair<ll, ll>    pll;
typedef vector<pii>     vpii;
typedef vector<pll>     vpll;
typedef vector<ve>      vve;

// マクロ
#define repr(itr, bgn, end) for (ll itr = (ll)bgn; itr < (ll)end; ++itr)
#define rep(itr, end) repr(itr, 0, end)
#define reprrev(itr, bgn, end) for (ll itr = (ll)end - 1; itr >= (ll)bgn; --i)
#define reprev(itr, end) reprrev(itr, 0, end)
#define all(container) container.begin(), container.end()
#define sortall(container) sort(all(container))
#define yn(cond) cond ? (cout << "Yes" << endl) : (cout << "No" << endl)
#define YN(cond) cond ? (cout << "YES" << endl) : (cout << "NO" << endl)

// 定数
#define LLONG_MAX 9223372036854775807
constexpr double PI = 3.14159265358979323846;
constexpr ll INF = 1 << 15;
constexpr ll MOD = (ll)1e9 + 7;
constexpr double EPS = 1e-7;

// よく使うもの
constexpr int dy[4] = { 0, 1, 0, -1 };
constexpr int dx[4] = { 1, 0, -1, 0 };


// vector入力
template<typename T>
istream& operator >> (istream& is, vector<T>& vec) {
	for (T& x : vec) is >> x;
	return is;
}

// vector出力
template<typename T>
ostream& operator << (ostream& os, vector<T>& vec) {
	for (T& x : vec) os << x << " ";
	return os;
}

// ***<ここから>****************************************************************

int main(void) {

	int K;
	vi A(3);
	cin >> A[0] >> A[1] >> A[2] >> K;
	sortall(A);

	int ans = A[0] + A[1] + A[2] * pow(2, K);

	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 256
#!/usr/bin/env python3
import sys
INF = float("inf")


def solve(n: int, a: "List[int]"):

    # 正スタート
    tot = 0
    countA = 0
    for i, x in enumerate(a):
        tot += x
        if i % 2 == 0:
            if tot <= 0:
                countA += -tot+1
                tot = 1
        else:
            if tot >= 0:
                countA += tot+1
                tot = -1

    tot = 0
    countB = 0
    for i, x in enumerate(a):
        tot += x
        if i % 2 == 1:
            if tot <= 0:
                countB += -tot+1
                tot = 1
        else:
            if tot >= 0:
                countB += tot+1
                tot = -1
    print(min(countA, countB))

    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    n = int(next(tokens))  # type: int
    a = [int(next(tokens)) for _ in range(n)]  # type: "List[int]"
    solve(n, a)


if __name__ == '__main__':
    main()


Measured memory_bytes: 15580
from collections import Counter

N = int(input())
A = [list(map(int, input().split())) for _ in range(N)]

pq = []

for x, y in A:
    for i, j in A:
        if x == i and y == j:
            continue
        pq.append(str(i-x)+str(j-y))

ans = Counter(pq).most_common()

if ans == []:
    print(1)
else:
    print(N - ans[0][1])

Measured memory_bytes: 3828
#include<bits/stdc++.h>
    using namespace std;
    int main()
    {
      int n;
      cin >> n;
      if(n%2==1)
      {
        cout << "No\n";
        exit(0);
      }
      string a;
      cin >> a;
      for(int i=0;i<n/2;i++)
      {
        if(a[i]!=a[n/2+i])
        {
          cout << "No\n";
          exit(0);
        }
      }
      cout << "Yes\n";
    }

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <sstream>
#include <utility>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <cmath>
#include <functional>
#include <chrono>
#include <cstring>
#include <limits.h>

using namespace std;
typedef long long lint;
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef vector<lint> vl;
typedef pair<lint,lint> pll;

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

    int n; cin>>n;
    vi p(n);
    vi cnt(1e6+1, 0);
//    set<int>
    for (int &i : p){
        cin>>i;
        cnt[i]++;
    }

    sort(p.begin(), p.end());
    auto it = unique(p.begin(), p.end());
    p.resize(it - p.begin());

    vi vst(1e6+1, 0);

    for (int i : p){
        if(cnt[i] > 1) vst[i] = 1;
        for (int j = 2*i; j<= 1e6; j += i){
            vst[j] = 1;
        }
    }

    int ans = 0;
    for (int i=1; i<=1e6; ++i){
        if (!vst[i]) ans += cnt[i];
    }
    cout<<ans;



}


Measured memory_bytes: 11908
import sys
input = sys.stdin.readline
from operator import itemgetter
from scipy.sparse import csr_matrix
import numpy as np

N = int(input())

XY = [[i] + [int(x) for x in input().split()] for i in range(N)]

edge = set()
for key in [itemgetter(1),itemgetter(2)]:
  XY.sort(key = key)
  for i in range(N-1):
    i1,x1,y1 = XY[i]
    i2,x2,y2 = XY[i+1]
    d = min(abs(x1-x2),abs(y1-y2))
    edge.add((i1,i2,d))
    
# csr形式に直す
edge = sorted(list(edge))
row,col,value = zip(*edge)
value = np.array(value,dtype=int)
graph = csr_matrix((value,(row,col)),shape=(N,N))

# 最小全域木
from scipy.sparse.csgraph import minimum_spanning_tree
tree = minimum_spanning_tree(graph, overwrite = True).astype(int)
answer = tree.sum()
print(answer)


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

using namespace std;
using ll = unsigned long long;
using P = pair<long double, long double>;

const ll INF64 = 1LL << 60;
const int INF = 1 << 29;
const ll MOD = 1000000007;

const int CASES = 3;

// 負の数にも対応した mod (a = -11 とかでも OK)
inline long long mod(long long a, long long m) {
    long long res = a % m;
    if (res < 0) res += m;
    return res;
}

// 拡張 Euclid の互除法
long long extGCD(long long a, long long b, long long &p, long long &q) {
    if (b == 0) { p = 1; q = 0; return a; }
    long long d = extGCD(b, a%b, q, p);
    q -= a/b * p;
    return d;
}

// 逆元計算 (ここでは a と m が互いに素であることが必要)
long long modinv(long long a, long long m) {
    long long x, y;
    extGCD(a, m, x, y);
    return mod(x, m); // 気持ち的には x % m だが、x が負かもしれないので
}


ll com (const ll n, const ll k){
    ll ue = 1, sita = 1;
    for(ll i = 0; i < k; ++i){
        ue *= (n-i);
        ue %= MOD;
        sita *= (i + 1);
        sita %= MOD;
    }
    return ue * modinv(sita, MOD) % MOD;
}

void solve() {
    ll x, y; cin >> x >> y;
    ll sum = x + y;
    if(sum % 3 != 0){
        cout << 0 << endl;
        return;
    }

    ll n = sum / 3;
    ll k = min(x-n, n - (x - n));
    cout << com(n,k) << endl;
    return;
}

int main() {
#ifdef MYLOCAL
    vector<string> filenames {"input1.txt", "input2.txt", "input3.txt", "input4.txt"};
    cout << "------------\n";
    for(int i = 0; i < CASES; ++i){
        ifstream in(filenames[i]);
        cin.rdbuf(in.rdbuf());
        solve();
        cout << "------------\n";
    }
#else

    solve();

#endif
    return 0;
}



Measured memory_bytes: 256
#!/usr/bin/env python
import sys
sys.setrecursionlimit(10**9)
from collections import deque
import heapq
from itertools import combinations
import bisect

mod=998244353
n,m,k=map(int,input().split())

def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

#mod = 10**9+7 #出力の制限
N = n+3
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

# a = cmb(n,r,mod)

ans=0
for i in range(k+1):
    ans+=pow(m-1,n-1-i,mod)*cmb(n-1,i,mod)
    ans%=mod
print((ans*m)%mod)



Measured memory_bytes: 112840
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
const int INF = 1001001001;
using ll = long long;


int main() {
  string a;
  cin >> a;
  cout << a.at(0) << a.at(1) << a.at(2) << endl;
  return 0;
}

Measured memory_bytes: 3624
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <queue>
#include <stack>
#include <cstdlib>
#include <map>
#include <iomanip>
#include <set>
#include <functional>
#include <stdio.h>
#include <ctype.h>
#include <random>
#include <string.h>
#include <unordered_map>
#include <cstdio>
using namespace std;
#define all(vec) vec.begin(),vec.end()
typedef long long ll;

ll gcd(ll x, ll y) {
	if (y == 0)return x;
	return gcd(y, x%y);
}
ll lcm(ll x, ll y) {
	return x / gcd(x, y)*y;
}
ll kai(ll x, ll y, ll m) {
	ll res = 1;
	for (ll i = x - y + 1; i <= x; i++) {
		res *= i; res %= m;
	}
	return res;
}
ll mod_pow(ll x, ll y, ll m) {
	ll res = 1;
	while (y > 0) {
		if (y & 1) {
			res = res * x % m;
		}
		x = x * x % m;
		y >>= 1;
	}
	return res;
}

ll comb(ll x, ll y, ll m) {
	if (y > x)return 0;
	return kai(x, y, m) * mod_pow(kai(y, y, m), m - 2, m) % m;
}

int par[200010], ran[200010];

void init(int n_) {
	for (int i = 1; i <= n_; i++)par[i] = i, ran[i] = 0;
}

int find(int x) {
	if (par[x] == x)return x;
	else return par[x] = find(par[x]);
}

void unite(int x, int y) {
	x = find(x), y = find(y);
	if (x == y)return;
	if (ran[x] < ran[y])par[x] = y;
	else {
		if (ran[x] == ran[y])ran[x]++;
		par[y] = x;
	}
}

int n, m;
int cnt[200010];
int ans;

signed main() {
	std::random_device rnd;
	std::mt19937_64 mt(rnd());
	cin >> n >> m;
	init(n);
	for (int i = 0; i < m; i++) {
		int a, b; cin >> a >> b;
		unite(a, b);
	}
	for (int i = 1; i <= n; i++)cnt[find(i)]++;
	for (int i = 1; i <= n; i++)ans = max(ans, cnt[i]);
	cout << ans << endl;
}

Measured memory_bytes: 5948
#include<iostream>
#include<vector>
#include<utility>
#include<map>
#include<deque>
#include<numeric>
#include<algorithm>
#include<unordered_map>
#include<cmath>

using namespace std;
using ll = long long int;
constexpr int INF = 1 << 29;
constexpr ll MOD = ll(1e9 + 7);
string s;

int main(void) {
	cin >> s;
	string ret = "Yes";
	if (s[0] == s[1] && s[0] == s[2] && s[1] == s[2])
		ret = "No";
	cout << ret << endl;
	return 0;
}

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

//typedef
//------------------------------------------
typedef long long LL;
typedef vector<LL> VL;
typedef vector<VL> VVL;
typedef vector<string> VS;
typedef pair<LL, LL> PLL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
const int MOD = 1000000007;

//MOD
//--------------------------------------------
#define MUL(a,b) (((a) % MOD) * ((b) % MOD)) % MOD

// grid
//--------------------------------------------
VL dx = {0, 1, 0, -1};
VL dy = {1, 0, -1, 0};
VL dx2 = {-1, 0, 1, -1, 1, -1, 0, 1};
VL dy2 = {-1, -1, -1, 0, 0, 1, 1, 1};

//debug
//--------------------------------------------
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

//IO accelerate
//--------------------------------------------
struct InitIO {
    InitIO() {
        cin.tie(nullptr);
        ios_base::sync_with_stdio(false);
        cout << fixed << setprecision(30);
    }
} init_io;

//main code

int main(int argc, char const* argv[])
{
	LL a,b,x;
	cin >> a >> b >> x;
	cout << (b/x) - (a/x) + (a%x==0?1:0) << endl;
	return 0;
}


Measured memory_bytes: 256
#q:グラフ探索済み格納キュー n:キューの次探索インデックス l:キュー内の次格納インデックス
def bfs_len_max(ind,graph,q_num):
    distance_arr=[0 if i==ind  else -1 for i in range(len(graph))]
    q=[-1 for _ in range(q_num)]
    q[0]=ind
    l=1
    n=0
    while len(q)>l:
        for i in graph[ind]:
            if distance_arr[i]==-1:
                distance_arr[i]=distance_arr[ind]+1
                q[l]=i
                l+=1
        #print(n)
        #print("elapsed q:",q)
        #print("elapsed distance:",distance_arr)
        #print()
        n+=1
        ind=q[n]


    return distance_arr
    

n,m=list(map(int,input().split()))
maze=[]
for i in range(n):
    tmp=input()
    maze.append([k for k in tmp])
#move=[[0 for _ in range(m)] for _ in range(n)]
#print(move)


q_num=0
graph=[[] for _ in range(n*m)]
for i in range(n):
    for j in range(m):
        if maze[i][j]=="#":
            continue
        ind=i*m+j
        q_num+=1
        #move[i][j]=ind
        if i!=0:
            if maze[i-1][j]!="#":
                graph[ind].append((i-1)*m+j)
        if i!=n-1:
            if maze[i+1][j]!="#":
                graph[ind].append((i+1)*m+j)
        if j!=0:
            if maze[i][j-1]!="#":
                graph[ind].append(i*m+j-1)

        if j!=m-1:
            if maze[i][j+1]!="#":
                graph[ind].append(i*m+j+1)
#print(graph)
ans=0
for s in range(m*n):
    if len(graph[s])==0:
        continue
    #print("ind:",s)
    tmp=bfs_len_max(s,graph,q_num)
    #print("res:",tmp)
    ans=max(ans,max(tmp))
    #print("\n\n\n\n")
print(ans)

Measured memory_bytes: 3188
"use strict";
function main(input) {
  const inputs = input.split("\n").filter(x => x !== "");

  const X = Number(inputs[0].split(" ")[0]);
  const Y = Number(inputs[0].split(" ")[1]);

  console.log(X + Y/2);
}

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


Measured memory_bytes: 7372