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

int main()
{
    int n,m;cin>>n>>m;
    char arr[n+2][m+2];
    int dp[n+2][m+2];
    dp[0][0]=1;
    
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<m;j++)
        cin>>arr[i][j];
    }
    memset(dp,0,sizeof(dp));
    dp[0][0]=1;
    for(int i=1;i<n;i++)
    {
        if(arr[i][0]!='#')dp[i][0]=dp[i-1][0];
    }
    for(int i=1;i<m;i++)
    {
        if(arr[0][i]!='#')dp[0][i]=dp[0][i-1];
    }
    for(int i=1;i<n;i++)
    {
        for(int j=1;j<m;j++)
        {
           if(arr[i][j]!='#') dp[i][j]=dp[i-1][j]+dp[i][j-1],dp[i][j]%=1000000000+7;
        }
    }
    /*for(int i=0;i<n;i++)
    {
        for(int j=0;j<m;j++)
        cout<<dp[i][j]<<" ";
        cout<<endl;
    }*/
    cout<<dp[n-1][m-1]<<endl;
}

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

int a,b;
string s;

int main()
{
	scanf("%d%d",&a,&b);
	cin>>s;
	if((int)s.length()!=a+b+1)
	{
		puts("No");
		return 0;
	}
	int cnt=0;
	for(int i=0;i<(int)s.length();i++)
	{
		if(s[i]=='-')cnt++;
	}
	if(cnt!=1)
	{
		puts("No");
		return 0;
	}
	cnt=0;
	for(int i=0;i<(int)s.length();i++)
	{
		if(isdigit(s[i]))cnt++;
		if(s[i]=='-')
		{
			if(cnt!=a)
			{
				puts("No");
				return 0;
			}
			cnt=0;
		}
	}
	if(cnt!=b)puts("No");
	else puts("Yes");
	return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;

#define MAXN 10005

int n;
long long cnta,cntb;
long long a[MAXN],b[MAXN];

int main()
{
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
        scanf("%lld",&a[i]);
    for(int i=1;i<=n;i++)
        scanf("%lld",&b[i]);
    for(int i=1;i<=n;i++)
    {
        long long t=a[i]-b[i];
        if(t>0LL)
            cnta+=t;
        else if(t<0LL)
            cntb+=(-t)/2;
    }
    if(cntb<cnta)
    {
        printf("No\n");
        return 0;
    }
    printf("Yes\n");
}


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

int main() {
    ll a, b;
    cin >> a >> b;
    ll sum = 1;
    ll cnt = 0;
    while (true) {
        sum += a-1;
        cnt++;
        if (sum >= b) break;
    }
    if (b == 1) cnt = 0;
    cout << cnt << endl;

    return 0;
}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.ListIterator;
import java.util.Map.Entry;

import java.util.PriorityQueue;
import java.util.Random;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;


public class Main {
	
	public static void main(String[] args) throws IOException {	
		try(final Scanner sc = new Scanner(System.in)){
			final String S = sc.next();
			final String T = sc.next();
			
			System.out.println(T.startsWith(S) && T.length() == S.length() + 1 ? "Yes" : "No");
		}
	}

	public static class Scanner implements Closeable {
		private BufferedReader br;
		private StringTokenizer tok;

		public Scanner(InputStream is) throws IOException {
			br = new BufferedReader(new InputStreamReader(is));
		}

		private void getLine() throws IOException {
			while(!hasNext()){
				tok = new StringTokenizer(br.readLine());
			}
		}

		private boolean hasNext() {
			return tok != null && tok.hasMoreTokens();
		}

		public String next() throws IOException {
			getLine();
			return tok.nextToken();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}
		

		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}

		public int[] nextIntArray(int n) throws IOException {
			final int[] ret = new int[n];
			for(int i = 0; i < n; i++){
				ret[i] = this.nextInt();
			}
			return ret;
		}

		public long[] nextLongArray(int n) throws IOException {
			final long[] ret = new long[n];
			for(int i = 0; i < n; i++){
				ret[i] = this.nextLong();
			}
			return ret;
		}

		public void close() throws IOException {
			br.close();
		}
	}
}


Measured memory_bytes: 32764
N, M = map(int, input().split())
edges = []
for _ in range(M):
    a, b = map(lambda x: int(x)-1, input().split())
    edges.append((a, b))

parent = [i for i in range(N)]
height = [1] * N

def find(i):
    while i != parent[i]:
        i = parent[i]
    return i

def union(i, j):
    i = find(i)
    j = find(j)
    if height[i] >= height[j]:
        parent[j] = i
        height[i] = max(height[i], height[j] + 1)
    else:
        parent[i] = j
        height[j] = max(height[j], height[i] + 1)

bridges = 0
for cand in range(M):
    parent = [i for i in range(N)]
    height = [1] * N
    islands = N
    for i in range(M):
        if i == cand:
            continue
        a, b = edges[i]
        if find(a) == find(b):
            continue
        islands -= 1
        union(a, b)
    if islands > 1:
        bridges += 1
print(bridges)



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

#define REP(i,s,n) for(int i=s;i<n;++i)
#define rep(i,n) REP(i,0,n)
#define fst first
#define snd second
#define pb push_back
#define ALL(x) x.begin(),x.end()
#define EPS (1e-9)
#define equals(a,b) (fabs((a)-(b))<EPS)

using namespace std;

bool LT(double a,double b) { return !equals(a,b) && a < b; }
bool LTE(double a,double b) { return equals(a,b) || a < b; }

const string YES = "";
const string NO  = "";

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

void solve() {

}

int main() {
  string s;
  cin >> s;
  rep(i,(int)s.size()) {
    if( s[i] == '?' )  cout << 'D';
    else cout << s[i];
  } puts("");

  return 0;
}


Measured memory_bytes: 3724
package main

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

func main() {
	h := getInt()
	w := getInt()

	ans := ""
	for i := 0; i <= h+1; i++ {
		if i == 0 || i == h+1 {
			ans += fmt.Sprintln(strings.Repeat("#", w+2))
		} else {
			ans += fmt.Sprintln("#" + getString() + "#")
		}
	}

	fmt.Println(ans)
}

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

var sc = bufio.NewScanner(os.Stdin)

func init() {
	tmp := 101
	sc.Buffer(make([]byte, tmp), tmp)
	sc.Split(bufio.ScanWords)
}

func getInt() int {
	i, err := strconv.Atoi(getString())
	if err != nil {
		panic(err)
	}
	return i
}

func getString() string {
	sc.Scan()
	s := sc.Text()
	return s
}


Measured memory_bytes: 1408
#include <iostream>
//#include <iomanip>
//#include <string>
//#include <vector>
//#include <algorithm>
//#include <utility>
//#include <set>
//#include <map>
//#include <queue>
//#include <deque>
//#include <bitset>
//#include <math.h>
using namespace std ;
using ll = long long ;
//using ld = long double ;
//using vll = vector<ll> ;
//using vvll = vector<vll> ;
//using vc = vector<char> ;
//using vvc = vector<vc> ;
//using vb = vector<bool> ;
//using vvb = vector<vb> ;
//using pll = pair<ll,ll> ;
//#define all(v) v.begin(),v.end()
//ll mod = 1000000007 ;
//long double pie = acos(-1) ;
//ll INF = 1000000000000 ;

//void yorn(bool a){if(a) cout << "Yes" << endl ; else cout << "No" << endl ;}
//void YorN(bool a){if(a) cout << "YES" << endl ; else cout << "NO" << endl ;}
//ll gcd(long long a,long long b){if(b==0) return a ; return gcd(b,a%b) ;}
//ll lcm(long long a,long long b){return a/gcd(a,b)*b ;}
//ll sa(long long a,long long b){if(a>b) return a-b ; return b-a ;}
//void mysort(vector<long long> &a){sort(a.begin(),a.end()) ;}
//void myrev(vector<long long> &a){reverse(a.begin(),a.end()) ;}
//void fix_cout(){cout << fixed << setprecision(20) ;}

int main(){
	ll a,b,c,d ;
	cin >> a >> b >> c >> d ;
	ll x = c-a ;
	ll y = d-b ;
	for(int i=0;i<x;i++) cout << 'R' ;
	for(int i=0;i<y;i++) cout << 'U' ;
	for(int i=0;i<x;i++) cout << 'L' ;
	for(int i=0;i<y+1;i++) cout << 'D' ;
	for(int i=0;i<x+1;i++) cout << 'R' ;
	for(int i=0;i<y+1;i++) cout << 'U' ;
	for(int i=0;i<1;i++) cout << 'L' << 'U' ;
	for(int i=0;i<x+1;i++) cout << 'L' ;
	for(int i=0;i<y+1;i++) cout << 'D' ;
	for(int i=0;i<1;i++) cout << 'R' << endl ;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

    public static void main( String[] args ){

        Scanner in = new Scanner(System.in);

        String[] params = in.nextLine().split(" ");
        int n = Integer.parseInt(params[0]);
        int d = Integer.parseInt(params[1]);

        int[][] x = new int[n][d];
        for( int i = 0 ; i < n ; i++ ){
            String[] rows = in.nextLine().split(" ");
            for( int j = 0 ; j < d ; j++ ){
                x[i][j] = Integer.parseInt(rows[j]);
            }
        }

        int count = 0;
        for( int nIndex = 0 ; nIndex < n - 1 ; nIndex++ ){
            for( int nIndex2 = nIndex + 1 ; nIndex2 < n ; nIndex2++ ){

                double square = 0;
                for( int j = 0 ; j < d ; j++ ){
                    square += (x[nIndex][j] - x[nIndex2][j])*(x[nIndex][j] - x[nIndex2][j]);
                }
                double result = Math.sqrt(square);

                if( result%1 == 0.0 ){
                    count++;
                }

            }
        }

        System.out.println(count);

        return;

    }
}

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

using namespace std;
typedef long long int ll;
typedef pair<ll, ll > pi;  
typedef pair<pair<ll, ll >, ll > pii;  
vector<ll > vec;
vector<vector<ll > > vec2;
ll MOD = 1000000007;
ll INF = 1145141919454519;

int main() {

    ll N;
    cin >> N;

    for(ll i = 0; i < N; i++){
        ll t; cin >> t;
        vec.push_back(t);
    }

    sort(vec.begin(), vec.end());

    cout << vec.back() - vec.front() << endl;

}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define YES() printf("YES\n")
#define NO() printf("NO\n")
#define Yes() printf("Yes\n")
#define No() printf("No\n")
#define out(x) cout << x << endl;
#define in(x,y,h,w) x >= 0 && x < h && y >= 0 && y < w

#define int long long
//typedef    long long          ll;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      P;

template <typename T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template <typename T> T &chmax(T &a, const T &b) { return a = max(a, b); }
 
const int INF=1e+18;
const double EPS=1e-9;
const int MOD=1000000007;

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

int mod_inv(int X){
	int a = X, b = MOD, u = 1, v = 0;
	while(b) {
		int t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	if(u < 0) u += MOD;
	return u;
}

signed main(){
	string s;
	int n,a[100010] = {},c[100010] = {},ans = 0,q = 0,p[100010] = {1};
	cin >> s;
	n = s.length();
	for(int i = 1;i <= n;i++) p[i] = p[i - 1] * 3 % MOD;
	for(int i = 0;i < n;i++){
		if(s[i] == '?') q++;
	}
	for(int i = 0;i < n;i++){
		a[i + 1] = a[i];
		if(s[i] == 'A') (a[i + 1] += 1) %= MOD;
		else if(s[i] == '?') (a[i + 1] += mod_inv(3)) %= MOD;
	}
	for(int i = n - 1;i >= 0;i--){
		c[i] = c[i + 1];
		if(s[i] == 'C') (c[i] += 1) %= MOD;
		else if(s[i] == '?') (c[i] += mod_inv(3)) %= MOD;
	}
	for(int i = 0;i < n;i++){
		if(s[i] == 'B') ans = (ans + a[i] * c[i + 1] % MOD) % MOD;
		else if(s[i] == '?') ans = (ans + a[i] * c[i + 1] % MOD * mod_inv(3) % MOD) % MOD;
	}
	cout << ans * p[q] % MOD << endl;
	return 0;
}

Measured memory_bytes: 2816
#include<iostream>
#include<vector>
#include<map>
#include<set>
#include<string>
#include<utility>
#include<algorithm>
#include<cstdio>
#include<iomanip>
#include<queue>
#include<stack>

#define ll int64_t
#define Rep(i, n) for (ll i = 0; i < n; i++)

using namespace std;

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

    ll N;
    cin >> N;
    vector<ll> A(N);
    ll a = 0;
    Rep (i, N) {
        cin >> A[i];
        if (i % 2 == 0) a += A[i];
        else a -= A[i];
    }

    a /= 2;
    Rep (i, N) {
        if (i) cout << " ";
        cout << 2 * a;
        a = A[i] - a;
    }
    cout << "\n";
}

Measured memory_bytes: 2176
n = int(input())
if n == 1:
    print(0)
    exit()

def factorization(num):
    arr = []
    temp = num
    for i in range(2, int(num**0.5)+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([num, 1])

    return arr

x = factorization(n)
ans = 0
for i in range(len(x)):
  x[i][1] -= 1
  ans += 1
  y = 2
  while x[i][1] > 0:
    x[i][1] -= y
    if x[i][1] >= 0:
      ans += 1
    y += 1
 
print(ans)

Measured memory_bytes: 9488
#include <bits/stdc++.h>
using namespace std;
int main(){
	int A,B,C,D;
	cin >> A >> B >> C >> D;
	int L = A + B, R = C + D;
	if(L > R) cout << "Left" << endl;
	else if(L == R) cout << " Balanced" << endl;
	else cout << "Right" << endl;
}

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

int main() {
  std::string n;
  cin>>n;
  if(n[0]==n[1] || n[1]==n[2] || n[2]==n[3]){
      cout<<"Bad"<<endl;
      }else{
          cout<<"Good"<<endl;
          }           
}

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

using namespace std;

using ll = long long;
using ld = long double;
using P = pair<int, int>;
constexpr ld EPS = 1e-12;
constexpr int INF = numeric_limits<int>::max() / 2;
constexpr int MOD = 1e9 + 7;

template <typename T>
void printv(const vector<T> &v) {
  int sz = v.size();
  for (int i = 0; i < sz; i++) {
    cout << v[i] << " \n"[i == sz - 1];
  }
}

int n;
vector<string> ret;
void dfs(string s, char nxt) {
  if ((int)s.size() == n) {
    ret.push_back(s);
    return;
  }
  auto snxt = s + nxt;
  dfs(snxt, nxt + 1);
  for (auto c = 'a'; c < nxt; c++) {
    auto ssnxt = s + c;
    dfs(ssnxt, nxt);
  }
  return;
}

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

  cin >> n;
  dfs("", 'a');
  sort(ret.begin(),ret.end());
  for(auto s:ret) cout << s << endl;
}


Measured memory_bytes: 7796
#include<cstdio>
#include<algorithm>
using namespace std;
int a[1110000];
long long cnt[1110000],ans[1110000];
bool cmp(int a,int b)
{return a>b;}
inline void read(int &x)
{
	x=0;register char c=getchar();
	while(c<48||57<c)c=getchar();
	for(;48<=c&&c<=57;c=getchar()) x=x*10+(c&15);
}
void write(const int x)
{
	if(x>9)write(x/10);
	putchar(x%10|48);
}
int main()
{
	int n;
	read(n);
	int x;
	for(int i=1;i<=n;i++)
	{
		read(x);
		a[x]++;
	}
	//a:the number of the xs
	int len;
	for(int i=1;i<=n;i++)
		cnt[a[i]]++;
	len--;
	//cnt:the number of the as
	
	for(int i=n;i;i--)
		cnt[i]+=cnt[i+1];
	int Ans=0;
	long long Cnt=0;
	for(int i=n;i;i--)
	{
		while((Cnt+cnt[Ans+1])>=1ll*i*(Ans+1))
			Cnt+=cnt[++Ans];
		ans[i]=Ans;
	}
	for(int i=1;i<=n;i++)
		write(ans[i]),putchar(10);
	return 0;
}

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

int main() {
  int D;
  cin >> D;
  string e,s;
  e =" Eve";
  s ="Christmas";
  if(D == 25)cout << s <<endl;
  if(D == 24)cout << s << e <<endl;
  if(D == 23)cout << s << e << e <<endl;
  if(D == 22)cout << s << e << e << e <<endl;
}

Measured memory_bytes: 3596
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

# 遅延評価で加えてあげるだけ

N,Q = map(int,input().split())
AB = [[int(x) for x in input().split()] for _ in range(N-1)]
PX = [[int(x) for x in input().split()] for _ in range(Q)]

graph = [[] for _ in range(N+1)]
for a,b in AB:
    graph[a].append(b)
    graph[b].append(a)

value = [0] * (N+1)
for p,x in PX:
    value[p] += x
    
q = [(1,0)]
while q:
    x,parent = q.pop()
    value[x] += value[parent]
    for y in graph[x]:
        if y == parent:
            continue
        q.append((y,x))

answer = ' '.join(map(str,value[1:]))
print(answer)


Measured memory_bytes: 150556
a,b,c,d = map(int,input().split())
#L = list(map(int,input()split()))
T = c//b
#print(T,c%b,a,b,c,d)
A = a//d
if c%b>0:
    #(c%d>0)
    T +=1
if a%d>0:
    A +=1
#print(T,A)
if T <= A:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 9116
#include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>
using namespace std;

int main()
{
	int i,N,K;
	long temp,ans;
	vector<long> h;
	cin>>N>>K;
	for(i=0;i<N;i++){
		cin>>temp;
		h.push_back(temp);
	}
	sort(h.begin(),h.end());
	ans=pow(10,9)+1;
	for(i=0;i<N-K+1;i++){
		temp=h.at(i+K-1)-h.at(i);
		if(temp<ans){
			ans=temp;
		}
	}					
	cout<<ans;
	return 0;
}


Measured memory_bytes: 1400
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rrep(i,a,b) for(int i=(int)(a);i>=(int)(b);--i)
#define fore(i,a) for(auto &i:a)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define isin(i,a,b) ((a) <= (i) && (i) < (b))
#define uni(a) (a).erase(unique(all(a)),(a).end())
#define fi first
#define se second
#define pb push_back
#define sz(a) (int)(a).size()
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
using ll  = long long;
using unit= unsigned;
using ull = unsigned long long;
using P   = pair<int,int>;
using vi  = vector<int>;
using vl  = vector<ll>;
using vvi = vector<vi>;
using vp  = vector<P>;
void _main(); int main(){ cin.tie(0); ios::sync_with_stdio(false); _main(); }
template<class T>void YES(T condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
template<class T>void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class T>void POSS(T condition){ if(condition) cout << "POSSIBLE" << endl; else cout << "IMPOSSIBLE" << endl; }
template<class T>void Poss(T condition){ if(condition) cout << "Possible" << endl; else cout << "Impossible" << endl; }
template<class T>bool chmax(T &a, const T &b){ if (a<b){ a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b){ if (b<a){ a = b; return 1; } return 0; }
template<class T>T gcd(T a, T b){ if (b==0){ return a; }else{ return gcd(b, a%b); }}
template<class T>T lcm(T a, T b){ return a / gcd(a, b) * b; }
constexpr double eps = 1e-10;
constexpr int inf = INT_MAX / 2;
constexpr ll infl = 1LL << 60;

bool CanSunukeGoBeyoundFunuke(int N, int A, int B, int C, int D, string S) {
  S[B-1] = '.';
  rep(i, max(2,B), D+1) {
    if (S[i-2] == '.' && S[i-1] == '.' && S[i] == '.') return true;
  }
  return false;
}

bool Solve(int N, int A, int B, int C, int D, string S) {
  if (C > D && CanSunukeGoBeyoundFunuke(N, A, B, C, D, S) == false) return false;
  S[C-1] = '.';
  S[D-1] = '.';
  rep(i, max(1,A), C) {
    if (S[i-1] == '#' && S[i] == '#') return false;
  }
  rep(i, max(1,B), D) {
    if (S[i-1] == '#' && S[i] == '#') return false;
  }
  return true;
}

void _main() {
  int N, A, B, C, D;
  string S;
  cin >> N >> A >> B >> C >> D >> S;
  Yes(Solve(N, A, B, C, D, S));
}

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

int main() {
    int N;
    scanf("%d", &N);

    vector<long long> a(N);
    long long sum_a = 0;
    long long sum_b = 0;
    for (int i = 0; i < N; i++) {
        scanf("%lld", &a[i]);
        if (i % 2 == 0 && a[i] >= 0) sum_a += a[i];
        if (i % 2 != 0 && a[i] >= 0) sum_b += a[i];
    }

    vector<int> cnt;
    if (sum_a == 0 && sum_b == 0){
        long long max = a[0];
        int idx = 0;
        for (int i = 1; i < N; i++) {
            if (max < a[i]) {
                max = a[i];
                idx = i;
            }
        }
        printf("%lld\n", max);
        printf("%d\n", N-1);
        for (int i = N-1; i > idx; i--) printf("%d\n", i+1);
        for (int i = 0; i < idx; i++) printf("%d\n", 1);
    } else {
        if (sum_a < sum_b) {
            a.erase(a.begin());
            cnt.push_back(1);
        } 
        while (a.size() > 3) {
            if (a[0] < 0) {
                a.erase(a.begin());
                cnt.push_back(1);
                a.erase(a.begin());
                cnt.push_back(1);
            } else {
                if (a[2] >= 0) {
                    a.erase(a.begin(), a.begin()+2);
                    cnt.push_back(2);
                } else {
                    a.erase(a.begin()+1, a.begin()+3);
                    cnt.push_back(3);
                }
            }
        }
        if (a.size() == 3) {
            if (a[0] < 0) {
                cnt.push_back(1);
                cnt.push_back(1);
            } else {
                if (a[2] < 0) {
                    cnt.push_back(3);
                    cnt.push_back(2);
                } else {
                    cnt.push_back(2);
                }
            }
        } else if (a.size() == 2) {
            cnt.push_back(2);
        }
        printf("%lld\n", max(sum_a, sum_b));
        printf("%d\n", cnt.size());
        for (int i = 0; i < cnt.size(); i++){
            printf("%d\n", cnt[i]);
        }
    }

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
typedef vector<ll> VI;
typedef vector<VI> VVI;
const ll MOD = 1000000007;
const ll INF = 2147483647;
const ll LINF = 9223372036854775807;
#define REP(i, n) for(int i = 0; i < n; i++)
#define ALL(v) v.begin(), v.end()

int main() {
	int n, m; cin >> n >> m;
	if (n == m)
		cout << "Yes";
	else
		cout << "No";
}

Measured memory_bytes: 256
X = int(input())

if X<=599:
  print(8)
elif X<=799:
  print(7)
elif X<=999:
  print(6)
elif X<=1199:
  print(5)
elif X<=1399:
  print(4)
elif X<=1599:
  print(3)
elif X<=1799:
  print(2)
else:
  print(1)

Measured memory_bytes: 9176
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = 1e9 + 7;
const int N = 2e5 + 5;
int parent[N],n,m,sum,vis[N];
void Init()
{
    for(int i = 1;i <= n;i++)
        parent[i] = i;
    return;
}

int get_boss(int v)
{
    if(parent[v] == v)
        return v;
    else
    {
        parent[v] = get_boss(parent[v]);
        return parent[v];
    }
}

void Merge(int v,int u)
{
    int t1 = get_boss(v);
    int t2 = get_boss(u);
    parent[t2] = t1;
    return;
}

int main()
{
    int i,a,b;
    scanf("%d %d",&n,&m);
    Init();
    for(i = 0;i < m;i++){
        scanf("%d %d",&a,&b);
        Merge(a,b);
    }
    int maxn = 0;
    for(i = 1;i <= n;i++){
    	vis[get_boss(i)]++;
    	maxn = max(vis[get_boss(i)],maxn);
    }
    printf("%d\n",maxn);
    return 0;
}

Measured memory_bytes: 5288
#define _USE_MATH_DEFINES
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <ctype.h>
#include <limits.h>	
#define inf (INT_MAX-1)
#define INF 9223372036854775807
#define EPS 1e-10
#define sq(n) ((n)*(n))
#define rep(i,n) for(i=0;i<n;i++)
#define rev(i,n) for(i=n-1;i>=0;i--)
#define sort(a,n) qsort(a,n,sizeof(TYPE),cmp)
#define sort_r(a,n) qsort(a,n,sizeof(TYPE),cmp_r);
#define chsort(s,n) qsort(s,n,sizeof(char),cmp)
#define chsort_r(s,n) qsort(s,n,sizeof(char),char_cmp_r);
#define TYPE int
#define MEMSET(a) memset(a,0,sizeof(a))
const int mod=(int)1e09+7;

int in(void){
	int i;scanf("%d",&i);
	return i;
}
long long llin(void){
	long long i;scanf("%lld",&i);
	return i;
}
double din(void){
	double i;scanf("%lf",&i);
	return i;
}
void chin(char s[]){
	scanf("%s",s);
}
void print(int a){
	printf("%d\n",a);
}
void llprint(long long a){
	printf("%lld\n",a);
}
void dprint(double a){
	printf("%.10f\n",a);
}
void print2(int a,int b){
	printf("%d %d\n",a,b);
}
long long max(long long a,long long b){
	return a>b?a:b;
}
long long min(long long a,long long b){
	return a<b?a:b;
}
long long llabs(long long a){
	return a>0?a:-a;
}
double dmax(double a,double b){
	return a>b?a:b;
}
int cmp(const void *a,const void *b){
	return *(TYPE *)a-*(TYPE *)b;
}
int cmp_r(const void *a,const void *b){
	return *(TYPE *)b-*(TYPE *)a;
}
int char_cmp(const void *a,const void *b){
	return strcmp((char *)a,(char *)b);
}
int char_cmp_r(const void *a,const void *b){
	return strcmp((char *)b,(char *)a);
}
void swap(int *a,int *b){
	int t=*a;
	*a=*b;
	*b=t;
}
long long gcd(long long x,long long y){
	return x%y?gcd(y,x%y):y;
}
long long lcm(long long x,long long y){
	return x/gcd(x,y)*y;
}

// konoshita kara kaku

int main(void){
	int x[3],i,ans=0;
	rep(i,3)x[i]=in();
	sort(x,3);
	while(x[1]!=x[2]){
		x[0]++;
		x[1]++;
		ans++;
	}
	while(x[0]+2<x[2]){
		x[0]+=2;
		ans++;
	}
	if(x[0]+2==x[1])ans++;
	else if(x[0]+1==x[1])ans+=2;
	print(ans);
	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define rep(i, n) for(int (i)=0; (i)<(n); (i)++)

using namespace std;
typedef long long ll;

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

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

  vector<int> A(N);
  vector<int> B(N); 
  for(int i=0; i<N; i++)
    {
      cin >> A[i];
      B[i]=A[i];
    }
  
  sort(B.begin(), B.end());

  for(int i=0; i<N; i++)
    if(A[i]!=B[N-1])
      cout << B[N-1] << endl;
    else
      cout << B[N-2] << endl;
  

  return 0;
}


//cout << setprecision(13);
//next_permutation(v.begin(), v.end());



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

int main() {
    int a, b, c;
    cin >> a >> b >> c;

    if (a == b && a != c && b != c) cout << "Yes" << endl;
    else if (a == c && a != b && b != c) cout << "Yes" << endl;
    else if (b == c && a != b && a != c) cout << "Yes" << endl;
    else {
        cout << "No" << endl;
    }
}

Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#include"bits/stdc++.h"
#ifdef _DEBUG
#define DBG(n) n
#else
#define DBG(n)
#endif
#define INF          1e9
#define INFLL        1e18
#define EPS          1e-9
#define MOD          1000000007
#define REP(i,n)     for(ll i=0,i##_len=(n);i<i##_len;++i)
#define REP1(i,n)    for(ll i=1,i##_len=(n);i<=i##_len;++i)
#define REPR(i,n)    for(ll i=(n)-1;i>=0;--i)
#define REPR1(i,n)   for(ll i=(n);i>0;--i)
#define REPC(i,obj)  for(auto i:obj)
#define ALL(obj)     (obj).begin(),(obj).end()
#define SETP(n)      cout<<fixed<<setprecision(n)
#define VV(T,h,w)    move(vector<vector<T>>(h,move(vector<T>(w))))
#define VVI(T,h,w,i) move(vector<vector<T>>(h,move(vector<T>(w,i))))
using namespace std;
using ll = long long;
template<typename T = ll>inline T in() { T ret; cin >> ret; return ret; }

int main()
{
	string s; cin >> s;
	cout << (s[0] == s[2] ? "Yes" : "No") << endl;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
#include <math.h>
#include <cmath>

using namespace std;
using ll =long long;
using vi = vector<int>; 
using vvi = vector<vi>; 
using vl = vector<ll>; 
using vvl = vector<vl>; 
using vs = vector<string>;
using vvs = vector<vs>; 
using vc = vector<char>;
using vvc = vector<vc>; 
using vb = vector<bool>;
using vvb = vector<vb>; 

#define rep(i,n); for( int i =0; i < n ; i ++)
#define all(a) a.begin(),a.end()
#define pb(a) push_back(a)
#define pd(a) printf("%.10f\n",a)
#define mem(a) memset(a,0,sizeof(a))
#define f(i,a,b) for(int i=a;i<b;i++)
#define pri(a)  printf("%.14lf\n",a);
#define MOD 1000000007
typedef pair<int, int> P;
bool is_int_lround(double x){
  return std::lround(x)==x;
}
ll keta(ll x){
  ll n=0;
  while(x>0){
    x /=10 ;
    n ++;
  }
  return n;
}

ll conbi(int n,int m){
  
  cin>>n>>m;
  vector<ll> a(100);
  a[0] =1;
  for(int i=0;i<14;i++){
    a[i+1]=a[i]*(i+1);
  }
  return a[n] /(a[m] *a[n-m]);
}

long long modpow(long long a, long long n, long long mod) {
    long long res = 1;//繰り返し二乗法
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
ll kaijo(ll x){
  ll z=1;
  while(x>0){
    z *=x;
    z %=MOD;
    x--;
  }
  return z;
}
ll yakusu_num(ll n){
  vl yakusu(n+1,1);
  for(ll i=2;i*i<=n;i++){ 
    while(n%i==0){
      n /=i;
      yakusu[i]++;
    }
  }
  if(n!=1)yakusu[n]++;
  ll num=1;
  for(ll i=0;i <=n;i++){
    num*=yakusu[i];
  }
  return num;
}


//cout<<""<<endl;
int main(){
 ll N,M,X;cin>>N>>M>>X;vl C(N);
  vvl A(N,vector<ll> (M));
  bool ok=true;
  ll ans=10000000000;
  ll cnt=0;
  rep(i,N){
    cin>>C[i];
    rep(j,M){
      cin>>A[i][j];
    }
  }
  vl han(M);
  rep(i,M){
    rep(j,N){
      han[i]+=A[j][i];
    }
    
    if(han[i]<X)ok=false;
  }
  if(!ok)cout<<-1<<endl;
  else{
    for (int tmp = 0; tmp < (1 << N); tmp++) {
      bitset<12> s(tmp);
      cnt =0;
      bool ok2 =true;
      rep(i,M){
        han[i]=0;
      }
      for(int k=0;k<N;k++){
        if(s.test(k)){
          rep(j,M){
            han[j]+=A[k][j];
          }
          cnt +=C[k];
        }
      }
      rep(i,M){
        if(han[i]<X)ok2=false;
      }
      if(ok2)ans=min(cnt,ans);
    }
   cout<<ans<<endl;
  }
  
}


Measured memory_bytes: 3588
#pragma once
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <deque>
#include <numeric>
#include <iomanip>
#define M_PI acos(-1)
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int INF = 1000000007;
const int MAX_V = 201;
int now = 0;

const int MAX = 510000;
const int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < MAX; i++) {
		fac[i] = fac[i - 1] * i % MOD;
		inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
		finv[i] = finv[i - 1] * inv[i] % MOD;
	}
}

// 二項係数計算
long long COM(int n, int k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
struct edge {
	int t;
	edge(int _t) : t(_t) {}
};
bool use[100010];


vector<edge> te[100010];
vector<edge> fe[100010];
int t[64];
int d[100100];
ll rec(int num) {
	if (num == 0) return 0;
	return rec(num - 1) + num;
}
ll gcd(int a, int b) {
	if (b == 0) return a;
	return gcd(b, a % b);
}


void Solve() {
	ll n;
	cin >> n;

	ll nt = n;
	int c = 0;
	bool all9 = true;
	while (nt >= 10)
	{
		if (nt % 10 != 9) all9 = false;
		nt /= 10;
		c++;
	}
	int res = c * 9;
	res += all9 ? nt : nt - 1;
	cout << res << endl;
}


int main() {
	Solve();
	return 0;
}



Measured memory_bytes: 6016
/*
　　　∫ ∫ ∫
　　　ノヽ
　　（＿　 ）
　（＿　　　 ）
（＿＿＿＿＿＿ ）
　ヽ(´･ω･)ﾉ　
　　 |　 /
　　 UU
*/
#pragma region macro
#include <bits/stdc++.h>
typedef long long int64;
using namespace std;
using P = pair<int64, int64>;
typedef vector<int> vi;
const int MOD = (int)1e9 + 7;
const int64 INF = 1LL << 62;
const int inf = 1<<30;
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; }
#define REP(i, n) for (int i = 0; i < (n); i++)
#define FOR(i,s,n) for (int i = s; i < (n); i++)
#define ALL(obj) (obj).begin(), (obj).end() //コンテナじゃないと使えない!!
#define debug(x) cerr << #x << ": " << x << "\n";
#define mp make_pair
#define bn '\n'
template <typename T>
ostream& operator<<(ostream& os, const vector<T> &V){
    int N = V.size();
    REP(i,N){
        os << V[i];
        if (i!=N-1) os << " ";
    }
    os << "\n";
    return os;
}
template <typename T,typename S>
ostream& operator<<(ostream& os, pair<T,S> const&P){
    os << "(";
    os << P.first;
    os << " , ";
    os << P.second;
    os << ")";
    return os;
}
template <typename T>
ostream& operator<<(ostream& os, set<T> &S){
    auto it=S.begin();
    while(it!=S.end()){
        os << *it;
        os << " ";
        it++;
    }
    os << "\n";
    return os;
}
template <typename T>
ostream& operator<<(ostream& os, deque<T> &q){
    for(auto it=q.begin();it<q.end();it++){
        os<<*it;
        os<<" ";
    }
     os<<endl;
    return os;
}
vector<pair<int,int>> dxdy = {mp(0,1),mp(1,0),mp(-1,0),mp(0,-1)};
#pragma endregion
//fixed<<setprecision(10)<<ans<<endl;



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


    vector<int64> A(4);
    cin >> A[0] >> A[1] >> A[2] >> A[3];
    sort(A.begin(),A.end());



    cout << abs(A[0]+A[3]-A[1]-A[2]) << endl;
}


Measured memory_bytes: 3220
N,M=map(int,input().split())
shop_list = [0]*N
cost = 0

for i in range(N):
  shop_list[i]=list(map(int,input().split()))
  
shop_list.sort(key= lambda x: x[0])
for A,B in shop_list:
  if B < M:
    M -= B
    cost += A*B
  elif B >= M:
    cost += A*M
    M = 0
  if M==0:
    break

print(cost)



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

int main()
{
	int n,m,j,y,p=0;
	cin>>n>>m;
	int a[n+1],b[n+1];
	for(int i=1;i<=n;i++)
	{
		cin>>a[i];
		b[i]=0;
	}
	for(int i=1;i<=m;i++)
	{
		cin>>j>>y;
		if(a[j]>a[y])
		swap(j,y);
		else if
		(a[j]==a[y])
		b[y]++;
		b[j]++;
	}
	for(int i=1;i<=n;i++)
	{
		if(b[i]==0)
		p++;
	}
	cout<<p;
	return 0;
}

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

int compare_int(const void *a, const void *b){return *(int*)a - *(int*)b;}

int main(void){
	int N,X,i;
	scanf("%d%d",&N,&X);
	int x[N+1];
	for(i=0;i<N;i++)scanf("%d",&x[i]);
	x[N] = X;
	qsort(x, N+1, sizeof(int), compare_int);
	int def[N];
	for(i=0;i<N;i++)def[i] = x[i+1]-x[i];
	qsort(def,N, sizeof(int), compare_int);
	int a,b,r,ans=def[0];
	for(i=0;i<N-1;i++){
		a = def[i+1];
		b = ans;
		r = a % b;
		while(r != 0){
			a = b;
			b = r;
			r = a % b;
		}
		ans = b;
	}
	printf("%d",ans);
	
	return 0;
}

Measured memory_bytes: 1396
#include<iostream>
#include<algorithm>
using namespace std;
int main () {
   long long int n,k,l=1000000007;cin>>n>>k;
   long long int a[n],c[n]={0},d[n]={0},w=0,count1=0;
   for (long long int i=0;i<n;i++) cin>>a[i];
   for (long long int j=0;j<n;j++) {
   	long long int s=a[j];
   	for (long long int z=j+1;z<n;z++) {
   		if (s>a[z]) count1++;
	   }
	   d[w]=count1;
	   count1=0;
	   w++;
   }
   sort (a,a+n);
   long long int x=2,v=0;
   c[0]=0;
   for (long int i=1;i<n;i++) {
   	if (a[i]!=a[i-1]) c[i]=i;
   	else c[i]=c[i-1];
   }
     //sort (a,a+n);
   //for (long long int i=0;i<n;i++) cout<<d[i]<<" ";
    long long int sum=0;
    for (long long int i=0;i<n;i++) {
   	long long int h;
   	h=(d[i]%l)*(k%l);
   	sum+=h%l;
   	if (sum>l) sum=sum%l;
   }
   //long long int sum=0;
   //for (long long int i=0;i<n;i++) cout<<c[i]<<" ";
   for (long long int i=0;i<n;i++) {
   	long long int g=k*(k-1)/2,h;
   	h=(c[i]%l)*(g%l);
   	sum+=h%l;
   	if (sum>l) sum=sum%l;
   }
   long long int t=sum%l;
   cout<<t<<endl;}

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

#ifdef LOCAL
#define debug(var) cerr << #var << " = " << var << endl;
#else
#define debug(var)
#endif

void init() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
}

const int N = 1e5+34;
const int M = 2e5+34;

int a[N];
vector<pair<int, int>> g[N];

bool bio[N];
bool dfs(int u, int c) {
  a[u] = c;
  bio[u] = true;
  bool ret = false;
  for (const auto &e: g[u]) {
    if (bio[e.first]) {
      if (a[e.first]-a[u] != e.second) return true;
      continue;
    }
    ret |= dfs(e.first, c+e.second);
  }
  return ret;
}

void solve() {
  int n, m; scanf("%d%d", &n, &m);
  for (int i = 0; i < m; ++i) {
    int l, r, d; scanf("%d%d%d", &l, &r, &d);
    g[--l].emplace_back(--r, d);
    g[r].emplace_back(l, -d);
  }
  for (int i = 0; i < n; ++i) {
    if (bio[i]) continue;
    if (dfs(i, 0)) {
      printf("No");
      return;
    }
  }
  printf("Yes");
}

int main() {
  init();
  int t = 1; //scanf("%d", &t);
  while (t--) {
    solve();
  }
  return 0;
}


Measured memory_bytes: 17332
#include <cassert>

#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
//#include <boost/foreach.hpp>
//#include <boost/range/algorithm.hpp>
#define rep(i,j,k) for(int i=(int)j;i<(int)k;i++)
#define ll long long
#define Sort(v) sort(all(v))
#define INF 1e9
#define LINF 1e18
#define END return 0
#define pb push_back
#define se second
#define fi first
#define pb push_back
#define all(v) (v).begin() , (v).end()
#define MP make_pair
#define MOD 1000000007LL
#define int long long
using namespace std;
int day[12]={31,28,31,30,31,30,31,31,30,31,30,31};
int dx[]={0,1,0,-1};
int dy[]={1,0,-1,0};
struct edge{int to,cost;};
typedef pair<int,int> P;

bool isupper(char c){if('A'<=c&&c<='Z')return 1;return 0;}
bool islower(char c){if('a'<=c&&c<='z')return 1;return 0;}
bool isPrime(int x){if(x==1)return 0;if(x==2)return 1;if(x%2==0)return 0;for(int i=3;i*i<=x;i++)if(x%i==0)return 0;return 1;}
bool iskaibun(string s){for(int i=0;i<s.size()/2;i++)if(s[i]!=s[s.size()-i-1])return 0;return 1;}
bool isnumber(char c){return ('0'<=c&&c<='9');}
bool isalpha(char c){return (isupper(c)&&islower(c));}
void printvi(vector<int> v){rep(i,0,v.size()){if(i)cout<<" ";cout<<v[i];}cout<<endl;}
void printvil(vector<int> v){rep(i,0,v.size()){cout<<v[i]<<endl;}}
void printvvi(vector<vector<int>> v){
    rep(i,0,v.size()){
        rep(j,0,v[i].size())cout<<v[i][j];
        cout<<endl;
    }
}
void printvstr(vector<string> v){
    rep(i,0,v.size()){
        cout<<v[i]<<endl;
    }
}

signed main (){
    int v[3];
    rep(i,0,3)cin>>v[i];
    sort(v,v+3);
    if(v[0]==5&&v[1]==5&&v[2]==7)cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
    
}
/*

*/


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

int main(){
	string s;
	ll ans=0;
	cin>>s;
	ll slen=s.length();
	for(int i=0;i<slen;i++){
		if(s[i]=='1'){
			ans++;
		}
	}
	cout<<ans<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main(void){
 int N,A,B;
 cin>>N;
 if(N == 1){
     cout<<"Hello World";
 }
 else{
     cin>>A>>B;
     cout<<A+B;
 }
    return 0;
}

Measured memory_bytes: 256
N = int(input())
A = list(map(int, input().split()))


def insertion_sort(A, N):
    for i in range(1, N):
        v = A[i]
        j = i - 1
        while j >= 0 and A[j] > v:
            A[j+1] = A[j]
            j -= 1
        A[j+1] = v
        print(*A)

print(*A)
insertion_sort(A, N)

Measured memory_bytes: 8096
#include <bits/stdc++.h>
using namespace std;
 
#define REP(i, s) for (int i = 0; i < s; ++i)
#define ALL(v) (v).begin(), (v).end()
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define DEBUG
#define int long long
#define INF 1e9
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }
template<class T> ostream& operator << (ostream &s, set<T> P)
{ EACH(it, P) { s << "<" << *it << "> "; } return s << endl; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P)
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s << endl; }
template<class T>void show(vector<T>v){for (int i = 0; i < v.size(); i++){cerr<<v[i]<<" ";}cerr<<"\n";}
typedef long long ll;
set<string>st;

signed main(){
   int n;
   string s;
   cin>>n>>s;
   int cnt=0;
   for (int i = 0; i < 1000; i++)
   {
       vector<int>v;
        int copy=i;
       while(copy>0){
           v.push_back(copy%10);
           copy/=10;
       }
       if(v.size()==0){
           v.push_back(0);
           v.push_back(0);
           v.push_back(0);
           
       }
       if(v.size()==1){
           v.push_back(0);
           v.push_back(0);
       }
       if(v.size()==2){
           v.push_back(0);
       }
       bool flag0=false;
    bool flag1=false;
    bool flag2=false;
    bool flag3=false;
    for (int j = 0; j < s.size(); j++)
    {
        if(v[2]==s[j]-'0' && !flag0){
            flag1=true;
            flag0=true;
            continue;
        }
        if(v[1]==s[j]-'0' && flag1){
            flag2=true;
            flag1=false;
            continue;
        }
        if(v[0]==s[j]-'0' && flag2 && !flag1){
            flag3=true;
            flag2=flag1=false;
            continue;
        }
    }
    if(flag3) {
        cnt++;
       // show(v);
    }

   }
   cout<<cnt<<endl;
   
    return 0;
}

Measured memory_bytes: 256
/******************************************
* AUTHOR : kamesh_11 *
* INSTITUTION : GVPCOE *
******************************************/

#include <bits/stdc++.h>
using namespace std;

#define pi 3.141592653589793
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define bs binary_search
#define endl '\n'
#define start_clock clock_t beginn=clock()
#define end_clock clock_t endd=clock()
#define cal_exec_time double time_spent=(double)(endd-beginn)/CLOCKS_PER_SEC
#define print_exec_time cout<<endl<<time_spent<<" secs"

typedef long long int ll;

const ll MOD = 1e9 + 7;

ll powmod(ll a,ll b) {ll res=1;a%=MOD; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%MOD;a=a*a%MOD;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}

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

    int n;
    cin>>n;

    if(n%1000 == 0)
        cout<<"0";
    else{
        int div = n/1000;
        div += 1;
        int x = 1000 * div;
        cout<<x - n;
    }

    return 0;
}

Measured memory_bytes: 3644
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, j, n) for (int i = j; i < n; i++)
#define all(x) (x).begin(),(x).end()
#define INF (1<<30)

/////////////////////////////////////////////////////////

void Main(){
  int N, M; cin >> N >> M;
  vector<vector<int>> V(N);
  rep(i, 0, M){
    int a, b; cin >> a >> b;
    a--; b--;
    V[a].push_back(b);
    V[b].push_back(a);
  }
  string res = "IMPOSSIBLE";
  for(int i = 0; i < V[0].size(); i++){
    for(int j = 0; j < V[V[0][i]].size(); j++){
      if(V[V[0][i]][j] == N - 1) res = "POSSIBLE";
    }
  }
  cout << res << endl;
}

/////////////////////////////////////////////////////////

int main(){
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  //cout << std::fixed << std::setprecision(15);

  Main();
}


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

using namespace std;

int main() {
  int N, D, X;
  cin >> N >> D >> X;
  int a[N];
  for (int i = 0; i < N; i++) {
    cin >> a[i];
  }

  int sum = 0;
  for (int i = 0; i < N; i++) {
    sum++;
    for (int j = 2; j <= D; j++) {
      int v = (a[i] * (j -1)) + 1;
      if (v <= D) {
        sum++;;
      }
    }
  }
  sum += X;
  cout << sum << endl;
  return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int N,A[200200],V[200200]; long long ans;

int main()
{
	scanf ("%d",&N);
	for (int i=1;i<=N;i++){
		scanf ("%d",&A[i]);
		if (A[i-1] == 0) V[i] = V[i-1];
		else V[i] = i-1;
		int j = V[i], x = A[i];
		while (j > 0){
			if (A[j] & x) break;
			x ^= A[j];
			j = V[j];
		}
		ans += i - j;
	}
	printf ("%lld\n",ans);

	return 0;
}

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

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

    vector<int> x(N), a(N);
    for (auto& y : x) cin >> y;

    x.push_back(X);
    sort(x.begin(), x.end());

    for (int i = 1; i < x.size(); i++) {
        a.push_back(x[i] - x[i - 1]);
    }

    int t = a[0];
    for (int i = 1; i < a.size(); i++) {
        t = __gcd(t, a[i]);
    }
    cout << t << endl;

    return 0;
}


Measured memory_bytes: 1408
#include<stdio.h>
int main(void){
  char *s="python3 -c\""
"_,t=open(0);m=a=0\n"
"for h in map(int,t.split()):a+=h>=m;m=max(m,h)\n"
"print(a)\n"
"\"";
  system(s);
  return 0;
}            

Measured memory_bytes: 3280
#include <iostream>
#include <queue>

using namespace std;

int main(void)
{	
	int n;
	cin >> n;
	
	priority_queue<int> q;
	int t;
	for (int i = 0; i < n; i++) {
		cin >> t;
		q.push(t);
	}
	int ans = q.top();
	q.pop();
	ans /= 2;

	while (!q.empty()) {
		ans += q.top();
		q.pop();
	}
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
from heapq import heappush, heappop
n, m, s, t = map(int, input().split())

s_dist = [float('inf')] * (n+1)
t_dist = [float('inf')] * (n+1)
yen_edge = {}
snu_edge = {}
for i in range(m):
  u, v, a, b = map(int, input().split())
  if u not in yen_edge:
    yen_edge[u] = {}
    snu_edge[u] = {}
  if v not in yen_edge:
    yen_edge[v] = {}
    snu_edge[v] = {}
  yen_edge[u][v] = yen_edge[v][u] = a
  snu_edge[u][v] = snu_edge[v][u] = b

def dijkstra(dist, edge, s):
  end = set()
  q = []
  dist[s] = 0
  heappush(q, (0, s))
  while len(q):
    c, k = heappop(q)
    if dist[k] < c:
      continue
    end.add(k)
    for j, cost in edge[k].items():
      if j not in end:
        if dist[j] > c + cost:
          dist[j] = c + cost
          heappush(q, (dist[j], j))

dijkstra(s_dist, yen_edge, s)
dijkstra(t_dist, snu_edge, t)

ans = []
ans.append(s_dist[n]+t_dist[n])
for i in range(n-1, 0, -1):
  ans.append(min(ans[-1], s_dist[i]+t_dist[i]))

money = 10 ** 15
for a in ans[::-1]:
  print(money - a)

Measured memory_bytes: 109520
import java.util.Arrays;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int x = sc.nextInt();
		int[] d = new int[n];
		int[] c = new int[n];
		for(int i=0;i<n;i++) {
			d[i] = sc.nextInt();
			c[i] = sc.nextInt();
		}
		Queue<Long> q = new PriorityQueue<Long>();
		q.offer(0L);
		int[] dist = new int[200001];
		Arrays.fill(dist, 1 << 29);
		while(!q.isEmpty()) {
			long cx = q.poll();
			int bx = (int) cx;
			int bc = (int) (cx >>> 32);
//			System.out.println(bx + "," + bc);
			if (bx == x) {
				System.out.println(bc);
				return;
			}
			for(int i=0;i<n;i++) {
				for(int dir=-1;dir<=1;dir+=2) {
					int nx = bx + d[i] * dir;
					int nc = bc + c[i];
					if (nx < 0 || nx > 200000) {
						continue;
					}
					if (dist[nx] > nc) {
						dist[nx] = nc;
						q.offer(((long) nc << 32) | nx);
					}
				}
			}
		}
		System.out.println(-1);
	}

}


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

int main(){
    ll n,p;cin>>n>>p;
    map<ll, int> mp;
    for(ll i=2; i*i<=p; i++){
        if(p%i==0){
            while(p%i==0){
                mp[i]++;
                p /= i;
            }
        }
    }
    if(p!=1)mp[p]++;
    
    ll ans = 1;
    
    for(auto m: mp){
        ll key = m.first;
        ll len = m.second;
        len /= n;
        while(len){
            ans *= key;
            len--;
        }
    }
    
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3632