akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#pragma region InOutputMacros
#define ios\
    ios::sync_with_stdio(false);\
    cin.tie(nullptr);
#define VEC(type, name, size)\
    V<type> name(size);\
    IN(name)
#define VVEC(type, name, h, w)\
    VV<type> name(h, V<type>(w));\
    IN(name)
#define INT(...)\
    int __VA_ARGS__;\
    IN(__VA_ARGS__)
#define LL(...)\
    ll __VA_ARGS__;\
    IN(__VA_ARGS__)
#define STR(...)\
    string __VA_ARGS__;\
    IN(__VA_ARGS__)
#define CHAR(...)\
    char __VA_ARGS__;\
    IN(__VA_ARGS__)
#define DOUBLE(...)\
    DOUBLE __VA_ARGS__;\
    IN(__VA_ARGS__)
#define LD(...)\
    LD __VA_ARGS__;\
    IN(__VA_ARGS__)
template <class T> void scan(T &a) { cin >> a; }
template <class T> void scan(vector<T> &a) { for(auto &i : a) scan(i); }
template <class T, class L> void scan(pair<T, L> &p){ scan(p.first); scan(p.second); }
void IN() {}
template <class Head, class... Tail> void IN(Head &head, Tail &... tail) { scan(head); IN(tail...); }
template <class T> inline void print(T &x){ cout << x << '\n';}
#pragma endregion
#pragma region Macros
#define ll long long
#define ld long double
#define FOR(i,l,r) for(ll i=(l);i<(r);++i)
#define REP(i,n) FOR(i,0,n)
#define REPS(i,n) FOR(i,1,n+1)
#define RFOR(i,l,r) for(ll i=(l);i>=(r);--i)
#define RREP(i,n) RFOR(i,n-1,0)
#define RREPS(i,n) RFOR(i,n,1)
#define pb push_back
#define eb emplace_back
#define SZ(x) ((ll)(x).size())
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
template<class T = ll> using V = vector<T>;
template<class T = ll> using VV = V<V<T>>;
template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b; return true; }return false; }
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b; return true; }return false; }
inline void Yes(bool b = true) {cout << (b ? "Yes" : "No") << '\n';}
inline void YES(bool b = true) {cout << (b ? "YES" : "NO") << '\n';}
inline void err(bool b = true) {if(b) {cout << -1 << '\n'; exit(0);}}
template<class T> inline void fin(bool b = true, T e = 0) {if(b) {cout << e << '\n'; exit(0);}}
template<class T> T Roundup_div(T x, T y) {return (x+(y-1))/y;}
template <typename T> T pow(T a, long long n, T e = 1) {T ret = e; while (n) {if (n & 1) ret *= a; a *= a; n >>= 1; } return ret; }
const ll INF = 1e18;
#pragma endregion

int main(){
    ios;
    INT(a, b, c);
    if(a < b) swap(a, b);
    Yes((a > c and c > b));
}

Measured memory_bytes: 3568
#include<cstdio>
#include<iostream>
#include<cstring>
#include<algorithm>
#define debug cout<<"****************"<<endl
using namespace std;
typedef long long ll;
inline void ju() {
	freopen("***.in","r",stdin);
	freopen("***.out","w",stdout);
}
inline ll rd() {
	ll x=0,f=1; char c=getchar();
	while((c<'0'||c>'9')&&(c!='-')) c=getchar();
	if(c=='-') f=-1,c=getchar();
	while(c>='0'&&c<='9') {
		x=(x<<3)+(x<<1)+c-'0';
		c=getchar();
	}
	return x*f;
}
const int N=1e5+10;
int a[N],b1[N],b2[N];
int main() {
	int n=rd(),x1=0,y1=0,x2=0,y2=0;
	for(int i=1;i<=n;++i) a[i]=rd();
	for(int i=1;i<=n;i+=2) ++b1[a[i]];
	for(int i=2;i<=n;i+=2) ++b2[a[i]];
	for(int i=1;i<N;++i) {
		if(b1[i]>b1[x1]) y1=x1,x1=i;
		else if(b1[i]>b1[y1]) y1=i;
		if(b2[i]>b2[x2]) y2=x2,x2=i;
		else if(b2[i]>b2[y2]) y2=i;
	}
	int ans;
	if(x1!=x2) ans=n-b1[x1]-b2[x2];
	else ans=n-max(b1[x1]+b2[y2],b1[y1]+b2[x2]);
	printf("%d\n",ans);
	return 0;
}


Measured memory_bytes: 1408
#include<bits/stdc++.h>
using namespace std;
///Welcome to Nasif's Code
#define bug printf("bug\n");
#define bug2(var) cout<<#var<<" "<<var<<endl;
#define co(q) cout<<q<<endl;
typedef long long int ll;
typedef unsigned long long int ull;
const int MOD = (int)1e9+7;
const int MAX = 1e6;
#define pi acos(-1)
#define inf 1000000000000000LL
#define FastRead    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int main()
{
    FastRead
    //freopen("output.txt", "w", stdout);
     int n;
     cin>>n;
     cout<<n/3<<endl;

    return 0;
}


Measured memory_bytes: 3600
parseInt(x) = parse(Int, x)
n = parseInt(readline())
s = chomp(readline())

if n % 2 == 1
    println("No")
else
    cnt = 0
    for i in 1:Int(n/2)
        if s[i] == s[Int(n/2)+i]
            global cnt += 1
        end
    end
    if cnt == Int(n/2)
        println("Yes")
    else
        println("No")
    end
end



Measured memory_bytes: 109968
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <iomanip>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
using lint = long long;
using namespace std;

int main() {
	int N;
	cin >> N;
	double A[110];
	rep(i, N) cin >> A[i];
	cout << fixed << setprecision(10);
	
	long double res = 0;
	rep(i, N) res += 1 / A[i];
	res = 1 / res;
	
	cout << res << endl;
	return 0;
}

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

using namespace std;

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

  bitset<200000 + 1> from1, fromm;
  for (int i = 0; i < M; i++) {
    int a, b;
    cin >> a >> b;
    if (a == 1) from1[b] = true;
    if (b == N) fromm[a] = true;
  }

  cout << ((from1 & fromm).any() ? "POSSIBLE" : "IMPOSSIBLE") << endl;

  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
using namespace std;
//---------------------------------------
bool judge(string s, string p);  //p???s???????????????????????????????????¢??°
void print_ans(bool ans);
//---------------------------------------

int main(void)
{
	string s, p;  //????????°??¶_s, ??????????????????p
	
	getline(cin, s);  //???????????????????????????????????????
	getline(cin, p);  //???????????????????????????????????????
	
	s += s;
	
	print_ans(judge(s, p));
	
	return 0;
}

//------------------------------------------
bool judge(string s, string p)
{
	//s.find(p) s??¨p????????´???????????????????????´????????°???????????°??£?????????????????´??????????????°string::npos?????°??£????????????
	
	if(s.find(p) == string::npos){
		return false;
	}
	return true;
}
	
	
	/*int len_s = s.size();
	int len_p = p.size();
	
	for(int i = 0; i < len_p; i++){
		for(int j = 0; j < len_s; j++){
		
			if(p[i+j] == s[j]){
				if((i+1) == len_p){
					return true;
				}
			}
			else{
				break;
			}
		}
	}
	return false;
	*/


//------------------------------------------
void print_ans(bool ans)
{
	if(ans == true){
		cout << "Yes" << endl;
	}
	else{
		cout << "No" << endl;
	}
}

Measured memory_bytes: 3192
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <numeric>

#define REP(i, a, b) for (int i = int(a); i < int(b); i++)
using namespace std;
typedef long long int ll;

// clang-format off
#ifdef _DEBUG_
#define dump(...) do{ cerr << __LINE__ << ":\t" << #__VA_ARGS__ << " = "; PPPPP(__VA_ARGS__); cerr << endl; } while(false)
template<typename T> void PPPPP(T t) { cerr << t; }
template<typename T, typename... S> void PPPPP(T t, S... s) { cerr << t << ", "; PPPPP(s...); }
#else
#define dump(...)
#endif
template<typename T> vector<T> make_v(size_t a, T b) { return vector<T>(a, b); }
template<typename... Ts> auto make_v(size_t a, Ts... ts) { return vector<decltype(make_v(ts...))>(a, make_v(ts...)); }
template<typename T>
bool chmin(T &a, T b) { if (a > b) {a = b; return true; } return false;}
template<typename T>
bool chmax(T &a, T b) { if (a < b) {a = b; return true; } return false;}
// clang-format on

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    ll n;
    cin >> n;
    ll ans = 1LL << 60;
    for (ll i = 1; i * i <= n; i++) {
        if (n % i == 0) {
            chmin(ans, i + n / i - 2);
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 384
#include <iostream>
#include <string>
#include <map>
#include <vector>
#include <algorithm>
#include <iostream>
#include <string>
#include <set>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define all(x) (x).begin(),(x).end()
#define Graph vector<vector<int>>;
#define iterG(next_v, G, v) for(auto next_v : G[v]
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    char c;
    string s = "aeiou";
    cin >> c;
    if(find(s.begin(), s.end(), c) != s.end()){
        cout << "vowel" << endl;
    }else{
        cout << "consonant" << endl;
    }
    
    return 0;
}



Measured memory_bytes: 256
from math import factorial

n, a, b = map(int, input().split())
v = list(map(int, input().split()))
v.sort(reverse=True)

n1 = v.count(v[a - 1])
n2 = v[:a].count(v[:a][a - 1])

print(sum(v[:a]) / a)
if len(set(v[:a])) != 1:
	if n1 == n2:
		print(1)
	else:
		print(int(factorial(n1) / (factorial(n2) * factorial(n1 - n2))))
else:
	ans = 0
	if n1 == 1:
		print(1)
	else:
		for i in range(a, min(n1 + 1, b + 1)):
			ans += int(factorial(n1) / (factorial(i) * factorial(n1 - i)))
		print(int(ans))

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
    
int main(){
  string s;
  cin >> s;
  if(s[2] == s[3] && s[4] == s[5]) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}


Measured memory_bytes: 256
/// @file xor_sum.cc
/// @brief xor_sum の実装ファイル
/// @author Yusuke Matsunaga (松永 裕介)
///
/// Copyright (C) 2019 Yusuke Matsunaga
/// All rights reserved.


#include <iostream>
#include <vector>


using namespace std;


int
main(int argc,
     char** argv)
{
  int n;
  cin >> n;

  vector<long int> a_list(n);
  int max_bit = 60;
  // ビットごとの出現数が奇数の場合，
  // どのような振り分けを行っても 1 になる．
  // その値を odd とする．
  long int odd = 0;
  for ( int i = 0; i < n; ++ i ) {
    long int a;
    cin >> a;
    a_list[i] = a;
    odd ^= a;
  }

  // odd のビットを落としたデータを a1_list に入れる．
  // 結果，a1_list の要素のすべてのXORをとると0になる．
  vector<long int> a1_list(n);
  for ( int i = 0; i < n; ++ i ) {
    a1_list[i] = a_list[i] & ~odd;
  }

  // a1_list のデータを2つのグループに分割してグループ内
  // で XOR を取ったものの和を最大にする．
  // => a1_list の冪集合のうち XOR で最大になる集合を求める．
  // => XOR(a1_list) = 0 より片側が最大なら他方も最大となる．
  // a XOR a = 0 となるので a1_list の各データに対して a1_list
  // の他のデータを任意回 XOR しても結果としては1回XORしたか
  // 不変かのどちらかとなる．
  // そこで，a1_list の各データが単位ベクトルになるような変形
  // を施す．結果の単位ベクトルをすべてXORしたものが上記の解
  // となる．
  // 結局，a1_list をブールベクトルの集合と見なした時の線形独立
  // な単位ベクトルを求めることになる．
  int rank = 0;
  for ( int bit = max_bit - 1; bit >= 0; -- bit ) {
    long int bitmask = (1UL << bit);
    // rank 以降で bit が立っているデータを探す．
    for ( int i = rank; i < n; ++ i ) {
      if ( a1_list[i] & bitmask ) {
	// i と rank を入れ替える．
	if ( i > rank ) {
	  auto tmp = a1_list[i];
	  a1_list[i] = a1_list[rank];
	  a1_list[rank] = tmp;
	}
	// rank 以外のデータの bit の位置の1を落とす．
	for ( int j = 0; j < n; ++ j ) {
	  if ( j != rank ) {
	    if ( a1_list[j] & bitmask ) {
	      a1_list[j] ^= a1_list[rank];
	    }
	  }
	}
	++ rank;
	break;
      }
    }
  }

  long int even = 0;
  for ( int i = 0; i < n; ++ i ) {
    even ^= a1_list[i];
  }

  long int val = even * 2 + odd;
  cout << val << endl;

  return 0;
}


Measured memory_bytes: 1792
using System.Collections.Generic;
using System.Linq;
using System;

public class P
{
    public int eq { get; set; }
    public int wp { get; set; }
}

public class Hello
{
    public static void Main()
    {
        var n = int.Parse(Console.ReadLine().Trim());
        var a = new int[n];
        var d = new Dictionary<int, P>();
        for (int i = 0; i < n; i++)
        {
            var w = (int)(decimal.Parse(Console.ReadLine().Trim()) * 1000);
            a[i] = w;
            if (d.ContainsKey(w)) d[w].eq++;
            else d[w] = new P { eq = 1 };
        }
        getAns(a, d, n);
    }
    static void getAns(int[] a, Dictionary<int, P> d, int n)
    {
        var less = 0;
        foreach (var x in d.OrderBy(y => y.Key))
        {
            d[x.Key].wp = d[x.Key].eq + less * 3 - 1;
            less += d[x.Key].eq;
        }
        foreach (var x in a)
            Console.WriteLine(d[x].wp);
    }
}



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

int main()
{
    int N;
    std::cin >> N;
    std::vector<int> p(N);
    for (int i = 0; i < N; i++)
        std::cin >> p[i];

    int min_num = INT_MAX;
    int cnt = 0;
    for (int i = 0; i < N; i++)
    {
        if (min_num > p[i])
            min_num = p[i];
        
        if (p[i] <= min_num)
            cnt++;
    }

    std::cout << cnt << std::endl;

    return 0;
}

Measured memory_bytes: 1024
/* #include <iostream>
#include <string>
 */
#include <bits/stdc++.h>
using namespace std;

int fun(int N){
    if (N == 0){
        return 2;
    }else if (N==1){
        return 1;
    }else {
        int64_t s1 = fun(N-1);
        int64_t s2 = fun(N-2);
        return s1 + s2;
    }

}

int main() {
    int N;
    cin >> N;
    
    vector<int64_t> ans(N+1);
    ans.at(0) = 2LL;
    ans.at(1) = 1LL;

    //cout << "test1" <<endl;

    for (int i = 2; i <  N+1; i++){
        ans.at(i) = ans.at(i-2) + ans.at(i-1);
    }
    //cout << "test2" <<endl;

    cout << ans.at(N) << endl;
    
}

Measured memory_bytes: 256
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

/**
 *
 * @author Administrator
 */
public class Main {
    
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        
        long n = sc.nextLong();
        
        List<Long>list = new ArrayList();
        
        for(int i=0; i<n; i++){
            list.add(sc.nextLong());
        }
        
        Collections.sort(list);
        
        long sum = 0;
        
        for (Long ele : list){
            sum += ele;
        }
        
        if(sum % 10 != 0){
            System.out.println(sum);
        } else {
            for (Long ele : list){
                if((sum - ele)%10 !=0){
                    System.out.println(sum - ele);
                    return;
                }
            }
            System.out.println(0);
        }
        
    }
    
}

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

bool cmp(int a,int b){
    return a>b;
}

int main(){
    int n,m;
    int tot=0;
    int aa[105];
    cin>>n>>m;
    for(int i=1;i<=n;i++){
        cin>>aa[i];
        tot = tot+aa[i];
    }
    sort(aa+1,aa+n+1,cmp);
    int f = 1;
    double t = (tot*1.0)/(4.0*m);
    for(int i=1;i<=m;i++){
        if(aa[i]<t){
            f=0;
            break;
        }
    }
    if(f==1)
        cout<<"Yes";
    else
        cout<<"No";
    return 0;
}


Measured memory_bytes: 256
import sys
sys.setrecursionlimit(1000000)

n, m = map(int, input().split())
friends = [set() for i in range(n)]


def dfs(i):
    ans[-1] += 1
    flg[i] = 1
    for j in friends[i]:
        if not flg[j]:
            dfs(j)


for i in range(m):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    friends[a].add(b)
    friends[b].add(a)

flg = [0]*n
ans = []

for i in range(n):
    ans.append(0)
    if not flg[i]:
        dfs(i)

print(max(ans))


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

int main(){
    string v[3];
    for(ll i=0;i<3;++i){
        cin>>v[i];
    }
    char ans;
    ll flag=0;

    bool bol=true;
    while(bol){
        if(v[flag].size()==0){
            if(flag==0){
                ans='A';
            }else if(flag==1){
                ans='B';
            }else if(flag=2){
                ans='C';
            }
            bol=false;
        }else if(v[flag][0]=='a'){
            v[flag]= v[flag].substr(1,v[flag].size());
            flag=0;
        }else if(v[flag][0]=='b'){
            v[flag]= v[flag].substr(1,v[flag].size());
            flag=1;
        }else if(v[flag][0]=='c'){
            v[flag]= v[flag].substr(1,v[flag].size());
            flag=2;
        }
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000
#define sz(x) ((int)(x).size())
#define fi first
#define sec second
#define all(x) (x).begin(),(x).end()
#define sq(x) ((x)*(x))
#define rep(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define repn(i,a,n) for(int (i)=(a);(i)<(int)(n);(i)++)
#define EQ(a,b) (abs((a)-(b))<eps)
template<class T> void chmin(T& a,const T& b){if(a>b)a=b;}
template<class T> void chmax(T& a,const T& b){if(a<b)a=b;}
string s;
int n;
int main(){
	cin >> n;
	cin >> s;
	int a=0,b=0;
	for(int i=0;i<s.size();i++){
		if(s[i]=='R')a++;
		else b++;
	}
	if(a>b)cout << "Yes" << endl;
	else cout << "No" << endl;
	return 0;
}

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

using namespace std;

int main()
{
	int n;
	cin >> n;
	int X = 0, Y = 0, T = 0;
	for (int i = 0; i < n; i++) {
		int x, y, t;
		scanf("%d%d%d", &t, &x, &y);
		int d = abs(x - X) + abs(y - Y), u = t - T;
		if (d > u || (u - d) % 2) {
			cout << "No" << endl;
			return 0;
		}
		X = x, Y = y, T = t;
	}
	cout << "Yes" << endl;
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ull = long long;
int main(){
    ull n, a, b, c, d, e;
    cin >> n >> a >> b >> c >> d >> e;

    ull shortest = min(a, b);
    shortest = min(shortest, c);
    shortest = min(shortest, d);
    shortest = min(shortest, e);
    /*ull warizan=0;
    warizan = ceil(n / shortest);

    ull ans =0;
    ans = warizan + 5 - 1;*/
    cout << max({(n-1)/a, (n-1)/b, (n-1)/c, (n-1)/d, (n-1)/e}) + 5 << endl;
    return 0;
}

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

int main(){
	pair<int,int> a[100];
	int n,m;
	while(cin>>n>>m,n||m){
		for(int i=0;i<m;i++){
			a[i] = make_pair(0,i+1);
		}
		for(int i=0;i<n;i++){
			for(int j=0;j<m;j++){
				int f;
				cin>>f;
				if(f) --a[j].first;
			}
		}
		sort(a,a+m);
		cout<<a[0].second;
		for(int j=1;j<m;j++){
			cout<<' '<<a[j].second;
		}
		cout<<endl;
	}
	return 0;
}

Measured memory_bytes: 1164
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int dx[]={1,0,-1,0},dy[]={0,1,0,-1};
struct node
{
	int x,y;
}t;
char a[1005][1005];
int inq[1005][1005];
int n,m;
deque<node>q;
bool check(int x,int y,int w)
{
	return !(x<1||x>n||y<1||y>m||inq[x][y]<=w);
}
signed main()
{
	int i,j,sx,sy,ex,ey;
	string s;
	cin>>n>>m>>sx>>sy>>ex>>ey;
	for(i=1;i<=n;i++)
	{
		cin>>s;
		for(j=1;j<=m;j++)
		{
			a[i][j]=s[j-1];
			if(a[i][j]=='#')
				inq[i][j]=-1;
			else
				inq[i][j]=2147483647;
		}
	}
	q.push_front((node){sx,sy});
	inq[sx][sy]=0;
	while(q.size())
	{
		t=q.front();
		q.pop_front();
		if(t.x==ex&&t.y==ey)
		{
			cout<<inq[ex][ey];
			while(q.size())
				q.pop_front();
			return 0;
		}
		for(i=0;i<4;i++)
			if(check(t.x+dx[i],t.y+dy[i],inq[t.x][t.y]))
			{
				inq[t.x+dx[i]][t.y+dy[i]]=inq[t.x][t.y];
				q.push_front((node){t.x+dx[i],t.y+dy[i]});
			}
		for(i=-2;i<3;i++)
			for(j=-2;j<3;j++)
				if(check(t.x+i,t.y+j,inq[t.x][t.y]+1))
				{
					inq[t.x+i][t.y+j]=inq[t.x][t.y]+1;
					q.push_back((node){t.x+i,t.y+j});
				}
	}
	cout<<-1;
	return 0;
}//wdnmd

Measured memory_bytes: 12516
#include <bits/stdc++.h>
#define PI 3.14159265359
#define NIL (-1)
#define LL long long
using namespace std;
const int64_t MOD = 1e9 + 7;
const int INF = INT_MAX;

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

	int n = B / A;

	cout << min(n, C) << endl;
}

Measured memory_bytes: 3648
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
template<typename T, typename V = __gnu_pbds::null_type>
using ordered_set = __gnu_pbds::tree<T, V, less<T>, __gnu_pbds::rb_tree_tag, __gnu_pbds::tree_order_statistics_node_update>;
// find_by_order(), order_of_key()
#define SZ(v) int((v).size())
#define ALL(vec) (vec).begin(),(vec).end()
typedef long long i64;
template<typename T> inline bool uax(T &x, T y) {return (y > x) ? x = y, true : false;}
template<typename T> inline bool uin(T &x, T y) {return (y < x) ? x = y, true : false;}
#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); \
  stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
void err(istream_iterator<string>) {}
template<typename T1,typename T2> ostream& operator<<(ostream& os, pair<T1,T2> buf) {
  return os << "(" << buf.first << ": " << buf.second << ")"; }
#define DefOut(Con) template<typename T>ostream&operator<<(ostream&os,Con<T>&A){ bool f = false; os << "{"; \
  for (const auto e: A) { if (f) os << ", "; os << e; f = true; } return os << "}"; }
#define DefOut2(Con) template<typename K,typename V>ostream&operator<<(ostream&os,Con<K,V>&A) \
{ bool f = false; os << "{"; for (auto &e: A) { if (f) os << ", "; os << e; f = true; } return os << "}"; }
template<typename T>ostream &operator << (ostream &os,vector<vector<T>>& A) {
  for (auto &B: A) os << '\n' << B; return os; }
DefOut(vector) DefOut(set) DefOut(multiset) DefOut2(map) 
template<typename T,typename... Args> void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " =: " << a << endl; err(++it, args...); }
template<typename T> void kek(T ans) {cout << ans << endl; exit(0);}
int const MOD = 1e9 + 7;
long long const INF = 1e18;
/***********************************************************************/

int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
 
  int n, a, b;
  cin >> n >> a >> b;
  kek(min(n * a, b));
  
  return 0;
} 


Measured memory_bytes: 256
#pragma GCC optimize ("O3")
#pragma GCC target ("avx2")
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please

const int mod = 1e9 + 7;
constexpr ll modpow(ll A, ll B) {
	ll kotae = 1;
	while (B > 0) {
		if (B & 1) kotae = kotae * A % mod;
		A = A * A % mod;
		B >>= 1;
	}
	return kotae;
}


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


	int N;
	cin >> N;
	pair<ull, ull> AB[200001];
	int a0 = 0, b0 = 0;
	int ab00 = 0;
	int ka = 0, kb = N - 1;
	rep(i, N) {
		ll a, b;
		cin >> a >> b;

		if (a == 0 && b == 0) {
			ab00++;
			continue;
		}
		if (a == 0) {
			a0++;
			continue;
		}
		if (b == 0) {
			b0++;
			continue;
		}

		if (a < 0) {
			a = -a;
			b = -b;
		}
		bool p = (b > 0);
		if (!p) {
			b = -b;
			swap(a, b);
		}

		int k = __builtin_clzll(a) - __builtin_clzll(b);
		if (k > 0) a <<= k;
		else b <<= -k;
		if (a > b) {
			b <<= 1;
			k--;
		}
		b -= a;
		b <<= 1;

		ull tmp1 = ull(k + 64) << 57, tmp2 = 0;
		for (int i = 56; i >= 0; i--) {
			if (b >= a) {
				tmp1 += (1ull << i);
				b -= a;
			}
			b <<= 1;
		}
		for (int i = 63; i >= 0; i--) {
			if (b >= a) {
				tmp2 += (1ull << i);
				b -= a;
			}
			b <<= 1;
		}
		if (p) AB[ka++] = { tmp1,tmp2 };
		else AB[kb--] = { tmp1,tmp2 };
	}
	auto BA = AB + kb + 1;
	kb = N - 1 - kb;
	ll kotae = 1;
	sort(AB, AB + ka);
	sort(BA, BA + kb);
	BA[kb] = { ~(ull)0, 0 };

	pair<ull, ull> mae = AB[0];
	int p = 0;
	int kA = 0;
	rep(i, ka) {
		if (mae != AB[i]) {
			int tmp = 0;

			pair<ull, ull> mae2 = BA[p];
			int kB = 0;
			while (BA[p] <= mae) {
				if (mae2 != BA[p]) {
					kotae = kotae * modpow(2, kB) % mod;
					mae2 = BA[p];
					kB = 1;
				}
				else kB++;
				p++;
			}

			if (mae == mae2) {
				tmp = kB;
			}
			else {
				kotae = kotae * modpow(2, kB) % mod;
			}

			if (tmp) {
				kotae = kotae * (modpow(2, kA) + modpow(2, kB) - 1) % mod;
			}
			else {
				kotae = kotae * modpow(2, kA) % mod;
			}

			mae = AB[i];
			kA = 1;
		}
		else kA++;
	}

	int tmp = 0;
	pair<ull, ull> mae2 = BA[p];
	int kB = 0;
	while (p < kb) {
		if (mae2 != BA[p]) {
			if (AB[ka - 1] == mae2) {
				tmp = kB;
			}
			else {
				kotae = kotae * modpow(2, kB) % mod;
			}
			mae2 = BA[p];
			kB = 1;
		}
		else kB++;
		p++;
	}

	if (AB[ka - 1] == mae2) {
		tmp = kB;
	}
	else {
		kotae = kotae * modpow(2, kB) % mod;
	}

	if (tmp) {
		kotae = kotae * (modpow(2, kA) + modpow(2, kB) - 1) % mod;
	}
	else {
		kotae = kotae * modpow(2, kA) % mod;
	}

	kotae = kotae * (modpow(2, a0) + modpow(2, b0) - 1) % mod;

	co((kotae - 1 + ab00 + 2 * mod) % mod);

	Would you please return 0;
}

Measured memory_bytes: 6748
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int H = sc.nextInt();
		int W = sc.nextInt();
		int h = sc.nextInt();
		int w = sc.nextInt();

		System.out.print((H - h) * (W - w));

	}
}

Measured memory_bytes: 23636
import sys

def main():
    input = sys.stdin.readline
    N = int(input())
    V = list(map(int, input().split()))
    V.sort()
    ans = V[0]
    for i in range(1, N):
        ans = (ans + V[i]) / 2

    return ans


if __name__ == '__main__':
    print(main())


Measured memory_bytes: 3060
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.UncheckedIOException;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

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

    static class AIrreversibleOperation {
        public void solve(int testNumber, LightScanner in, PrintWriter out) {
            String s = in.string();
            long ans = 0;
            int wi = 0;
            for (int i = 0; i < s.length(); i++) {
                if (s.charAt(i) == 'W') {
                    ans += i - wi;
                    wi++;
                }
            }
            out.println(ans);
        }

    }

    static class LightScanner {
        private BufferedReader reader = null;
        private StringTokenizer tokenizer = null;

        public LightScanner(InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
        }

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

    }
}



Measured memory_bytes: 27284
import java.util.*;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		int X = sc.nextInt();
		int Y = sc.nextInt();
		int[] count = new int[N+1];
		for( int i=1; i<=N-1; i++ ){
			for( int k=i+1; k<=N; k++ ){
				if( k<=X ){
					count[k-i]++;                      
				}
				if( i>=Y ){
					count[k-i]++; 
				}
				if( i<Y && k>X ){
					count[ Math.min( k-i, Math.abs(i-X)+Math.abs(k-Y)+1 ) ]++; 
				}
			}
		}
		for( int i=1; i<=N-1; i++ ){
			System.out.println(count[i]);
		}
	}
}


Measured memory_bytes: 22484
#include <iostream>

#define HOUR 3600
#define MIN 60

using namespace std;

int main(){
    int s_in, h, m, s;
    
    cin >> s_in;
    
    h = s_in/HOUR;
    m = (s_in-h*HOUR)/MIN;
    s = s_in%MIN;
    
    cout << h << ":" << m << ":" << s << "\n";
    
    return 0;
}



Measured memory_bytes: 3116
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
typedef long long ll;

template<typename T>
void input(T &x) {
	x=0; T a=1;
	register char c=getchar();
	for(;c<48||c>57;c=getchar())
		if(c==45) a=-1;
	for(;c>=48&&c<=57;c=getchar())
		x=x*10+c-48;
	x*=a;
	return;
}

#define MAXN 1010
#define MAXM 1010

int n,m;
int a[MAXN][MAXM];
int sum[MAXM];

namespace solve30 { //O(n*m*2^m)
	
	bool chose[15];

	void main() {
		for(int i=1;i<=n;i++)
			for(int j=1;j<=m;j++)
				input(a[i][j]),a[i][j]--;
		int ans=2147483647;
		for(int s=1;s<1<<m;s++) {
			for(int i=0;i<m;i++)
				if(s&(1<<i)) chose[i]=true;
			for(int i=1;i<=n;i++)
				for(int j=1;j<=m;j++)
					if(chose[a[i][j]]) {
						sum[a[i][j]]++;
						break;
					}
			int Max=0;
			for(int i=0;i<m;i++) {
				Max=max(Max,sum[i]),
				sum[i]=0,chose[i]=false;
			}
			ans=min(ans,Max);
		}
		printf("%d\n",ans);
		return;
	}

}

namespace solve70 { // O(n*m*log n)
	
	int cnt[MAXN];
	bool not_chose[MAXM];

	bool Judge(int mid) {
		memset(not_chose,0,sizeof(not_chose));
		for(int i=1;i<=n;i++) cnt[i]=1;
		while(true) {
			memset(sum,0,sizeof(sum));
			bool flag=true;
			for(int i=1;i<=n;i++) {
				for(;cnt[i]<=m&&not_chose[a[i][cnt[i]]];cnt[i]++);
				if(cnt[i]>m) return false;
				if(++sum[a[i][cnt[i]]]>mid)
					not_chose[a[i][cnt[i]]]=true,flag=false;
			}
			if(flag) return true;
		}
		return false;
	}

	void main() {
		for(int i=1;i<=n;i++)
			for(int j=1;j<=m;j++)
				input(a[i][j]);
		int l=1,r=n,ans;
		while(l<=r) {
			int mid=l+r>>1;
			if(Judge(mid)) ans=mid,r=mid-1;
			else l=mid+1;
		}
		printf("%d\n",ans);
		return;
	}

}

int main() {
//	freopen("sports.in","r",stdin),
//	freopen("sports.out","w",stdout),
	input(n),input(m);
	if(n<=10&&m<=10) solve30::main();
	else solve70::main();
//	fclose(stdin),fclose(stdout);
	return 0;
}


Measured memory_bytes: 1408
(defun solver ()
  (let ((x (read)) (y (read))
         (array (vector 0 1 3 1 2 1 2 1 1 2 1 2 3)))
    (if (= (svref array x) (svref array y))
        (format t "Yes~%")
        (format t "No~%"))))

(solver)

Measured memory_bytes: 12388
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int D;
  cin >> D;
  
  vector<int> c(26);
  for (int i = 0; i < 26; i++) {
    cin >> c.at(i);
  }
  
  vector<vector<int>> s(D, vector<int>(26));
 
  // 入力 (2重ループを用いる)
  for (int i = 0; i < D; i++) {
    for (int j = 0; j < 26; j++) {
      cin >> s.at(i).at(j);
    }
  }
  
  //int man = 0;
  vector<int> last(26,0);
  for(int i=0; i<D; i++){
    int kaisai = 0;
    int tmp = 0;
    for(int k=0; k<26; k++){ // i日目にk thの問題
      int add = s.at(i).at(k);
      last.at(k) = i+1;
      for(int j=0; j<26; j++){
        add -= c.at(j)*(1 + i - last.at(j));
      }
      last.at(k) = i-1;
      if(tmp < add){
        tmp = add;
        kaisai = k;
      }
	}
    
    last.at(kaisai) = i+1;
    
    cout << kaisai+1 << endl;
  }
  
  return 0; 
}

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

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    string s;
    cin>>s;
    string f="ABC";
    if(s==f)
        cout<<"ARC"<<endl;
    else    
        cout<<"ABC"<<endl;
	return 0;
}

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

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep3(i,m,n) for(int (i)=m;(i)<=(n);(i)++)
#define rep3rev(i,m,n) for(int (i)=m;(i)>=(n);(i)--)
#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second
#define pb push_back
#define eb emplace_back

using ll = long long;
using vll = vector<ll>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using P = pair<int, int>;

void Main(){
    int x, y, z, k; cin >> x >> y >> z >> k;
    vll a(x), b(y), c(z);
    rep(i, x) cin >> a[i];
    rep(i, y) cin >> b[i];
    rep(i, z) cin >> c[i];
    sort(rall(a));
    sort(rall(b));
    sort(rall(c));
    
    vll data, ans;
    
    rep(i, x){
        rep(j, y){
            data.pb(a[i] + b[j]);
        }
    }
    
    sort(rall(data));
    
    rep(i, min(3000, (int)data.size())){
        rep(j, z){
            ans.pb(data[i] + c[j]);
        }
    }
    
    sort(rall(ans));
    
    rep(i, k){
        cout << ans[i] << endl;
    }

    return;
}

int main(){
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	Main();
	return 0;
}

Measured memory_bytes: 44068
#include<bits/stdc++.h>
#define mp make_pair
#define fi first
#define se second
#define VAL 100000
#define ll  long long int
#define INF 10000000000000000LL
#define pll pair<long long , long long>
const int MAX=1e7;
const ll MOD=998244353;
const int TOT_PRIMES=19;
const int MAX_A=70;
using namespace std;
int main() 
{
	ios_base::sync_with_stdio(false); 
    cin.tie(NULL);  
    cout.tie(0);
    int n , m;
    string s;
    int idx;
    for(int i=1;i<=5;i++){
      int x;
      cin>>x;
      if(x==0)
        idx=i;
    }
    cout<<idx;
}

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

int main() {
	int i,n;
	cin>>n;
	int h[n];
	for(i=0;i<n;i++)
	    cin>>h[i];
	int dp[n];
	dp[0]=0;
	dp[1]=abs(h[1]-h[0]);
	for(i=2;i<n;i++)
	    dp[i]=min(dp[i-1]+abs(h[i-1]-h[i]),dp[i-2]+abs(h[i-2]-h[i]));
	cout<<dp[n-1];
	return 0;
}

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

int main(){
  int N, K;
  cin >> N >> K;
  int A[N];
  for(int i=0;i<N;i++) cin >> A[i];
  sort(A, A+N);
  int ans = 1000000000;
  for(int i=0;i<(N-K+1);i++){
    int t = A[i+K-1] - A[i];
    ans = min(ans, t);
  }
  cout << ans << endl;
}

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

int main() {
    int X, Y;
    cin >> X >> Y;

    int x, y;
    for (int i = 0; i <= X; ++i) {
        x = i;
        y = X - i;
        if (x * 2 + y * 4 == Y) {
            goto success;
        }
    }
    cout << "No" << endl;
    return 0;
success:
    cout << "Yes" << endl;
}

Measured memory_bytes: 3632
#include <iostream>

using namespace std;

int main()
{
	int a, b, c, d, e;
	cin >> a >> b >> c >> d >> e;
	if(a == 0)
	 cout << 1;
	if(b == 0)
	 cout << 2;
	if(c == 0)
	 cout << 3;
	if(d == 0)
	 cout << 4;
	if(e == 0)
	 cout << 5;
	return 0;
}

Measured memory_bytes: 3548
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main()
{
    ll n,k;
    cin>>n>>k;
    ll a[n];
    for(ll i=0;i<n;i++)
    {
        cin>>a[i];
    }
    ll sum=0;
    sort(a,a+n);
    for(ll i=0;i<k;i++)
    {
        sum=sum+a[i];
    }
    cout<<sum;
}


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

#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
const int INF = 1e9;

int main() {
  ll n, ans = INF;
  cin >> n;
  if (n == 1) {
    puts("1");
    return 0;
  }
  vector<ll> x(n), y(n);
  rep(i, n) cin >> x[i] >> y[i];

  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      if (i == j) continue;
      int p = x[i] - x[j];
      int q = y[i] - y[j];
      int cnt = 0;
      for (int k = 0; k < n; ++k) {
        for (int l = 0; l < n; ++l) {
          if (k == l) continue;
          if (x[l] == x[k] + p && y[l] == y[k] + q) cnt++;
        }
      }
      ans = min(ans, n - cnt);
    }
  }

  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <queue>
#include <map>
#include <numeric>
#include <unordered_map>
#include <iomanip>
#include <functional>
#include <bitset>
#include <complex>

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define all(x) (x).begin(),(x).end()

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

typedef long long ll;

using namespace std;
using vec=vector<ll>;
using mat=vector<vec>;
int mod=1e9+7;
mat mul(mat &a,mat &b)
{
  mat res(a.size(),vec(b[0].size(),0));
  for(int i=0;i<a.size();i++)
  {
    for(int k=0;k<b.size();k++)
    {
      for(int j=0;j<b[0].size();j++)
      {
        res[i][j]+=a[i][k]*b[k][j];
        res[i][j]%=mod;
      }
    }
  }
  return res;
}

mat pow(mat &a,ll n)
{
  mat b(a.size(),vec(a.size(),0));
  for(int i=0;i<a.size();i++)
  {
    b[i][i]=1;
  }
  while(n>0)
  {
    if(n&1)b=mul(b,a);
    a=mul(a,a);
    n>>=1;
  }
  return b;
}

int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll n,k;
  cin>>n>>k;
  mat p(n,vector<ll>(n,0));
  rep(i,n)rep(j,n)cin>>p[i][j];
  mat x(n,vector<ll>(1,1));
  auto q=pow(p,k);
  mul(q,x);
  int res=0;
  rep(i,n)rep(j,n){res+=q[i][j];res%=mod;}
  cout<<res<<endl;




  return 0;

}


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

using namespace std;

const int MOD = 1e9+7;

int s;
vector <long long int> dp;

long long int solve(int s) {
	if (s == 0) {
		return 1;
	}

	if (s < 0) {
		return 0;
	}

	if (dp[s] != -1) {
		return dp[s];
	}

	long long int ways = 0;

	for (int i = 3; ; i++) {
		if (s - i < 0) {
			break;
		}
		ways += solve(s-i);
		ways %= MOD;
	}

	return dp[s] = ways;
}

int main() {
	cin >> s;

	dp.assign(s+1, -1);

	cout << solve(s) << "\n";

	return 0;
}

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

#define REP(i,init, n) for(lli i=init;i<n;i++)
#define REPE(i,init, n) for(lli i=init;i<=n;i++)
#define REPIT(it,container) for(auto it = container.begin(); it != container.end(); it++)
#define REPIT_R(it,container) for(auto it = container.rbegin(); it != container.rend(); it++)

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

typedef long long int lli;
typedef pair<lli, lli> P;

int main() {
    string s;
    cin >> s;
    int len = s.length();
    lli maru = 0;
    REP(i, 0, len) {
        if (s[i] == 'o')
            maru++;
    }
    lli left = 15 - len;
    if (maru + left > 7)
        cout << "YES" << endl;
    else
        cout << "NO" << endl;
}


Measured memory_bytes: 256
package main

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

func main() {

	A := oneInt()
	B := oneInt()
	C := oneInt()
	D := oneInt()

	for {
		C = C - B
		if C <= 0 {
			fmt.Print("Yes")
			return
		}
		A = A - D
		if A <= 0 {
			fmt.Print("No")
			return
		}
	}

}

func exp(val int) float64 {
	var temp float64
	for index := 1; index <= val; index++ {
		temp += float64(index)
	}
	return temp / float64(val)
}

func searchAbove(slice []int, target int, index int) int {
	for i := index + 1; i < len(slice); i++ {
		v := slice[i]
		if v >= target {
			return i
		}
	}
	return -1
}

var sc = bufio.NewScanner(os.Stdin)

func oneInt() int {
	var a int
	fmt.Scan(&a)
	return a
}
func oneStr() string {
	var a string
	fmt.Scan(&a)
	return a
}

func nextLine() string {
	sc.Scan()
	return sc.Text()
}

func scanNums() (nums []int) {
	s := nextLine()
	numStr := strings.Split(s, " ")

	for _, n := range numStr {
		i, _ := strconv.Atoi(n)
		nums = append(nums, i)
	}
	return nums
}

func scanStrings() (strs []string) {
	s := nextLine()
	list := strings.Split(s, " ")
	strs = append(strs, list...)
	return strs
}

func abs(a int) int {
	return int(math.Abs(float64(a)))
}

func pow(p, q int) int {
	return int(math.Pow(float64(p), float64(q)))
}

func min(nums ...int) int {
	if len(nums) == 0 {
		panic("funciton min() requires at least one argument.")
	}
	res := nums[0]
	for i := 0; i < len(nums); i++ {
		res = int(math.Min(float64(res), float64(nums[i])))
	}
	return res
}

func max(nums ...int) int {
	if len(nums) == 0 {
		panic("funciton max() requires at least one argument.")
	}
	res := nums[0]
	for i := 0; i < len(nums); i++ {
		res = int(math.Max(float64(res), float64(nums[i])))
	}
	return res
}

func strSearch(a []string, b string) bool {
	for i := 0; i < len(a); i++ {
		if a[i] == b {
			return true
		}
	}
	return false
}

func sortAsc(a []int) []int {
	sort.Ints(a)
	return a
}

func sortDesc(a []int) []int {
	sort.Sort(sort.Reverse(sort.IntSlice(a)))
	return a
}

func gcd(a, b int) int {
	if b == 0 {
		return a
	}
	return gcd(b, a%b)
}

func lcm(a, b int) int {
	if a == 0 && b == 0 {
		return 0
	}
	return a * b / gcd(a, b)
}


Measured memory_bytes: 1756
# -*- coding: utf-8 -*-
import sys
from collections import deque, defaultdict
from math import sqrt, factorial, gcd, ceil
# def input(): return sys.stdin.readline()[:-1] # warning not \n
# def input(): return sys.stdin.buffer.readline().strip() # warning bytes
# def input(): return sys.stdin.buffer.readline().decode('utf-8')
import string
# string.ascii_lowercase
from bisect import bisect_left
MOD = int(1e9)+7
INF = float('inf')


def solve():
    # n, m = [int(x) for x in input().split()]
    k, s = [int(x) for x in input().split()]
    ans = 0
    for i in range(k+1):
        for j in range(k+1):
            z = s - (i + j)
            if 0 <= z <= k:
                ans += 1
    print(ans)

    


t = 1
# t = int(input())
for case in range(1,t+1):
    ans = solve()


"""

azyxwvutsrqponmlkjihgfedcb

"""


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

using ll = long long;
#define ALL(c) (c).begin(), (c).end()
const int MOD = 1000000007;

template <typename T> bool next_combination(const T first, const T last, int k) {
    const T subset = first + k;
    // empty container | k = 0 | k == n 
    if (first == last || first == subset || last == subset) {
        return false;
    }
    T src = subset;
    while (first != src) {
        src--;
        if (*src < *(last - 1)) {
            T dest = subset;
            while (*src >= *dest) {
                dest++;
            }
            iter_swap(src, dest);
            rotate(src + 1, dest + 1, last);
            rotate(subset, subset + (last - dest) - 1, last);
            return true;
        }
    }
    // restore
    rotate(first, subset, last);
    return false;
}

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

    vector<ll> v(5, 0);
    string s;
    for (int i = 0; i < n; i++) {
        cin >> s;
        if (s[0] == 'M') {
            v[0]++;
        } else if (s[0] == 'A') {
            v[1]++;
        } else if (s[0] == 'R') {
            v[2]++;
        } else if (s[0] == 'C') {
            v[3]++;
        } else if (s[0] == 'H') {
            v[4]++;
        }
    }

    vector<int> c(5);
    iota(ALL(c), 0);

    ll t = 0; 
    do {
        t += v[c[0]] * v[c[1]] * v[c[2]];
    } while(next_combination(ALL(c), 3));

    cout << t << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i=0; i<(int)(n); ++i)
#define rep1(i,n) for (int i=1; i<=(int)(n); ++i)
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using Graph = vector<vi>;  // vi <=> vl
using vb = vector<bool>;
using boolGraph = vector<vb>;
using P = pair<int, int>;  // int <=> ll
const int MOD = 1e9+7;
const int MOD2 = 998244353;
const double EPS = 1e-9;

void solve() {
  string s, t; cin >> s >> t;
  unordered_map<char, char> edge;
  rep(i,s.size()) {
    if (!edge.count(s[i])) {
      edge[s[i]] = t[i];
    }
    else if (edge[s[i]] != t[i]) {
      cout << "No\n";
      return;
    }
  }
  unordered_set<char> dup;
  for (auto p : edge) {
    if (!dup.count(p.second)) {
      dup.insert(p.second);
    }
    else {
      cout << "No\n";
      return;
    }
  }
  cout << "Yes\n";
}

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(12);
  solve();
  return 0;
}


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

yakusuu=[]
import math
for i in range(1,int(math.sqrt(m)+1)):
  if m%i==0:
    yakusuu.append(i)
    yakusuu.append(m//i)
yakusuu.sort()
for num in yakusuu:
  if num>=n:
    print(m//num)
    exit()
    
    

Measured memory_bytes: 63860
#include<iostream>
#include<cmath>
#include<vector>
#include<algorithm>
#include<string>
#include<utility>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
using namespace std;

int main(){
  int x,y,s;
  while(1){
    cin>>x>>y>>s;
    if(x==0 && y==0 && s==0)break;
    vector<int> good1,good2;
    loop(i,1,s){
      loop(j,1,s){
	int num1=i*(100+x)/100;
	int num2=j*(100+x)/100;
	if((num1+num2)==s){   
	  good1.push_back(i);
	  good2.push_back(j);
	}
      }
    }
    int ans=0;
    int size=good1.size();
    rep(i,size){
      int ans1=good1[i]*(100+y)/100;
      int ans2=good2[i]*(100+y)/100;
      ans=max(ans,ans1+ans2);
    }
    cout<<ans<<endl;
  }
  return 0;
}

Measured memory_bytes: 1236
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#define rep(i,a,n) for(ll i =(a);i<(n);i++)
#define urep(i,a,n) for(ll i = (a);i>=(n);i--)
#define all(x) (x).begin(),(x).end()
#define INF 1e9
const int mod = 1e9 + 7;
typedef long long ll;
using namespace std;
ll N, M, Q;
ll A[100001];
ll B[100001];
ll ans;
string S;
ll K;
map<ll, ll> m;
ll gcd(ll a, ll b) {
	if (b == 0)return a;
	else return gcd(b, a%b);
}
int main() {
	cin >> A[0] >> A[1] >> A[2];
	sort(A, A + 3);
	ll num = A[2]*2 - A[1] - A[0];
	if (!(num % 2)) {
		cout << num / 2 << endl;
	}
	else {
		cout << num / 2 + 2 << endl;
	}
	cin >> num;
	return 0;
}

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

#define rep(i, n) for(int i=0; i < n; i++)
#define REP(i, n, m) for(int i=n; i < m; i++)
#define reps(i, n) for(int i=1; i <= n; i++)
#define ALL(v) v.begin(), v.end()
#define rALL(v) v.rbegin(), v.rend()
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)

using namespace std;
using ll=long long;

const ll INF = 1LL << 60;

ll mod=1000000007;

template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}


int main() {
  int n,x,t;
  cin>>n>>x>>t;
  cout<<((n+x-1)/x)*t;
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
#define REP(i, init, n) for(int i = (int)(init); i < (int)(n); i++)
long MOD = 1000000007;

#define vi vector<int>
#define vl vector<long>
#define vvi vector<vector<int>>
#define vvl vector<vector<long>>
#define pint pair<int, int>
#define plong pair<long, long>

int main() {
    string S; 
    cin>>S;
    vvl modT(13, vl(S.size(), 0));
    vl modP(S.size());
    modP[0] = 1;
    REP(i, 1, S.size()){
        modP[i] = (modP[i-1]*10)%13;
    }
    reverse(S.begin(), S.end());
    if(S[0] == '?'){
        REP(i, 0, 10) modT[i][0]++;
    }else{
        int d = S[0] - '0';
        modT[d][0]++;
    }
    REP(i, 1, S.size()){
        char d = S[i];
        if(d == '?'){
            REP(j, 0, 10){
                int shift = (modP[i]*j)%13;
                REP(k, 0, 13){
                    modT[(k+shift)%13][i] += modT[k][i-1];
                }
            }
        }else{
            int d_i = d - '0';
            int shift = (modP[i]*d_i)%13;
            REP(j, 0, 13){
                modT[(j+shift)%13][i] += modT[j][i-1];
            }
        }
        REP(j, 0, 13) if(modT[j][i] > MOD) modT[j][i] %= MOD;
    }
    cout << modT[5][S.size()-1] << endl;
}

Measured memory_bytes: 11504
n,m = map(int,input().split())
L = []
ans = 1000
for i in range(m):
    L.append(list(map(int,input().split())))
if n == 1:
    for i in range(10):
        flag = True
        t = str(i)
        for j in range(m):
            if t[L[j][0]-1] != str(L[j][1]):
                flag = False
                break
        if flag:
            ans = min(i, ans)
elif n == 2:
    for i in range(10, 100):
        flag = True
        t = str(i)
        for j in range(m):
            if t[L[j][0]-1] != str(L[j][1]):
                flag = False
                break
        if flag:
            ans = min(i, ans)
else:
    for i in range(100, 1000):
        flag = True
        t = str(i)
        for j in range(m):
            if t[L[j][0]-1] != str(L[j][1]):
                flag = False
                break
        if flag:
            ans = min(i, ans)
if ans == 1000:
    print(-1)
else:
    print(ans)


Measured memory_bytes: 3064