akhauriyash/Code-Regression huggingface dataset:
// Best practice

#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file 
#include <ext/pb_ds/tree_policy.hpp> 
#include <ext/pb_ds/detail/standard_policies.hpp>
#include <functional> // for less 

#define int         long long
#define pb          emplace_back
#define pf          emplace_front
#define all(a)      (a).begin(),(a).end()
#define rall(a)     (a).rbegin(),(a).rend()
#define x           first
#define y           second
#define endl        '\n'
#define tezz        ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
using namespace std;
using namespace __gnu_pbds; 
 
typedef tree<pair<int,int>, null_type, less<pair<int,int>>, rb_tree_tag, tree_order_statistics_node_update> pbds; 

#define fbo find_by_order
#define ook order_of_key

signed main() {
   tezz
   
   int n;
   cin >> n;
   vector<int> a(n);
   for(int i=0; i<n; i++){
       cin >> a[i] ;
   }
   if(n==1){
       cout << a[0] << endl;
       return 0;
   }
   vector<int> pre(n),post(n);
   pre[0]=a[0];
   post[n-1]=a[n-1];
   for(int i=1; i<n; i++){
       pre[i]=__gcd(pre[i-1],a[i]);
   }
   for(int i=n-2; i>=0; i--){
       post[i]=__gcd(post[i+1],a[i]);
   }
   
//   for(auto it: pre)cout << it << " ";
//   cout << endl;
//   for(auto it: post)cout << it << " ";
//   cout << endl;
   
   int mx=max(pre[n-2],post[1]);
   for(int i=1; i<n-1; i++){
       mx=max( __gcd(pre[i-1],post[i+1] ), mx);
   }
   cout << mx << endl;
   
   
   return 0;
}

Measured memory_bytes: 2560
//go 1.6

package main
import(
	"fmt"
	)

func main() {
	var(
		s string
		c int
		)
		fmt.Scan(&s)
		
		if s[0] == '1'{
			c++
		}
		if s[1]== '1'{
			c++
		}
		if s[2]=='1'{
			c++
		}
		fmt.Println(c)
}

Measured memory_bytes: 512
#!/usr/bin/env python3
from collections import Counter
from itertools import accumulate

def main():
    N = int(input())
    A = sorted(map(int, input().split()))
    # 倍数リストを保持して、チェックしていく
    B = [0] * (A[N-1]+1)
    for i in range(N):
        j = A[i]
        while j <= A[N-1]:
            B[j] += 1
            j += A[i]
    # print(B)
    ans = 0
    for i in range(N):
        if B[A[i]] == 1:
            ans += 1
    print(ans)


if __name__ == "__main__":
    main()


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

int n, z, w, a[2001];
int dpX[2][2001], dpY[2][2001];

void display() {
	for (int i = 0; i < 2; i++) {
		for (int j = 0; j < n; j++) {
			cout << "dpX[" << i << "][" << j << "]" << dpX[i][j] << " ";
		}
		cout << endl;
	}
	for (int i = 0; i < 2; i++) {
		for (int j = 0; j < n; j++) {
			cout << "dpY[" << i << "][" << j << "]" << dpY[i][j] << " ";
		}
		cout << endl;
	}
	cout << endl;
}

int main() {
	cin >> n >> z >> w;
	for (int i = 1; i <= n; i++) {
		cin >> a[i];
	}
	a[0] = w;

	for (int j = 0; j < n; j++) {//ここでnに飛んだ時のスコアを計算
		dpX[n % 2][j] = abs(a[j] - a[n]);
		dpY[n % 2][j] = abs(a[j] - a[n]);
		//dpX[(n + 1) % 2][j] = 0;
		//dpY[(n + 1) % 2][j] = INT32_MAX;
	}
	//display();
	/*for (int i = 0; i < 2; i++) {
		dpX[i][n] = INT32_MAX;
		dpY[i][n] = 0;
	}*/

	for (int i = n-1; i >= 0 ; i--) {//あとはn-1からのスコアを計算するだけ
		for (int j = 0; j < i; j++) {//nが1だとここを通らない
			dpX[i % 2][j] = max(dpY[(i + 1) % 2][i], dpX[(i+1) % 2][j]);
			dpY[i % 2][j] = min(dpX[(i + 1) % 2][i], dpY[(i+1) % 2][j]);
		}
	}
	//display();

	if (n == 1) {
		cout << abs(w - a[n]) << endl;
	}
	else {
		cout << dpX[0][0] << endl;
	}
}

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

int main()
{
    long long x;
    cin >> x;
    x--;
    stack<char> vec;
    vec.push('a'+x%26);
    x = x-x%26;
    x /=26;
    while(x){
        int r = x%26;
        if(r==0){
            r=26;
            x--;
        }  
        vec.push(r+'a'-1);
        x/= 26;
        
    }
    while(!vec.empty()){
        cout << vec.top();
        vec.pop();
    }
}

Measured memory_bytes: 3608
dice = [int(_) for _ in input().split()]
num = int(input())
dire = {"N": [2,6,3,4,1,5],"S":[5,1,3,4,6,2],
      "E":[4,2,1,6,5,3],"W":[3,2,6,1,5,4]}
z_dire = [1,4,2,5,3,6]

for i in range(num):
    dis = [int(_) for _ in input().split()]
    count = 0
    while dice[0] != dis[0]:
        em = dice[:]
        for j in range(len(dice)):
            if count % 2 == 0:
                em[j] = dice[dire["N"][j]-1]
            else:
                em[j] = dice[dire["E"][j]-1]
        else:
            del dice[:]
            dice = em[:]
        count += 1

    while dice[1] != dis[1]:
        em = dice[:]
        for j in range(len(dice)):
            em[j] = dice[z_dire[j]-1]
        else:
            del dice[:]
            dice = em[:]
    print(dice[2])


Measured memory_bytes: 5608
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        String s = sc.next();
        String strB = s.replaceAll("R", "");
        String strR = s.replaceAll("B", "");
        

        if (strR.length() > strB.length() )
            System.out.println("Yes");
        else
            System.out.println("No");
        
    }

}

Measured memory_bytes: 23124
import java.io.PrintWriter;
import java.util.Scanner;

public class Main {
  public static PrintWriter out = new PrintWriter(System.out);
  public static Scanner in = new Scanner(System.in);

  public static void main(String[] args) {
    //      int t = ni();
    //      while (t-- > 0)
    solve();
    out.flush();
  }

  private static void solve() {

    int n = ni();
    int k = ni();
    int[] a = na(n);
    boolean[] dp = new boolean[k + 1];
    for (int i = 0; i <= k; i++) {
      for (int x : a) {
        if (i - x >= 0) {
          dp[i] |= !dp[i - x];
        } else break;
      }
    }
    out.println(dp[k] ? "First" : "Second");
  }

  private static int ni() {
    return in.nextInt();
  }

  private static int[] na(int n) {
    int[] a = new int[n];
    for (int i = 0; i < n; i++) a[i] = ni();
    return a;
  }

  private static long[] nal(int n) {
    long[] a = new long[n];
    for (int i = 0; i < n; i++) a[i] = nl();
    return a;
  }

  private static long nl() {
    return in.nextLong();
  }

  private float nf() {
    return in.nextFloat();
  }

  private static double nd() {
    return in.nextDouble();
  }
}


Measured memory_bytes: 37860
#include"bits/stdc++.h"
#include<boost/multi_array.hpp>
#include<boost/optional.hpp>
#include<boost/range/irange.hpp>
#include<boost/range/algorithm.hpp>
#include<boost/range/adaptors.hpp>
using namespace std;
namespace adaptor = boost::adaptors;

#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)--)
typedef long long ll;

void Main()
{
  	int H, W, N;
	cin >> H >> W >> N;
  	int mx = max(H,W);
  	int ans = (N-1)/mx + 1;
  	cout << ans << endl;
	return;
}

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

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define uli unsigned long long int
#define INF 99999999999
#define rep(i,m,n) for(lli i = m;i < n;i++)
#define rrep(i,m,n) for(lli i=m-1;i>=n;i--)
#define pb(n) push_back(n)
#define UE(N) N.erase(unique(N.begin(),N.end()),N.end());
#define Sort(n) sort(n.begin(), n.end())
#define Rev(n) reverse(n.begin(),n.end())
#define Out(S) cout << S << endl
#define NeOut(S) cout << S
#define HpOut(S) cout << setprecision(150) << S << endl
#define Vec(K,L,N,S) vector<L> K(N,S)
#define DV(K,L,N,M,S) vector<vector<L>> K(N,vector<L>(M,S))
#define TV(K,L,N,M,R,S) vector<vector<vector<L>>> K(N,vector<vector<L>>(M,vector<L>(R,S)))
#define pint pair<lli,lli>
#define paf(L,R) pair<L,R>
#define mod 1000000007
#define MAX 5100000
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
#define chmin(a, b) a = (((a)>(b)) ? (b) : (a))
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int main(){
  lli A,B,C,D,E,F,N,M,K,L,R,X,Y,H,W,sum=0,num=0,flag=0;string S,T;
  cin >> N >> K;
  Vec(P,lli,N,0);rep(i,0,N)cin >> P[i];
  Vec(Q,lli,50,0);
  rep(i,0,50)rrep(j,50,0){
    sum=0;
    if(j<i){
      rep(k,0,N)if(P[k]&(1LL<<j))sum++;
      if(sum*2<N)Q[i]|=(1LL<<j);
    }
    else if(j==i) continue;
    else if(K&(1LL<<j))Q[i]|=(1LL<<j);
  }
  sum=0;
  rep(i,0,50){
    if(Q[i]>K)continue;
    sum=0;
    rep(j,0,N)sum+=P[j]^Q[i];
    chmax(num,sum);
  }
  Out(num);
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
    using namespace std;
     
    int main() {
      long n;
      int a,ans;
      a =0;ans=0;
      cin >> n;
      for(int i=2;i<=sqrt(n);i++){
        while(n%i == 0){
          n/=i;
          a++;
        }
        for(int j=1;j*(j+1)/2<=a;j++){
          ans++;
        }
        a = 0;
      }
      if(n != 1)ans++;
      cout << ans << endl;
    }

Measured memory_bytes: 3660
#include<stdio.h>
#include<stdlib.h>
#include<math.h>

#define df 0

int main(){
  long int w,h,x,y;
  scanf("%ld%ld%ld%ld",&w,&h,&x,&y);
 printf("%lf %d",w*h*1.0/2,(w%2==0 && h%2==0 && w/2==x && h/2==y)?1:0);
}

///  confirm df==0  ///


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define REP(i,a) for(int i = 0; i < (a); i++)
#define ALL(a) (a).begin(),(a).end()
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1e9;
const long long LINF = 1e18;
const long long MOD = 1e9 + 7;

signed main(){
    int n,k;
    ll r,s,p;
    cin >> n >> k;
    cin >> r >> s >> p;
    string t;
    cin >> t;
    ll ans = 0;
    bool use[n] = {};
    REP(i,n){
        if(t[i] == 's' && !(i - k >= 0 && t[i - k] == 's' && use[i - k])){
            ans += r;
            use[i] = true;
        }else if(t[i] == 'p' && !(i - k >= 0 && t[i - k] == 'p' && use[i - k])){
            ans += s;
            use[i] = true;
        }else if(t[i] == 'r' && !(i - k >= 0 && t[i - k] == 'r' && use[i - k])){
            ans += p;
            use[i] = true;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 512
#include<iostream>
#include<algorithm> 
using namespace std;
#define N 100010
 int main(){
 int n,m,h[N],ma[N];
 cin>>n>>m;
 for(int i=1;i<=n;i++){
 cin>>h[i];
 ma[i]=0;
 }
 for(int i=0;i<m;i++){
 int a,b;
 cin>>a>>b;
 ma[a]=max(ma[a],h[b]);
 ma[b]=max(ma[b],h[a]);
 }
 int ans=0;
 for(int i=1;i<=n;i++){
 ans+=h[i]>ma[i];
 }
 cout<<ans<<endl;
 }


Measured memory_bytes: 4416
#   1 - 399：灰色
#  400- 799：茶色
#  800-1199：緑色
# 1200-1599：水色
# 1600-1999：青色
# 2000-2399：黄色
# 2400-2799：橙色
# 2800-3199：赤色
# また、レートが 3200 以上になると色を自由に変えることができます。

n = int(input())
a = list(map(int, input().split()))

used_colors = set()
unknown_color = 0

for i in range(n):
    if   1  <= a[i] <=  399: used_colors.add(0)
    if  400 <= a[i] <=  799: used_colors.add(1)
    if  800 <= a[i] <= 1199: used_colors.add(2)
    if 1200 <= a[i] <= 1599: used_colors.add(3)
    if 1600 <= a[i] <= 1999: used_colors.add(4)
    if 2000 <= a[i] <= 2399: used_colors.add(5)
    if 2400 <= a[i] <= 2799: used_colors.add(6)
    if 2800 <= a[i] <= 3199: used_colors.add(7)
    if 3200 <= a[i]        : unknown_color += 1

minimum = max(1, len(used_colors))
maximum = len(used_colors) + unknown_color
print(minimum, maximum)


Measured memory_bytes: 3064
import collections
n,k = map(int, input().split())
a = list(map(int, input().split()))

c = collections.Counter(a).most_common()[::-1]
p = len(c) - k
if p <= 0:
  print(0)
else:
  print(sum(list(map(lambda x:x[1], c[:p]))))

Measured memory_bytes: 43160
#include<bits/stdc++.h>
using namespace std;
//type
typedef long long ll;
using pii = pair<int, int>;
using vi = vector<int>;
//x * y * 1.0 can cause overflow
//constant
#define inf (int)(1e9+7)
#define mod (ll)(1e9+7)
#define eps 1e-10
int dy[] = {0, 0, -1, 1, -1, 1, -1, 1};
int dx[] = {1, -1, 0, 0, -1, 1, 1, -1};
//omission
#define eb emplace_back
#define F first
#define S second
#define SZ(x) ((int)(x).size())
#define all(v) v.begin(), v.end()
//manip
#define chmax(a, b) a = max(a, b)
#define chmin(a, b) a = min(a, b)
#define UNIQUE(v) v.erase(unique(v.begin(), v.end(), v.end());
#define fill(x, y) memset(x, y, sizeof(x))
#define ceil(a, b) a / b + !!(a % b)
template<class T> T power(T a, T b)
{return b ? power(a * a % inf, b / 2) * (b % 2 ? a : 1) % inf : 1;}
#define LB(v, x) (int)(lower_bound(all(v), x) - v.begin())
#define UB(v, x) (int)(upper_bound(v.begin(), v.end(), x) - v.begin())
//loop
#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define rep3(i, st, n) for (int i = st; i < n; ++i)
//algorithm
//double pointer, l start, how many adds, can be 0 -> init r = l, sum = 0
//bfs, not x, y, i, j
//not !(i % 2), i % 2 == 0

int main() {
    //cast caution
    //look constraints always
    cin.tie(0); ios::sync_with_stdio(false);
    
    string s; cin >> s;
    rep3(i, 1, SZ(s)) if (s[i] == s[i - 1]) {
        cout << "Bad" << endl;
        return 0;
    }
    cout << "Good" << endl;
    
    
}
//cast caution



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

typedef long long ll;
typedef unsigned long long ull;
typedef unsigned __int128 HASH;
typedef pair<int,int> pii;
typedef pair<ll, ll> pll;
typedef pair<ull, ull> pullull;
typedef pair<ll,int> plli;
typedef pair<double, int> pdbi;
typedef pair<int,pii> pipii;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<pii> vpii;
typedef vector<vector<int>> mat;

#define rep(i,n) for (int i=0;i<(n);i++)
#define rep2(i,a,b) for (int i=(a);i<(b);i++)
#define rrep(i,n) for (int i=(n);i>0;i--)
#define rrep2(i,a,b) for (int i=(a);i>b;i--)
#define pb push_back
#define fi first
#define se second
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()

const ll hmod1 = 999999937;
const ll hmod2 = 1000000000 + 9;
const ll INF = 1<<30;
const ll mod = 10000 + 7;
const int dx4[4] = {1, 0, -1, 0};
const int dy4[4] = {0, 1, 0, -1};
const int dx8[8] = {1, 1, 1, 0, 0, -1, -1, -1};
const int dy8[8] = {0, 1, -1, 1, -1, 0, 1, -1};
const double pi = 3.141592653589793;

//#define int long long
#define addm(X, Y) (X) = ((X) + ((Y) % mod) + mod) % mod

int m, n;
bool check[7368791 + 1];

signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    while (true) {
        cin >> m >> n;
        if (m == 0 && n == 0) break;
        ll now = m;
        fill(check, check + 7368791 + 1, false); 
        while (n >= 0) {
            if (check[now]) {
                now++;
                continue;
            }
            ll b = 1;
            ll b_now = now;
            while (b_now < 7368791) {
                check[b_now] = true;
                b++;
                b_now =  now * b;
            }
            n--;
            now++;
        }
        cout << now - 1 << endl;
    }
}

Measured memory_bytes: 10340
#include<iostream>
#include<algorithm>
#include<set>

using namespace std;

int main()
{
	long a,b,n;
	cin >> a >> b >> n;
	
	long z;
	long x = min(b-1, n);
	z = int(a*x/b) - a* int(x/b);
	
	cout << z << endl;

	return 0;

}

Measured memory_bytes: 3532
H,W,K = list(map(int,input().split()))
 
 
amida = [0 for i in range(8)]
amida[0]=1
amida[1]=2
amida[2]=3
amida[3]=5
amida[4]=8
amida[5]=13
amida[6]=21
amida[7]=34
 
def amida_num(k,l):
    return amida[max(k,0)]*amida[max(l,0)]
 
 
dp=[[0 for i in range(W)] for j in range(H+1)]
 
dp[0][0] = 1
 
if W!=1:
    for i in range(1,H+1):
        for j in range(W):
            if j==0:
                dp[i][j]=dp[i-1][j+1]*amida_num(0,W-3) + dp[i-1][j]* amida_num(0,W-2)
            elif j==W-1:
                dp[i][j]=dp[i-1][j-1]*amida_num(0,W-3) + dp[i-1][j]* amida_num(0,W-2)
            else:
                dp[i][j]=dp[i-1][j-1]*amida_num(j-2,W-j-2) + dp[i-1][j]*amida_num(j-1,W-j-2) + dp[i-1][j+1]*amida_num(j-1,W-j-3)
    print(dp[H][K-1]%(10**9+7))
else:
    print(1)

Measured memory_bytes: 3064
using System;

namespace NextPrime
{
    class Program
    {
        static void Main(string[] args)
        {

            var X = int.Parse(Console.ReadLine());

            while (true)
            {
                bool prime = true;
                for (int j = 2; j < X; j++)
                {
                    if (X % j == 0)
                    {
                        prime = false;
                        continue;
                    }
                }

                if (prime)
                {
                    Console.WriteLine(X);
                    return;
                }

                X++;
            }

        }
    }
}


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

using namespace std;

#define INF 210000000
#define int long long

int gcd(int a, int b) {
  int amari = a % b;
  int c = b;
  if (amari == 0) {
    return b;
  } else {
    return gcd(b, amari);
  }
}

int lcm(int a, int b) { return a * b / gcd(a, b); }

struct num{
    int v;
    int n;
};

bool cmp(num a,num b){
    return b.v > a.v;
}
void Main(){
    int n;
    cin >> n;
    vector<num> p;
    for(int i=0;i<n;i++){
        int tmp;
        cin >> tmp;
        num t;
        t.n = i;
        t.v = tmp;
        p.push_back(t);
    }
    int cnt = 0;
    sort(p.begin(),p.end(),cmp);
    for(int i=0;i<n;i++){
        if(p[i].n != i) cnt++;
    }
    if(cnt == 0 || cnt == 2){
        cout << "YES";
    }else{
        cout << "NO";
    }

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



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main () {
  int N;
  cin >> N;
  vector<string> data(N);
  for (int i = 0; i < N; i++) {
    cin >> data.at(i);
  }
  int flag = 1;
  if (data.at(0).back() != data.at(1).front()) flag = 0;
  for (int i = 0; i < N - 2; i++) {
    if (data.at(i + 1).back() != data.at(i + 2).front()) flag = 0;
  }
  for (int i = 0; i < N; i++) {
    if (flag == 0) break;
    for (int j = 0; j < i; j++) {
      if (data.at(i) == data.at(i - j - 1)) flag = 0;
    }
  }
  if (flag == 1) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <vector>
#include <queue>
#include <set>
#include <string>
#include <map>
#include <cstring>

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

using namespace std;
typedef long long ll;
const int mod = 1000000007;

int color[100100];
typedef pair<int, int> wedge;
vector<wedge> to[100100];

void dfs(int i, int c) {
    color[i] = c;
    for(auto e: to[i]) {
        if (color[e.first]==0 && e.second % 2 == 0) dfs(e.first, c); 
        else if (color[e.first]==0 && e.second % 2 != 0) dfs(e.first, -c); 
    }
    return;
}

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

    int u, v, w;
    rep(i, n-1) {
        cin >> u >> v >> w;
        --u, --v;
        to[u].push_back(wedge(v, w));
        to[v].push_back(wedge(u, w));
    }
    memset(color, 0, sizeof(color));
    rep(i, n) {
        if (color[i]==0) {
            dfs(i, 1);
        }
    }
    rep(i, n) {
        if (color[i]==1) cout << "0" << endl;
        else cout << "1" << endl;
    }
    return 0;
}


Measured memory_bytes: 8832
#include <iostream>
#include <cctype>
#include <algorithm>
#include <vector>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <utility>
#include <string>
#include <functional>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <iomanip>
#include <bitset>
#define pb push_back
#define YES cout<<"YES"<<endl
#define Yes cout<<"Yes"<<endl
#define NO cout<<"NO"<<endl
#define No cout<<"No"<<endl
#define rep(i,n) for(int i=0;i<n;i++)
#define INF (1<<20)
#define LLINF (1LL<<60)
#define MOD 1000000007
typedef long long ll;
using namespace std;

int main(){
    int n,r;
    cin >> n >> r;
    if(n>=10){
        cout << r;
    }else{
        cout << r + (10 - n) * 100;
    }
    return 0;
}


Measured memory_bytes: 256
nums = [[[0 for _ in range(10)] for _ in range(3)] for _ in range(4)]

n = int(input())
for i in range(n):
    b, f, r, v = [int(_) for _ in input().split()]
    nums[b - 1][f - 1][r - 1] += v

is_first = True
for building in nums:
    if not is_first:
        print("#" * 20)
    is_first = False 
    for floor in building:
        for room in floor:
            print(" " + str(room), end = "")
        print()



Measured memory_bytes: 5624
N, M = map(int,input().split())

banned_list = []
for i in range(M):
    banned_list.append(tuple(map(int,input().split())))
banned_list = sorted(banned_list,key=lambda x:x[1])
#status = [1 for _ in range(N-1)]
status = set()
counter = 0
for i in range(M):
    a = banned_list[i][0]
    b = banned_list[i][1]
    if len([one for one in status if (one >= a-1 and one < b-1)]) == 0:
        status  |= {b-2}
        counter += 1
print(counter)

Measured memory_bytes: 63644
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
#define chmin(a, b) ((a) = min((a), (b)))
#define chmax(a, b) ((a) = max((a), (b)))
#define fs first
#define sc second
#define eb emplace_back
using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;

const ll MOD = 1e9 + 7;
const ll INF = 1e18;
const double pi = acos(-1);
const double eps = 1e-10;

int dx[] = {1, 0, -1, 0};
int dy[] = {0, -1, 0, 1};

int main(){
    int n, a, b; cin>>n>>a>>b;
    cout << min(n * a, b) << endl;
}

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

using namespace std;


void solve() {
    int n; cin >> n;
    vector<int> b(n);
    for (auto& x: b) {
        cin >> x;
    }
    vector<int> a;
    while (!b.empty()) {
        int sz = b.size();
        bool flag = false;
        for (int i = sz-1; i >= 0; i--) {
            if (b[i] == i+1) {
                flag = true;
                a.emplace_back(i+1);
                b.erase(b.begin()+i);
                break;
            }
        }
        if (!flag) {
            cout << -1 << "\n";
            exit(0);
        }
    }
    reverse(a.begin(), a.end());
    for (auto& x: a) {
        cout << x << "\n";
    }
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    solve();
    cout << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
static const int64_t mod=1000000007;
using ll=long long ;
ll f(ll x,ll y){
if(y==0) return 1;
  else{
  if(y%2==0)
  return (f(x,y/2)*f(x,y/2))%mod;
   else
  return (((x*f(x,y/2))%mod)*f(x,y/2))%mod;
 
  }
 
}
int main(){
ll n,k;
  cin>>n>>k;
  if(k<=n-1){
  vector<ll>A(k+1);
    A.at(0)=1;
    for(int i=1;i<=k;i++)
    A.at(i)=(((A.at(i-1)*(n-i))%mod)*(((n-i+1)*f(i,2*mod-4))%mod))%mod;
      int64_t ans=0;
      for(int i=0;i<=k;i++)
        ans=(ans+A.at(i))%mod;
      cout<<ans<<endl;
    
  
  }else{
  vector<ll>A(n);
    A.at(0)=1;
    for(int i=1;i<n;i++)
    A.at(i)=(((A.at(i-1)*(n-i))%mod)*(((n-i+1)*f(i,2*mod-4))%mod))%mod;
      int64_t ans=0;
      for(int i=0;i<n;i++)
        ans=(ans+A.at(i))%mod;
      cout<<ans<<endl;
  }
   return 0;
}

Measured memory_bytes: 1792
import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

k = int(input())
num = k+2
lst = [([None]*num) for i in range(num)]
# print(lst)
for i in range(num):
    for j in range(num):
        lst[i][j] = gcd(i+1,j+1)
# print(lst)

ans = 0
for a in range(1,k+1):
    for b in range(1,k+1):
        NUM = lst[a-1][b-1]
        for c in range(1,k+1):
            ans += lst[NUM-1][c-1]

print(ans)


Measured memory_bytes: 9776
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <queue>
using namespace std;

int N, T;
int mod = 1e9 + 7;

int main() {
    cin >> N >> T;
    int t;
    cin >> t;
    long long total = T, stop = T;
    for (int i = 1; i < N; i++) {
        cin >> t;
        total += (stop < t? T: T + t - stop);
        stop = t + T;
    }
    cout << total << endl;
}

Measured memory_bytes: 256
#include <cstdio>
#include <algorithm>
#include <iostream>
#include <cstring>
#include <list>
#include <cmath>
#include <vector>
#include <stack>
#include <set>
#include <map>
#define sf scanf
#define pf printf
#define show(x) cout<<"x:"<<x<<endl;
using namespace std;
typedef long long ll;
const int maxn=1000;
const int vmaxn=10000;
const int inf=1e9+5;
int n,a[maxn],s;
int b[maxn],t[vmaxn+1];

ll solve()
{
    int ans=0;

    bool V[maxn];
    for(int i=0;i<n;i++) b[i]=a[i],V[i]=false;
    sort(b,b+n);
    for(int i=0;i<n;i++)t[b[i]]=i;
    for(int i=0;i<n;i++)
    {
        if(V[i])continue;
        int cur=i;
        int S=0;
        int m=vmaxn;
        int an=0;
        while(1)
        {
            V[cur]=true;
            an++;
            int v=a[cur];
            m=min(m,v);
            S+=v;
            cur=t[v];
            if(V[cur])break;
        }
        ans+=min(S+(an-2)*m,m+S+(an+1)*s);
    }

    return ans;
}

int main()
{
    cin>>n;
    s=vmaxn;
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
        s=min(s,a[i]);
    }
    int ans=solve();
    cout<<ans<<endl;

    return 0;
}



Measured memory_bytes: 3156
#include<iostream>

using namespace std;

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

        string s;

        int counter=0;

        int flag=0;

        for(int i=1;i<=n;i++)
        {
                cin >> s;
                if(s=="A")
                {
                        counter++;
                }
                if(s=="Un")
                {
                        counter--;
                }
                if(counter<0)
                {
                        flag=1;
                        break;
                }
        }

        if(flag==1)
        {
                cout << "NO" << endl;
        }
        else if(s!="A" && counter==0)
        {
                cout << "YES" << endl;
        }
        else
        {
                cout << "NO" << endl;
        }
        
        return 0;
} 


Measured memory_bytes: 3160
#include <iostream>
#include <stack>
#include <string>
#include <sstream>

inline int toInt(std::string s) {
    int v;
    std::istringstream sin(s);
    sin >> v;
    return v;
}
 
int main () {
  std::string s;
  std::stack<int> st;
  while (std::cin >> s) {
        if (isdigit(s[0])) {
            st.push(toInt(s));
        }
        else {
            int a = st.top();
            st.pop();
            int b = st.top();
            st.pop();
            switch(s[0]) {
            case '+':
                st.push(a + b);
                break;
            case '-':
                st.push(b - a);
                break;
            case '*':
                st.push(a * b);
                break;
            }
        }
    }
  std::cout<<st.top()<<'\n';
    return 0;
}



Measured memory_bytes: 3184
d = int(input())
C = list(map(int, input().split()))
S = [list(map(int, input().split())) for _ in range(d)]
T = [int(input()) for _ in range(d)]

last = [0] * 26
score = 0

for i, (s, t) in enumerate(zip(S, T), 1):
    score += s[t-1]
    last[t-1] = i
    for j in range(26):
        score -= C[j] * (i - last[j])
    print(score)
    

Measured memory_bytes: 9324
#include <bits/stdc++.h>
#define For(i, a, b) for(int (i)=(a); (i)<(b); (i)++)
#define rFor(i, a, b) for(int (i)=(a)-1; (i)>=(b); (i)--)
#define rep(i, n) For((i), 0, (n))
#define rrep(i, n) rFor((i), (n), 0)
using namespace std;

string s, t;
int n, m;
int dp[1010][1010];

int solve(int i, int j){
    if(i==0 || j==0) return dp[i][j] = max(i, j);
    if(dp[i][j] >= 0) return dp[i][j];
    if(s[i-1] == t[j-1]){
        dp[i][j] = min(solve(i-1, j)+1, solve(i, j-1)+1);
        return dp[i][j] = min(dp[i][j], solve(i-1, j-1));
    }
    dp[i][j] = min(solve(i-1, j)+1, solve(i, j-1)+1);
    return dp[i][j] = min(dp[i][j], solve(i-1, j-1)+1);
}

int main(){
    cin >> s >> t;
    n = (int)(s.size()); m = (int)(t.size());
    rep(i, n+1)rep(j, m+1) dp[i][j] = -1;
    cout << solve(n, m) << endl;
}


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

using namespace std;
using ll = long long;

int n;
ll d, a;
ll edges[200006];

vector<pair<ll, ll>> dots;

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

    cin>>n>>d>>a;
    int c=0;
    for(int i=0;i<n;i++){
        ll x, h;
        cin>>x>>h;
        dots.emplace_back(x, (h/a)+(h%a>0));
    }
    ll ans = 0;
    ll curr_val = 0;
    sort(dots.begin(), dots.end());
    for(int i=0;i<n;i++){
        while(c<n && dots[c].first<=dots[i].first+2*d) c++;
        curr_val -= edges[i];
        if(curr_val<dots[i].second){
            ans+=(dots[i].second - curr_val);
            edges[c] += (dots[i].second - curr_val);
            curr_val = dots[i].second;
        }
    }
    cout<<ans;
    return 0;
}

Measured memory_bytes: 6512
#include <bits/stdc++.h>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<math.h>
using namespace std;

struct Point{
  double x,y;
};

void koch(int n,Point a,Point b){
  if(n==0) return;
  Point s,t,u;
  double th=M_PI*60.0/180.0;

  s.x=(2.0*a.x+1.0*b.x)/3.0;
  s.y=(2.0*a.y+1.0*b.y)/3.0;
  t.x=(1.0*a.x+2.0*b.x)/3.0;
  t.y=(1.0*a.y+2.0*b.y)/3.0;
  u.x=(t.x-s.x)*cos(th)-(t.y-s.y)*sin(th)+s.x;
  u.y=(t.x-s.x)*sin(th)+(t.y-s.y)*cos(th)+s.y;

  koch(n-1,a,s);
  printf("%.8f %.8f\n",s.x,s.y);
  koch(n-1,s,u);
  printf("%.8f %.8f\n",u.x,u.y);
  koch(n-1,u,t);
  printf("%.8f %.8f\n",t.x,t.y);
  koch(n-1,t,b);
}



int main(){
  Point a,b;
  int n;
  cin>>n;
  a.x=0;
  a.y=0;
  b.x=100;
  b.y=0;

  printf("%.8f %.8f\n",a.x,a.y);
  koch(n,a,b);
  printf("%.8f %.8f\n",b.x,b.y);
  return 0;
}



Measured memory_bytes: 3152
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		int Q = sc.nextInt();
		int A[] = new int[Q];
		int P[] = new int[N];
		for(int i = 0 ; i < Q ; ++i){
			A[i] = sc.nextInt() - 1;
			int a = A[i];
			P[a]++;
		}
		for(int i = 0 ; i < N ; ++i){
			int neg = Q - P[i];
			int p = K - neg;
			if(p <= 0){
				System.out.println("No");
			}else{
				System.out.println("Yes");				
			}
		}
	}
}


Measured memory_bytes: 61416
from math import sqrt
n = int(input())
a = []
for i in range(n):
  x,y=map(int,input().split())
  t = (x,y)
  a.append(t)
d,f=0,0
for i in range(n-1):
  for j in range(i+1,n):
    r = sqrt((a[i][0]-a[j][0])**2+(a[i][1]-a[j][1])**2)
    d+=(n-1)*r
  f+=(i+1)
print(d/f)

Measured memory_bytes: 3064
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <algorithm>
#include <sstream>
#include <istream>

using namespace std;

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

int main(){
	ll h;
	int n;
	ll a[100000];
	cin >> h >> n;
	for(int i=0;i<n;i++) cin >> a[i];
	ll sum = 0;
	for(int i=0;i<n;i++) sum += a[i];
	if(sum>=h){
		cout << "Yes" << endl;
	}else{
		cout << "No" << endl;
	}
	return 0;
}

Measured memory_bytes: 1024
#include<iostream>
#include<cstring>
#include<string>
#include<algorithm>

using namespace std;

int main(){
    int n;
    int a[200005];
    int f=1;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    sort(a,a+n);
    for(int i=0;i<n-1;i++){
        if(a[i]==a[i+1]){
            f=0;
        }
    }
    if(f){
        cout<<"YES";
    }
    else{

        cout<<"NO";
    }
}


Measured memory_bytes: 1024
#include<iostream>
#include<string>
#include<vector>
#include<stdio.h>
#include<algorithm>
#include<math.h>
#include<numeric>
#include<iomanip>
#include<deque>
#include<tuple>
#include<queue>
#include<map>
#include<cstdint>
#include<unordered_map>
#include<boost/multiprecision/cpp_int.hpp>


#define rep(i, n) for(int i = 0; i < ( int)(n); i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define vi vector<int>
#define all(x) (x).begin(),(x).end()
#define F first
#define S second

namespace mp = boost::multiprecision;

using cpp_int = mp::cpp_int;
using ll = long long;
using uint1024_t = mp::uint1024_t;
using namespace std;
void plus2(deque<int>&num,int i) {
		num[i] = 0;
		if (i == 0) {
			num.push_front(1);
			num.push_front(1);
		}
		else if (i == 1) {
			num[0] += 1;
			num.push_front(1);
		}
		else {
			num[i - 1] += 1;
			num[i - 2] += 1;
		}
}
void minus1(deque<int>&num, int i) {
		num[i] = 1;
		if (i == 0) {
			num.push_front(1);
		}
		else {
			num[i - 1] += 1;
		}
}
void plus3(deque<int>&num, int i) {
	if (i == 0) {
		num[i] = 1;
		num.push_front(1);
		num.push_front(1);
	}
	else if (i == 1) {
		num[i] = 1;
		num[0]+=1;
		num.push_front(1);
	}
	else {
		num[i] = 1;
		num[i - 1] += 1;
		num[i - 2] += 1;
	}
}
void plus22(deque<int>&num, int i) {
	num[i] = 1;
	num[i + 1] = 0;
}

int main() {
	string s;
	cin >> s;
	ll k;
	cin >> k;
	k--;
	cpp_int count = 0;
	int i = 0;
	while (s[i]=='1') {
		i++;
	}
	if (i > k) {
		cout << 1 << endl;
	}
	else {
		cout << s[i] << endl;
	}
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void) {
int a, b, c, d, e;

scanf("%d %d",&a,&b);

c = a + b;
d = a * b;

if(c == 15) {
printf("+\n");
} else if (d == 15) {
printf("*\n");
} else {
printf("x\n");
}

}

Measured memory_bytes: 128
using System;
using System.Collections.Generic;
using System.Linq;
using console=System.Console;
namespace AtCoderTemplate
{
    public class App
    {
        public static void Main(string[] args)
        {
            string s="0";
        Console.WriteLine(
  console.ReadLine().ToCharArray().Select(c => "ACGT".Contains(c))
            .Select((b) =>s=b?(int.Parse(s)+1).ToString():"0").Max(v=>int.Parse(v)));
        }
    }
}

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

int main() {
	long n,m,l,k=0,g,z=0;
	cin>>n>>m;
	string s,t;
	cin>>s>>t;
	l=(n*m)/__gcd(n,m);
	g=__gcd(n,m);
	if(min(n,m)==1){
		
		if(s.at(0)==t.at(0))cout<<n*m<<endl;
		else cout<<"-1"<<endl;
	}
	else{
	if(g==1){
		if(s.at(0)==t.at(0))cout<<l<<endl;
		else cout<<"-1"<<endl;
	}
	else{
	for(int i=0;i<g;i++){
		if(s.at((n*i)/g)!=t.at((m*i)/g))k++;
	}
	if(k>0)cout<<"-1"<<endl;
	else{
		cout<<l<<endl;
	}
	}
	}
	return 0;
}

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

int main()
{
	string n;
	int cnt=0;
	cin >> n;
	for (int i = 1; i < n.length(); i++)
	{
		if (n[i - 1] == n[i]) cnt++;
		else if(i != 1) break;
	}
	if (cnt >= 2) cout << "Yes";
	else cout << "No";
}


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

#define int long long

#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;

template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

signed main(){
    int N;
    string S;
    cin>>N>>S;
    int ans=0;

    for(int i=1;i<N;i++){
        string s,t;
        s=S.substr(0,i);
        t=S.substr(i);
        int latte=0;
        for(char c='a';c<='z';c++)if(count(all(s),c)&&count(all(t),c))latte++;
        chmax(ans,latte);
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<=n;++i)
#define eachdo(e,array) for(const auto& e : array)
#define lower_index(v,a) (int)distance(v.begin(), lower_bound((v).begin(),(v).end(),a))
template<class T> bool chmin(T &a, T b){if(a>b){a=b;return true;}return false;}
template<class T> bool chmax(T &a, T b){if(a<b){a=b;return true;}return false;}
typedef long long ll;
const int inf = 1<<28;
const ll INF = 1LL<<57;
const ll MOD = 1e9+7;

int main(){ 
    ll N,M; cin >> N >> M;
    vector<ll> c(M);
    rep(i,M) cin >> c[i];
    vector<vector<ll>> dp(M+1,vector<ll>(N+1,INF));
    dp[0][0] = 0;
    rep(i,M)rep(j,N+1){
        chmin(dp[i+1][j],dp[i][j]);
        if (0<=j-c[i]) chmin(dp[i+1][j],dp[i+1][j-c[i]] + 1);
    }
    cout << dp[M][N] << endl;
}


Measured memory_bytes: 11548
#include <iostream>
#include <climits>
#include <bitset>
#include <stack>
#include <queue>
#include <iomanip>
#include <limits>
#include <string>
#include <cmath>
#include <set>
#include <map>
#include <math.h>
#include <algorithm>
#include <vector>
#include <string.h>
#include <complex>

using namespace std;
typedef long long ll;


typedef complex<double> xy_t;
double dot_product(xy_t a, xy_t b) { return (conj(a)*b).real(); }
double cross_product(xy_t a, xy_t b) { return (conj(a)*b).imag(); }

typedef pair<ll,ll> P;
long long int INF = 1e18;
double Pi = 3.141592653589;
const int mod = 1000000007;
// memset(a,0,sizeof(a)); →全部０にする

vector<int> G[100005];
std::vector<P> tree[100010];

int dx[9]={1,0,-1,0,1,1,-1,-1,0};
int dy[9]={0,1,0,-1,1,-1,-1,1,0};

#define p(x) cout<<x<<endl;
#define el cout<<endl;
#define pe(x) cout<<x<<" ";
#define ps(x) cout<<fixed<<setprecision(25)<<x<<endl;
#define re(i,a,b) for(i=a;i<=b;i++)
#define pb push_back
#define lb lower_bound
#define ub upper_bound

ll i,j,k,ii,jj;
ll n,m,sum,num;
ll ans=0;
ll a,b,c,d,e,h,w;
ll x[500005],y[100005],z[100005];
char s[100005];
vector <ll> aa,bb;
bool dame=false;
bool check[100005];

int main(){
    cin>>s;
    n = strlen(s);
    reverse(s,s+n);
    while(true){
        if(num>=n){
            break;
        }
        if(s[num]=='m'){
            if(s[num+1]!='a' || s[num+2]!='e' || s[num+3]!='r' || s[num+4]!='d'){
                dame=true;
                break;
            }else{
                num += 5;
            }
        }
        if(s[num]=='e'){
            if(s[num+1]!='s' || s[num+2]!='a' || s[num+3]!='r' || s[num+4]!='e'){
                dame=true;
                break;
            }else{
                num += 5;
            }
        }
        if(s[num]=='r'){
            if(s[num+1]=='e' && s[num+2]=='m' && s[num+3]=='a' && s[num+4]=='e' && s[num+5]=='r' && s[num+6]=='d'){
                num += 7;
            }else if(s[num+1]=='e' && s[num+2]=='s' && s[num+3]=='a' && s[num+4]=='r' && s[num+5]=='e'){
                num += 6;
            }else{
                dame=true;
                break;
            }
        }
    }
    if(dame){
        p("NO");
    }else{
        p("YES");
    }
    return 0;
}


Measured memory_bytes: 6656
#include <bits/stdc++.h>
#define LL long long
#define pb push_back
#define mp make_pair
#define INF 0x3f3f3f3f
#define Inf 1000000000000000000LL
#define rep(i,x) for(int (i)=1;(i)<=(x);(i)++)
#define repp(i,x,y) for(int (i)=(x);(i)<=(y);(i)++)
#define forn(i,x) for(int (i)=0;(i)<(x);(i)++)
#define foreach(i,x) for(auto (i):(x))
using namespace std;
typedef pair<int,int>pii;
int n,m,q;
int c[100010][20];
int co[100010];
vector<int>G[100010];
int main(){
	cin>>n>>m;
	for(int i=0;i<m;i++){
		int x,y;
		cin>>x>>y;
		x--,y--;
		G[x].pb(y);
		G[y].pb(x);
	}
	cin>>q;
	for(int i=0;i<q;i++){
		int v,d;
		cin>>v>>d>>co[i+1];
		v--;
		c[v][d]=i+1;
	}
	for(int i=11-2;i>=0;i--)
		for(int v=0;v<n;v++)
			for(int u:G[v]){
				c[u][i]=max(c[u][i],c[v][i+1]);
			}
	for(int i=0;i<n;i++){
		int mx=0;
		for(int j=0;j<11;j++)mx=max(mx,c[i][j]);
		cout<<co[mx]<<endl;
	}
	return 0;
}


Measured memory_bytes: 14712
#include "iostream"
#include <stdio.h>
#include <algorithm>
#include <stdlib.h>
#include <cstring>
#include <math.h>
#include <cctype>
#include <stack>
#include <vector>
#include <list>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <iomanip>
using namespace std;
using ll=long long;
#define MOD  1000000007


int main(int argc, char const *argv[]) {
  ll a,b,c;
  std::cin >> a >> b >> c;

  if(a+b>=c)std::cout << b+c << '\n';
  else std::cout << a+2*b+1 << '\n';
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include<math.h>
#include<list>
#include <algorithm>
#include<set>
#include<vector>
#include<math.h>
#include<map>
#include<string>
#include <numeric>
#include <queue>
#include <sstream>
#include <bitset>
#include<stack>

using namespace std;
using ll = long long;
using vll = vector<long long>;
using sll = set<long long>;

template<typename T>
T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }
template<typename T>
T lcm(T a, T b) { return a / gcd(a, b) * b; }

template<typename T>
map<T, T> getPrimeFactor(T n) {
	map<T, T> res;
	for (T i = 2; i * i <= n; ++i) {
		while (n % i == 0) {
			res[i] ++;
			n /= i;
		}
	}
	if (n != 1) res[n] = 1;
	return res;
}

template<typename T>
bool IsPrimeNumber(T num)
{
	if (num <= 2) return true;
	else if (num % 2 == 0) return false;

	double sqrtNum = sqrt(num);
	for (int i = 3; i <= sqrtNum; i += 2)
	{
		if (num % i == 0)
		{
			return false;
		}
	}

	return true;
}

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


#define in(x) cin >> x
#define out(x) cout << x
#define outn(x) cout << x << '\n'
#define outs(x) cout << x << ' '
#define rep(i,s,e) for(ll i=s;i<e;i++)
#define repeq(i,s,e) for(ll i=s;i<=e;i++)


ll pow2(ll n, ll p, ll mod) {
	if (p == 0 || n == 1) {
		return 1;
	}
	else {
		ll ret = pow2(n * n % mod, p / 2, mod);
		if (p % 2 == 1) {
			ret *= n;
		}
		return ret % mod;
	}
}

int main() {
	ll A, B, N, num, ans, r;
	std::cin >> N >> A >> B;
	ans = N / (A + B);
	ans = ans * A;
	ans += min(N % (A + B), A);

	std::cout << ans << endl;
	return 0;

}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<stack>
#include<queue>
using namespace std;

int main() {
  int n, a, b;
  long long min=0,max=0;
  cin >> n >> a >> b;
  
  for (int i = 0; i < n - 1; i++) {
	min += a;
  }
  min += b;
  for (int i = 0; i < n - 1; i++) {
	max += b;
  }
  max += a;
  if (max - min + 1 <= 0) {
	cout << 0 << endl;
  }
  else {
	cout << max - min + 1 << endl;
  }


}

Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#define popcount __builtin_popcount
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;

int main()
{
    int n; cin>>n;
    ll s[100010];
    for(int i=0; i<n; i++) cin>>s[i];
    ll ans=0;
    for(int d=1; d<n-1; d++){
        ll sum=0;
        for(int i=1; n-1-(i+1)*d>0; i++){
            if((n-1)%d==0 && n-1<=2*i*d) break;
            sum+=s[i*d];
            sum+=s[n-1-i*d];
            ans=max(ans, sum);
        }
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 1152
# include <cstdio>
# include <cstring>
# include <cstdlib>
# include <iostream>
# include <vector>
# include <queue>
# include <stack>
# include <map>
# include <bitset>
# include <set>
# include <cmath>
# include <algorithm>
using namespace std;
# define lowbit(x) ((x)&(-x))
# define pi acos(-1.0)
# define eps 1e-8
# define MOD 1000007
# define INF 1000000000
# define mem(a,b) memset(a,b,sizeof(a))
# define FOR(i,a,n) for(int i=a; i<=n; ++i)
# define FDR(i,a,n) for(int i=a; i>=n; --i)
# define bug puts("H");
# define lch p<<1,l,mid
# define rch p<<1|1,mid+1,r
# define mp make_pair
# define pb push_back
typedef pair<int,int> PII;
typedef vector<int> VI;
# pragma comment(linker, "/STACK:1024000000,1024000000")
typedef long long LL;
inline int Scan() {
    int x=0,f=1; char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-') f=-1; ch=getchar();}
    while(ch>='0'&&ch<='9'){x=x*10+ch-'0'; ch=getchar();}
    return x*f;
}
inline void Out(int a) {
    if(a<0) {putchar('-'); a=-a;}
    if(a>=10) Out(a/10);
    putchar(a%10+'0');
}
const int N=100005;
//Code begin...

int a[N];

int main ()
{
    int n, k;
    scanf("%d%d",&n,&k);
    FOR(i,1,n) scanf("%d",a+i);
    sort(a+1,a+n+1);
    int siz=unique(a+1,a+n+1)-a-1;
    if (k>a[siz]) {puts("IMPOSSIBLE"); return 0;}
    if (siz==1) {
        puts(a[1]==k?"POSSIBLE":"IMPOSSIBLE");
        return 0;
    }
    int d=INF;
    FOR(i,2,siz) d=min(d,a[i]-a[i-1]);
    bool flag=true;
    FOR(i,2,siz) {
        if ((a[i]-a[i-1])%d) {
            flag=false; break;
        }
    }
    if (flag) {
        puts((a[1]-k)%d?"IMPOSSIBLE":"POSSIBLE");
    }
    else puts("IMPOSSIBLE");
    return 0;
}


Measured memory_bytes: 640
/*
            _           __                _      _____ _____ _____ 
  ___ _   _| |__   ___ / _|_ __ ___  __ _| | __ |___  |___  |___  |
 / __| | | | '_ \ / _ \ |_| '__/ _ \/ _` | |/ /    / /   / /   / / 
| (__| |_| | |_) |  __/  _| | |  __/ (_| |   <    / /   / /   / /  
 \___|\__,_|_.__/ \___|_| |_|  \___|\__,_|_|\_\  /_/   /_/   /_/   

*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long long ll ;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<int> vl;
typedef vector<pll> vpll;
typedef unordered_map <ll,ll> umap ; 
//#pragma GCC optimize "trapv"
#define loop(i,a,b) for(ll i=a ;i<b;i++)
#define For(i,n) for(int i=0;i<(ll)n;i++)
#define Rev(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,n) for(int i=1;i<=n;++i)
#define F first
#define S second
#define pb push_back
#define em emplace_back
#define all(v) (v).begin(),(v).end()                                                              
#define mems(x, y) memset(x, y, sizeof(x))
#define sz(v) (v).size()
#define mp(a,b) make_pair(a,b)
#define pf(n) {cout<<n<<"\n" ; return ;}
#define po(n) cout << n <<"\n " 
#define pff(n) cout << n << " " ; 
#define ar array
#define endl "\n" 
#define PI acos(-1) 
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}
template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
//#ifndef ONLINE_JUDGE
//#ifndef LOCAL
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
//#else
//#define debug(x...)
//#endif
//#define int ll 
template<class T> using oset =tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update> ;
long const M=1e9+7;
const long mxN =1e5+2 ;
const ll INF =1e18;
void solve(){ 
  string s,t;cin >> s >> t ;
  int ans =0 ;int n =sz(s) ;
  for(int i=0;i<n;i++){
    ans+=(s[i]!=t[i]) ;
  }
  cout << ans << endl ;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  //cout << setprecision(20) << fixed ;
  solve() ;
  // ll t ; cin >> t ; while(t--)solve() ;
	return 0;
}


Measured memory_bytes: 3796
n, s = map(int, input().split())
a = list(map(int, input().split()))
mod = 998244353

dp = [[0] * (s + 1) for _ in range(n + 1)]
dp[0][0] = 1

for i, e in enumerate(a, 1):
    for j in range(s + 1):
        dp[i][j] += 2 * dp[i-1][j]
        if j - e >= 0:
            dp[i][j] += dp[i-1][j-e]

        dp[i][j] %= mod

ans = dp[n][s]
print(ans)



Measured memory_bytes: 132592