akhauriyash/Code-Regression huggingface dataset:
import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        final int n = sc.nextInt();
        int m = sc.nextInt();
        boolean[][] graph = new boolean[n][n];
        boolean[] vid = new boolean[n];
        for(int i = 0;i < m;i++){
            int ai = sc.nextInt()-1;
            int bi = sc.nextInt()-1;
            graph[ai][bi] = true;
            graph[bi][ai] = true;
        }
        vid[0] = true;
        System.out.println(dfs(0, n, vid, graph));
    }
    public static int dfs(int v, int N, boolean[] Vid, boolean[][] Graph){
        for(int i = 0;i < N;i++){
            if(!Vid[i])     break;
            if(i == N-1)    return 1;
        }
        int ret = 0;
        for(int i = 0;i < N;i++){
            if(!Graph[v][i] || Vid[i])    continue;
            Vid[i] = true;
            ret += dfs(i, N, Vid, Graph);
            Vid[i] = false;
        }
        return ret;
    }
}

Measured memory_bytes: 21844
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,sqrt,factorial,hypot,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from fractions import gcd
from random import randint
def ceil(a,b): return (a+b-1)//b
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    A,B,C,D=MI()
    while(1):
        C-=B
        if(C<=0):
            print("Yes")
            break
        A-=D
        if(A<=0):
            print("No")
            break
if __name__ == '__main__':
    main()

Measured memory_bytes: 83376
while True:
    w, h = map(int, input().split())
    if w == h == 0:
        break

    #path[x][y][k]... kは0123が上下左右
    path = [[[True] * 4 for _ in range(w)] for _ in range(h)]
    for i in range(2 * h - 1):
        s = list(map(int, input().split()))
        x = i // 2

        if i % 2 == 0:
            for j in range(w-1):
                if s[j] == 1:
                    path[x][j][3] = False
                    path[x][j+1][2] = False
        else:
            for j in range(w):
                if s[j] == 1:
                    path[x][j][1] = False
                    path[x+1][j][0] = False

    from collections import deque
    que = deque()
    move = [(-1, 0, 0), (1, 0, 1), (0, -1, 2), (0, 1, 3)]
    inf = 10 ** 7
    d = [[inf] * w for _ in range(h)]
    que.append((0, 0))
    d[0][0] = 1

    while que:
        px, py = que.popleft()
        if px == h-1 and py == w-1:
            break
        for dx, dy, k in move:
            qx, qy = px + dx, py + dy
            if 0 <= qx < h and 0 <= qy < w \
                and path[px][py][k] == True and d[qx][qy] == inf:
                d[qx][qy] = d[px][py] + 1
                que.append((qx, qy))

    print(0 if d[h-1][w-1] == inf else d[h-1][w-1])


Measured memory_bytes: 6220
#include <bits/stdc++.h>
#define ll long long
#define ull unsigned ll
#define ld long double
#define pll pair<ll, ll>
#define pii pair<int, int>
#define f first
#define se second
#define pb push_back
#define ft fflush(stdout)
 
 
using namespace std;
 
 
const int N = 1e5 + 123;
const int PLS = 3e5 + 123;
const ll mod = 1e9 + 7;
const ll inf = 1e16;


ll n, k, a[N], dp[N], p[N];


ll get(ll l, ll r) {
    return ((p[r] - p[l - 1]) % mod + 2 * mod) % mod;
}


int main() {
    ios_base::sync_with_stdio(NULL);
    cin.tie(NULL); cout.tie(NULL);
    cin >> n >> k;
    for (int i = 1; i <= n; i++)
        cin >> a[i];
    dp[0] = 1;
    for (int j = 0; j <= k; j++)
        p[j] = 1;
    for (int i = 1; i <= n; i++) {
        for (int j = 0; j <= k; j++)
            dp[j] = get(max(0ll, j - a[i]), j);
        p[0] = dp[0];
        for (int j = 1; j <= k; j++)
            p[j] = (p[j - 1] + dp[j]) % mod;
    }
    cout << dp[k];
}

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

int main() {
  string S;
  cin >> S;

  int mp[3] = {0};
  for (char c : S) mp[c-'a']++;

  string ans = "YES";
  int mi = *min_element(begin(mp), end(mp));
  int ma = *max_element(begin(mp), end(mp));
  if (1 < ma - mi) ans = "NO";
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3708
#include <stdio.h>
#include <iostream>
#include <string>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <queue>
#include <vector>
#include <iomanip>
using namespace std;


int main(){
    // input
    int N, X; cin >> N >> X;
    vector<int> L(N);
    for (int i = 0; i < N; i++){
        cin >> L.at(i);
    }

    // compute
    int D = 0;
    int cnt = 0;
    while(D <= X){
        cnt++;
        if(cnt == N+1) break;
        D = D + L.at(cnt-1);
    }

    // output
    cout << cnt << endl;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a) (a).begin(),(a).end()
#define pb emplace_back
#define INF (1e9+1)

int main(){
    int x;
    cin>>x;
    
    cout<<"ai1333"<<string(x/100,'3')<<endl;
}



Measured memory_bytes: 3164
# -*- coding: utf-8 -*-
"""
Created on Sat Feb 16 20:52:46 2019

@author: Owner
"""


import collections
import scipy.misc
import sys
import numpy as np
import math
from operator import itemgetter
import itertools
import copy

#素因数を並べる
def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n /= i
      table.append(int(i))
    i += 1
  if n > 1:
    table.append(int(n))
  return table   
# 桁数を吐く
def digit(i):
    if i > 0:
        return digit(i//10) + [i%10]
    else:
        return []
    
def getNearestValueIndex(list, num):
    """
    概要: リストからある値に最も近い値のインデックスを取得する関数
    @param list: データ配列
    @param num: 対象値
    @return 対象値に最も近い値
    """

    # リスト要素と対象値の差分を計算し最小値のインデックスを取得
    idx = np.abs(np.asarray(list) - num).argmin()
    return idx

"""
N, X = map(int, input().split())

x = [0]*N
x[:] = map(int, input().split())

P = [0]*N
Y = [0]*N
for n in range(N):
    P[n], Y[n] = map(int, input().split())
    
all(nstr.count(c) for c in '753')

# 複数配列を並び替え
ABT = zip(A, B, totAB)
result = 0
# itemgetterには何番目の配列をキーにしたいか渡します
sorted(ABT,key=itemgetter(2))
A, B, totAB = zip(*ABT)
A.sort(reverse=True)

# 2進数のbit判定
(x >> i) & 1

# dp最小化問題
dp = [np.inf]*N
for n in range(N):
    if n == 0:
        dp[n] = 0
    else:
        for k in range(1,K+1):
            if n-k >= 0:
                dp[n] = min(dp[n], dp[n-k] + abs(h[n]-h[n-k]))
            else:
                break

"""

S = input()
T = S.split('/')

date = int(T[1]+T[2])
if date <= 430:
    print('Heisei')
else:
    print('TBD')


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

int main()
{
  int K,N;
  cin >> N >> K;
  int ans = K;
  
  if(N > 1)
  {
    for(int i=0; i<N-1; i++)
    {
      ans *= K-1;
    }
  }  
  cout << ans;
}
  
  

Measured memory_bytes: 3640
A, B = input().split()

kA = int(A[0:3]) * 100 + int(A[1:2]) * 10 + int(A[0:1])
kB = int(B[0:3]) * 100 + int(B[1:2]) * 10 + int(B[0:1])

maxB = int(B[0:3]) + int(kB <= int(B))
maxA = int(A[0:3]) + int(kA < int(A))

print(maxB - maxA)

Measured memory_bytes: 3064
#include <stdio.h>

typedef int keytype;

void inssort(int n, keytype a[])
{
    int i, j;
    keytype x;

    for (i = 1; i < n; i++) {
        x = a[i];
        for (j = i - 1; j >= 0 && a[j] < x; j--)
            a[j + 1] = a[j];
        a[j + 1] = x;
    }
}

#define THRESHOLD 10
#define STACKSIZE 32  /* たかだか int のビット数程度 */

void quicksort(int n, keytype a[])
{
    int i, j, left, right, p;
    int leftstack[STACKSIZE], rightstack[STACKSIZE];
    keytype x, t;

    left = 0;  right = n - 1;  p = 0;
    for ( ; ; ) {
        if (right - left <= THRESHOLD) {
            if (p == 0) break;
            p--;
            left = leftstack[p];
            right = rightstack[p];
        }
        x = a[(left + right) / 2];
        i = left;  j = right;
        for ( ; ; ) {
            while (a[i] > x) i++;
            while (x > a[j]) j--;
            if (i >= j) break;
            t = a[i];  a[i] = a[j];  a[j] = t;
            i++;  j--;
        }
        if (i - left > right - j) {
            if (i - left > THRESHOLD) {
                leftstack[p] = left;
                rightstack[p] = i - 1;
                p++;
            }
            left = j + 1;
        } else {
            if (right - j > THRESHOLD) {
                leftstack[p] = j + 1;
                rightstack[p] = right;
                p++;
            }
            right = i - 1;
        }
    }
    inssort(n, a);
}

/*
void quicksort(keytype a[], int first, int last)
{
    int i, j;
    keytype x, t;

    x = a[(first + last) / 2];
    i = first;  j = last;
    for ( ; ; ) {
        while (a[i] < x) i++;
        while (x < a[j]) j--;
        if (i >= j) break;
        t = a[i];  a[i] = a[j];  a[j] = t;
        i++;  j--;
    }
    if (first  < i - 1) quicksort(a, first , i - 1);
    if (j + 1 < last) quicksort(a, j + 1, last);
}
*/
void quicksort_des(keytype a[], int first, int last)
{
    int i, j;
    keytype x, t;

    x = a[(first + last) / 2];
    i = first;  j = last;
    for ( ; ; ) {
        while (a[i] > x) i++;
        while (x > a[j]) j--;
        if (i >= j) break;
        t = a[i];  a[i] = a[j];  a[j] = t;
        i++;  j--;
    }
    if (first  < i - 1) quicksort_des(a, first , i - 1);
    if (j + 1 < last) quicksort_des(a, j + 1, last);
}

int main(){
    int n;
    int a[200];

    scanf("%d", &n);
    for(int i = 0; i < n; ++i){
        scanf("%d", &a[i]);
    }
#if 0 
    quicksort(a, 0, n-1);
    int alice = 0, bob = 0;
    for(int i = n - 1; i >= 0; i -= 2){
        alice += a[i];
        if(i - 1 >= 0) bob += a[i-1];
    }
#endif

    //quicksort_des(a, 0, n-1);
    quicksort(n, a);
    int alice = 0, bob = 0;
    for(int i = 0; i < n; ++i){
        //printf("%d\n",a[i]);
        if((i % 2) == 0) alice += a[i];
        else bob += a[i];
    }

    printf("%d\n", alice - bob);

    return 0;
}

Measured memory_bytes: 1688
import java.util.*;

class Main {
    // 
    static final long MOD = 1_000_000_007; // 10^9+7
    static final int MAX = 2_147_483_646; // intの最大値 
    static final int INF = 1_000_000_000; // 10^9  
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        HashMap<String,Integer> str = new HashMap<String,Integer>();
        for(int i = 0;i < n;i++){
            String s = sc.next();
            if(str.containsKey(s)){
                int tmp = str.get(s);
                tmp++;
                str.put(s, tmp);
            }else{
                str.put(s, 1);
            }
        }
        int high = 0;
        int count = 0;
        for(int i:str.values()){
            if(high < i)high = i;
        }
        for(int i:str.values()){
            if(high == i)count++;
        }
        
        List moji = new ArrayList<String>();
        for(Map.Entry<String,Integer> entry:str.entrySet()){
            if(entry.getValue()==high){
                //System.out.println(entry.getKey());
                moji.add(entry.getKey());
            }
        }
        Collections.sort(moji);
        for(int i=0;i<moji.size();i++){
			System.out.println(moji.get(i));
		}
    }

}

Measured memory_bytes: 85968
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n, l;

    cin >> n >> l;

    int eat = 0;
    int sum = l;
    for (int i = 1; i < n; i++) {
        sum += i + l;
        if (abs(eat + l) > abs(i + l)) {
            eat = i;
        }
    }

    cout << sum - (eat + l);
}

Measured memory_bytes: 256
n, m = map(int, input().split())
odd = m if m%2 else m-1 # m以下の最大の奇数
even = m-1 if m%2 else m # m以下の最大の偶数
mid = 1 + odd + 1 # 右半分の開始点

for i in range(1, (1+odd)//2+1):
    print(i, i+odd)
    odd -= 2
    
for i in range(mid, mid + even//2):
    print(i, i+even)
    even -= 2

Measured memory_bytes: 9280
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <list>
#include <set>
#include <map>
#include <numeric>
#include <regex>
#include <tuple>
#include<iomanip>
using namespace std;

typedef long long ll;
typedef pair<int, int> P;
#define MOD 1000000007 // 10^9 + 7
#define INF 1000000000 // 10^9
#define LLINF 1LL<<60

int L[101];

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

	int N; ll X; cin >> N >> X;
	for (int i = 0; i < N; i++) cin >> L[i];
	ll pos = 0;
	int ans = 1;
	for (int i = 0; i < N && pos <= X; i++) {
		pos += L[i];
		if (pos <= X) ans++;
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;
import java.math.BigDecimal;

public class Main{
	public static void main(String[] args){

		Scanner scan = new Scanner(System.in);

		double r = scan.nextDouble();

		final double CIRCLERATE = 3.141592653589;

		double s = CIRCLERATE * r * r;
		double l = 2 * CIRCLERATE * r;

		BigDecimal x = new BigDecimal(s);
		x = x.setScale(5, BigDecimal.ROUND_HALF_UP);

		BigDecimal y = new BigDecimal(l);
		y = y.setScale(5, BigDecimal.ROUND_HALF_UP);

		System.out.printf("%.5f" + " " + "%.5f", x, y);
	}
}

Measured memory_bytes: 28352
n,m,p=map(int,input().split())
y=list(map(int,input().split()))
x=list(list(map(int,input().split())) for _ in range(n))

import numpy as np

cnt=0

for i in range(n):
	if np.dot(np.array(y),np.array(x[i]).T)+p>0:
		cnt+=1

print(cnt)

Measured memory_bytes: 12680
#include <iostream>
#include <vector>
#include <algorithm>
#include <stack>
#include <string>
#include <map>
#include <functional>
#include <cmath>
#include <cstdio>
#include <cstring>
using namespace std;

#define PI 4*atan(1)

int main(){
  int n;
  cin >> n;
  for(int i = 0; i < n; i++){
    bool base[3] = {false};
    int point = 0, out = 0;
    while(1){
      char s[8];
      cin >> s;
      if(strcmp(s, "HIT") == 0){
        if(base[2] == true){
          point += 1;
          base[2] = false;
        }
        if(base[1] == true){
          base[1] = false;
          base[2] = true;
        }
        if(base[0] == true){
          base[0] = false;
          base[1] = true;
        }
        base[0] = true;
      }
      if(strcmp(s, "OUT") == 0){
        out++;
        if(out == 3)break;
      }
      if(strcmp(s, "HOMERUN") == 0){
        for(int j = 0; j < 3; j++){
          if(base[j] == true){
            // cout << "base[" << i << "]" << endl;
            base[j] = false;
            point++;

          }
        }
        point++;
          // cout << "point:" << point << endl;
      }
    }
    cout << point << endl;
  }
}

Measured memory_bytes: 1160
#include <cstdio>
#include <iostream>
#include <algorithm>

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

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n;
    cin >> n;
    cout << n * n*n;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<time.h>
#include<random>
using namespace std;

struct Dice{
    int s[6];
    void move(char c){
        int tmp;
        if(c=='N'){
            tmp=s[0];
            s[0]=s[1];
            s[1]=s[5];
            s[5]=s[4];
            s[4]=tmp;
        }
        else if(c=='S'){
            tmp=s[0];
            s[0]=s[4];
            s[4]=s[5];
            s[5]=s[1];
            s[1]=tmp;
        }
        else if(c=='E'){
            tmp=s[0];
            s[0]=s[3];
            s[3]=s[5];
            s[5]=s[2];
            s[2]=tmp;
        }
        else if(c=='W'){
            tmp=s[0];
            s[0]=s[2];
            s[2]=s[5];
            s[5]=s[3];
            s[3]=tmp;
        }
    }
    int get_top(){
        return s[0];
    }
    int get_right(){
        return s[2];
    }
};

int main(){
    Dice dice;
    for(int i=0;i<6;i++)cin>>dice.s[i];
    int n,s0,s1;
    cin>>n;
    srand((int)time(0));
    for(int i=0;i<n;i++){
        cin>>s0>>s1;
        while(true){
            if(dice.s[0]==s0&&dice.s[1]==s1)break;
            int random=rand()%4;
            if(random==0)dice.move('N');
            else if(random==1)dice.move('S');
            else if(random==2)dice.move('E');
            else dice.move('W');
        }
        cout<<dice.get_right()<<endl;
    }

    return 0;
}


Measured memory_bytes: 3076
#include <iostream>
#include <vector>
#include <cmath>
#include <queue>
#include <deque>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <functional>
#include <bitset>
#include <utility>
#include <sstream>
#include <fstream>
#include <stack>
#include <cstdlib>
#include <complex>
#include <set>

using namespace std;

#define INF 1070000000LL
#define pb push_back
#define irep(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) irep(i,0,n)

typedef long long lint;
typedef pair<int, int> pint;
struct Edge{
    int to,weight;
};
typedef vector<vector<Edge> > Graph;


int main(){
    int a;
    string s;
    cin >> a >> s;
    if(3200 <= a)cout << s << endl;
    else cout << "red" << endl;
    return 0;
}


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

using namespace std;

const double N = 23;
const double PI = acos(-1);

int get(int x) {
    if(x < 2) return 2;
    return get(x - 1) + get(x - 2);
}

int main() {

    int H, W, h, w;

    cin >> H >> W >> h >> w;

    int ans = H * W - (H * w) - (W * h) + (w * h);
    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++)
typedef long long ll;ll MM = 1000000000;ll mod = MM + 7;

int main(){
int n,k;cin>>n>>k;
  vector<int>h(n);
  rep(i,n) cin>>h.at(i);
  sort(h.begin(),h.end());
  int ans=MM;
  rep(i,n-k+1) ans=min(ans,h.at(k-1+i)-h.at(i));
cout<<ans<<endl;  
}

Measured memory_bytes: 640
#!/bin/ruby


year, month, day = gets.chomp.split("/").map(&:to_i)

if year < 2019
  puts "Heisei"
elsif year >= 2020
  puts "TBD"
elsif year == 2019
  if month >= 5
    puts "TBD"
  else
    puts "Heisei"
  end
end


Measured memory_bytes: 1788
# -*- coding: utf-8 -*-
# 整数の入力
#a = int(input())
# スペース区切りの整数の入力
b, c = map(int, input().split())
# 文字列の入力
#s = input()
# 出力
if(c >= b):
	print("Yes")
else:
	print("No")



Measured memory_bytes: 2940
r,c = map(int,input().split())
table = [[0 for j in range(c+1)]for i in range(r+1)]


for i in range(r):
    a = list(map(int,input().split()))
    sumr = 0

    for j in range(c):
        table[i][j] = a[j]
        sumr += a[j]
    table[i][c] = sumr

for j in range(c+1):
    sumc = 0

    for i in range(r):
        sumc += table[i][j]
    table[r][j] = sumc

for i in range(r+1):
    for j in range(c+1):
        if j == 0:
            print(table[i][j],end="")
        else:
            print("",table[i][j],end="")
    print()


Measured memory_bytes: 6744
d = input().split()
p = [(-1, 2, 4, 1, 3, -1), (3, -1, 0, 5, -1, 2), (1, 5, -1, -1, 0, 4),
(4, 0, -1, -1, 5, 1), (2, -1, 5, 0, -1, 3), (-1, 3, 1, 4, 2, -1)]
for _ in range(int(input())):
  t, f = [d.index(s) for s in input().split()]
  print(d[p[t][f]])


Measured memory_bytes: 5604
#include<stdio.h>
 
int main(void){
  char s[20],t[20];
  scanf("%s %s",s,t);
  int a,b;
  scanf("%d %d",&a,&b);
  char u[20];
  scanf("%s",u);
  
  if(strcmp(s,u)==0){
    printf("%d %d\n",a-1,b);
  }else{
    printf("%d %d",a,b-1);
  }
  return 0;
}

Measured memory_bytes: 1656
import sys
sys.setrecursionlimit(10**7)
MOD = 10**9+7
l = [int(i) for i in sys.stdin.readline().strip()]
#i番目までで決まってない時
dp0 = [0] * (len(l) + 1)
#i番目までで決まっている時
dp1 = [0] * (len(l) + 1)
dp0[0] = 1
for i, _l in enumerate(l, 1):
    if _l == 0:
        dp0[i] = dp0[i-1]
        dp1[i] = dp1[i-1] * 3
    else:
        dp0[i] = dp0[i-1] * 2
        dp1[i] = dp1[i-1] * 3 + dp0[i-1]
    dp0[i] %= MOD
    dp1[i] %= MOD
res = dp0[-1] + dp1[-1]
res %= MOD
print(res)

Measured memory_bytes: 46044
/****************************************************
*   Template for coding contests                    *
*   Author    :    Sanjeev Sharma                   *
*   Email     :    thedevelopersanjeev@gmail.com    *
*****************************************************/
#pragma GCC optimize ("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize ("unroll-loops")
#pragma GCC optimize("no-stack-protector,fast-math")
#pragma GCC target ("sse4")
#pragma comment(linker, "/stack:200000000")

#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>

#define deb(x) cout << #x << " is " << x << "\n";

using namespace std;
using namespace __gnu_pbds;

const double PI = 2 * acos(0.0);
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int n, m;
    cin >>n >>m;
    if(n != m)
        cout <<"No";
    else 
        cout <<"Yes";
    return 0;
}


Measured memory_bytes: 256
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;

namespace A
{
    public class Program
    {
        static void Main(string[] args)
        {
            var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);
            Solve();
            Console.Out.Flush();
        }

        public static void Solve()
        {
            var c1 = Console.ReadLine();
            var c2 = Console.ReadLine();
            var c3 = Console.ReadLine();
            Console.WriteLine($"{c1[0]}{c2[1]}{c3[2]}");
        }
    }
}


Measured memory_bytes: 11092
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define rrep(ri,n) for(int ri = (int)(n-1); ri >= 0; ri--)
#define rep2(i,x,n) for(int i = (int)(x); i < (int)(n); i++)
#define rrep2(ri,x,n) for(int ri = (int)(n-1); ri >= (int)(x); ri--)
#define repit(itr,x) for(auto itr = x.begin(); itr != x.end(); itr++)
#define rrepit(ritr,x) for(auto ritr = x.rbegin(); ritr != x.rend(); ritr++)
#define ALL(x) x.begin(), x.end()
using ll = long long;
using namespace std;

int main(){
  int n;
  cin >> n;
  vector<int> p(n);
  rep(i, n) cin >> p.at(i);
  rep(i, n) p.at(i)--;
  vector<int> a(n), b(n);
  rep(i, n){
    int no = (i+1) * (n+1);
    a.at(i) = b.at(n-i-1) = no;
  }
  rep(i, n){
    a.at(p.at(i)) += i;
  }
  rep(i, n){
    if(i != 0) cout << " ";
    cout << a.at(i);
  }
  cout << endl;
  rep(i, n){
    if(i != 0) cout << " ";
    cout << b.at(i);
  }
  cout << endl;
  return 0;
}

Measured memory_bytes: 3816
main(){
	float f;
	for(;~scanf("%f",&f);){
		if(f>91)		puts("heavy");
		else if(f>81)	puts("light heavy");
		else if(f>75)	puts("middle");
		else if(f>69)	puts("light middle");
		else if(f>64)	puts("welter");
		else if(f>60)	puts("light welter");
		else if(f>57)	puts("light");
		else if(f>54)	puts("feather");
		else if(f>51)	puts("bantam");
		else if(f>48)	puts("fly");
		else			puts("light fly");
	}
	exit(0);
}

Measured memory_bytes: 0
#include <iostream>

using namespace std;

int main()
{
  int H,W;
  cin >> H >> W;

  string S[H];

  for(int i = 0; i < H; i++) cin >> S[i];
  int d[8][2] = {{-1,-1},
		 {0,-1},
		 {1,-1},
		 {-1,0},
		 {1,0},
		 {-1,1},
		 {0,1},
		 {1,1}};

  int l = 1;
  for(int i = 0; i < H; i++){
    for(int j = 0; j < W; j++){
      if(S[i][j] == '#'){
	//	l++;
	continue;
      }
      int countbomb = 0;
      //      cout << "\n" << "check" << l << "\n";
      for(int k = 0; k < 8; k++){
	int x = j+d[k][0];
	int y = i+d[k][1];
	if(x < 0 || x >= W || y < 0 || y>= H){
	  //	  cout << "No" << "\n";
	  continue;
	}else if(S[y][x] == '#'){
	  //	  cout << "Yes" << "\n";
	  countbomb++;
	}else{
	  //	  cout << "soso" << " " << y << "," << x << "," << S[y][x]<< "\n";
	}
      } 
      //      cout << "countbomb: " << countbomb << "\n";
      S[i][j] = '0' + countbomb;
      //      l++;
    }
    cout << S[i] << "\n";
  }

  
  return 0;
}


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

template <class T, class F = multiplies<T>>
T power(T a, long long n, F op = multiplies<T>(), T e = {1}) {
  assert(n >= 0);
  while (n) {
    if (n & 1) e = op(e, a);
    if (n >>= 1) a = op(a, a);
  }
  return e;
}

template <unsigned M> struct modular {
  using m = modular;
  unsigned v;
  modular(long long a = 0) : v((a %= M) < 0 ? a + M : a) {}
  m operator-() const { return m() -= *this; }
  m& operator+=(m r) { if ((v += r.v) >= M) v -= M; return *this; }
  m& operator-=(m r) { if (v < r.v) v += M; v -= r.v; return *this; }
  m& operator*=(m r) { v = (uint64_t)v * r.v % M; return *this; }
  m& operator/=(m r) { return *this *= power(r, M - 2); }
  friend m operator+(m l, m r) { return l += r; }
  friend m operator-(m l, m r) { return l -= r; }
  friend m operator*(m l, m r) { return l *= r; }
  friend m operator/(m l, m r) { return l /= r; }
  friend bool operator==(m l, m r) { return l.v == r.v; }
};

constexpr long long mod = 1e9 + 7;
using mint = modular<mod>;

using mat = array<array<mint, 2>, 2>;
mat operator*(mat l, mat r) {
  mat res;
  for (int i : {0, 1}) {
    for (int k : {0, 1}) {
      for (int j : {0, 1}) {
        res[i][j] += l[i][k] * r[k][j];
      }
    }
  }
  return res;
}
mint fib(long long n) {
  mat a{1, 1, 1, 0}, e{1, 0, 0, 1};
  return power(a, n + 1, multiplies<mat>(), e)[0][0];
}

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  long long k;
  cin >> k;
  --k;
  long long ok = 0, ng = 2e9;
  while (ng - ok > 1) {
    long long mid = (ok + ng) / 2;
    (mid * (mid + 1) <= k ? ok : ng) = mid;
  }
  k -= ok * (ok + 1);
  long long i = 2 * ok + (k >= ok + 1);
  k %= ok + 1;
  long long j = -1;
  if (k <= ok / 2) {
    j = 2 * k;
  } else {
    k -= ok / 2 + 1;
    long long t = (ok + 1) / 2;
    j = 2 * (t - k - 1) + 1;
  }
  i -= j;
  mint res = fib(i) * fib(j);
  cout << res.v << '\n';
}



Measured memory_bytes: 3184
N,M=map(int,input().split())
a= [int(input()) for i in range(M)]
d=[None]*(N+1)
for i in range(M):
    d[a[i]]=0
d[0]=1
if d[1]!=0:
    d[1]=1
for i in range(2,N+1):
    if d[i]!=0:
        d[i]=(d[i-1]+d[i-2])%1000000007
print(d[N])

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

#include <math.h>
#include <stdlib.h>


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

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

// const int INF = 1001001001;
// long long max => LLONG_MAX

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    
   int n; cin >> n;
   string s, t; cin >> s >> t;
   string l = "";

   for(int i = 0; i < n; i++){
       l = l+s[i];
       l= l +t[i]; 
   }
   cout << l << 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++)
long long mo = 1e9 + 7;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> Pii;
typedef pair<ll,ll> Pll;
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }

int main(){
    ll N;
    string s;
    cin >> s;
    N = s.size();
    vector<char> v;
    rep(i,N){
        if(s[i] != 'x'){
            v.push_back(s[i]);
        }
    }
    rep(i,v.size()/2){
        if(v[i] != v[int(v.size()) - 1 - i]){
            cout << -1 << endl;
            return 0;
        }
    }
    ll cnt = 0;
    ll l = 0;
    ll r = N-1;
    while(l < r){
        if(s[l] != s[r]){
            cnt++;
            if(s[l] == 'x'){
                l++;
            }else{
                r--;
            }
        }else{
            l++;
            r--;
        }
    }
    cout << cnt << endl;
}


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

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

typedef int _loop_int;
#define REP(i,n) for(_loop_int i=0;i<(_loop_int)(n);++i)
#define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i)
#define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i)

#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

#define CHMIN(a,b) a=min((a),(b))
#define CHMAX(a,b) a=max((a),(b))

// mod
const ll MOD = 1000000007ll;
#define FIX(a) ((a)%MOD+MOD)%MOD

// floating
typedef double Real;
const Real EPS = 1e-11;
#define EQ0(x) (abs(x)<EPS)
#define EQ(a,b) (abs(a-b)<EPS)
typedef complex<Real> P;

int main(){
  vector<vi> c(3,vi(3));
  REP(i,3)REP(j,3)cin>>c[i][j];
  REP(a1,101)REP(a2,101)REP(a3,101){
    vi a({a1,a2,a3});
    vi b(3);
    REP(i,3)b[i] = c[i][0] - a[0];
    bool ok = true;
    REP(i,3)REP(j,3)if(c[i][j] != a[j]+b[i]){
      ok = false;
    }
    if(ok){
      puts("Yes");return 0;
    }
  }
  puts("No");
  return 0;
}


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

res = 0
for i in range(N):
    x = min(A[-1-i], B[-1-i])
    res += x
    A[-1-i] -= x
    y = min(A[-1-i], B[-2-i])
    res += y
    A[-1-i] -= y
    B[-2-i] -= y

x = min(A[0], B[0])
res += x
print(res)

Measured memory_bytes: 82148
class Node:
    def __init__(self, k):
        self.parent = None
        self.childs = [None, None]
        self.key = k


class Tree:
    def __init__(self):
        self.root = None

    def insert(self, z):
        y = None
        x = self.root
        while x != None:
            y = x
            if z.key < x.key:
                x = x.childs[0]
            else:
                x = x.childs[1]
        z.p = y
        if y == None:
            self.root = z
        elif z.key < y.key:
            y.childs[0] = z
        else:
            y.childs[1] = z

    def find(self, k):
        x = self.root
        while x != None:
            if k == x.key:
                return True
            if k < x.key:
                x = x.childs[0]
            else:
                x = x.childs[1]
        return False


def preorder(p):
    s = ""
    if p == None:
        return ""
    s += f"{p.key} "
    s += preorder(p.childs[0])
    s += preorder(p.childs[1])
    return s


def inorder(p):
    s = ""
    if p == None:
        return ""
    s += inorder(p.childs[0])
    s += f"{p.key} "
    s += inorder(p.childs[1])
    return s


n = int(input())

t = Tree()
for i in range(n):
    v = input().split()
    if v[0] == "insert":
        t.insert(Node(int(v[1])))
    elif v[0] == "find":
        print("yes" if t.find(int(v[1])) else "no")
    else:
        print(" "+inorder(t.root).strip())
        print(" "+preorder(t.root).strip())



Measured memory_bytes: 126616
#include<iostream>
#include<string>
#include<vector>
#include<utility>
#include<queue>
#include<algorithm>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<complex>
#define INF 2147483647
#define llINF 9223372036854775807
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long
using namespace std;
int main(){
  int n;cin>>n;
  vector<int> mons(n);
  for(int i=0;i<n;i++)cin>>mons[i];
  sort(mons.begin(),mons.end());
  ll total=mons[0];
  int cnt=1;
  for(int i=1;i<n;i++){
    if(mons[i]<=2*total){
      cnt++;
      total+=mons[i];
    }else{
      cnt=1;
      total+=mons[i];
    }
  }
  cout<<cnt<<endl;
  return 0;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
#define INF 1e18
#define int long long
#define Rep(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) Rep(i, 0, n)
#define all(a) (a).begin(), (a).end()
using namespace std;
typedef pair<int, int> P;
typedef pair<int, P> PP;
const int mod = 1000000007;

int digit(int n)
{
    int res = 0;
    while (n > 0)
    {
        res++;
        n /= 10;
    }
    return res;
}

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

    int a, b;
    cin >> a >> b;
    int n = digit(b);
    rep(i, n) a *= 10;
    a += b;
    for (int i = 1; i * i <= a; i++)
    {
        if (i * i == a)
        {
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;
}

Measured memory_bytes: 256
import sys
import numpy as np
import math
def Ii():return int(sys.stdin.readline())
def Mi():return map(int,sys.stdin.readline().split())
def Li():return list(map(int,sys.stdin.readline().split()))
n,k = Mi()
a = np.array(sys.stdin.readline().split(), np.int64)
maxa = np.max(a)
mina = maxa//(k+1)
while maxa > mina+1:
  mid = (mina+maxa)//2
  div = np.sum(np.ceil(a/mid-1))
  if div > k:
    mina = mid
  else:
    maxa = mid
  
print(maxa)

Measured memory_bytes: 52644
#include<iostream>
#include<vector>
#include<algorithm>
#include<functional>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<unordered_map>
#include<climits>
#include<cstdlib>
#include<cmath>
#include<string>
#include<iomanip>
#include<bitset>

using namespace std;

#define ll long long int

ll const MOD = 1000000007;
ll const INF = (long long int)1 << 61;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    ll h,w;
    cin >> h >> w;

    vector<string> grid;

    for(int i = 0; i < h; i++){
        string x;
        cin >> x;
        grid.push_back(x);
    }

    vector<vector<ll>> dp(h,vector<ll>(w,0));
    dp[0][0] = 1;

    for(int i = 0; i < h; i++){
        for(int j = 0; j < w; j++){
            if(grid[i][j] == '#')continue;
            if(i+1 < h){
                if(grid[i+1][j] == '.'){
                    dp[i+1][j] += dp[i][j];
                    dp[i+1][j] %= MOD;
                }
            }
            if(j+1 < w){
                if(grid[i][j+1] == '.'){
                    dp[i][j+1] += dp[i][j];
                    dp[i][j+1] %= MOD;
                }
            }
        }
    }

    cout << dp[h-1][w-1] << endl;
    
    return 0;
}

Measured memory_bytes: 9216
use proconio::input;
//use itertools::Itertools;

fn main() {
    input!(n: u64);
    input!(d: u64);
    let dd = d * d;
    let mut sum = 0;
    for _ in 0..n {
        input!(v: [i64; 2]);
        if (v[0] * v[0] + v[1] * v[1]) as u64 <= dd {
            sum += 1;
        }
    }
    println!("{}", sum)
}

Measured memory_bytes: 4920
#include <bits/stdc++.h>
using namespace std;
#define Hello ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define endl '\n'
#define ll long long
int n, d, ans = 0;
int arr[15][15];
bool solve(int i, int j){
    double ans = 0;
    for(int idx = 0; idx < d; idx++){
        ans += ((arr[i][idx] - arr[j][idx]) * (arr[i][idx] - arr[j][idx]));
    }
    ans = sqrt(ans);
    int ans2 = ans;
    return ans2 == ans;
}
int main()
{
    Hello
    cin >> n >> d;
    for(int i = 0; i < n; i++)
        for(int j = 0; j < d; j++)
            cin >> arr[i][j];
    for(int i = 0; i < n; i++)
        for(int j = i + 1; j < n; j++)
            if(solve(i, j))
                ans++;
    cout << ans;
    return 0;
}


Measured memory_bytes: 3624
#include<bits/stdc++.h>
using namespace std;
#define hackcyborg shresth_walia
#define ll long long int
#define ld long double
#define For(i,a,b) for (int i = (a); i!=(b); i = (a)<(b)? i+1 : i-1)
#define pb push_back
#define mod 1000000007
int main()
{
    ll n,k;
    cin>>n>>k;
    ll ans=0;
    for(ll x=k;x<=n+1;x++)
        {
            ans+=(n*x-(x*(x-1))+1)%mod;
            ans%=mod;
        }
        cout<<ans;
}


Measured memory_bytes: 3632
#include <bits/stdc++.h>
#define REP(i, a, b) for(int i(a); i <= (b); ++i)

#define gc getchar()
struct Reader {
	template <class T> inline operator T() {
		T w; char c, p = 0;
		for(; !isdigit(c = gc); c == '-' && (p = 1));
		for(w = c & 15; isdigit(c = gc); w = w * 10 + (c & 15));
		return p ? -w : w;
	}
}rd;

template <class T> inline bool smin(T&x, const T&y) { return y < x ? x = y, 1 : 0; }
template <class T> inline bool smax(T&x, const T&y) { return x < y ? x = y, 1 : 0; }

typedef long long ll;

ll f[100005];
int main() {
	int n = rd, m = rd;
	while(n--){
		int w = rd, v = rd;
		for (int i = m; i >= w; --i)
			smax(f[i], f[i - w] + v);
	}
	ll ans = 0;
	REP(i, 0, m) smax(ans, f[i]);
	std::cout << ans;
	return 0;
}



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

#define fi first
#define se second
#define all(x) x.begin(), x.end()
using namespace std;
using ull = unsigned long long;
using ll = long long;
constexpr int I_INF = INT_MAX;
constexpr ll L_INF = LLONG_MAX;
const long double PI = (acos(-1));
const ull MOD = 1000000007;


struct __INIT {
    __INIT() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(15);
    }
} __init;

int main(){
    int X;
    cin >> X;
    for(int i = 1; i <= X; i++){
        if((1 + i) * i / 2 >= X){
            cout << i << endl;
            return 0;
        }
    }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int n,a;
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
	{
		scanf("%d",&a);
		if(a&1)
			continue;
		if(a%3!=0&&a%5!=0)
		{
			puts("DENIED");
			return 0;
		}
	}
	puts("APPROVED");
	return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#define ff first
#define ss second
#define pb push_back
typedef long long ll;
#define db(x) cerr<<__LINE__<<": "<<#x<<" = "<<(x)<<'\n'
const int inf = 1e9+7;
const int N = 1e6+9;
ll p1[N], p2[N];

void solve() {
    ll a, b, n, m, k;
    cin>>n>>m>>k;
    for(int i=0;i<n;++i) {
        cin>>p1[i];
        if(i) p1[i] += p1[i-1];
        // cout<<p1[i]<<" ";
    }
    for(int i=0;i<m;++i) {
        cin>>p2[i];
        if(i) p2[i] += p2[i-1];
        // cout<<p2[i]<<" ";
    }
    // cout<<endl;

    int mx = upper_bound(p2, p2+m, k) - p2;
    // cout<<mx<<endl;
    for(int i=0;i<n;++i) {
        int s = upper_bound(p2, p2+m, k-p1[i]) - p2;
        if(p1[i]<=k) mx = max(mx, i+1);
        if(s) mx = max(mx, s+i+1);
    }
    cout<<mx<<endl;
}
int main() {
    ios_base::sync_with_stdio(0);
    int T=1 ,cas=0;
    while(T--) {
        solve();
    }
    return 0;
}

// ll, reset, 1, bottom

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


 int main(){
int a,b,c,d;
   string n;
   cin >> n;
   a= n.at(0)-48;
   b=n.at(1)-48;
   c=n.at(2)-48;
   d= n.at(3)-48;
   if(a+b+c+d==7){
     cout << a << '+' << b << '+' << c << '+' << d << '=' << 7 << endl;
   }
   else if(a+b+c-d==7){
     cout << a << '+' << b << '+' << c << '-' << d << '=' << 7 << endl;
   }
   else if(a+b-c+d==7){
     cout << a << '+' << b << '-' << c << '+' << d << '=' << 7 << endl;
   }
   else if(a-b+c+d==7){
     cout << a << '-' << b << '+' << c << '+' << d << '=' << 7 << endl;
   }
   else if(a+b-c-d==7){
     cout << a << '+' << b << '-' << c << '-' << d << '=' << 7 << endl;
   }
   else if(a-b+c-d==7){
     cout << a << '-' << b << '+' << c << '-' << d << '=' << 7 << endl;
   }
   else if(a-b-c+d==7){
     cout << a << '-' << b << '-' << c << '+' << d << '=' << 7 << endl;
   }
   else cout << a << '-' << b << '-' << c << '-' << d << '=' << 7 << endl;
 }
   

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

template<class Type>
Type solve(Type res = Type()){
    ll a,b,c; cin >> a >> b >> c;
    res = a+b+c - max({a,b,c});
    return res;
}
int main(void) {
    cin.tie(0); ios_base::sync_with_stdio(false);
    // solve(0);
    cout << fixed << setprecision(15) << solve<ll>() << endl;
    return 0;
}


Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<string>
#include<math.h>
#include<vector>
#include<queue>
#include<map>
#include<stack>
#include<fstream>
#include<stdlib.h>
#include<set>
#include<climits>
#include<cmath>  
#include<memory.h> 
#include<sstream>
#include<time.h>
#include<iomanip>
using namespace std;
const unsigned long long BIGEST=1000000000000000000+1000000000000000000;
const long long BIGER=1000000000000000000;
const int BIG=1000000000;
const long long MOD=1004535809;
const long long LMOD=154590409516822759;
//const long long LMOD=1000000007;
#define Fi first
#define Se second
#define P2 pair
#define Pii pair<int,int>
#define Pll pair<long long,long long>
#define Cb make_pair
#define ll long long
#define Ull unsigned long long
#define Sf scanf
#define Pf printf
#define Pb push_back
#define Psh push
#define Stc stack
#define Vct vector
#define Ret return
#define Re0 return 0
#define Sz size
#define Is insert
#define Que queue
#define Emp empty
#define Fro front
#define Rv reverse
#define Er erase
#define Bg begin
#define Srt sort
#define Pq priority_queue
#define Ins insert
#define Ite iterator
#define Cou count
#define Cot continue
#define Beg begin
int main()
{
	string st;
	cin>>st;
	int t=0;
	for(int i=0;i<st.Sz();++i)
	{
		t+=((st[st.Sz()-i-1]!=st[i])?1:0);
	}
	cout<<t/2;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define INF 1000000
using namespace std;
int dp[205][205][205];
int f(int a, int b, int c){
    //cout<<a<<" "<<b<<" "<<c<<endl;
    if(a>200) return INF;
    if(b>200) return INF;
    if(c>200) return INF;
    if(a==b && b==c) return 0;
    if(dp[a][b][c]!=-1) return dp[a][b][c];
    int mn=1+f(a+1, b+1, c);
    mn=min(mn, 1+f(a+1, b, c+1));
    mn=min(mn, 1+f(a, b+1, c+1));
    mn=min(mn, 1+f(a+2, b, c));
    mn=min(mn, 1+f(a, b+2, c));
    mn=min(mn, 1+f(a, b, c+2));
    return dp[a][b][c]=mn;
}
int main(){
    //cout<<200*200*200<<endl;
    int a, b, c;
    memset(dp, -1, sizeof(dp));
    scanf("%d %d %d", &a, &b, &c);
    printf("%d\n", f(a, b, c));
    return 0;
}


Measured memory_bytes: 34048
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cstdlib>
using namespace std;
// 多倍長テンプレ
/* ---------------------- ここから ---------------------- */
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>
namespace mp = boost::multiprecision;
// 任意長整数型
using Bint = mp::cpp_int;
// 仮数部が1024ビットの浮動小数点数型(TLEしたら小さくする)
using Real = mp::number<mp::cpp_dec_float<1024>>;
/* ---------------------- ここまで ---------------------- */
void YES(){cout << "YES" << endl;}
void NO(){cout << "NO" << endl;}
void Yes(){cout << "Yes" << endl;}
void No(){cout << "No" << endl;}
int main() {
  int N;
  cin >> N;
  cout << N+N*N+N*N*N;
  cout << endl;
  return 0;
}


Measured memory_bytes: 3624
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <utility>

#include <stdio.h>

#define rep(i, n) for (int i = 0; i < (n); i++)
#define irep(i, k, n) for (int i = (k); i < (n); i++)
#define rrep(i, k, n) for (int i = (k); i >= (n); i++)
#define pb push_back
#define vec vector
#define ref(a) &(a)

const int mod = 1e9 + 7;

typedef long long ll;

using namespace std;

int x;

bool is_prime(int n) {
  if (n == 2) return true;
  if (n % 2 == 0) return false;
  for (int i = 3; i <= (n / 2); i += 2) {
    if (n % i == 0) return false;
  }
  return true;
}

int solve() {
  for (int i = x; ; i++) {
    if (is_prime(i)) return i;
  }
}

int main() {
  cin >> x;
  cout << solve() << endl;
  return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize ("O3")
#pragma GCC target ("avx")
#include <bits/stdc++.h>

using namespace std;
using ll = long long;

/**
 * main
 */
int main () {
  ll N;
  cin >> N;
  cout << (ll)pow(floor(sqrt(N)), 2) << '\n';
}


Measured memory_bytes: 256
#include <iostream>
#include <map>
using namespace std;
typedef pair<int,int> P;
bool is_prime[1000010] = {};
int dx[4] = {0,-1,0,1},dy[4] = {1,0,-1,0};
int field[1010][1010] = {};
P dp[1010][1010] = {};

int main(){
    int N,M;
    while(cin >> M >> N && M>0){
        if(M==1){
            cout << 0 << " " << 0 << endl;
            continue;
        }
        for(int i=2;i<=M;i++) is_prime[i] = true;
        for(int i=2;i<=M;i++){
            if(!is_prime[i]) continue;
            for(int j=2;i*j<=M;j++) is_prime[i*j] = false;
        }
        int x = 0,y = 0;
        map<int,P> m;
        int mi_x = 1e9,mi_y = 1e9;
        int direction = 0;
        int now = 0,corner = 2,cnt = 2;
        m[1] = {0,0};
        for(int i=2;i<=M;i++){
            x += dx[direction]; y += dy[direction];
            m[i] = {x,y};
            if(i==corner){
                direction++;
                direction %= 4;
                cnt++;
                corner += cnt/2;
            }
            mi_x = min(mi_x,x);
            mi_y = min(mi_y,y);
        }
        int ma_x = 0,ma_y = 0;
        for(auto a:m){
            m[a.first].first -= mi_x;
            m[a.first].second -= mi_y;
            ma_x = max(m[a.first].first,ma_x);
            ma_y = max(m[a.first].second,ma_y);
        }
//        cerr << "ma_x:" << ma_x << " ma_y:" << ma_y << endl;
        for(int i=0;i<=ma_x+1;i++) for(int j=0;j<=ma_y;j++) {field[i][j] = -1; dp[i][j] = {0,0};}
        for(int i=1;i<=M;i++){
            field[m[i].first][m[i].second] = i;
        }
        for(int i=ma_x;i>=0;i--){
            for(int j=0;j<=ma_y;j++){
                if(field[i][j]==-1) continue;
                dp[i][j] = {is_prime[field[i][j]],(is_prime[field[i][j]]? field[i][j]:-1)};
                P best = {-1,-1};
                if(field[i+1][j]!=-1) best = dp[i+1][j];
                if(j>0 && field[i+1][j-1]!=-1 && best<dp[i+1][j-1]) best = dp[i+1][j-1];
                if(j<ma_y && field[i+1][j+1]!=-1 && best<dp[i+1][j+1]) best = dp[i+1][j+1];
                best.first += is_prime[field[i][j]];
                if(is_prime[field[i][j]] && dp[i][j].second==-1) best.second = field[i][j];
                if(dp[i][j]<best) dp[i][j] = best;
            }
        }
/*        for(int i=0;i<=ma_x;i++){
            for(int j=0;j<=ma_y;j++) cerr << dp[i][j].second << " ";
            cerr << endl;
        }
*/       int sx = m[N].first,sy = m[N].second;
        cout << dp[sx][sy].first << " " << (dp[sx][sy].first!=0? dp[sx][sy].second:0) << endl;
    }
}


Measured memory_bytes: 78420