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

struct Count {
    long long x;
    long long y;
    int count;
};

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

    long long x[N], y[N];
    for(int i = 0; i < N; i++) {
        cin >> x[i] >> y[i];
    }

    vector<Count> vec;

    for(int i = 0; i < N; i++) {
        for(int j = i+1; j < N; j++){
            long long dx = x[i] - x[j];
            long long dy = y[i] - y[j];

            bool find = false;
            for(int k = 0; k < vec.size(); k++){
                Count c = vec[k];
                if(c.x == dx && c.y == dy){
                    vec[k].count++;
                    find = true;
                }
                if(c.x == -dx && c.y == -dy){
                    vec[k].count++;
                    find = true;
                }
            }

            if(find == false){
                Count a = {dx, dy, 1};
                Count b = {-dx, -dy, 1};
                vec.push_back(a);
                vec.push_back(b);
            }
            

        }
    }
    
    int maxv = 0;
    for(int k = 0; k < vec.size(); k++){
        maxv = max(maxv, vec[k].count);
    }


    cout << N - maxv << endl;

    return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
#define forn(i, n) for(int i = 0; i < (int)(n); i++)
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef unsigned int ui32;
const long long INFLL = 1e18;
using namespace std;

const int INF = 1000 * 1000 * 1000;
const int MAXN = 800;
char f[MAXN + 1][MAXN + 1];
int h, w, k, d[MAXN + 1][MAXN + 1], mv[4][2] = { { -1, 0 }, { 1, 0 }, { 0, -1 }, { 0, 1 } };

bool valid(int x, int y) {
    return 1 <= x && x <= h && 1 <= y && y <= w;
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);

    cin >> h >> w >> k;
    int a, b;
    for (int i = 1; i <= h; i++) {
        for (int j = 1; j <= w; j++) {
            cin >> f[i][j];
            if (f[i][j] == 'S')
                a = i, b = j;
            d[i][j] = INF;
        }
    }
    queue<pair<int, int> > q;
    q.push({ a, b });
    d[a][b] = 0;
    while (!q.empty()) {
        int x = q.front().first;
        int y = q.front().second;
        q.pop();
        if (d[x][y] == k)
            continue;
        for (int i = 0; i < 4; i++) {
            int nx = x + mv[i][0];
            int ny = y + mv[i][1];
            if (valid(nx, ny) && f[nx][ny] != '#' && d[nx][ny] == INF) {
                d[nx][ny] = d[x][y] + 1;
                q.push({ nx, ny });
            }
        }
    }
    for (int i = 1; i <= h; i++) {
        for (int j = 1; j <= w; j++) {
            if (d[i][j] <= k) {
                q.push({ i, j });
                d[i][j] = 0;
            }
        }
    }
    while (!q.empty()) {
        int x = q.front().first;
        int y = q.front().second;
        q.pop();
        for (int i = 0; i < 4; i++) {
            int nx = x + mv[i][0];
            int ny = y + mv[i][1];
            if (valid(nx, ny) && d[nx][ny] == INF) {
                d[nx][ny] = d[x][y] + 1;
                q.push({ nx, ny });
            }
        }
    }
    int ans = INF;
    for (int i = 1; i <= h; i++) {
        for (int j = 1; j <= w; j++) {
            if (i == 1 || j == 1 || i == h || j == w) {
                ans = min(ans, (d[i][j] + k - 1) / k);
            }
        }
    }
    cout << 1 + ans << endl;
    return 0;
}

Measured memory_bytes: 8576
#include <iostream>

using namespace std;

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

  int x;
  cin >> x;
  if (x < 1200) {
    cout << "ABC" << endl;
  } else {
    cout << "ARC" << endl;
  }

  return 0;
}


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

bool check(int i,string x,string y){
    
    int nx=x.size(),ny=y.size();
    if(nx<ny || i>nx-ny+1)return false;
        
        for (int j = 0; j < ny; j++)
        {
            if(x[i+j]!='?' && x[i+j]!=y[j])
            {
                return false;
            }
        }
        return true;

}

string fillString(int i,string x,string y){
    x.replace(i,y.size(),y);
    replace(x.begin(),x.end(),'?','a');
    return x;
}

int main(){
    string s,t;cin>>s>>t;
    string inf=string(s.size()+1,'z');
    string ret=inf;
    for (int i = 0; i < s.size(); i++)
    {
        if (check(i,s,t))
        {
      
            ret=min(ret,fillString(i,s,t));
  //          cout<<i<<" "<<ret<<endl;
        }
        
    }
    cout<<((ret==inf)?"UNRESTORABLE":ret)<<endl;
    
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define INF 2e9
using namespace std;
typedef long long llong;
typedef long double ldouble;
int main()
{
  int N;
  cin >> N;
  vector<int> data(N);
  for(int i=0; i<N; i++) cin >> data.at(i);
  sort(data.begin(), data.end());
  if(N%2==1) cout << 0 << endl;
  else {
    cout << data.at(N/2) - data.at(N/2-1) << endl;
  }
}

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


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

namespace mp = boost::multiprecision;

using cpp_int = mp::cpp_int;
using ll = long long;
using namespace std;

int main() {
	int n;
	cin >> n;
	int count4 = 0;
	int count2 = 0;
	int count = 0;
	rep(i, n) {
		int a;
		cin >> a;
		if (a % 4 == 0) {
			count4++;
		}
		else if (a % 2 == 0) {
			count2++;
		}
		else {
			count++;
		}
	}
	bool flag = true;
	count4++;
	if (count2 > 0) {
		if (count <= count4) {
			count++;
		}
		else {
			count += 2;
		}
	}
	
	if (count > count4) {
		flag = false;
	}
	if (flag) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}

}


Measured memory_bytes: 256
#include <stdio.h>
int main(void){
int gyo;
int a[100], b[100];

scanf("%d", &gyo);

int count = 0;
   
for(int i = 0; i < gyo; i++) {
    scanf("%d %d", &a[i], &b[i]);
  //  printf("%d %d\n", a[i], b[i]);
    
    if(a[i] == b[i]) {
    count = count + 1;
    }
    
    if(count >= 3)
    break;
    
    if(a[i] != b[i])
    count = 0;
   }

//printf("%d\n", count);

if(count >= 3)
printf("Yes");

else
printf("No");
   
   
}


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

using namespace std;
#define pi acos(-1)
#define _terminated return 0
#define endl "\n"
#define yes cout << "yes" << endl 
#define no cout << "no" << endl 
#define booster ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);


typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vector<long> > v2l;

const int mod = 1e+5;
const int mx = 2e+5;
const ll inf = 1e18;

void upper_bubble_sort(){
     int i,j,temp,number_of_input;
     int array[100];
     cin >> number_of_input;
     for(i=0; i<number_of_input; i++)
         cin >> array[i];
         for(i=0; i<number_of_input; i++){
             for(j=0; j<(number_of_input-i-1); j++){
               if(array[j] > array[j+1]){
                 temp = array[j];
                 array[j] = array[j+1];
                 array[j+1] = temp;
                }
              }
         }
    for(i=0; i<number_of_input; i++)
      cout << array[i] << endl;
}
void bst(void){
          int low,high,mid,keynum,num,array[100];
          cin >> keynum;
          low = 1;
	         high = num;
         	do{
		        mid = (low + high) / 2;
		         if(keynum < array[mid])
			         high = mid - 1;
		         else if (keynum > array[mid])
			         low = mid + 1;
	         } 
          while (keynum != array[mid] && low <= high);
	        if(keynum == array[mid]){
            cout << "number located at " << mid +1 << endl;}
         else
           no;
        }

int solvio1(int p){
     while (p >= 10) 
     p /= 10; 
     return p; 
} 
void solve(){ 
    int N,P,i; 
    int ans = INT_MAX;
    cin >> N;
    int cnt = 0;
    for(i=0; i<N; i++){ 
       cin >> P; 
       if(P <= ans){ 
          ans = P; 
          cnt++; 
       } 
     } 
    cout << cnt << endl;
}
    
int main(){
    booster;
    solve();
    _terminated;
}

Measured memory_bytes: 3648
#include <bits/stdc++.h>
#define ll long long int
#define ld long double
#define pb push_back
#define ss second
#define ff first
#define INF 300000000000001
#define ll_max 9000000000000000001
//#define mod 1000000007
#define PI 3.14159265358979323846L
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define db(args...) {string _ss = #args; replace(_ss.begin(), _ss.end(), ',' , ' '); stringstream ___s(_ss) ; debug(___s, args);}
using namespace std;
typedef vector<pair<ll,ll> > vll;
typedef vector<pair<int,int> > vii ;
typedef pair<ll,ll> pll;
const ll N = 100001;
const ll M = 1;
ll mod = 1000000007;
struct point {
    ll x, y;
    ll i;
};

void debug(stringstream &s){}
template <typename T, typename... Args>
void debug(stringstream &s, T a, Args... args)
{
    string word;
    s >> word;
    cout << word << " = " << a << endl;
    debug(s, args...);
}

ll fast_exp(ll x, ll n)
{
    if(n == 0) return 1;
    else if(n & 1)
        return fast_exp(x, n - 1) * x % mod;
    else
    {
        ll tmp = fast_exp(x, n >> 1);
        return tmp * tmp % mod;
    }
}

vector<int> p;
void soe(int n = 1000001)
{
    bool P[n];
    P[0] = P[1] = 1;
    for(int i = 2; i < n; i++)
    {
        if(!P[i])
        {
            p.pb(i);
            for(int j = i + i; j < n; j += i)
            P[j] = 1;
        }
    }
}

int main()
{
    fast;
    int _ = 1;
    //cin >> _;
    while(_--)
    {
        ll n, m, x = 0, y = 0, ans = 0, k = 0;
        cin >> n >> m >> x >> k;
        ans = min(k, n);
        k -= min(k, n);
        if(k > m)
            k -= m;
        else k = 0;
        ans -= min(k, x);
        cout << ans << "\n";
    }
    return 0;
}


Measured memory_bytes: 3656
import java.util.Scanner;


public class Main {
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		
		Long l = sc.nextLong();
		
		String ret = "";
		
		while(true) {
			l--;
			int c = (int)(l%26);
			char x = (char)('a' + c);
			ret = String.valueOf(x) + ret;
			l /= 26;
			if ( l == 0 ) break;
		}
	
		System.out.println(ret);
	}
	
}


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

#define cn count
#define pb push_back
#define in insert
#define fs first
#define sc second
#define sz size
#define len length
#define forn(i, n) for (ll i = 0; i < (ll) (n); ++i)
#define forni(i, n) for (ll i = 1; i < (ll) (n); ++i)
#define IO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)

using namespace std;
using ll = long long;
const ll inf = 1e9+7; 
const double PI =  3.141592653589793;

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


// _   .-')                .-. .-')                 .-')                                               
//( '.( OO )_              \  ( OO )               ( OO ).                                             
// ,--.   ,--.).-'),-----. ,--. ,--.  .-'),-----. (_)---\_) ,--. ,--.     .-----.  ,-.-')  .-'),-----. 
// |   `.'   |( OO'  .-.  '|  .'   / ( OO'  .-.  '/    _ |  |  | |  |    '  .--./  |  |OO)( OO'  .-.  '
// |         |/   |  | |  ||      /, /   |  | |  |\  :` `.  |  | | .-')  |  |('-.  |  |  \/   |  | |  |
// |  |'.'|  |\_) |  |\|  ||     ' _)\_) |  |\|  | '..`''.) |  |_|( OO )/_) |OO  ) |  |(_/\_) |  |\|  |
// |  |   |  |  \ |  | |  ||  .   \    \ |  | |  |.-._)   \ |  | | `-' /||  |`-'| ,|  |_.'  \ |  | |  |
// |  |   |  |   `'  '-'  '|  |\   \    `'  '-'  '\       /('  '-'(_.-'(_'  '--'\(_|  |      `'  '-'  '
// """    """     """""""" """  """"      """""""  """""""  """"""""      """"""   """         """""""
 


Measured memory_bytes: 5204
#include <iostream>
#include <string>
#include <algorithm>
#include <numeric>

using namespace std;

#define rep(i,n) for(int i=0;i<(int)n;i++)
#define deb(x) cout<<#x<<'='<<x<<endl
#define darr(arr,n) rep(i,(n-arr)){cout<<*(arr+i)<<' ';}cout<<endl;

int main() {

    string S;
    cin >> S;
    int ans = -2;
    rep(i, S.size()) {
        if (S[i] == 'A') {
            for (int j = S.size() - 1; j >= 0; j--) {
                if (S[j] == 'Z') {
                    ans = j - i + 1;
                    goto end;
                }
            }
        }
    }
end:
    cout << ans << endl;
}


Measured memory_bytes: 640
#include <cstdio>
#include <string>
#include <iostream>
using namespace std;
#define ll long long 
string s;
ll length,ans;
void dfs()
{
	length = s.length();
	ans = length; 
	if(length <= 1) return;
	for(int i = 0; i < length; i++)
	{
		if(i == length - 1) return;
		if(s[i] == 'S' && s[i+1] == 'T')
		{
			s.erase(i,2);
			i -= 2; 
			ans -= 2;
		} 
	}
	//dfs();
}
int main()
{
	cin >> s;
	dfs();
	printf("%d\n",ans);
	return 0;
} 

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

using namespace std;

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

    int sum = 0;
    int max = 0;

    long now;
    long before;
    for (int i = 0; i < N; i++)
    {
        cin >> now;
        if (now <= before && i !=0)
        {
            sum++;
        }
        else
        {
            if (max < sum)
            {
                max = sum;
            }
            sum = 0;
        }

        before = now;
    }

    if (max < sum)
    {
        max = sum;
    }

    cout << max << endl;
}

Measured memory_bytes: 256
import sys
input = sys.stdin.readline
n = int(input())
l = list(map(int,input().split()))
import bisect
l.sort()
count = 0
for i in range(n-2):
    for j in range(i+1,n-1):
        count += bisect.bisect_left(l,l[i]+l[j]) - j - 1
print(count)

Measured memory_bytes: 3188
import java.io.*;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		Scanner scan = new Scanner(System.in);
        String s = scan.next();
        int a = Integer.parseInt(s);
        s = scan.next();
        int b = Integer.parseInt(s);
        s = scan.next();
        int c = Integer.parseInt(s);
        
        if (a < b){
        	if(b < c){
        		System.out.println("Yes");
        	}else{
        		System.out.println("No");
        	}
        }else{
        	System.out.println("No");
        }
		
	}
}

Measured memory_bytes: 25988
import sys
input = sys.stdin.readline
sys.setrecursionlimit(200000)

n, m = map(int, input().split())
graph = [[] for _ in range(n)]
for i in range(m):
    x, y = map(int, input().split())
    graph[x - 1].append(y - 1)

dp = [-1] * n
def count(a):
    if dp[a] != -1:
        return dp[a]
    else:
        dp[a] = 0
        for i in graph[a]:
            dp[a] = max(count(i) + 1, dp[a])
        return dp[a]

print(max([count(i) for i in range(n)]))


Measured memory_bytes: 59476
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
Max = sys.maxsize
def l(): #intのlist
    return list(map(int,input().split()))
def m(): #複数文字
    return map(int,input().split())
def onem(): #Nとかの取得
    return int(input())
def s(x): #圧縮
    a = []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa == x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): #listをスペースごとに分ける
    return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
    return max(map(max,x))

n = list(input())
a = n[0]

for i in range(1,4):
    if a == n[i]:
        print("Bad")
        exit()
    a = n[i]
print("Good")

Measured memory_bytes: 38384
#include"bits/stdc++.h"
using namespace std;
int map1[20][20]={0};

int main(){
	int n;
	cin>>n;
	memset(map1,-1,sizeof(map1));
	for(int i=0;i<n;i++){
		int num;
		scanf("%d",&num);
		for(int j=1;j<=num;j++){
			int a,b;
			scanf("%d%d",&a,&b);
			map1[i][a-1]=b;
		}
	}
	int ch[20]={0};
    int ans=0;
    for(int i = 0; i < (1<<n); i++){
    	memset(ch,0,sizeof(ch));
    	int tempnum=0;
        for(int j = 0; j <=n; j++){
            if(i & (1 << j)){
                ch[j]=1;
                tempnum++;
            }
        }
        int flag=0;
        for(int k=0;k<n;k++){
        	if(ch[k]==1){
        		for(int l=0;l<n;l++){
        			if(map1[k][l]!=-1&&map1[k][l]!=ch[l]){
        				flag=1;
					}
				}
			}
		}
		if(flag)continue;
		else ans=max(ans,tempnum);
    }
    cout<<ans<<endl;
} 

Measured memory_bytes: 256
#include <cstdio>
#include <functional>
#include <algorithm>
#include <vector>
#include <limits>
#include <numeric>
#include <type_traits>
#include <iostream>
#include <queue>
#include <bits/stdc++.h>

#define INF (1ll<<60)
#define MOD 1000000007
#define BOUND 27182818284

typedef long long ll;
typedef long long int lli;

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

template<class T>bool umax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool umin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

using namespace std;

// gcd
int gcd(int a, int b){
    if(a==0)
        return b;
    return gcd(b%a,a);
}
// gcd array
int findGCD(int arr[], int n){
    int result = arr[0];
    for (int i=1; i < n; i++)
        result = gcd(arr[i], result);

    return result;
}

// sort big to small
// sort(A,A+N, greater<int>());

// v.front() = -BOUND;
// v.back() = BOUND;

// Iterator
// v.begin
// v.end

int main() {
    long long N,K,ans=0;
    long long b=0;
    int digit_one[1000]={0};
    int ans_digit[1000]={0};
    cin >> N >> K;
    vector<long long>a(N);

    rep(i,N){
        cin >> a[i];
    }

    // 2進数にしたとき各桁で1が登場する回数の各数字についての合計を求める
    rep(i,N){
        int digit=0;
        long long temp;
        temp=a[i];
        while(temp>0){
            digit_one[digit]+=temp&1;
            temp>>=1;
            digit++;
        }
    }

    // 基本的には・・・
    // digit_one[i]で表されるi桁目の1の数が数字の入力数の半分より
    // 多いなら0
    // 少ないなら1にすればよい
    // ただし・・・
    // Kを超えない範囲でなければならない

    // 上位bitから埋めていくことでXORをとったときに最大となるXを求める
    bool tight = true;
    long long X = 0;
    for(long long i=45; i>=0; i--) {
        X <<= 1;

        // 今見ているKのある桁のビットが1であるなら
        // Xの後ろに1を1桁分追加する余裕がある
        // (余裕があるだけで実際に追加するかは別)
        // tightがfalseならXに追加する数はどんなものでもよい
        // なぜならtightがfalseであるならすでに追加するビットよりも
        // 共通した上位ビット(そのビットをK_i,X_iとする)でK_iが1, X_iが0
        // となっているためKの制約ではXについて0と1の
        // どちらを追加してもよい状態である
        if (tight && ((K >> i) & 1) == 0) {
            ;
        } else {
            long long cnt1 = digit_one[i];
            long long cnt0 = N - digit_one[i];

            if (cnt1 < cnt0){
                X++;
            }else {
                if (tight) tight = false;
            }
        }
    }

    rep(i,N){
        ans+=a[i]^X;
    }

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



Measured memory_bytes: 1024
#include <iostream>
#include <vector>
#include <numeric>
#include <algorithm>
#include <climits>

constexpr int SINT_MAX = std::numeric_limits<int>::max();
constexpr int SINT_MIN = std::numeric_limits<int>::min();

using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vll>;

template<class T>
T choose(bool b, T t, T f)
{
    if (b) return t;
    else return f;    
}

const char *YesNo(bool b)
{
    return choose(b, "Yes", "No");
}

const char *YESNO(bool b)
{
    return choose(b, "YES", "NO");
}

template<class NumT>
NumT diffabs(NumT l, NumT r)
{
    if (l < r) return r-l;
    else return l-r;    
}

struct myinout_t {} io;

template<class T>
myinout_t &operator >>(myinout_t &my, T &i)
{
    cin >> i;
    return my;
}

myinout_t &operator >>(myinout_t &my, int &i)
{
    int r = scanf("%d", &i);
    if (r != 1) exit(EXIT_FAILURE);
    return my;
}

myinout_t &operator >>(myinout_t &my, ll &i)
{
    int r = scanf("%lld", &i);
    if (r != 1) exit(EXIT_FAILURE);
    return my;
}

template<class T>
myinout_t &operator <<(myinout_t &my, const T &i)
{
    cout << i;
    return my;
}

myinout_t &operator <<(myinout_t &my, int i)
{
    printf("%d", i);
    return my;
}

myinout_t &operator <<(myinout_t &my, ll i)
{
    printf("%lld", i);
    return my;
}

myinout_t &operator <<(myinout_t &my, double i)
{
    printf("%.20f", i);
    return my;
}

constexpr char BR = '\n';


///////////////////////////////////////////////////
#include <map>

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

    vvi plot(55, vi(30, 0));
    for (int i = 0; i < N; i++)
    {
        string s;
        io >> s;
        int m = 0, n = 0, d = 0;
        
        if (size_t pos = s.find_first_of('.'); pos == string::npos)
        {
            d = 0;
        }
        else
        {
            d = s.size() - pos - 1;
            s.erase(pos, 1);
        }

        ll a = stoll(s);

        while (a % 2 == 0)
        {
            a /= 2;
            ++m;
        }
        while (a % 5 == 0)
        {
            a /= 5;
            ++n;
        }

        int md = m - d + 9;
        int nd = n - d + 9;
        ++plot[md][nd];
    }

    ll ans = 0;
    for (int i = 0; i < 55; i++)
    {
        for (int j = 0; j < 30; j++)
        {
            if (plot[i][j] > 0)
            {
                for (int ii = max(0, 18-i); ii < 55; ii++)
                {
                    for (int jj = max(0, 18-j); jj < 30; jj++)
                    {
                        if (ii == i && jj == j) continue;
                        ans += (ll)plot[ii][jj] * plot[i][j];
                    }
                }
            }
            if (i >= 9 && j >= 9)
            {
                ans += (ll)plot[i][j] * (plot[i][j] - 1) / 2;
            }
            plot[i][j] = 0;
        }
    }
    
    io << ans << BR;
}

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

int main() {
 int N,L,max;
  cin >> N >> L; 
  max = L + N - 1;
  
  if(L > 0){
    cout << L*N + N*(N+1)*0.5 - N - L <<endl;
  }else if(max < 0){
    cout << L*N + N*(N+1)*0.5 - N - max <<endl;
  }else{
    cout << L*N + N*(N+1)*0.5 - N <<endl;
  }
  
  return 0;
}
  

Measured memory_bytes: 256
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
#define pb push_back
#define pf push_front
#define ff first
#define ss second
#define vll vector<ll>
#define pll pair<ll, ll>
#define vpll vector<pll>
#define endl "\n"
const ll maxn = 2*(1e5 + 5);
const ll mod = 1e9+7;

int main()
{
    ll i, j=0, k=0, t, n, m, a=0, maxi, mini;

    cin>>n>>k;
    t=(((n+1)*n)%mod)/2;

    for ( i = k; i <= n; i++)
    {
        maxi = (n*(n+1))/2 - ((n-i+1)*(n-i))/2;
        mini = (i*(i-1))/2;

        a+=(maxi-mini+1)%mod;
    }
    cout<<(a+1)%mod<<endl;
    return 0;
}

Measured memory_bytes: 3616
#include <bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{//freopen ("vacation.txt","r",stdin);
ll n;
cin>>n;
int a[n],b[n],c[n];
for(int i=0;i<n;i++)
{ cin>>a[i]>>b[i]>>c[i];
}
int dp1[n],dp2[n],dp3[n];
dp1[0]=a[0]; dp2[0]=b[0]; dp3[0]=c[0];
for(int i=1;i<n;i++)
{ dp1[i]=a[i]+max(dp2[i-1],dp3[i-1]);
  dp2[i]=b[i]+max(dp3[i-1],dp1[i-1]);
  dp3[i]=c[i]+max(dp1[i-1],dp2[i-1]);
}
cout<<max(dp1[n-1],max(dp2[n-1],dp3[n-1]))<<endl;
return 0; 
}

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

int main(){
  int n; cin>>n;
  set<int> ans;
  
  for(int i=0;i<n;i++){
    int a;
    cin>>a;
    if(ans.find(a)==ans.end()){
      ans.insert(a);
    }else{
      ans.erase(a);
    }
  }
  cout<<ans.size()<<endl;
  return 0;
}

Measured memory_bytes: 4864
gets.to_i.times do
  f = false
  a = [0]
  b = [0]

  gets.split.map(&:to_i).each do |x|
    if a.last < x && ((x-a.last).abs <= (x-b.last).abs)
      a << x
    elsif b.last < x
      b << x
    else
      f=true
    end
  end
  puts f ? "NO" : "YES"
end

Measured memory_bytes: 6108
fun main(args: Array<String>) {
    // Your code here!
    val FF = 500
    val F = 5
    var x = readLine()!!.toInt()
    var point:Int = 0
    
    point = 1000 * (x / FF) 
    x -= (x / FF) * FF
    
    point += 5 * (x / F)
    println(point)
    
}


Measured memory_bytes: 31832
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
// 解説確認後30min
int main(void){
  char s[101];
  char ans[2];
  long int k;

  scanf("%s%ld", s, &k);

  for(int i = 0; i < k; i++){
    //    printf("i = %d s[i] = ", i);
    if(s[i] != '1'){
      ans[0] = s[i];
      break;
    }
    if(i == k){
      printf("1\n");
      return 0;
    }
  }
  
  printf("%c\n", ans[0]);
  
  return 0;
}


Measured memory_bytes: 128
#include "bits/stdc++.h"
#define _overload3(_1,_2,_3,name,...)name
#define _rep(i,n)repi(i,0,n)
#define repi(i,a,b)for(int i=int(a),i##_len=(b);i<i##_len;++i)
#define MSVC_UNKO(x)x
#define rep(...)MSVC_UNKO(_overload3(__VA_ARGS__,repi,_rep,_rep)(__VA_ARGS__))
#define all(c)c.begin(),c.end()
#define write(x)cout<<(x)<<'\n'
using namespace std; typedef long long ll; template<class T>using vv = vector<vector<T>>;
template<class T>auto vvec(int n, int m, T v) { return vv<T>(n, vector<T>(m, v)); }
template<class T, class U>bool chmax(T& a, U&& b) { return a < b ? a = b, 1 : 0; }
template<class T, class U>bool chmin(T& a, U&& b) { return b < a ? a = b, 1 : 0; }
constexpr int INF = 1 << 29, MOD = int(1e9) + 7; constexpr ll LINF = 1LL << 60;
struct aaa { aaa() { cin.tie(0); ios::sync_with_stdio(0); cout << fixed << setprecision(10); }; }aaaa;

int N;
vv<int> tree;
vector<bool> black, white;

void dfs_pre(int v, int p) {
    int bcnt = 0, wcnt = 0;
    for (int u : tree[v]) {
        if (u == p) continue;
        dfs_pre(u, v);
        bcnt += black[u];
        wcnt += white[u];
    }
    if (bcnt > 0) white[v] = true;
    if (wcnt == (int)tree[v].size() - (p != -1)) black[v] = true;
}

bool dfs(int v, int p, bool pb, bool pw) {
    int bcnt = pb, wcnt = pw;
    for (int u : tree[v]) {
        if (u == p) continue;
        bcnt += black[u];
        wcnt += white[u];
    }
    if (wcnt == (int)tree[v].size()) return true;
    for (int u : tree[v]) {
        if (u == p) continue;
        if (dfs(u, v, wcnt - white[u] == (int)tree[v].size() - 1, bcnt - black[u] > 0)) {
            return true;
        }
    }
    return false;
}

int main() {
    cin >> N;
    tree.resize(N);
    rep(i, N - 1) {
        int a, b;
        cin >> a >> b;
        a--; b--;
        tree[a].push_back(b);
        tree[b].push_back(a);
    }

    black.resize(N);
    white.resize(N);
    dfs_pre(0, -1);
    write(dfs(0, -1, false, false) ? "First" : "Second");
}

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

using namespace std;

int const inf = 0x3f3f3f3f;

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

    int n, k;
    cin >> n >> k;

    vector<int> const w = [&] {
        vector<int> w(n);
        for (auto& i : w) {
            cin >> i;
        }
        return w;
    } ();

    auto cost = [&] (int i, int j) {
        return abs(w[i] - w[j]);
    };

    vector<int> dp(n, inf);
    dp[n-1] = 0;

    for (int i = n-2; i >= 0; i--) {
        for (int j = i+1; j < min(i + k + 1, n); j++) {
            dp[i] = min(dp[i], dp[j] + cost(i, j));
        }
    }

    cout << dp[0] << "\n";
}

Measured memory_bytes: 1024
#include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

int main()
{
    for(;;){
        int n, k;
        cin >> n >> k;
        if(n == 0)
            return 0;

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

        int sum = 0;
        for(int i=0; i<k; ++i)
            sum += a[i];

        int ret = sum;
        for(int i=0; i<n-k; ++i){
            sum -= a[i];
            sum += a[i+k];
            ret = max(ret, sum);
        }
        cout << ret << endl;
    }
}

Measured memory_bytes: 0
#pragma comment(linker, "/stack:20000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,sse3,sse4,popcnt,abm,mmx")

#include <bits/stdc++.h>

#define f first
#define s second

#define pb push_back
#define pp pop_back
#define mp make_pair

#define sz(x) (int)x.size()
#define sqr(x) ((x) * 1ll * (x))
#define all(x) x.begin(), x.end()

#define rep(i, l, r) for (int i = l; i <= r; i++)
#define per(i, l, r) for (int i = l; i >= r; i--)

#define dbg(x) cerr << (#x) << " --> " << (x) << nl;
#define Kazakhstan ios_base :: sync_with_stdio(0), cin.tie(0), cout.tie(0);

#define nl '\n'
#define ioi exit(0);

using namespace std;

#ifdef superset
  #include <ext/pb_ds/assoc_container.hpp>
  #include <ext/pb_ds/tree_policy.hpp>
  #include <ext/pb_ds/detail/standard_policies.hpp>

  using namespace __gnu_pbds;
  typedef tree < pair <int, int>, null_type, less < pair <int, int> >, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
#endif

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

const int N = 5e5 + 7, inf = 1e9 + 7, mod = 1e9 + 7;
const ll linf = (ll)1e18 + 7;
const int dx[] = {-1, 0, 1, 0, 1, -1, -1, 1}, dy[] = {0, 1, 0, -1, 1, -1, 1, -1};

int get_int() {
  char x = getchar();
  bool mns = 0;
  while (!isdigit(x)) mns |= x == '-', x = getchar();
  int res = 0;
  while (isdigit(x)) res = res * 10 + x - '0', x = getchar();
  if (mns) res = -res;
  return res;
}
void add(int &x, int y) {
  x += y;
  if (x >= mod) x -= mod;
  if (x < 0) x += mod;
}
int mult(int x, int y) {
  return x * 1ll * y % mod;
}
int sum(int x, int y) {
  add(x, y);
  return x;
}

int a, b, c, d, e, f;
ld need;
ld calc(int x, int y) {
  return (100 * y) / (ld)(x + y);
}
map <ll, bool> g1, g2;
ld mx = -linf;
int ax, ay;
void solve() {
  cin >> a >> b >> c >> d >> e >> f;
  a *= 100;
  b *= 100;
  rep(i, 0, inf) {
    if (i * a > f) break;
    rep(j, 0, inf) {
      if (i * a + j * b <= f) g1[i * a + j * b] = 1;
      else break;
    }
  }
  rep(i, 0, inf) {
    if (i * c > f) break;
    rep(j, 0, inf) {
      if (i * c + j *d <= f) g2[i * c + j * d] = 1;
      else break;
    }
  }
  need = (ld)100 / e;
  rep(i, 0, f) {
    rep(j, 0, i) {
      if (i + j <= f && (j <= (i / 100) * e) && g1[i] && g2[j]) {
        if (calc(i, j) > mx) {
          mx = calc(i, j);
          ax = i, ay = j;
        }
      }
    }
  }

  cout << ax + ay << ' ' << ay;
}
int main() {
  #ifdef IOI2018
    #define Toktama ""
    freopen (Toktama".in", "r", stdin);
    //freopen (Toktama".out", "w", stdout);
  #endif
  int T = 1;
  while (T--)
    solve();
  ioi
}


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

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

const int INF=1e9;
const int MOD=1e9+7;

ll a[210000];

bool check(ll N,ll K,ll mid){
    ll res=0;
    for(int i=0;i<N;i++){
        res+=(a[i]-1)/mid;
    }
    if(res>K) return true;
    else return false;
}

int main(){
    ll N,K; cin >> N >> K;
    ll ans=0;
    for(int i=0;i<N;i++){
        cin >> a[i];
        ans=max(ans,a[i]);
    }
    if(K==0){
        cout << ans << endl;
        return 0;
    }
    ll right=INF;
    ll left=0;
    for(int i=0;i<1000;i++){
        ll mid=(right+left)/2;
        if(mid==0) break;
        if(check(N,K,mid)){
            left=mid;
        }else{
            right=mid;
        }
    }
    cout << right << endl;
    return 0;
}

Measured memory_bytes: 5124
<?php
fscanf(STDIN, "%d %d %d", $w, $a, $b);
$a_r = $a + $w;
$b_r = $b + $w;
if($b > $a_r) {
    echo ($b - $a_r). "\n";
} elseif($a > $b_r) {
    echo ($a - $b_r). "\n";
} else {
    echo "0\n";
}

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

int descending_compare(const void *a, const void *b){
    if (*(int*)a > *(int*)b){
        return -1;
    }else if (*(int*)a == *(int*)b){
        return 0;
    }else{
        return 1;
    }
}

int ascending_compare(const void *a, const void *b){
    if (*(int*)a < *(int*)b){
        return -1;
    }else if (*(int*)a == *(int*)b){
        return 0;
    }else{
        return 1;
    }
}

// array pointer = *a, num of element = n, key = key
long long lower_bound(int *a, long long n, long long key){
    long long ng, mid, ok;
    ng = -1, ok = n-1;
    while (llabs(ok - ng) > 1){
        mid = (ok + ng) / 2;
        if (key <= a[mid]){
            ok = mid;
        }else{
            ng = mid;
        }
    }
    if (a[ok] >= key)return ok;
    return n;
}

//greatest common divisor
unsigned long gcd(unsigned long x, unsigned long y){
    if (y == 0){ 
        return x;
    }else if (x > y){
        return gcd(y, x % y);
    }else{
        return gcd(x, y % x);
    }
}

unsigned long lcm(unsigned long x, unsigned long y){
    unsigned long g = gcd(x, y);
    return x*y/g;
}



long long factorial(int x){
    long long rtn = 1;
    int i;
    for (i = x; i > 1; i--){
        rtn = (rtn*i);
    }
    return rtn;
}




/*unsigned long long pascal[100][100] = {0};
void make_pascal(void){
    for (int i = 0; i < 100; i++){
        pascal[i][0] = 1;
    }
    pascal[1][1] = 1;
    for (int i = 2; i < 100; i++){
        for (int j = 1; j < 100; j++){
           pascal[i][j] = (pascal[i-1][j-1]+pascal[i-1][j]) % mod;
        }
    }
}*/
long long mod = 1000000007;
//x ^ n
long long mod_pow(long long x, long long n){
    long long res = 1;
    for(int i = 0;i < 60; i++){
        if(n >> i & 1) res = res * x % mod;
        x = x * x % mod;
    }
    return res;
}

/*int struct_ascending_compare(const void *p, const void*q){
    return (*(structname *)p) -> member - (*(structname *)q) -> member;
}*/



long long h[100005];
long long n, a, b;

int check(long long k){
    long long selected = 0;
    for (int i = 0; i < n; i++){
        if (h[i] > b * k){
            selected += (h[i]- b*k)/(a-b);
            if ((h[i]- a*k)%(a-b)){
                selected++;
            }
        }
    }
    if (selected <= k) return 1;
    else return 0;
}

int main(void){
    scanf("%lld %lld %lld", &n, &a, &b);
    for (int i = 0; i < n; i++){
        scanf("%lld", &h[i]);
    }

    long long ng, mid, ok;
    ng = 0, ok = 1000000000;
    while (llabs(ok - ng) > 1){
        mid = (ok + ng) / 2;
        if (check(mid)){
            ok = mid;
        }else{
            ng = mid;
        }
    }

    printf("%lld\n", ok);

    return 0;
}



Measured memory_bytes: 896
#include <bits/stdc++.h>
using namespace std;
int main(){
    
    string w;
    cin >>w;
    vector<int> memo(27,0);
    for(int i = 0;i < 27;i++){
        for(int j = 0;j < w.size();j++){
            if('a'+i==w[j]) memo[i]++ ;
        }
    }
    bool checker = 1;
    for(int i = 0;i < 27;i++){
        if(memo[i] % 2 == 1) checker = 0;
    }
    if(checker) cout << "Yes" << endl;
    else cout <<"No"<< endl;
    
}

Measured memory_bytes: 256
x = list(map(int, input().split()))
a = [x[0]-1, x[1]]
ans = 0
for i in a:
    n = i%4
    if n == 1:
        as1 = 1
    elif n == 2:
        as1 = 1^i
    elif n == 3:
        as1 = 0
    else:
        as1 = 0^i
    ans = ans^as1

print(ans)

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

int main(){

  int x;
  cin>>x;

  //整数どうしの割り算は小数点が切り捨てられます
  //X%60 で Xを60で割ったあまりを計算できます
  int h = x / 3600;
  int m = (x / 60) % 60;
  int s = x % 60;
  cout<<h<<":"<<m<<":"<<s<<endl;

  return 0;
}



Measured memory_bytes: 3112
#include <iostream>
#include <bitset>
#include <algorithm>
#include <vector>
#include <map>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cctype>
#include <queue>
#include <string.h> 
using namespace std;

const int M = 1e5+10;
struct ac
{
	long long p,q;
}a[M];
bool cmpm(const ac k,const ac l)
{
	return k.p<l.p;
}
int main()
{
	long long m,n,i;
	cin>>m>>n;
	for(i=0;i<m;i++)
	{
		cin>>a[i].p>>a[i].q;
	}
	sort(a,a+m,cmpm);
	long long sum=0;
	for(i=0;i<m;i++)
	{
		sum+=a[i].q;
		if(sum>=n)
		{
			cout<<a[i].p<<endl;
			break;
		}
	}
	return 0;
}


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

#define en "\n"
#define INF (int) 9e18
#define HELL (int) (1e9 + 7)
#define int long long
#define double long double
#define uint unsigned long long
#define pii pair<int, int>
#define pb push_back
#define fs first
#define sc second
#define size(a) (int) a.size()
#define deb(x) cerr << #x << " => " << x << en
#define debp(a) cerr << #a << " => " <<"("<<a.fs<<", "<<a.sc<<") " << en;
#define deba(x) cerr << #x << en; for (auto a : x) cerr << a << " "; cerr << en;
#define debpa(x) cerr << #x << en; for (auto a : x)cerr<<"("<<a.fs<<", "<<a.sc<<") "; cerr << en;
#define debm(x) cerr << #x << en; for (auto a : x){for(auto b : a) cerr << b << " "; cerr << en;}
#define getMat(x, n, m, val) vector<vector<int>> x(n, vector<int> (m, val))
#define fastio ios_base :: sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
#define pout cout << fixed << setprecision(10)
int fastpow(int a, int b, int m = HELL) { int res = 1; a %= m;
while (b > 0) { if (b & 1) res = (res * a) % m; a = (a * a) % m; b >>= 1; } return res;}
#define inv(a) fastpow(a, HELL - 2)
#define mul(a, b) ((a % HELL) * (b % HELL)) % HELL

int32_t main() { fastio;
	string s; cin >> s;
	if (s.back() == 's') {
		cout << s << "es" << endl;
	} else {
		cout << s << "s" << endl;
	}
	return 0;
}

Measured memory_bytes: 3636
n, m = map(int, input().split())
ab = [list(map(int, input().split())) for i in range(m)]
class UnionFind(object):
    def __init__(self, size):
        self.parent = [i for i in range(size)]
        self.rank = [0 for _ in range(size)]


    def find(self, x):
        if self.parent[x] == x:
            return x
        else:
            return self.find(self.parent[x])


    def unite(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return

        if self.rank[x] < self.rank[y]:
            self.parent[x] = y
        else:
            self.parent[y] = x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1

    def same(self, x, y):
        return self.find(x) == self.find(y)
def C(x):
    U=UnionFind(n)
    for i in range(m):
        if i==x :
            continue
        U.unite(ab[i][0]-1, ab[i][1]-1)
    for i in range(n):
        for j in range(n):
            if not U.same(i, j):
                return False
    return True
ans=0
for y in range(m):
    if not C(y):
        ans+=1
print(ans)

Measured memory_bytes: 3064
#include<stdio.h>

int main(){
  int n;
  int pa, pb;
  int sa = 0, sb = 0;
  int i;
  for(;;){
    scanf("%d",&n);
    if(n==0) break;
    sa = 0; sb = 0;
    for(i=0;i<n;i++){
      scanf("%d %d",&pa,&pb);
      if(pa > pb) sa += pa+pb;
      else if(pa < pb) sb += pa+pb;
      else sa += pa, sb += pb;
    }
    printf("%d %d\n", sa, sb);
  }
  return 0;
}

Measured memory_bytes: 600
//In the name of Allah
#include <bits/stdc++.h>
using namespace std;

typedef long long ll; 
typedef pair<int,int> pii; 
const int maxN = 1000 * 100 + 100; 
int a[maxN]; 

int main() { 
	ios::sync_with_stdio(false); cin.tie(0); 
	int n; cin >> n; 
	int ans = 0; 
	for( int i = 0 ; i < n ; i++ ) { 
		cin >> a[i]; 
		a[i]--; 
	}
	for( int i = 0 ; i < n ; i++ ) 
		if( a[a[i]] == i ) ans++; 
	cout << ans /2 << endl;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define mp make_pair
#define pb(x) push_back(x)
#define vi vector<int>
#define vs vector<string>
#define vll vector<long long>
#define vc vector<char>
#define vs vector<string>
#define pii pair<int, int>
#define pll pair<long long, long long>
#define pil pair<int, long long>
#define pli pair<long long, int>
#define pcc pair<char, char>
#define pdd pair<double, double>
#define mll map<long long, long long>
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(), (v).end()
#define flsh fflush(stdout)
#define gcd __gcd
#define clr(x) memset(x, 0, sizeof(x))
#define mod 1000000007LL
#define mod2 998244353LL
#define INF 1000000000007
 

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> o_tree;


void solve()
{
    ll n;
    cin>>n;
    ll i,j;
    ll a[n];
    for(i=0;i<n;i++)cin>>a[i];
    string print[3];
    print[0]="pairwise coprime";
    print[1]="setwise coprime";
    print[2]="not coprime";

    mll m;
    ll g=0;
    for(i=0;i<n;i++)
    {
        g=gcd(g,a[i]);
        // cout<<a[i]<<" ";
        for(j=2;j*j<=a[i];j++)
        {
            if(a[i]%j==0)
            {
                m[j]++;
                // cout<<j<<" ";
                while(a[i]%j==0)
                {
                    a[i]/=j;
                }
            }
        }
        if(a[i]>1)
        {
            // cout<<a[i]<<" ";
            m[a[i]]++;
        }
        // cout<<"\n";
    }
    if(g>1)
    {
        cout<<print[2]<<"\n";
        return;
    }
    ll f=0;
    for(auto it:m)
    {
        // cout<<it.first<<" "<<it.second<<"\n";
        if(it.second>1)
        {
           f=1;
        //    break; 
        }
    }
    if(!f)
    {
        cout<<print[0];
        return;
    }
    if(g==1)
    {
        cout<<print[1];
        return;
    }
    cout<<print[2];

    
}



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


if (fopen("input.txt","r" ))
  {
     freopen("input.txt", "r", stdin);
     freopen("output.txt", "w", stdout);
  }
cout<<setprecision(20);


ll t=1;


// cin>>t;


while(t--)
{
solve();
} 


return 0;
}

Measured memory_bytes: 16148
#include<bits/stdc++.h>
using namespace std;
#define ll long long
typedef pair<ll,ll> P;
typedef pair<ll,P> PP;
const ll MOD = 1e9+7;

int main(){
  string s;
  ll t;
  cin>>s>>t;
  int n=s.size();
  ll sn[20];

  ll mf=0;
  for(int i=0;i<n;i++){
	if(s[i]=='+')sn[i]=0;
	else if(s[i]=='*')sn[i]=1;
	else sn[i]=s[i]-'0';
  }
  for(int i=0;i<n;i++){
	if(i%2&&sn[i]){
	  sn[i+1]=sn[i-1]*sn[i+1];
	  sn[i-1]=0;
	  sn[i]=0;
	}
  }
  for(int i=0;i<n;i++){
	mf+=sn[i];
  }

  ll ltr=s[0]-'0';
  for(int i=1;i<n;i+=2){
	if(s[i]=='+')ltr+=(ll)(s[i+1]-'0');
	else ltr*=(ll)(s[i+1]-'0');
  }

  if(t==mf&&t==ltr)cout<<"U"<<endl;
  else if(t==mf)cout<<"M"<<endl;
  else if(t==ltr)cout<<"L"<<endl;
  else cout<<"I"<<endl;
  
  return 0;
}



Measured memory_bytes: 3192
N, M = map(int, input().split())
A = list(map(int, input().split()))
#SA = sorted(A)

D = []
for _ in range(M):
  B, C = map(int, input().split())
  D.append([B, C])

SD = sorted(D, key=lambda x:x[1], reverse=True)

for b, c in SD:
  A += b * [c]
  if len(A) > N*2:
    break

SA = sorted(A, reverse=True)
#X = min(N, len(SD))
#SD = SD[:X]

print(sum(SA[:N]))
  


Measured memory_bytes: 30272
#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define ii pair<int,int>
//#define int long long
using namespace std;
int main(){
        ios_base::sync_with_stdio(0);
        cin.tie(NULL);  int n;
  string str;
  cin >> n >> str;
  for(int i=0;i<str.size();i++){
    if(str[i]+n<='Z')
    cout << (char)(str[i]+n);
    else cout << (char)(str[i]+n-'Z'+-1+'A');
}
}


Measured memory_bytes: 256
using System;
using System.Text;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using static System.Console;
using static System.Math;
using System.Numerics;

namespace AtCoder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            new Program().Solve(new ConsoleInput(Console.In, ' '));
        }

        public void Solve(ConsoleInput cin)
        {
            // 解答はココに書く
            int[] num = cin.ReadIntArray(3);
            if(num[0] == num[1] && num[1] == num[2])
            {
                Console.WriteLine("No");
            }
            else if(num[0] != num[1] && num[1] != num[2] && num[2] != num[0])
            {
                Console.WriteLine("No");
            }
            else
            {
                Console.WriteLine("Yes");
            }

            //Console.ReadLine();
        }
    }

    public class ConsoleInput
    {
        private readonly System.IO.TextReader _stream;
        private char _separator = ' ';
        private Queue<string> inputStream;
        public ConsoleInput(System.IO.TextReader stream, char separator = ' ')
        {
            this._separator = separator;
            this._stream = stream;
            inputStream = new Queue<string>();
        }
        public string Read
        {
            get
            {
                if (inputStream.Count != 0) return inputStream.Dequeue();
                string[] tmp = _stream.ReadLine().Split(_separator);
                for (int i = 0; i < tmp.Length; ++i)
                    inputStream.Enqueue(tmp[i]);
                return inputStream.Dequeue();
            }
        }
        public string ReadLine { get { return _stream.ReadLine(); } }
        public int ReadInt { get { return int.Parse(Read); } }
        public long ReadLong { get { return long.Parse(Read); } }
        public double ReadDouble { get { return double.Parse(Read); } }
        public string[] ReadStrArray(long N) { var ret = new string[N]; for (long i = 0; i < N; ++i) ret[i] = Read; return ret; }
        public int[] ReadIntArray(long N) { var ret = new int[N]; for (long i = 0; i < N; ++i) ret[i] = ReadInt; return ret; }
        public long[] ReadLongArray(long N) { var ret = new long[N]; for (long i = 0; i < N; ++i) ret[i] = ReadLong; return ret; }
    }
}


Measured memory_bytes: 11220
#include<bits/stdc++.h>
using namespace std;
#define intl long long int 

int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	intl i,j;
	cin>>i>>j;
	intl ans=i/j;
	if(i%j!=0){
		ans++;
	}
	cout<<ans<<"\n";
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
      
#define FOR(i,a,b) for(ll i = (a); i < (ll)(b); i++)
#define REP(i,n) FOR(i,0,n)
#define YYS(x,arr) for(auto& x:arr)
#define PW(x) (1LL<<(x))
#define SZ(x) ((ll)(x).size())

#define pb emplace_back
#define fi first
#define se second

using namespace std;

using ld = long double;
using ll = long long int;

const ll INF = (ll)1e9 + 10;
const ll INFLL = (ll)1e18 + 10;
const ll MOD = 1e9+7;
     
template<class T> T &chmin( T &a , const T &b ){ return a = min(a,b); }
template<class T> T &chmax( T &a , const T &b ){ return a = max(a,b); }
template<class T> void UNIQUE(vector<T> &a){ a.erase(unique(a.begin(), a.end()), a.end()); }

template<class S, class T> ostream& operator << (ostream& os, const pair<S, T> v){
  os << "(" << v.first << ", " << v.second << ")"; return os;
}
template<class T> ostream& operator << (ostream& os, const vector<T> v){
  for(int i = 0; i < v.size(); i++){if(i > 0){os << " ";} os << v[i];} return os;
}
template<class T> ostream& operator << (ostream& os, const vector<vector<T>> v){
  for(int i = 0; i < v.size(); i++){if(i > 0){os << endl;} os << v[i];} return os;
}

ll in(){long long int x; scanf("%lld", &x); return x;}
ld fin(){double x; scanf("%lf", &x); return x;}
char yuyushiki[1000010]; string stin(){scanf( "%s", yuyushiki ); return yuyushiki;}

// head

using P = pair<int, int>;

int n, m;

int G[710][710];

int cnt[2];
int col[710];

bool dp[710][710];

void dfs(int x, int c){
  // cout << x << " " << c << endl;
  col[x] = c;
  cnt[c]++;
  REP(i, n){
    if(G[x][i] == 0){
      continue;
    }
    if(col[i] == -1){
      dfs(i, 1-c);
    } else if(col[i] == c){
      puts("-1");
      exit(0);
    }
  }
}

int main(){

  n = in();
  m = in();
  REP(i, n){
    REP(j, i){
      G[i][j] = G[j][i] = 1;
    }
  }
  REP(i, m){
    int a = in() - 1;
    int b = in() - 1;
    G[a][b] = G[b][a] = 0;
  }

  REP(i, n){
    col[i] = -1;
  }

  vector<P> cs(0);
  REP(i, n){
    if(col[i] == -1){
      cnt[0] = cnt[1] = 0;
      dfs(i, 0);
      cs.pb(cnt[0], cnt[1]);
      // cout << cs.back() << endl;
    }
  }

  dp[0][0] = true;
  REP(i, SZ(cs)){
    REP(j, n+1){
      if(dp[i][j]){
        dp[i+1][j+cs[i].fi] = true;
        dp[i+1][j+cs[i].se] = true;
      }
    }
  }

  ll ans = INFLL;
  REP(i, n+1){
    if(dp[SZ(cs)][i]){
      chmin(ans, i * (i-1) / 2 + (n-i) * (n-i-1) / 2);
    }
  }

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


Measured memory_bytes: 2688