akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
typedef pair<P,int> T;
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 LLINF 1000000000000000
#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;}
int N;
int a[100100];
int b,s;
int main(){
	scanf("%d",&N);
	for(int i=0;i<N;i++){
		scanf("%d",&a[i]);
		b |= (a[i]&(-a[i]));
		s ^= a[i];
	}
	int ans = 0;
	for(int i=30;i>=0;i--){
		int a = ((s>>i)&1)^(ans&1);
		if(a==1){
			if((b>>i)&1){
				ans++;
			}else{
				cout << -1 << endl;
				return 0;
			}
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 640
#define _USE_MATH_DEFINES
 
#include <bits/stdc++.h> 

using namespace std;
 
#define len(x) (int)((x).size())
#define endl '\n'
#define x first
#define y second
#define int long long
#define double long double
#define all(a) (a).begin(), (a).end()
 
#ifdef LOCAL
    #define dbg(x) cout << #x << " = " << x << endl;
#else 
    #define dbg(x)
#endif 
 
void solve(); signed main() {
#ifdef LOCAL
    freopen("input.txt", "r", stdin);                                       
    freopen("output.txt", "w", stdout);
#endif
    srand(time(0));
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cout.setf(ios::fixed); cout.precision(10);
    solve();    
}

const int INF = 1e18, MAXN = 2e5 + 10, MOD = 1e9 + 7;
int fact[MAXN], rfact[MAXN], cnt[MAXN];

int c(int n, int k) {
	if (k > n) return 0;
	return ((fact[n] * rfact[n - k] % MOD) * rfact[k]) % MOD;
}

int bin_pow(int num, int n) {
	if (n == 0) {
		return 1;
	}

	if (n % 2 == 0) {
		int tmp = bin_pow(num, n / 2) % MOD;
		return tmp * tmp % MOD;
	}
	else {
		return num * bin_pow(num, n - 1) % MOD;
	}
}

void solve() {
	fact[0] = 1;
	rfact[0] = bin_pow(fact[0], MOD - 2);
	for (int i = 1; i < MAXN; ++i) {
		fact[i] = (fact[i - 1] * i) % MOD;
		rfact[i] = bin_pow(fact[i], MOD - 2);
	}

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

	int x;
	for (int i = 1; i <= n; ++i) {
		if (cnt[i] == 2) {
			x = i;
		}
	}

	vector<int> id;
	for (int i = 0; i < n + 1; ++i) {
		if (a[i] == x) {
			id.push_back(i);
		}
	}

	int dif = id[1] - id[0] + 1;
	dif = n + 1 - dif;
	for (int k = 1; k <= n + 1; ++k) {
		cout << (MOD + c(n + 1, k) - c(dif, k - 1)) % MOD << endl;
	}
}

Measured memory_bytes: 5888
#include<algorithm>
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#include<cstdio>
#include<iomanip>
#include<cmath>
using namespace std;

long long modinv(long long a, long long m) {
    long long b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}

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

long long getAns(long long A, string B) {
    
    long long b = 0;
    int keta = 1;
    bool underPoint = false;
    for (int i = 0; i < B.size(); i++) {
        if (B[i] == '.') {
            underPoint = true;
            continue;
        }
        
        if (underPoint == false) {
            b = B[i] - '0';
        } else {
            keta *= 10;
            b = 10 * b + B[i] - '0';
        }
    }
    A *= b;
    A /= keta;
    return A;
}

int main(){
//    cout << fixed << setprecision(10);
    long long A;
    string B;
    cin >> A >> B;
    cout << getAns(A, B);

    return 0;
}

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

int main(){
  int r;
  cin >> r;
  
  if(r < 1200) cout << "ABC" << endl;
  else if(r >= 1200 & r < 2800) cout << "ARC" << endl;
  else cout << "AGC" << endl;
  
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define fo(i,a,b) for(int i = a; i < b; i++)
#define pb push_back
typedef long long ll;
const int mod = 1e9+7;
void self_add(int &a, int b)
{
    a+=b;
    if(a >= mod) a-=mod;
}
int main()
{
    int n;
    cin >> n;
    int arr[n][n];
    fo(i,0,n) fo(j,0,n) cin >> arr[i][j];
    vector<int> dp(1<< n);
    dp[0] = 1;
    fo(i,0,(1<<n)-1)
    {
        int a = __builtin_popcount(i);
        fo(b,0,n)
        {
            if(arr[a][b] == 1 && !(i & 1<<b))
            {
                int m2 = i ^ (1 << b);
                self_add(dp[m2], dp[i]);
            }
        }
    }
    cout << dp[(1<<n)-1] << endl;

}


Measured memory_bytes: 8448
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
int main(){
    string s, t;
    cin >> s >> t;
    int S = (int)s.size();
    int T = (int)t.size();
    int INF = 1e9;
    vector<vector<int>> dp(S + 1, vector<int>(T + 1, 0));
    for(int i = 1; i < S + 1; i++){
        for(int j = 1; j < T + 1; j++){
            if(s[i - 1] == t[j - 1]){
                int temp = dp[i][j];
                dp[i][j] = max(dp[i - 1][j - 1] + 1, max(dp[i - 1][j], dp[i][j - 1]));
            }
            else{
                dp[i][j] = max(dp[i - 1][j], dp[i][j - 1]);
            }
        }
    }
    int cnt = dp[S][T];
    vector<char> ans(cnt);
    int si = S, sj = T;
    int flag = 0;
    while(cnt > 0){
        if(s[si - 1] == t[sj - 1]){
            ans[cnt - 1] = s[si - 1];
            si--;
            sj--;
            cnt--;
        }
        else if(dp[si][sj] == dp[si - 1][sj]){
            si--;
        }
        else sj--;
    }
    for(int i = 0; i < dp[S][T];i++){
        cout << ans[i];
    }
    cout << endl;
}

Measured memory_bytes: 38636
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
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 kessido
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BRng10s solver = new BRng10s();
        int testCount = Integer.parseInt(in.next());
        for (int i = 1; i <= testCount; i++)
            solver.solve(i, in, out);
        out.close();
    }

    static class BRng10s {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            long a = in.NextLong();
            long b = in.NextLong();
            long c = in.NextLong();
            long d = in.NextLong();
            String YES = "Yes";
            String NO = "No";
            boolean can = true;
            if (a < b) {
                can = false;
            } else if (d < b) {
                can = false;
            } else {
                d %= b;
                if (c + 1 < b) {
                    a %= b;
                    if (a >= c + 1) can = false;
                    else {
                        if (d != 0) {
                            a += ((b - 1 - a) / d) * d;
                            if (a >= c + 1) can = false;
                            else {
                                long x = MathExtensions.gcd(b, d);
                                a += ((b - 1 - a) / x) * x;
                                if (a >= c + 1) can = false;
                            }
                        }
                    }
                }
            }
            if (can) {
                out.println(YES);
            } else out.println(NO);
        }

    }

    static class MathExtensions {
        public static long gcd(final long a, final long b) {
            if (a == 0)
                return b;
            return gcd(b % a, a);
        }

    }

    static class InputReader {
        BufferedReader reader;
        StringTokenizer tokenizer;

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

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

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

    }
}



Measured memory_bytes: 21972
#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using vs = vector<string>;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
typedef long long ll;
typedef pair<int, int> P;
const ll INF = 1e9 + 7;
const int MAX_N = 2e5, MAX_M = 1e5, MAX_K = 1e9;

//qsortでの比較用の関数 cmp
//qsort(配列名,要素数,sizeof(要素型),cmp)
int cmp(const void *p, const void *q) {
	return *(int*)p - *(int*)q;
}

int  a,b;
void solve() {
	if (a >= b) {
		rep(i, a) cout << b;
		cout << endl;
	}
	else {
		rep(i, b) cout << a;
		cout << endl;
	}
}	
int main() {
	cin >> a >> b;
	solve();
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <string>
#include <algorithm>
#include <string.h>
#include <ctype.h>
#include <math.h>
#include <float.h>
#include <iomanip>
#include <iostream>
using namespace std;
 
int main(){

    int N,K,p[200010]={},b[1010]={},s;
    long long sum[1010]={};

    double v[200010]={},ans=0,temp=0;

    cin >> N >> K;
    for(int i=0;i<N;i++)
    {
        cin >> p[i];
        b[p[i]]+=1;
    }

    for(int i=1;i<=1000;i++)
    {
        double tempv = 0;
        if(b[i]>=1)
        {
            for(int j=1;j<=i;j++)
            {
                sum[i] +=j;
            }
            tempv = (double)sum[i] / (double)i;

            for(int k=0;k<N;k++)
            {
                if(p[k]==i)
                {
                    v[k] = tempv;
                }
            }
        }
    }

    for(int i=0;i<K;i++)
    {
        ans += v[i];
    }

    s = 0;

    temp=ans;

    for(int i=K;i<N;i++)
    {
        temp -=v[i-K];
        temp +=v[i];
        if(temp>ans)
        {
            ans = temp;
        }
    }
    cout<<setprecision(10)<<fixed;
    cout<<ans<<endl;

}


Measured memory_bytes: 2688
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define pf push_front
#define pob pop_back
#define pof pop_front
#define scn(n) scanf("%d",&n)
#define scnll(n) scanf("%lld",&n)
#define nl printf("\n")
#define YES printf("YES\n")
#define Yes printf("Yes\n")
#define yes printf("yes\n")
#define NO printf("NO\n")
#define No printf("No\n")
#define no printf("no\n")
using namespace std;
int main(){
    int n;scn(n);
    int h[n+1],dp[n+1];
    for(int i=1;i<=n;i++) scn(h[i]);
    dp[n]=0;
    dp[n-1]=abs(h[n-1]-h[n]);
    for(int i=n-2;i>0;i--){
        dp[i]=min(dp[i+1]+abs(h[i]-h[i+1]),dp[i+2]+abs(h[i]-h[i+2]));
    }
    printf("%d\n",dp[1]);
}


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

ll gcd(ll a, ll b) { return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) { return a/gcd(a,b)*b;}

int main(){
    ll n , k;
    cin >> n >> k;

    ll a = n % k;
    ll b = k - a;
    cout << min(a,b) << endl;
    return 0;
}  


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using str = string;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<vs> vvs;
typedef vector<vc> vvc;
typedef vector<vb> vvb;
using P = pair<ll,ll>;
#define REP(i, n) for (ll i = 0; i < (int)(n); i++)
#define RREP(i, n) for (ll i = (int)(n)-1; i > -1 ; i--)
#define IN(T, x) T x;cin >> x;
#define AIN(T, a, n) vector<T> a(n);REP(i, n){cin >> a[i];}
#define A2IN(T1, a, T2, b, n) vector<T1> a(n);vector<T2> b(n);REP(i, n){cin >> a[i] >> b[i];}
#define ALL(a) (a).begin(),(a).end()
#define SORT(a) sort(ALL(a))
#define RSORT(a) SORT(a);reverse(ALL(a))
#define pb push_back
#define mp make_pair
#define PF first
#define PS second
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<typename A, size_t N, typename T>void Fill(A (&array)[N], const T &val){fill( (T*)array, (T*)(array+N), val );}
#define OUT(x) cout << x << endl
#define BOUT(b) if(b){OUT("Yes");}else{OUT("No");}
const ll MOD = 100000007;
const ll INF = 10e9;
#define PI 3.14159265369;
ll dx[4] = {1,-1,0,0};
ll dy[4] = {0,0,1,-1};
ll ddx[8] = {1,1,1,-1,-1,-1,0,0};
ll ddy[8] = {0,1,-1,0,1,-1,1,-1};


int main() {
  IN(ll,N);
  AIN(ll, A, N);
  ll sum = 0;
  REP(i,N){
    for(ll j = i+1; j < N; j++){
      sum += A[i]*A[j];
    }
  }
  OUT(sum);
}



Measured memory_bytes: 256
// Problem : B - Palindrome-philia
// Contest : AtCoder Beginner Contest 147
// URL : https://atcoder.jp/contests/abc147/tasks/abc147_b
// Memory Limit : 1024.000000 MB 
// Time Limit : 2000.000000 milisec 
// Powered by CP Editor (https://github.com/coder3101/cp-editor)

// writer: w33z8kqrqk8zzzx33
#include <bits/stdc++.h>
using namespace std;
 
#define iter(i, a, b) for(int i=(a); i<(b); i++)
#define rep(i, a) iter(i, 0, a)
#define rep1(i, a) iter(i, 1, (a)+1)
#define log(a) cerr<<"\033[32m[DEBUG] "<<#a<<'='<<(a)<<" @ line "<<__LINE__<<"\033[0m"<<endl
#define all(a) a.begin(), a.end()
#define fi first
#define se second
#define pb push_back
#define mp make_pair
 
using ll=long long;
using pii=pair<int, int>;
//#define int ll
const int MOD = 1000000007;

signed main() {
    ios_base::sync_with_stdio(false); cin.tie(0);
    string s; cin >> s;
    int n = s.size(), ans = 0;
    iter(i, (n+1)/2, n)
        if(s[i] != s[n-1-i]) ans++;
    cout << ans << endl;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int s[10],ans=0,mini;
int main()
{
    int n=110;
    for(int i=0;i<5;i++)
    {
        cin>>s[i];
        if(n>s[i]%10&&s[i]%10!=0)
        {
            mini=i;
            n=s[i]%10;
        }
    }
    for(int i=0;i<5;i++)
    {
        if(mini==i)
            ans=ans+s[i];
        else
        {
            if(s[i]%10==0)
                ans=s[i]+ans;
            else
                ans=ans+((s[i]/10)+1)*10;
        }
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 256
package main

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

const (
	initialBufSize = 100000
	maxBufSize     = 10000000
)

var (
	sc = bufio.NewScanner(os.Stdin)
	wt = bufio.NewWriter(os.Stdout)
)

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

func nextInt() int {
	i, _ := strconv.Atoi(next())
	return i
}

func puts(a ...interface{}) {
	fmt.Fprintln(wt, a...)
}

func max(nums ...int) int {
	ret := nums[0]
	for _, v := range nums {
		if v > ret {
			ret = v
		}
	}
	return ret
}

type Food struct {
	a, b int
}

type Foods []Food

func (a Foods) Len() int      { return len(a) }
func (a Foods) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
func (a Foods) Less(i, j int) bool {
	return a[i].a < a[j].a
}

func main() {
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, initialBufSize), maxBufSize)
	defer wt.Flush()

	n, t := nextInt(), nextInt()
	foods := make(Foods, n)
	for i := 0; i < n; i++ {
		a, b := nextInt(), nextInt()
		foods[i] = Food{a, b}
	}
	sort.Sort(foods)

	// dp[i+1][j]: 料理iを時刻jに食べ終わるときの満足度の最大値
	dp := make([][10001]int, n+1)
	for i := 0; i < n; i++ {
		for j := 1; j <= 10000; j++ {
			// j-foods[i].a: 料理iを注文して食べ始める時間
			if 0 <= j-foods[i].a && j-foods[i].a < t {
				dp[i+1][j] = max(dp[i][j], dp[i][j-foods[i].a]+foods[i].b)
			} else {
				dp[i+1][j] = dp[i][j]
			}
		}
	}

	ans := 0
	for i := range dp[n] {
		ans = max(ans, dp[n][i])
	}
	puts(ans)
}


Measured memory_bytes: 243932
#include <stdio.h>
#include <stdlib.h>

struct node
{
    int ele;
    struct node *next;
};

struct stack
{
    struct node *top;
};

typedef struct node * Node;
typedef struct stack * Stack;

void initialize(Stack *);
void push(Stack, int);
void top(Stack);
void pop(Stack);

int main(void)
{
    int n, q, i;
    int cmd, idx, val;

    scanf("%d %d", &n, &q);

    Stack *list = (Stack *) malloc(sizeof(Stack *) * n);
    for (i = 0; i < n; i++)
        initialize(list + i);
    
    for (i = 0; i < q; i++) {
        scanf("%d %d", &cmd, &idx);
        if (cmd == 0) {
            scanf("%d", &val);
            push(list[idx], val);
        } else if (cmd == 1) {
            top(list[idx]);
        } else if (cmd == 2) {
            pop(list[idx]);
        }
    }

    return 0;
}

void initialize(Stack *s)
{
    (*s) = (Stack) malloc(sizeof(struct stack));
    (*s)->top = NULL;
}

void push(Stack s, int x)
{
    Node tmp = (Node) malloc(sizeof(struct node));
    tmp->ele = x;
    tmp->next = s->top;
    s->top = tmp;
}

void top(Stack s)
{
    if (s->top)
        printf("%d\n", s->top->ele);
}

void pop(Stack s)
{
    if (s->top) {
        Node tmp = s->top;
        s->top = s->top->next;
        free(tmp);
    }
}


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

int main(){
  int n,A[N],i,j,v,k;

  scanf("%d",&n);
  if(n>1000) exit(1);
  for(i=0; i<n; i++) scanf("%d",&A[i]);

  for(k=0; k<n-1; k++) printf("%d ",A[k]);
  printf("%d\n",A[n-1]);

  for(i=1; i<n; i++){
    v = A[i];
    j = i-1;
    while(j >= 0 && A[j] > v){
      A[j+1] = A[j];
      j--;
    }
    A[j+1] = v;
    for(k=0; k<n-1; k++) printf("%d ",A[k]);
    printf("%d",A[n-1]);
    printf("\n");

  }

  return 0;
}


Measured memory_bytes: 2108
import math
X = int(input())
def get_primenumber(number):
    prime_list = []
    #2からnumberまでの数字をsearch_listに入れる
    search_list = list(range(2,number+1))
    while True:
      #search_listの先頭の値が√nの値を超えたら処理終了
      if search_list[0] > math.sqrt(number):
        #prime_listにsearch_listを結合
        prime_list.extend(search_list)
        break
      else:
        #search_listの先頭をprime_listに入れる
        head_num = search_list[0]
        prime_list.append(head_num)
        #search_listの先頭をpopする
        search_list.pop(0)
        #head_numの倍数を取り除く
        search_list = [num for num in search_list if num % head_num != 0]
    return prime_list
l = get_primenumber(10**6)
for i in range(X,10**6):
  if i in l:
    print(i)
    break

Measured memory_bytes: 47536
#include <bits/stdc++.h>
typedef long long int LL;
typedef unsigned long long int ULL;
using namespace std;

// 插入此處

int main() {
    std::ios::sync_with_stdio(false);
    cin.tie(0);
    int H, W, K;
    cin >> H >> W >> K;
    vector<string> m(H, "");
    for (int i = 0; i < H; ++i) {
        cin >> m[i];
    }
    int ans = 0;
    for (int i = 0; i < (1<<H); ++i) {
        for (int j = 0; j < (1<<W); ++j) {
            int cnt = 0;
            for (int k = 0; k < H; ++k) {
                for (int l = 0; l < W; ++l) {
                    if ((i&(1<<k))==0 && (j&(1<<l))==0) {
                        if (m[k][l]=='#')  ++cnt;
                    }
                }
            }
            // cout << "i " << i << " j " << j << " cnt " << cnt << endl;
            if (cnt == K)  ++ans;
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3648
#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <cmath>

int compute_cost(const std::vector<int> &arr, const int v)
{
    int cost = 0;
    std::for_each(arr.begin(), arr.end(), [&](const int a) {
        cost += (v - a) * (v - a);
    });
    return cost;
}

int main()
{
    int n;
    std::cin >> n;
    std::vector<int> arr;
    arr.reserve(n);
    for (int i = 0; i < n; ++i)
    {
        int tmp;
        std::cin >> tmp;
        arr.push_back(tmp);
    }

    const int sum = std::accumulate(arr.begin(), arr.end(), 0);
    const double mean = sum / static_cast<double>(n);

    const int cost1 = compute_cost(arr, static_cast<int>(std::floor(mean)));
    const int cost2 = compute_cost(arr, static_cast<int>(std::ceil(mean)));

    std::cout << std::min(cost1, cost2) << std::endl;
    return 0;
}


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

void solve() {
	int x[5], y[5], ans = -1;
	for (int i = 0; i < 5; ++i) {
		x[i] = i + 1;
		cin >> y[i];
		ans = (x[i] == y[i]) ? ans : i + 1;
	}
	cout << ans << endl;
}

int main() {
	solve();
	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 erep(i,n) for(int i = 0;i<=n;i++)
#define rep1(i,n) for(int i = 1;i<n;i++)
#define erep1(i,n) for(int i = 1;i<=n;i++)
typedef long long ll;
#define vint vector<int>
#define vvint vector<vector<int>>
#define vstring vector<string>
#define vdouble vector<double>
#define vll vector<ll>:
#define vbool vector<bool>
#define INF 1101010101010101010
#define MOD 1000000007
#define int long long
using P = pair<int,int>;

signed main(){
  const double PI = acos(-1);
  int a;
  cin >> a;
  cout << a*2*PI << endl;
}

Measured memory_bytes: 3788
#include <iostream>
#include <iomanip>
#include <stdio.h>
#include <set>
#include <vector>
#include <map>
#include <cmath>
#include <algorithm>
#include <memory.h>
#include <string>
#include <sstream>
#include <cstdlib>
#include <ctime>
#include <cassert>

using namespace std;

typedef long long LL;
typedef pair<int,int> PII;

#define MP make_pair
#define PB push_back
#define FF first
#define SS second

#define FORN(i, n) for (int i = 0; i <  (int)(n); i++)
#define FOR1(i, n) for (int i = 1; i <= (int)(n); i++)
#define FORD(i, n) for (int i = (int)(n) - 1; i >= 0; i--)

#define DEBUG(X) { cout << #X << " = " << (X) << endl; }
#define PR0(A,n) { cout << #A << " = "; FORN(_,n) cout << A[_] << ' '; cout << endl; }

#define MOD 1000000007
#define INF 2000000000

int GLL(LL& x) {
    return scanf("%lld", &x);
}

int GI(int& x) {
    return scanf("%d", &x);
}

const int MAXN = 100010;
int cnt[MAXN], pos[MAXN];

int n, m, x, y;

int main() {
    GI(n); GI(m);

    FOR1(i, n) cnt[i] = 1;
    pos[1] = 1;

    while (m--) {
        GI(x); GI(y);

        cnt[x]--;
        cnt[y]++;

        if (pos[x] == 1) {
            if (cnt[x] == 0) {
                pos[x] = 0;
                pos[y] = 1;
            }
            else {
                pos[y] = 1;
            }
        }
    }

    int res = 0;
    FOR1(i, n) res += pos[i];
    printf("%d\n", res);
    
    return 0;
}


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

using namespace std;

#define YES cout << "YES" << endl;
#define NO  cout << "NO"  << endl;
#define Yes cout << "Yes" << endl;
#define No  cout << "No"  << endl;
 
#define INF INT_MAX
#define MOD 1000000007
#define PI  acos(-1)

using ll  = long long;
using ull = unsigned long long;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;

#define rep(i, n) for (ll i = 0; i < (n); i++)
#define rrep(i, n) for (ll i = (n)-1; i >= 0; i--)

int main(int argc, char *argv[])
{
    cin.tie(0);
    ios::sync_with_stdio(false);

    ll N;
    cin >> N;

    vector<ll> A(N);
    rep (i, N) {
        cin >> A[i];
    }

    map<ll, ll> m;
    rep (i, N) {
        m[A[i]]++;
    }

    ll ans = 1;
    if (N%2) {
        if (m[0] != 1) {
            cout << 0 << endl;
            return 0;
        }
        rep (i, N/2-1) {
            if (m[(i+1)*2] != 2) {
                cout << 0 << endl;
                return 0;
            }
        }
    } else {
        rep (i, N/2) {
            if (m[2*i+1] != 2) {
                cout << 0 << endl;
                return 0;
            }
        }
    }

    rep (i, N/2) {
        ans *= 2;
        ans %= MOD;
    }

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

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

//--------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define LL long long
#define INF INT_MAX/3

//--------------------------------------------
const double EPS = 1e-14;
const double PI  = acos(-1.0);

//--------------------------------------------

int main(){
  int n,k,x,y;
  scanf("%d %d %d %d",&n,&k,&x,&y);

  int sum = 0;
  REP (i, n) {    
    if (i < k) sum += x;
    else sum += y;
  }

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


Measured memory_bytes: 256
N=int(input())
W=list(map(int,input().split()))
S1=0
S2=sum(W)
#print(S1)
#print(S2)
#print(W)
n=float("inf")
for i in range(N-1):
    S1=S1+W[i]
    S2=S2-W[i]
    n=min(n,abs(S1-S2))
print(n)


Measured memory_bytes: 3060
import Control.Monad

main :: IO ()
main = do
  [n,m,c] <- map read . words <$> getLine
  bs <- map read . words <$> getLine
  ds <- replicateM n getLine
  print $ length $ filter (>0) $ map (f c bs) $ map (map read) $ map words ds

f :: Int -> [Int] -> [Int] -> Int
f c bs ds = sum (zipWith (*) bs ds) + c

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

typedef long long ll;

ll gcd(ll x, ll y) {
    if (y == 0) return x;
    return gcd(y, x % y);
}

int main() {
    int N;
    cin >> N;
    vector<int> A(N);
    map<int, int> mp;
    rep(i, N) cin >> A[i];
    rep(i, 2) {
        for (int j = 1; j * j <= A[i]; j++) {
            if (A[i] % j == 0) {
                mp[j]++;
                mp[A[i] / j]++;
            }
        }
    }
    //for (auto i : mp) cout << i.first << " " << i.second << endl;
    for (int i = 2; i < N; i++) {
        for (auto j : mp) {
            if (A[i] % j.first == 0) {
                mp[j.first]++;
            }
        }
    }
    int ans = 1, b = 1;
    for (auto i : mp) {
        if (i.second == N) ans = max(ans, i.first);
        if (i.second == N - 1) ans = max(ans, i.first);
    }
    cout << ans << endl;
    //for (auto i : mp) cout << i.first << " " << i.second << endl;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
#define BIT(n) (1LL << (n))
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPB(i, n) for (int i = 0; i < BIT(n); i++)
#define REPS(i, x) for (int i = 1; i <= (int)(x); i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define FORA(i, n) for (auto &&i : n)
#define FORS(i, m, n) for (int i = m; i <= n; i++)
#define INF 2e9
#define MOD (1000000007)
#define EPS 1e-9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
typedef long long int lli;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int AB, BC, CA;
  cin >> AB >> BC >> CA;
  cout << AB * BC / 2 << "\n";
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <cmath>
using namespace std;
int main(){
  int N,K,ans=1000000000;
  cin>>N>>K;
  int h[N];
  for(int i=0;i<N;i++) cin>>h[i];
  sort(h,h+N);
  for(int i=K-1;i<N;i++){
    ans=min(ans,h[i]-h[i-(K-1)]);
  }
  cout<<ans<<endl;
}

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

#define fo(i,a,b) for(int i=a;i<=b;i++)
#define fd(i,a,b) for(int i=a;i>=b;i--)

using namespace std;

typedef long long LL;
typedef double db;

int get(){
	char ch;
	while(ch=getchar(),(ch<'0'||ch>'9')&&ch!='-');
	if (ch=='-'){
		int s=0;
		while(ch=getchar(),ch>='0'&&ch<='9')s=s*10+ch-'0';
		return -s;
	}
	int s=ch-'0';
	while(ch=getchar(),ch>='0'&&ch<='9')s=s*10+ch-'0';
	return s;
}

const int N = 50005;
const int M = 2e6+5;

int n,m,q,Mod;
struct edge{
	int x,c,nxt;
}e[N*2];
int h[N],tot;

void inse(int x,int y,int c){e[++tot].x=y;e[tot].c=c;e[tot].nxt=h[x];h[x]=tot;}

vector<int>t0,t1,t2;
int dis[N],que[N];
int val[N];
LL ny[M],mi[M];

void bfs(){
	int he=0,ta=1;
	que[1]=1;
	fo(i,1,n)val[i]=dis[i]=-1;
	val[1]=dis[1]=0;
	for(;he<ta;){
		int x=que[++he];
		for(int p=h[x];p;p=e[p].nxt)
			if (dis[e[p].x]==-1){
				dis[e[p].x]=dis[x]+1;
				val[e[p].x]=(val[x]*2+e[p].c)%Mod;
				que[++ta]=e[p].x;
			}
	}
}

void add(int k1,int b1,int k2,int b2,int c){
	//if (k1<k2)swap(k1,k2),swap(b1,b2);
	int d=k1+1-k2;
	LL v=ny[k2]*(b1*2+c+Mod-b2)%Mod;
	if (d==0)t0.push_back(v);
	if (d==1)t1.push_back(v);
	if (d==2)t2.push_back(v);
}

int fa[M];

int getfather(int x){return fa[x]==x?x:fa[x]=getfather(fa[x]);}

int gcd(int x,int y){return !y?x:gcd(y,x%y);}

void merge(int x,int y){
	int fx=getfather(x),fy=getfather(y);
	fa[fx]=fy;
}

int d[M],u;
int d1[M],d2[M];
int divi[M],k;
int lst[M],pri[M];
bool bz[M],used[M];

void solve(){
	ny[0]=1;
	ny[1]=(Mod+1)/2;
	fo(i,2,Mod*2)ny[i]=ny[i-1]*ny[1]%Mod;
	mi[0]=1,mi[1]=2;
	fo(i,2,Mod*2)mi[i]=mi[i-1]*2%Mod;
	fo(x,1,n)
		for(int p=h[x];p;p=e[p].nxt){
			int y=e[p].x;
			add(dis[x],val[x],dis[y],val[y],e[p].c);
		}
	fo(i,0,Mod-1)fa[i]=i;
	/*
	printf("t0\n");
	for(auto u:t0)printf("%d ",u);putchar('\n');
	printf("t1\n");
	for(auto u:t1)printf("%d ",u);putchar('\n');
	printf("t2\n");
	for(auto u:t2)printf("%d ",u);putchar('\n');
	*/
	//0
	int g=Mod;
	for(auto u:t0)g=gcd(g,u);
	fo(i,0,Mod-1)merge(i,(i+g)%Mod);
	//1
	if (t1.begin()!=t1.end()){
		int v=t1.back();
		int g=Mod;
		for(auto u:t1)g=gcd(g,abs(u-v));
		fo(x,0,Mod-1)used[x]=0;
		fo(x,0,Mod-1)
		if(!used[x]){
			int g0=g;
			for(int st=x;!used[st];st=(st*2+v)%Mod)
				for(int y=st;!used[y];y=(y+g)%Mod){
					used[y]=1;
					merge(x,y);
				}
		}
	}
	//2
	if (t2.begin()!=t2.end()){
		int v=t2.back();
		int g=Mod;
		for(auto u:t2)g=gcd(g,abs(u-v));
		fo(x,0,Mod-1)used[x]=0;
		fo(x,0,Mod-1)
		if(!used[x]){
			int g0=g;
			for(int st=x;!used[st];st=(st*4+v)%Mod)
				for(int y=st;!used[y];y=(y+g)%Mod){
					used[y]=1;
					merge(x,y);
				}
		}
	}
}

int main(){
	n=get();m=get();q=get();Mod=get();
	fo(i,1,m){
		int x=get(),y=get(),c=get();
		inse(x,y,c);
		inse(y,x,c);
	}
	bfs();
	solve();
	//fo(i,0,Mod-1)if (getfather(i)==getfather(0))printf("%d ",i);putchar('\n');
	fo(cas,1,q){
		int x=get(),y=get(),r=get();
		int u=ny[dis[x]]*(r+Mod-val[x])%Mod;
		int v=ny[dis[y]]*(Mod-val[y])%Mod;
		int fu=getfather(u),fv=getfather(v);
		printf("%s\n",fu==fv?"YES":"NO");
	}
	return 0;
}

Measured memory_bytes: 57892
H,W=gets.chomp.split.map(&:to_i)
N=gets.to_i
a=gets.chomp.split.map(&:to_i)
g=Array.new(H,0).map{Array.new(W,0)}
p=0
a.each_with_index do |v,i|
  while(v>0)
    g[p / W][p % W]=i+1
    v-=1
    p+=1
  end
end

g.each_with_index do |v,i|
  if i.even?
    puts v.join(" ")
  else
    puts v.reverse.join(" ")
  end
end

Measured memory_bytes: 2428
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

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

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };
    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };
    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };
    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };
    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        a: i32,
        b: i32,
        c: i32,
    }
    if a == b {
        println!("{}", c);
    } else if a == c {
        println!("{}", b);
    } else {
        println!("{}", a);
    }
}


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

#define rep(i, n) for(int (i) = 0; i < (n); ++(i))

using ll = long long int;
const ll MOD = 1e9 + 7;

int main() {
  int N, M;
  std::cin >> N >> M;
  std::vector<int> s(M), c(M);
  rep(i, M) {
    std::cin >> s[i] >> c[i];
    --s[i];
  }

  std::vector<int> ans(N, -1);
  rep(i, M) {
    if(ans[s[i]] > 0 && ans[s[i]] != c[i]) {
      std::cout << -1 << '\n';
      return 0;
    }
    ans[s[i]] = c[i];
  }

  if(N == 1) {
    std::cout << std::max(0, ans[0]) << '\n';
    return 0;
  }

  if(ans[0] == 0) {
    std::cout << -1 << '\n';
    return 0;
  }

  if(ans[0] < 0) {
    ans[0] = 1;
  }
  rep(i, N) {
    std::cout << std::max(0, ans[i]);
  }
  std::cout << "" << '\n';
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long ll;

ll n,a,b,h[100001],t;

int main(void){
    cin>>n>>a>>b;
    ll l=0, r=(ll)1e9,m,sub,tm;
    for(int i=0;i<n;i++){
        cin>>t;
        h[i]=t;
    }
    while(r-l>1){
        m=l+(r-l)/2;
        tm=m;
        for(int i=0;i<n;i++){
            if(h[i]-tm*b<0)continue;
            sub=(h[i]-tm*b)/(a-b);
            if((h[i]-tm*b)%(a-b))m-=sub+1;
            else m-=sub;
        }
        if(m<0)l=tm;
        else r=tm;
    }
    cout<<r<<endl;
    return 0;
}


Measured memory_bytes: 1024
# coding: utf-8
import time
import re
import math

def main():
    n=int(input())
    s=input()
    x=0
    mx=0
    for a in s:
        if(a=='I'):x+=1
        elif(a=='D'):x-=1

        mx=max([mx,x])
    print(mx)
main()

Measured memory_bytes: 3184
N = int(input())
W = [input() for _ in range(N)]

def puts(s): # 個人的にこのほうが解りやすいので。。。
    print(s)

ans = 'Yes'

for i in range(N - 1):
    if W[i][-1] != W[i + 1][0]:
        ans = 'No'
        break

W.sort()

for i in range(N - 1):
    if W[i] == W[i + 1]:
        ans = 'No'
        break

puts(ans)

Measured memory_bytes: 3064
#include <stdio.h>

int main(void){
    int i,n,sv,ans[200001] = {0};

    scanf("%d",&n);
    for(i=0; i<n-1; i++){
        scanf("%d",&sv);
        ans[sv]++;
    }

    for(i=1;i<=n;i++){
        printf("%d\n",ans[i]);
    }
    return 0;
}

Measured memory_bytes: 2488
//To debug :  g++ -g file.cpp -o code
//to flush output : fflush(stdout) or cout.flush()
//cout<<setprecision(p)<<fixed<<var
//use 1LL<<i to for 64 bit shifting , (ll)2 because by default 2 is ll
 
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,a,n) for(i=a;i<n;++i)
#define irep(i,n,a) for(i=n;i>a;--i)
#define mod 1000000007
#define pb push_back
#define big 9223372036854775807
#define big1 LONG_MAX
#define big2 ll_MAX
#define big3 1000000000
#define sma1 LONG_MIN
#define sma2 ll_MIN
#define sma3 -1000000000
#define mp make_pair
#define dub double
#define ivec vector<ll>
#define lvec vector<long long>
#define cvec vector<char>
#define svec vector<string>
#define mt make_tuple
#define MOD 998244353
#define ld long double
#define pi acos(-1.0)

#define SZ(x)  (ll)(x.size())
/*
#define ss second.second
#define ff first.first
#define f first
#define s second
#define sf second.first
#define fs first.second*/
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)

int main()
{

    ll n,i,sum1=0,sum2=0;

    cin>>n;

    ll a[n+1],ans[n+1];

    for(i=1;i<=n;++i)
    {
        cin>>a[i];

        if(i!=1)
            sum1^=a[i];

        if(i!=n)
            sum2^=a[i];

    }

    ans[1] = sum1 , ans[n]=sum2;

    for(i=2;i<=(n-1);++i)
        ans[i] = ans[i-1]^(a[i-1]^a[i]);


    for(i=1;i<=n;++i)
        cout<<ans[i]<<" ";




    return 0;
}

Measured memory_bytes: 6680
#include <bits/stdc++.h>
//----***やべーやつら***----
using namespace std;
#define int long long

//----***型定義***----
using ll = long long;
using P = pair<int,int>;

//----***Like a Pythonista***----
#define REP(ii,jj,nn) for (ll ii=jj;ii<(nn);ii++)
#define RREP(ii,nn,jj) for (ll ii = nn; jj<ii;ii--)
#define each(i,...) for (auto&& i:__VA_ARGS__)
#define ALL(vec) (vec).begin(),(vec).end()
#define sum(...) accumulate(ALL(__VA_ARGS__),0LL)
#define dsum(...) accumulate(ALL(__VA_ARGS__),0.0)
#define vec(type,name,...) vector<type> name(__VA_ARGS__)
template<class T> inline auto max(const T& a){ return *max_element(ALL(a)); }
template<class T> inline auto min(const T& a){ return *min_element(ALL(a)); }
inline ll gcd(ll a,ll b){if(b == 0) return a;return  gcd(b,a%b);}
inline ll lcm(ll a,ll b){ll g = gcd(a,b);return a / g * b;}

//----***定数***----
#define MOD 1000000007
#define INF 100000000000000000
#define EPS 1e-9
#define PI  acos(-1)
const vector<vector<int>> DXY={{-1,0},{1,0},{0,-1},{0,1}};

//----***パーツ***----
#define fi first
#define se second
#define pb push_back
#define re return
#define br break

//----***入出力***---
void print() { std::cout << "\n"; }
template <class T>void print(const T &x) {std::cout << x<<"\n";}
template <class T, class... Args>void print(const T &x, const Args &... args) {std::cout << x << " ";print(args...);}
#define debug(var)  do{std::cerr << #var << " ↓ "<<"\n";view(var);}while(0);
#define dbg cerr<<"🥺🥺🥺🥺🥺🥺"<<endl;
template<typename T> void view(T e){std::cout << e << std::endl;}
template<typename T> void view(const std::vector<T>& v){for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void view(const std::vector<std::vector<T> >& vv){ for(const auto& v : vv){ view(v); } }

//----***初期時読み込み***----
struct initial{initial(){cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(15);};}initial_;


signed main(){
  vector<int> arr(3);cin>>arr[0]>>arr[1]>>arr[2];
  int ans=abs(((arr[0])/2)*arr[1]*arr[2]-((arr[0]+1)/2)*arr[1]*arr[2]);
  ans=min(ans,abs(((arr[1])/2)*arr[2]*arr[0]-((arr[1]+1)/2)*arr[2]*arr[0]));
  ans=min(ans,abs(((arr[2])/2)*arr[1]*arr[0]-((arr[2]+1)/2)*arr[1]*arr[0]));

  print(ans);



}


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

#define mp make_pair
#define pb push_back

#define int long long
#define ld long double

const int MOD = 1e9+7;
const int N = 1e6+5;

/*
    (n+1)*x = 360

*/

int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int n;
    cin>>n;
    
    if(360%n==0) {
        cout<<360/n;
    }
    else {
        int lol = __gcd(360LL, n);
        cout<<360/lol;
    }

    return 0;
}

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

int main(void){
	int N;
	cin >> N;
	int a[N];
	int c[N];
	int cc[3] = {};
	for(int i = 0; i < N; i++){
		cin >> a[i];
		if(a[i] % 4 == 0){
			cc[2]++;
		}else if(a[i] % 2 == 0){
			cc[1]++;
		}else{
			cc[0]++;
		}
	}
	if(N % 2 == 0){
		if(cc[2]*2 + cc[1] >= N){
			cout << "Yes" << endl;
		}else{
			cout << "No" << endl;
		}
	}else{
		if(cc[2]*2 + cc[1] + 1 >= N){
			cout << "Yes" << endl;
		}else{
			cout << "No" << endl;
		}
	}

	return 0;
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
int main(){
int g[13]={0,1,3,1,2,1,2,1,1,2,1,2,1};
int x,y;
cin>>x>>y;
cout<<(g[x]==g[y]?"Yes":"No")<<endl;
return 0;
}

Measured memory_bytes: 256
var
        s,s1,s2:ansistring;
        i,l:longint;
begin
        readln(s);
        s2:=s;
        l:=length(s);
        for i:=1 to l do begin
                if s[i]='b' then begin
                        s[i]:='d';
                        continue;
                end;
                if s[i]='d' then begin
                        s[i]:='b';
                        continue;
                end;
                if s[i]='p' then begin
                        s[i]:='q';
                        continue;
                end;
                if s[i]='q' then begin
                        s[i]:='p';
                        continue;
                end;
        end;
        for i:=l downto 1 do s1:=s1+s[i];
        if s1=s2 then writeln('Yes') else writeln('No');
end.

Measured memory_bytes: 640
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {

    FastScanner in;
    PrintWriter out;

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

    void solve() {
        int N = in.nextInt();
        int A = in.nextInt();
        int B = in.nextInt();
        out.println(Math.min(N * A, B));
    }


    void run() {
        in = new FastScanner();
        out = new PrintWriter(System.out);
        solve();
        out.close();
    }

    public class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public FastScanner(String s) {
            try {
                br = new BufferedReader(new FileReader(s));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

        public String nextToken() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                }
            }
            return st.nextToken();
        }

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

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

        public double nextDouble() {
            return Double.parseDouble(nextToken());
        }
    }

}

Measured memory_bytes: 21332
fn main() {
    let (n, k) = read_tuple::<usize>();
    let positions: Vec<i64> = read_vec();

    let mut min_dist = i64::max_value();
    for i in 0..(n-k+1) {
        let (left, right) = (positions[i], positions[i+k-1]);
        let (near, far) = if left.abs() < right.abs() {
            (left.abs(), right.abs())
        } else {
            (right.abs(), left.abs())
        };
        let tmp_dist = if left * right < 0 {
            near * 2 + far
        } else {
            far
        };

        if tmp_dist < min_dist {
            min_dist = tmp_dist;
        }
    }

    println!("{:?}", min_dist);
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().split_whitespace()
        .map(|e| e.parse().ok().unwrap()).collect()
}
fn read_tuple<T: std::str::FromStr + Copy>() -> (T, T) {
    let temp = read_vec();
    (temp[0], temp[1])
}



Measured memory_bytes: 6396
#include <bits/stdc++.h>
using namespace std;
constexpr int MOD = 1e9 + 7;

int fact[202020];
int factinv[202020];

int modpow(int a, int n) {
    if (n == 0) return 1;
    if (n % 2 == 0) {
        int t = modpow(a, n / 2);
        return 1ll * t * t % MOD;
    }
    return 1ll * a * modpow(a, n - 1) % MOD;
}

void init() {
    fact[0] = 1;
    for (int i = 1; i < 202020; i++) {
        fact[i] = 1ll * fact[i - 1] * i % MOD;
    }
    factinv[202020 - 1] = modpow(fact[202020 - 1], MOD - 2);
    for (int i = 202020 - 2; i >= 0; i--) {
        factinv[i] = 1ll * factinv[i + 1] * (i + 1) % MOD;
    }
    assert(factinv[0] == 1);
}

int ncr(int n, int r) {
    return 1ll * fact[n] * factinv[r] % MOD * factinv[n - r] % MOD;
}

void add(int& a, int b) {
    a += b;
    if (a >= MOD) a -= MOD;
}

void sub(int& a, int b) {
    a -= b;
    if (a < 0) a += MOD;
}

int main() {
    init();
    int h, w, n;
    cin >> h >> w >> n;
    vector<pair<int, int>> bs;
    for (int i = 0; i < n; i++) {
        int a, b;
        cin >> a >> b;
        a--, b--;
        bs.emplace_back(a, b);
    }
    bs.emplace_back(0, 0);
    n++;
    sort(bs.begin(), bs.end());
    // dp[i][j]: i番目までj(偶奇)個通るときの場合の数
    int dp[3030][2] = {};
    dp[0][0] = 1;
    for (int i = 0; i < n; i++) {
        for (int k = 0; k < 2; k++) {
            for (int j = i + 1; j < n; j++) {
                if (bs[j].first >= bs[i].first && bs[j].second >= bs[i].second) {
                    add(dp[j][!k], 1ll * dp[i][k] * ncr(bs[j].first + bs[j].second - bs[i].first - bs[i].second, bs[j].first - bs[i].first) % MOD);
                }
            }   
        }
    }
    int ans = ncr(h + w - 2, h - 1);
    for (int i = 1; i < n; i++) {
        for (int k = 0; k < 2; k++) {
            if (k) {
                sub(ans, 1ll * dp[i][k] * ncr(h - 1 - bs[i].first + w - 1 - bs[i].second, h - 1 - bs[i].first) % MOD);
            } else {
                add(ans, 1ll * dp[i][k] * ncr(h - 1 - bs[i].first + w - 1 - bs[i].second, h - 1 - bs[i].first) % MOD);
            }
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 1920
#include <bits/stdc++.h>
#define oo 381654729
using namespace std;
int N,M,X,Ans=oo;
int A[15],C[15],Grid[15][15];

int main(){
	cin>>N>>M>>X;
	for(int i=1;i<=N;++i){
		cin>>C[i];
		for(int j=1;j<=M;++j){
			cin>>Grid[i][j];
		}
	}
	for(int i=0;i<(1<<N);++i){
		memset(A,0,sizeof(A));
		int Price=0;
		for(int j=0;j<N;++j){
			if(i&(1<<j)){
				Price+=C[j+1];
				for(int k=1;k<=M;++k){
					A[k]+=Grid[j+1][k];
				}
			}
		}
		bool Ok=1;
		for(int i=1;Ok&&i<=M;++i){
			if(A[i]<X) Ok=0;
		}
		if(Ok) Ans=min(Ans,Price);
	}	
	if(Ans!=oo) cout<<Ans<<endl;
	else cout<<"-1\n";
}

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

int main(){
  int K,A,B;
  cin >> K >> A >> B;
  bool a =false;
  
  for(int i=A;i<B+1;i++){
    if(i%K==0){
      a=true;
      break;
    }
  }
  if(a){
    cout << "OK" << endl;
  }
  else{
    cout << "NG" << endl;
  }
}

Measured memory_bytes: 3620
#include<stdio.h>
int main(){
	int a,b,c;
	char op;
	while(1){
		scanf("%d %c %d",&a,&op,&b);
		if(op=='+'){
			c=a+b;
			printf("%d\n",c);
		}
		if(op=='-'){
			c=a-b;
			printf("%d\n",c);
		}
		if(op=='*'){
			c=a*b;
			printf("%d\n",c);
		}
		if(op=='/'){
			c=a/b;
			printf("%d\n",c);
		}
		else if(op=='?'){
			break;
		}
	}
	return 0;
}						

Measured memory_bytes: 600
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define F first
#define S second
//-std=c++11
#define print(x) printf("%.12f",x);
#define sz(x) (int)x.size()
#define all(x) (x).begin(), (x).end()
#define Red ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define rep(i, n) for(int i =0 ; i < n; ++i)
#define repr(i, n) for(int i=n-1;i>=0;i--)
#define Rep(i,a,b) for(int i=a;i<=b;i++)
#define Repr(i,a,b) for(int i=a;i>=b;i--)
#define pii pair < int, int >
#define iter ::iterator
#define forit(a) for(it=a.begin();it!=a.end();it++)
typedef vector<int> vi;
typedef  long long ll;
const int inf = int(1e9);
const int mod = inf + 7;
const int N = (int)2e5 + 5;
void solve(){
	char c;
	cin>>c;
	cout<<char(+c+1);
}


int main(){
	Red;
	int t=1;
	//cin>>t;
	while(t--)
	solve();
	return 0;
}

Measured memory_bytes: 256
package main

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

func template(a []int64) int64 {
	x := int64(0)
	for b := uint(0); b < 40; b++ {
		c := int64(0)
		for _, ai := range a {
			c += (ai & (int64(1) << b)) >> b
		}
		if c < int64(len(a))-c {
			x = x | (int64(1) << b)
		}
	}
	return x
}
func score(a []int64, x int64) int64 {
	var ret int64
	for _, ai := range a {
		ret += x ^ ai
	}
	return ret
}

var dbg = false

var sc = bufio.NewScanner(os.Stdin)

func main() {
	sc.Split(bufio.ScanWords)
	sc.Scan()
	n, _ := strconv.ParseInt(sc.Text(), 0, 64)
	sc.Scan()
	k, _ := strconv.ParseInt(sc.Text(), 0, 64)
	a := make([]int64, n)
	for i := int64(0); i < n; i++ {
		sc.Scan()
		a[i], _ = strconv.ParseInt(sc.Text(), 0, 64)
	}
	xtempl := template(a)
	xmax := int64(0)
	fmax := score(a, xmax)
	for b := uint(0); b < 40; b++ {
		bsp := int64(1) << b
		mask_lo := (int64(1) << b) - 1
		k_upper := k &^ mask_lo
		t_lower := xtempl & mask_lo
		x := (k_upper | t_lower) &^ bsp
		if x > k {
			continue
		}
		fx := score(a, x)
		if dbg {
			fmt.Printf("i %d X fx %d %d\n", b, x, fx)
		}
		if fx > fmax {
			fmax = fx
			xmax = x
		}
	}
	fmt.Println(fmax)
	if dbg {
		fmt.Println(n, k, xtempl, xmax, fmax)
	}
}


Measured memory_bytes: 3072