akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
using namespace std;

int n, m, q;
int a[50], b[50], c[50], d[50];
int ans;

void dfs(vector<int> &A) {
	if (A.size() == n+1) {
		int now = 0;
		for (int i = 0; i < q; i++) {
			if (A[b[i]] - A[a[i]] == c[i]) now += d[i];
		}
		ans = max(ans, now);
		return;
	}
	A.push_back(A.back());
	while (A.back() <= m) {
		dfs(A);
		A.back()++;
	}
	A.pop_back();
}

int main() {
	cin >> n >> m >> q;
	for (int i = 0; i < q; i++) {
		cin >> a[i] >> b[i] >> c[i] >> d[i];
	}
	vector<int> A(1,1);
	A.reserve(n+1);
	dfs(A);
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 3516
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef pair<P ,ll> P3;
typedef pair<P ,P> PP;
const ll MOD = ll(1e9)+7;
const int IINF = INT_MAX;
const ll LLINF = LLONG_MAX;
const int MAX_N = int(1e5 + 5);
const double EPS = 1e-6;
const int di[] = {0, 1, 0, -1}, dj[] = {1, 0, -1, 0};
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define SORT(v) sort((v).begin(), (v).end())
#define SORTR(v) sort((v).rbegin(), (v).rend())
#define ALL(v) (v).begin(), (v).end()


int main() {
    int n, m, imos[MAX_N]{}, ans = 0;
    cin >> n >> m;
    REP(i,m){
        int l, r;
        cin >> l >> r;
        imos[l]++;
        imos[r+1]--;
    }
    REP(i,n){
        imos[i+1] += imos[i];
        if(imos[i+1] == m){
            ans++;
        }
    }
    cout << ans << endl;
    return 0;
}

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

const int inf = 1e9;
const ll linf = 1e18;
const ll mod = 1e9 + 7;

int main()
{
    map<string, int> mp;

    int N; cin >> N;
    for (int i = 0; i < N; i++)
    {
        string s; cin >> s;
        mp[s]++;
    }

    int M; cin >> M;
    for (int i = 0; i < M; i++)
    {
        string t; cin >> t;
        mp[t]--;
    }
    
    int ans = 0;
    for (auto x: mp) ans = max(ans, x.second);

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

Measured memory_bytes: 256
#include<stdio.h>
#include <iomanip>
#include <iostream>
#include<string>
#include<vector>
#include<map>
#include<queue>
#include<algorithm>
#include <random>
#include <chrono>

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

using namespace std;
int main() {

	long long  n;
	cin >> n;
	long long mi = n - 1;
	for (long long i = 1; i <= sqrt(n) ; i++) {
		if (n % i == 0) {
			mi =min(mi, (i - 1) + (n / i - 1));
		}
	}
	cout << mi;
}

Measured memory_bytes: 256
import java.util.Scanner;

class Main {
    public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);

	int N = sc.nextInt();
	int p[] = new int[N];
	for (int i = 0; i < N; i++)
	    p[i] = sc.nextInt();

	int count = 0;
	for (int i = 0; i < N - 1; i++) {
	    int key = i;
	    for (int j = i + 1; j < N; j++) {
		if (p[key] > p[j])
		    key = j;
	    }
	    
	    if (key != i) {
		int tmp = p[i];
		p[i] = p[key];
		p[key] = tmp;
		count++;
	    }
	}

	if (count < 2)
	    System.out.println("YES");
	else
	    System.out.println("NO");
    }
}

Measured memory_bytes: 21844
#include <iostream>

using namespace std;

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

int main(){
	int n, t, a;
	cin >> n >> t >> a;
	int h[n];
	rep(i,n) cin >> h[i];
	
	int mine = (int)1e9, e, res; 
	rep(i,n) {
		e = abs(1000 * (t - a) - h[i] * 6);
		if(mine > e) {
			mine = e;
			res = i + 1;
		}
	}
	
	cout << res << endl;
	return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>

using namespace std;

typedef long long L11;
#define rep(i,a,b) for(int i=a;i<b;++i)




int main() {

	int N;
	int a[301010];

	cin >> N;


	rep(i, 0, 3 * N) cin >> a[i];

	sort(a, a + 3 * N, greater<int>());

	/*for (int i = 0; i < 3 * N; ++i)
		cout << a[i]<<" ";*/

	L11 total = 0;

	rep(i, 0, N) total += a[i * 2 + 1];

	cout << total << endl;

}

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

#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for (int i = x; i < n; i++)
#define OP(m) cout << m << endl
typedef long long ll;
typedef unsigned long long ull;

int main()
{
    int n;
    cin >> n;
    int b[n - 1];
    rep(i, n - 1) cin >> b[i];

    int minv = b[0];
    int sum = 0;

    sum += b[0];
    for (int i = 1; i < n - 1; i++)
    {
        minv = min(b[i], b[i - 1]);
        sum += minv;
    }

    sum += b[n - 2];
    OP(sum);

    return 0;
}

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

int main() {
  int n, ans, maxNum=0;
  cin >> n;
  vector<int> a(n);
  for(int i=0; i<n; i++) cin >> a[i];
  for(int i=0; i<a.size(); i++) {
    if(a[i]==maxNum+1) maxNum++;
  }
  if(maxNum==0) ans=-1;
  else ans=n-maxNum;
  cout << ans << endl;
}


Measured memory_bytes: 1024
def main():
    N = int(input())
    L = [int(i) for i in input().split()]
    ans = 0
    for i in range(N):
        for j in range(i+1, N):
            for k in range(j+1, N):
                if L[i] != L[j] and L[j] != L[k] and L[k] != L[i]:
                    A = [L[i], L[j], L[k]]
                    A.sort()
                    if A[2] < A[0] + A[1]:
                        ans += 1
    print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 67980
import java.io.*;
import java.util.Arrays;

public class Main {

	//@2262  Stopping Problem
	public static void main(String[] args) throws IOException {
		
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));

		String s = reader.readLine();
		String[] sp = s.split(" ");
		int ymax = Integer.parseInt(sp[0]);
		int xmax = Integer.parseInt(sp[1]);
		
		String[] map = new String[ymax];
		
		for(int y = 0; y < ymax; y++) {
			map[y] = reader.readLine();
		}
//		map[0] = "6>--v.";
//		map[1] = ".^--_@";
		
		reader.close();
		
		for(int k = 0;k < 100; k++) { // Å©çJèÔµ
			int x = 0;
			int y = 0;
			int xx = 1;
			int yy = 0;
			int v = 0;
		
		for(int step = 0;; step++) {
			if (step > 1000 * 2 * 40) { // 1000*1000*1000=19.98
//				System.out.printf("NO\n"); // â~µÈ¢
				break;
			}
			char c = map[y].charAt(x);
//			System.out.printf("%d %c\n", v, c);
			
			if (c == '@') {
				System.out.printf("YES\n"); // â~
				return;
			}
			else if ("0123456789".indexOf(c) >= 0) {
				v = "0123456789".indexOf(c);
			}
			else {
				if (c == '?') {
					// _
					int r = (int)Math.floor(Math.random() * 4);
					c = "<>^v".charAt(r);
				}
				switch(c) {
				case '<':
					xx = -1;
					yy = 0;
					break;
				case '>':
					xx = 1;
					yy = 0;
					break;
				case '^':
					xx = 0;
					yy = -1;
					break;
				case 'v':
					xx = 0;
					yy = 1;
					break;
				case '_':
					if (v == 0) {
						xx = 1;
						yy = 0;
					}
					else {
						xx = -1;
						yy = 0;
					}
					break;
				case '|':
					if (v == 0) {
						xx = 0;
						yy = 1;
					}
					else {
						xx = 0;
						yy = -1;
					}
					break;
				case '+':
					v = (v + 1) % 16;
					break;
				case '-':
					v = (v + 15) % 16;
					break;
				case '.':
					break;
				default:
					assert false;
				}
			}
			x = (x + xx + xmax) % xmax;
			y = (y + yy + ymax) % ymax;
		}			
		}
		System.out.printf("NO\n"); // â~µÈ¢
	}

}

Measured memory_bytes: 12000
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define mp make_pair
#define nt _int128
#define mod 1000000007
int main()
{
#ifndef ONLINE_JUDGE
   	freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll t;
    // cin >> t;
    t  = 1;
    while(t--)
    {
    	ll n;
    	cin>>n;
    	map<ll,ll>mp;
    	ll sm=0;
    	for(ll i=1;i<=n;i++)
    	{
    		ll x;
    		cin>>x;
    		mp[x]++;
    		sm+=x;
    	}
    	ll q;
    	cin>>q;
    	while(q--)
    	{
    		ll a,b;
    		cin>>a>>b;
    		if(mp.find(a)!=mp.end())
    		{
    			sm-=mp[a]*a;
    			sm+=mp[a]*b;
    			ll y=mp[a];
    			mp.erase(a);
    			mp[b]+=y;
    		}
    		cout<<sm<<endl;
    	}
    }
    return 0;
}

Measured memory_bytes: 7556
#include<iostream>
#include<string>
#include<vector>

using namespace std;

int s2tree(string &A, vector<int> &na, vector<pair<int,int>> &a, int b, int e){
	
	if(e - b <= 2) return -1;
	
	int inb = 0,ine = 0;
	for(int i = b, depth = 0; i < e; i++){
		if(A[i] == '(') {
			depth++;
		} else if(A[i] == ')'){
			depth--;
		}
		
		if(A[i] == '[' && !depth) {
			inb = i+1;
		}
		
		if(A[i] == ']' && !depth) {
			ine = i;
		}
	}

  int number = 0;

	for(int i = inb; i < ine; i++){
		number = number * 10 + A[i] - '0';
	}

  int ca = a.size();

	na.push_back(number);
	
	a.emplace_back(-1,-1);

  int ra = s2tree(A, na, a, b + 1, inb-2);
  int rb = s2tree(A, na, a, ine + 2, e-1);
  a[ca].first = ra;
  a[ca].second = rb;

	return ca;
}

int synthesis(
              vector<pair<int,int>> &a, vector<pair<int,int>> &b, vector<pair<int,int>> &c, vector<int> &na, vector<int> &nb, vector<int> &nc, int ca = 0, int cb = 0){
	
	nc.push_back(na[ca] + nb[cb]);
	c.push_back({-1,-1});
	
	int cc = c.size()-1;
	
	if(a[ca].first != -1 && b[cb].first != -1) {
    int d = synthesis(a, b, c, na, nb, nc, a[ca].first, b[cb].first);
    c[cc].first = d;
	}
	
	if(a[ca].second != -1 && b[cb].second != -1) {
    int d = synthesis(a, b, c, na, nb, nc, a[ca].second, b[cb].second);
    c[cc].second = d;
	}
	
	return cc;
}

string tree2s(vector<int>& nc, vector<pair<int,int>> &c, int cc = 0){
	string ra, rb, rc;
	
	if(cc == -1) return "";
	
	ra = tree2s(nc, c, c[cc].first);
	rc = tree2s(nc, c, c[cc].second);
	
	return "(" + ra + ")" + "[" + to_string(nc[cc]) + "]" + "(" + rc + ")";
}
signed main(){
	string A, B, C;
	vector<int> na, nb, nc;
	vector<pair<int,int>> a, b, c;
	
	cin>>A>>B;
	
	s2tree(A, na, a, 0, A.size());
	s2tree(B, nb, b, 0, B.size());
	synthesis(a, b, c, na, nb, nc);
	
	C = tree2s(nc, c);
	
	cout<<C<<endl;
}



Measured memory_bytes: 3332
#include <bits/stdc++.h>
using namespace std;
 
int main() {
	int N,m;
      cin >> N;
  	vector<int> v;
  bool unfound;
  for(int i;i < N; i++){
    cin >> m;
    unfound = true;
    for(int j = 0;j < v.size();j++){
      if(m == v.at(j)){
      	unfound = false;
        break;
      }
    }
    if(unfound) v.push_back(m);
  }
  cout << v.size() << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; ++i)
#define rep2(i, x, n) for(ll i = x, i##_len = (n); i < i##_len; ++i)
#define all(n) begin(n), end(n)
using ll = long long;
using P = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vs = vector<string>;
using vc = vector<char>;
using vb = vector<bool>;
using vd = vector<double>;
vi dir = {-1, 0, 1, 0, -1, -1, 1, 1, -1};

int main() {
  ll n, m;
  cin >> n >> m;
  cout << (1 << m) * (1900 * m + (n - m) * 100) << endl;
}

Measured memory_bytes: 3576
#include <iostream>
#include <string>
#include <algorithm>
#include <numeric>
#include <vector>


using namespace std;

int main(){
 
  int a,b,c,k;
  int ans=0;
  
  cin>>a>>b>>c>>k;

  for(int i=1;i<=k;i++){
    if(i<=a){
      ans=ans+1;
    }
    if(i>a && i<=b+a){

    }
    if(i>a+b){
      ans-=1;
    }
    
  }

  cout<<ans;
  
}

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

int main(){ 
    int n,y; cin>>n>>y;
    int huku=-1,higu=-1,nogu=-1;

    for(int i=0;i<=n;i++){
        for(int j=0;j+i<=n;j++){
            for(int k=0;i+j+k<=n;k++){
            if(y==i*10000+j*5000+k*1000&&i+j+k==n){
                huku=i;
                higu=j;
                nogu=k;
                
                }
            }
        }
    }
    cout<<huku<<" "<<higu<<" "<<nogu<<endl;
    }


Measured memory_bytes: 256
import java.io.IOException;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {

		Scanner sc = new Scanner(System.in);

		int X = sc.nextInt();
		int t = sc.nextInt();
		
		System.out.println(Math.max(X - t, 0));
		
	}
}



Measured memory_bytes: 20948
def test():
    n = int(input())
    h = list(map(int,input().split()))
    for i in range(n-1,0,-1):
        if h[i] < h[i-1]:
            h[i-1] -= 1
            if h[i] < h[i-1]:
                print("No")
                return
    print("Yes")    


if __name__ == "__main__":
    test()


Measured memory_bytes: 14396
import java.io.BufferedReader
import java.io.InputStream
import java.io.InputStreamReader
import java.io.PrintWriter
import java.util.*

fun gcd(a:Int, b:Int):Int {
    val c = a % b
    if (c == 0) return b
    return gcd(b, c)
}

fun gcd(a:Array<Int>):Int {
    val n = a.count()
    var ret = a[0]
    for (i in 1 until n) {
        ret = gcd(ret, a[i])
    }
    return ret
}
fun PrintWriter.solve(sc: FastScanner) {
    val n = sc.nextInt()
    val a = Array(n) { sc.nextInt() }
    val d = gcd(a)
    if (d != 1) {
        println("not coprime")
        return
    }
    val size = 1000005
    val isprime = BitSet(size)
    val minprime = IntArray(size) { -1 }
    for (i in 2 until size) {
        isprime[i] = true
    }
    for (i in 2 until size) {
        if (isprime[i]) {
            minprime[i] = i
            var j = 2
            while (i * j < size) {
                if (minprime[i * j] == -1) {
                    minprime[i * j] = i
                }
                isprime[i * j] = false
                j++
            }
        }
    }
    val primes = mutableSetOf<Int>()
    for (i in 0 until n) {
        var m = a[i]
        val set2 = mutableSetOf<Int>()
        while (minprime[m] != -1) {
            val p = minprime[m]
            if (primes.contains(p)) {
                println("setwise coprime")
                return
            }
            m /= p
            set2.add(p)
        }
        for (p in set2) {
            primes.add(p)
        }
    }
    println("pairwise coprime")
}

fun main() {
    val writer = PrintWriter(System.out, false)
    writer.solve(FastScanner(System.`in`))
    writer.flush()
}

class FastScanner(s: InputStream) {
    private var st = StringTokenizer("")
    private val br = BufferedReader(InputStreamReader(s))

    fun next(): String {
        while (!st.hasMoreTokens()) st = StringTokenizer(br.readLine())

        return st.nextToken()
    }

    fun nextInt() = next().toInt()
    fun nextLong() = next().toLong()
    fun nextLine() = br.readLine()
    fun nextDouble() = next().toDouble()
    fun ready() = br.ready()
}

Measured memory_bytes: 92940
#include<stdio.h>
char *P[]={"No", "Yes"};
char s[100][11], l[100], c;
short n, i, j;
int main(){
  register char k, r, f;
  scanf("%hd\n", &n);
  while((c=getchar())!=10){s[0][l[0]++]=c;}
  f=1;
  for(i=1; i<n; i++){
    while((c=getchar())!=10){s[i][l[i]++]=c;}
    if(s[i][0]!=s[i-1][l[i-1]-1]){f=0; break;}
    r=l[i];
    for(j=0; j<i; j++){
      if(l[j]!=r){continue;}
      f=0;
      for(k=0; k<r; k++){
        if(s[i][k]!=s[j][k]){f=1; break;}
      }
      if(!f){break;}
    }
    if(!f){break;}
  }
  puts(P[f]);
}


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

using namespace std;
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

#define FOR(k,m,n) for(ll (k)=(m);(k)<(n);(k)++)
#define REP(i,n) FOR((i),0,(n))
#define WAITING(str) int str;std::cin>>str;
#define DEBUGING(str) cout<< #str << " " str<<endl

constexpr int INF = (1 << 30);
constexpr ll INFL = (1ll << 60);
constexpr ll MOD = 1000000007;// 10^9+7

int N, M, s, t;
vector<vector<int>> edges;

vector<int> dijkstra(int s) {
	priority_queue<pii, vector<pii>, greater<pii>> pq;
	vector<int> d(N, INF);

	d[s] = 0;
	pq.push({ 0,s });
	while (!pq.empty()) {
		auto now = pq.top(); pq.pop();
		int v = now.second;
		for (auto next : edges[v]) {
			if (d[next] > d[v] + 1) {
				d[next] = d[v] + 1;
				pq.push({ d[next],next });
			}
		}
	}
	return d;
}

int main()
{
	cin >> N >> M >> s >> t;
	s--; t--;
	edges.resize(N);
	REP(i, M) {
		int x, y;
		cin >> x >> y;
		x--; y--;
		edges[x].push_back(y);
		edges[y].push_back(x);
	}
	auto dl = dijkstra(s);
	auto dr = dijkstra(t);
	int len = dl[t];

	// len - cnt
	map<int, int> mpl, mpr;
	for (auto d : dl)mpl[d]++;
	for (auto d : dr)mpr[d]++;

	ll res = 0;
	REP(i, len - 1) {
		int l = i;
		int r = len - 2 - i;
		if (mpl.find(l) == mpl.end())continue;
		if (mpr.find(r) == mpr.end())continue;
		res += (ll)mpl[l] * mpr[r];
	}
	cout << res << endl;

	return 0;
}



Measured memory_bytes: 10848
import java.io.*;
import java.util.*;
public class Main{
    private static void solver(InputReader sc, PrintWriter out) throws Exception {
        int n = sc.nextInt();
        int arr[] = new int[n+1];
        for(int i=0; i<n-1; i++){
            int x = sc.nextInt();
            arr[x]++;
        }
        for(int i=1;i<=n; i++)
            out.println(arr[i]);
    }
    private static boolean helper(long x){
        double ans = Math.sqrt(x);
        return ans%1!=0;
    }

    private static int gcd(int a, int b){
        if(b==0)
            return a;
        return gcd(b, a%b);
    }
    public static void main(String[] args) throws Exception {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        solver(in,out);
        out.close();
    }
    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

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

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

        public int nextInt() {
            return Integer.parseInt(next());
        }
        public long nextLong() {
            return Long.parseLong(next());
        }
        public int[] readIntArray(int n){
            int arr[] = new int[n];
            for(int i=0;i<n;i++) arr[i] = nextInt();
            return arr;
        }
    }
}
class Pair  {
    int x;
    int y;

    Pair(int x, int y) {
        this.x = x;
        this.y = y;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Pair pair = (Pair) o;
        return x == pair.x &&
                y == pair.y;
    }

    @Override
    public int hashCode() {
        return Objects.hash(x, y);
    }
}

Measured memory_bytes: 55296
#include <iostream>
#include <vector>
#include <list>
#include<utility>
#include <new>
#include <string>
#include<cmath>
#include<unordered_set>
#include<iomanip>
#include <stack>
#include<queue>
#include<algorithm>
#include<bits/stdc++.h>
using namespace std;
#define loop(i,x,z) for (int i=x;i<z;i++)
using ll =  long long int;
#define mod 1000000007
/*bool cmp(pair<ll,ll>a,pair<ll,ll>b){
return a.second<b.second;
}*/
int main()
{
    float d,t,s;
    cin>>d>>t>>s;
    if(d/s<=t){
       cout<<"Yes";
       }else{
        cout<<"No";
       }
	return 0;
}


Measured memory_bytes: 3720
#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  for(int i=0;i<(n);++i)
#define REPr(i,n) for(int i=(n)-1;i>=0; --i)
#define FORq(i, m, n) for(int i = (m);i <= (n);++i)
#define FORqr(i, m , n) for(int i = (n);i >=(m);--i)
#define PB push_back
#define MP make_pair
#define DEBUG printf("%s\n","debug")
#define fst first
#define snd second
#define SIN(x,S) (S.count(x) != 0)
#define M0(x) memset(x,0,sizeof(x))
#define FILL(x,y) memset(x,y,sizeof(x))
#define MM(x) memset(x,-1,sizeof(x))
#define ALL(x) (x).begin(),(x).end()
using namespace std;
typedef pair<int,int> PII;
typedef pair<long long,long long> PLL;
typedef vector<int> VI;
typedef vector < VI > VVI;
typedef vector<long long> VL;
typedef long long ll;
typedef long long integer;
///////////////////////////////////////////////
const ll MOD = 1000000007;
ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}

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

/*（๑•﹏•๑｀) */
int main() {
    int A,B,C;
    cin >> A >> B >> C;
    if ((A==B) and (B==C)) puts("Yes");
    else puts("No");
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <utility>
#include <algorithm>
#include <queue>
#include <map>
#include <fstream>
#include <array>
#include <utility>
#include <functional>

using namespace std;
typedef long long Int;
#define REP(i , x) for(int i = 0 ; i < x ; ++i)

typedef pair<int, int> P;


Int a = 100000;


int main()
{
	int n;
	while (cin >> n){
		REP(i, n){
			a += a * 0.05;
			if (a % 1000){
				a /= 1000;
				++a;
				a *= 1000;
			}
		}
		cout << a << endl;
	}
}

Measured memory_bytes: 1156
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;

int main(){
  int N;
  cin >> N;
  vector<int> P(N),ans(N);
  vector<string> S(N);
  for(int i=0;i<N;i++){
    cin >> S[i] >> P[i];   
  }
  int jisyoIdx = 1;
  for(int i=0;i<N;i++){
    for(int j=0;j<N;j++){
      if(i==j)continue;
      if(S[i]<S[j]){
      }else if(S[i]==S[j]){
        if(P[i]>P[j]){
        }else{
          jisyoIdx++;
        }
      }else{
        jisyoIdx++;
      }
    }
    //cout << jisyoIdx << endl;
    ans[i] = jisyoIdx;
    jisyoIdx = 1;
  }
  for(int i=1;i<=N;i++){
    for(int j=0;j<N;j++){
      if(i==ans[j])cout<<j+1<<endl;
    }
  }
  //cout << ans << endl;
}


Measured memory_bytes: 256
import sys

#+++++

def dd_max(ring):
	mm=25
	s=1
	for r in ring[1:]:
		#print(s,r,mm)
		if r >= 1:
			mm=min(s,mm)
			s=1
		else:
			s+=1
	return mm
	
		
def main():
	n = int(input())
	dl = list(map(int, input().split()))
	dl.append(0)
	
	#0が2個あったら0
	if dl.count(0) >=2:
		return 0
	#12が2個あったら0
	if dl.count(12) >=2:
		return 0
	#1-11が3個以上あったら0
	for i in range(1,11+1):
		if dl.count(i) >= 3:
			return 0
	
	ll=[0]*25
	ll[0]=1
	ll[24]=1
	cc=[]
	if dl.count(12) == 1:
		ll[12]=1
	for i in range(1,11+1):
		if dl.count(i)==2:
			ll[i]=1
			ll[24-i]=1
		if dl.count(i)==1:
			cc.append(i)
			
	if len(cc)==0:
		print(dd_max(ll))
		#print(ll)
		return 
	
	#1-11が2個あったらプラスとマイナスに配置が必須
	ret=0
	n_cc=len(cc)
	cc_max=(2**n_cc)-1
	for i in range(cc_max):
		tll=ll.copy()
		for j,v in enumerate(cc):
			if i & (2**j) > 0:
				tll[24-v]=1
			else:
				tll[v]=1
				
		tr=dd_max(tll)
		ret=max(ret, tr)
	
	print(ret)
	
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)

if __name__ == "__main__":
	if sys.platform =='ios':
		sys.stdin=open('inputFile.txt')
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

Measured memory_bytes: 3192
#pragma GCC optimize("O3") 
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx") 
#define __USE_MINGW_ANSI_STDIO 0
#include<bits/stdc++.h>                               
using namespace std;

#define PI acos(-1)
#define pb push_back
#define fi first
#define se second
#define sz(a) (int)(a).size()
#define all(c) (c).begin(), (c).end()
#define TIMESTAMP fprintf(stderr, "Execution time: %.3lf s.\n", (double)clock()/CLOCKS_PER_SEC)

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair <int, int> pii;
typedef vector <vi> vvi;
typedef vector <pii> vpii;
typedef vector<string> vs;

const int MAXN = 1e5 + 9;
const int MOD = (int)(1e9 + 7);
const int INF = 100500;

void input() {
	ll x;
	cin >> x;
	ll ans = 1;
	while(ans * (ans + 1) / 2 < x) ans++;
	cout << ans << endl;
}

void solve() {

}

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
#ifdef LOCAL
	freopen("xxx.in", "r", stdin);
	freopen("xxx.out", "w", stdout);
#else
	//freopen("xxx.in", "r", stdin);
	//freopen("xxx.out", "w", stdout);
#endif	
	input();
	solve();
	return 0;
}

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

string to_string(string s) { return '"' + s + '"';  }
string to_string(const char* s) { return to_string((string) s);  }
string to_string(bool b) { return (b ? "true" : "false");  }
string to_string(vector<bool>::reference b) { return to_string(bool(b));  }
template <typename A, typename B>
string to_string(pair<A, B> p) { return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";  }
template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> t) { return "(" + to_string(get<0>(t)) + ", " + to_string(get<1>(t)) + ", " +
    to_string(get<2>(t)) + ")";  }
    template <typename A>
    string to_string(A v) { bool first = true; string res = "{"; for (const auto &x : v) { if (!first) { res += ", ";  }
    first = false; res += to_string(x); } res += "}"; return res;  }

void debug_out() { cerr << endl;  }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) { cerr << " " << to_string(H); debug_out(T...);  }

#ifdef LOCAL
#define debug(...) cerr << "[L" << to_string(__LINE__) << ":" <<#__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif


ll gcd(ll a, ll b) {
  return b != 0 ? gcd(b, a % b) : a;
}

ll lcm(ll a, ll b) {
  ll g = gcd(a, b);
  return a / g * b;
}

ll nodiv(ll x, ll C, ll D) {
  return (x) - ll((x) / C) - ll((x) / D) + ll((x) / lcm(C,D));
}

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

  ll A,B,C,D;
  cin >> A >> B >> C >> D;
  ll l = lcm(C, D);
  ll aa = nodiv(A-1,C,D);
  ll bb = nodiv(B,C,D);
  cout << bb - aa << endl;
  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <algorithm>

#define MAX_H (200)
#define MAX_W (200)
#define INF (1000000000)

using namespace std;

// assume costs is initialized to INF s
void bellmanford(int *c, int N, int s, int *costs) {
  costs[s] = 0;
  for (int k = 0; k < N; k++) {
    for (int i = 0; i < N; i++) {
      for (int j = 0; j < N; j++) {
        costs[i] = min(costs[i], costs[j] + c[j + i * N]);
      }
    }
  }
}

int main(int argc, char *argv[]) {
  // read inputs
  int H, W, c[10 * 10], A[MAX_H * MAX_W];
  scanf("%d %d", &H, &W);
  for (int i = 0; i < 10; i++) {
    for (int j = 0; j < 10; j++) {
      scanf("%d", &c[j + i * 10]);
    }
  }
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      scanf("%d", &A[j + i * W]);
      A[j + i * W];  // NOTE : modified input
    }
  }

  // calculate lowest cost to change to 1 for each number
  int costs[10];
  for (int i = 0; i < 10; i++) {
    costs[i] = INF;
  }
  bellmanford(c, 10, 1, costs);

  // solve
  int ans = 0;
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      if (A[j + i * W] >= 0) {
        ans += costs[A[j + i * W]];
      }
    }
  }
  printf("%d\n", ans);

  return 0;
}


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


 int n;
 string s;
struct ca
{
  int idx,st,et,aidx;
};


int binarySearch(vector<int> arr, int l, int r, int x) 
{ 
    if (r >= l) { 
        int mid = l + (r - l) / 2; 
  
        // If the element is present at the middle 
        // itself 
        if (arr[mid] == x) 
            return mid; 
  
        // If element is smaller than mid, then 
        // it can only be present in left subarray 
        if (arr[mid] > x) 
            return binarySearch(arr, l, mid - 1, x); 
  
        // Else the element can only be present 
        // in right subarray 
        return binarySearch(arr, mid + 1, r, x); 
    } 
  
    // We reach here when element is not 
    // present in array 
    return -1; 
} 

int prime[1000001]={};

int power(int x, unsigned int y, int p)  
{  
    int res = 1;     
  
    x = x % p; 
   
    if (x == 0) return 0; 
  
    while (y > 0)  
    {  
         
        if (y & 1)  
            res = (res*x) % p;  
  
        
        y = y>>1; 
        x = (x*x) % p;  
    }  
    return res;  
}  

void pr()
{
  prime[1]=0;

 for(int i=2;i*i<1000001;i++)
  if(prime[i]==0)
  for(int j=i*i;j<1000001;j+=i)
  prime[j]=1;

}

int countSetBits( int n) 
{ 
     int count = 0; 
    while (n) { 
        count += n & 1; 
        n >>= 1; 
    } 
    return count; 
} 
  


void fun(vector<int> a,vector<int> b, vector<int> c)
{


    long count=0;

   for(int i=0;i<a.size();i++)
   for(int j=0;j<b.size();j++)
  {
     int x= min(a[i],b[j]);
      int y= max(a[i],b[j]);

      int z= y-x;


       int r1=-1;
        int r2=-1;

     if(x-z>=0)
    {
         if((s[x-z] != s[x]) && (s[x-z] != s[y]) )
           r1=1;
    }
     if(y+z<n)
   {
      if((s[y+z] != s[x]) && (s[y+z] != s[y]) )
           r2=1;
    }

     int h= c.size();
     if(r1!=-1)
      h--;

      if(r2!=-1)
      h--;

    if((x+y)%2==0)
   {
       int u= (x+y)/2;
        if((s[u] != s[x]) && (s[u] != s[y]) )
           h--;
    }

     count+=h;

  }
     
     

  cout<<count;
}







bool cmp1(ca c1,ca c2)
{
  if(c1.st<c2.st)
   return true;

  if(c1.st==c2.st && c1.idx<c2.idx)
   return true;

  return false;
}

bool cmp2(ca c1,ca c2)
{
  
  if(c1.idx<c2.idx)
  return true;
  return false;
}








int main()
{

    ios_base::sync_with_stdio(false); 
    cin.tie(NULL);  
   //pr();
  int t;
   //cin>>t;
   t=1;
  int id=1;

  while(t--)
{
  
    cin>>n;

    //string s;
    cin>>s;

     vector<int> a,b,c;

     for(int i=0;i<n;i++)
   {
        if(s[i]=='R')
        a.push_back(i);

        else if(s[i]=='G')
        b.push_back(i);
 
         else
        c.push_back(i);
    }

   if(c.size()>a.size() && c.size()>b.size())
   fun(a,b,c);

   else if(b.size()>a.size() && c.size()<b.size())
   fun(a,c,b);

    else
    fun(b,c,a);
      


}



return 0;
}




Measured memory_bytes: 3708
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int a = in.nextInt();
            if (n % 500 <= a) {
                out.print("Yes");
            } else {
                out.print("No");
            }
        }

    }
}



Measured memory_bytes: 23124
use std::io::*;
use std::str::FromStr;

pub fn read<T: FromStr>() -> T {
  let stdin = stdin();
  let stdin = stdin.lock();
  let token: String = stdin
    .bytes()
    .map(|c| c.expect("failed to read char") as char)
    .skip_while(|c| c.is_whitespace())
    .take_while(|c| !c.is_whitespace())
    .collect();
  token.parse().ok().expect("failed to parse token")
}

use std::cmp::{max, min};
use std::collections::HashMap;

fn main() {
  let m = read::<i64>();
  println!("{}", (48 - m));
}



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

using namespace std;

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

	return gcd(y, x % y);
}

int lcm(int x, int y) {
	return (x * y) / gcd(x, y);
}

int main() {
	int x;

	cin >> x;

	int l = lcm(x, 360);

	cout << l / x << "\n";

	return 0;
}

Measured memory_bytes: 3632
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <iomanip> // fixed, setprecision 
#include <math.h> // double sqrt
using namespace std;
int main(){
    long long N;
    cin>>N;
    long long n=round(sqrt(N));

    while(1){
        if(N%n==0)break;
        n--;
    }
    long long x=N/n;
    cout<<x+n-2;
    return 0;
}


Measured memory_bytes: 256
#include <bit>
#include <bitset>
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <math.h>
#include <stdlib.h>
#include <queue>
#include <stack>


typedef long double ld;
typedef long long ll;

using namespace std;

ll MOD = ((ll)1e9 + 7);

struct mod {
	ll x;

	mod(ll tx = 0) {
		x = tx;
	}
	
	mod& operator=(const ll & tx) {
		x = tx;
		return *this;
	}
	
	mod& operator=(const mod & m2) {
		x = m2.x;
		return *this;
	}

	mod operator+(const mod& m2) const {
		return (x + m2.x) % MOD;
	}

	mod& operator+=(const mod& m2) {
		x += m2.x;
		x %= MOD;
		return *this;
	}

	mod operator-(const mod & m2) const {
		return (x - m2.x + MOD) % MOD;
	}

	mod& operator-=(const mod & m2) {
		x -= m2.x;
		x = (x + MOD) % MOD;
		return *this;
	}

	mod operator*(const mod & m2) const {
		return (x * m2.x) % MOD;
	}

	mod& operator*=(const mod & m2) {
		x *= m2.x;
		x %= MOD;
		return *this;
	}

	mod mypow(ll k) const {
		mod ret = 1;
		mod cur = x;
		while (k) {
			if (k & 1) {
				ret *= cur;
			}
			cur *= cur;
			k >>= 1;
		}
		return ret;
	}

	mod inv() const {
		return mypow(MOD - 2);
	}

	mod operator/(const mod & m2) const {
		return mod(((*this).x * (*this).inv().x) % MOD);
	}

	mod& operator/=(const mod & m2) {
		x *= m2.inv().x;
		x %= MOD;
		return *this;
	}

	bool operator<(const mod & m2) const {
		return x < m2.x;
	}
};

ostream &operator<<(ostream & os, const mod & m) {
	return os << m.x;
}

/* TEMPLATE ENDS HERE */

#define MAXN (1 << 20)

int a[MAXN];

int main() {
	int n;
	cin >> n;
	for (int i = 1; i <= n; i++) {
		int t;
		cin >> t;
		a[t] = i;
	}
	for (int i = 1; i <= n; i++) {
		cout << a[i] << " ";
	}
	cout << endl;
	return 0;
}


Measured memory_bytes: 3584
#include<bits/stdc++.h>
#define LL long long
using namespace std;
const int P=998244353,maxn=(2e6)+5;
LL N,M,K,Fac[maxn],Inv[maxn],Ans;
LL Pow(LL a,LL b){LL s=1;for(LL w=a;b;b>>=1,w=w*w%P) if(b&1) s=s*w%P;return s;}
inline LL C(LL a,LL b){return Fac[a]*Inv[b]%P*Inv[a-b]%P;}
inline void Add(LL& x,LL y){if((x+=y)>=P) x-=P;}
inline void Dec(LL& x,LL y){if((x-=y)<0) x+=P;}
int main(){
	scanf("%d%d",&N,&M),K=N+(M<<1);
	Fac[0]=1;
	for(int i=1;i<=K;i++) Fac[i]=Fac[i-1]*i%P;
	Inv[K]=Pow(Fac[K],P-2);
	for(int i=K-1;~i;i--) Inv[i]=Inv[i+1]*(i+1)%P;
	for(int i=0,tp;i<=N&&i<=M;i++) if(!((tp=(M<<1)+M-i)&1)) Add(Ans,C(N,i)*C((tp>>1)+N-1,N-1)%P);
	LL O=0;
	for(int i=(M<<1)+1,ti=(M<<1)+M;i<=ti;i++) Add(O,C(ti-i+N-2,N-2)%P);
	Dec(Ans,N*O%P);
	printf("%lld\n",Ans);
    return 0;
}

Measured memory_bytes: 31488
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<utility>
#include<set>
#include<stack>
#include<list>
#include<deque>
#include<bitset>
#include<iomanip>
#include<cstring>
#include<sstream>
#include<cstdio>
#include<cstdlib>
#include<climits>
#include<cmath>
#include<cctype>


#define pb push_back
#define mp make_pair
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define ren(i,a,b) for(int i=a;i>=b;i--)
#define ff first
#define ss second
#define pll pair<long long int,long long int>
#define pii pair<int,int>
#define vll vector<long long int>
#define vii vector<int>
#define gi(n) scanf("%d",&n)
#define gll(n) scanf("%lld",&n)
#define gstr(n) scanf("%s",n)
#define gl(n) cin >> n
#define oi(n) printf("%d",n)
#define oll(n) printf("%lld",n)
#define ostr(n) printf("%s",n)
#define ol(n) cout << n
#define os cout<<" "
#define on cout<<"\n"
#define o2(a,b) cout<<a<<" "<<b
#define all(n) n.begin(),n.end()
#define present(s,x) (s.find(x) != s.end())
#define cpresent(s,x) (find(all(s),x) != s.end())
#define tr(container, it) for(__typeof(container.begin()) it = container.begin(); it != container.end(); it++)
using namespace std;

typedef unsigned long long int ull;
typedef long long int ll;
typedef vector<vector<ll> > mat;

int main()
{ios_base::sync_with_stdio(false);
ll n;
cin>>n;
ll x=1;
while(1)
{
	if((x*(x+1))/2>=n)
	{
		ol(x);
		return 0;
	}
	x++;
}
return 0;
}


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

#define fastIO() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

using namespace std;

typedef  long long  ll;

int main()
{
  fastIO();


	ll n , m , satf=0;
	cin>>n;
	m = n-1;
	ll arr[n], brr[n],  crr[m];
	for(int i=0; i<n; i++)
	{
		cin>>arr[i];
		arr[i]--;
	}
	for(int i=0; i<n; i++)
	{
		cin>>brr[i];
	}
	for(int i=0; i<m; i++)
	{
		cin>>crr[i];
	}
	for(int i=0; i<n; i++)
	{
		satf += brr[arr[i]];
		if(arr[i]==arr[i-1]+1)
		//then crr-1 from arr;}	
		{
			satf+= crr[arr[i-1]];
			}
	}
	cout<<satf<<'\n';
 return 0;
 }


Measured memory_bytes: 3616
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <numeric>
#include <math.h>

using namespace std;

typedef int long long;

const int q = 10000000000 + 7;

int main() {
	
	int n;
	cin >> n;
	vector<int> h(n);
	for (int i = 0; i < n; i++)
	{
		cin >> h[i];
	}

	bool yes = true;
	for (int i = n-2; i >= 0; i--)
	{
		if (h[i] > h[i + 1]) {
			h[i] --;
			if (h[i] > h[i + 1]) {
				yes = false;
			}
		}
	}

	if (yes) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
	
	return 0;
}

Measured memory_bytes: 888
#include<bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rep2(i, m, n) for(int i = (int)(m); i < (int)(n); i++)
#define rep_inv(i, n, m) for(int i = (int)(n); i > (int)(m); i--)
using namespace std;
using ll = long long;
using vl = vector<ll>;
using vc = vector<char>;
using vvl = vector<vl>;
using vvc = vector<vc>;
using pll = pair<ll, ll>;
using vpll = vector<pll>;

ll dist(ll i, ll j, ll X, ll Y){
  ll dif_iX = (i <= X) ? (X - i) : (i - X);
  ll dif_iY = (j <= Y) ? (Y - j) : (j - Y);
  ll th_XY = dif_iX + dif_iY + 1;

  ll ret = (j - i <= th_XY) ? (j - i) : th_XY;

  return ret;
}

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

  map<ll, ll> cnt;
  
  rep2(i, 1, N){
    rep2(j, i + 1, N + 1){
      cnt[dist(i, j, X, Y)]++;
    }
  }

  rep2(i, 1, N){
    cout << cnt[i] << endl;
  }
  
  return 0;
}


Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
void fastIO(){
  ios_base::sync_with_stdio(0); cin.tie(0);
}


int main(){
  fastIO();
  int n,y;
  cin>>n>>y;
  for(int i=0;i<=2000;i++){
  	for(int j=0;j<=2000;j++){
  		if(n-(i+j)>=0&&(10000*i)+(5000*j)+(1000*(n-(i+j)))==y&&(i+j)+(n-(i+j))==n){
  			cout<<i<<" "<<j<<" "<<n-(i+j)<<endl;
  			return 0;
  		}
  	}
  }
  cout<<"-1 -1 -1"<<endl;
}








Measured memory_bytes: 256
#include<iostream>
#include<vector>

using namespace std;

#define SENTINEL 1000000001
int n;
int cnt;

void merge( vector<int>& S, int left, int mid, int right )
{
	int n1 = mid - left;
	int n2 = right - mid;

	vector<int> L;
	vector<int> R;
	for( vector<int>::size_type i=0; i<n1; i++ ) {
	    L.push_back( S.at( left+i ) );
	}
	for( vector<int>::size_type i=0; i<n2; i++ ) {
	    R.push_back( S.at( mid+i ) );
	}
	
	L.push_back( SENTINEL );
	R.push_back( SENTINEL );	
	vector<int>::size_type i, j;
	i = j = 0;
	for( vector<int>::size_type k=left; k<right; k++ ) {
	    cnt++;
	    if( L.at(i) <= R.at(j) ) {
	        S.at(k) = L.at( i++ );
	    } else {
	        S.at(k) = R.at( j++ );
	    }
	}
	
    return;
}
void mergeSort( vector<int>& S, int left, int right )
{
	if( left+1 < right ) {
		int mid = ( left+right )/2;
		mergeSort( S, left, mid );
		mergeSort( S, mid, right );
		merge( S, left, mid, right );
	}
	return;
}

int main()
{
	ios::sync_with_stdio( false );
	cin>>n;
	vector<int> S;
	int num;
	for( int i=0; i<n; i++ ) {
		cin>>num;
		S.push_back( num );
	}
	cnt = 0;
	mergeSort( S, 0, n );
	for( vector<int>::iterator itr = S.begin(); itr!=S.end(); itr++ ) {
		cout<<*itr;
		if( itr < S.end()-1 ) { cout<<' '; }
	}
	cout<<'\n'<<cnt<<endl;	
    return 0;
}

Measured memory_bytes: 6016
a, b, c, d = map(int, input().split())
import fractions
lcm = c * d // fractions.gcd(c, d)
print(b - b // c - b // d + b // lcm - ((a - 1) - (a - 1) // c - (a - 1) // d + (a - 1) // lcm))


Measured memory_bytes: 64112
#include <iostream>
#include <iomanip>
#include <string>
#include <algorithm>
#include <functional>
#include <set>
#include <map>
#include <unordered_map>
#include <queue>
#include <deque>
#include <cmath>
#include <cstdio>

using namespace std;

typedef long long ll;

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

ll gcd(ll a, ll b)
{
    if (a < b) {
        ll t = a;
        a = b;
        b = t;
    }
    ll r = a % b;
    while (r != 0) {
        a = b;
        b = r;
        r = a % b;
    }
    return b;
}

int main(int argc, char **argv)
{
    int N;
    cin >> N;
    ll A[N];
    REP(i, N) cin >> A[i];

    ll L[N], R[N];
    L[0] = A[0];
    REP(i, N - 1) {
        L[i + 1] = gcd(L[i], A[i + 1]);
    }
    R[N - 1] = A[N - 1];
    for (int i = N - 2; i >= 0; --i) {
        R[i] = gcd(R[i + 1], A[i]);
    }

    ll maxGCD = max(R[1], L[N - 2]);
    FOR(i, 1, N - 1) {
        ll g = gcd(L[i - 1], R[i + 1]);
        if (g > maxGCD) maxGCD = g;
    }
    cout << maxGCD << endl;

    return 0;
}


Measured memory_bytes: 2560
#include <iostream>
#include <math.h>
#include <vector>
#include <map>
#include <set>
#include <climits>
#include <algorithm>
using namespace std;




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

	map<int,int> s;

	for(int i=0;i<k;++i){
		int d;
		cin>>d;
		for(int j =0;j<d;++j){
			int curr ;
			cin>>curr;
			s[curr]+=1;
		}
	}
	int res =0;
	for(int i=1;i<n+1;++i){
		if(s.find(i)==s.end()){
			res+=1;
		}
	}

	cout<<res;
	







}




Measured memory_bytes: 3628
#include<stdio.h>

int nibungi(int*,int,int);

int main(){

  int i,n1,n2,k,m=0;
  int A[100001],B;

  scanf("%d",&n1);
  for(i=0;i<n1;i++){
    scanf("%d",&A[i]);
  }
  scanf("%d",&n2);
  for(i=0;i<n2;i++){
    scanf("%d",&B);
    if(nibungi(A,B,n1) != 0) m++;
  }
  printf("%d\n",m);
  return 0;
}

int nibungi(int A[],int key,int n1){
  int center,left=0,right=n1;
  while(left<right){
    center = (left + right) / 2;
    if(A[center] == key) return center;
    else if(key < A[center]) right = center;
    else left = center + 1;
  }
  return 0;
}



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

#define MOD 1000000007

int main(){
    long long n, m;
    long long xx[100010], yy[100010];
    long long x[100010], y[100010];
    long long xa[100010], yb[100010];

    cin >> n >> m;

    for(int i = 0;i < n;i++){
        cin >> xx[i];
    }

    for(int i = 0;i < m;i++){
        cin >> yy[i];
    }

    n--; m--;

    for(int i = 0;i < n;i++){
        x[i] = (xx[i+1] - xx[i]) % MOD;
        xa[i] = ((n-i) * (i+1)) % MOD;
    }

    for(int i = 0;i < m;i++){
        y[i] = (yy[i+1] - yy[i]) %MOD;
        yb[i] = ((m-i) * (i+1)) % MOD;
    }

    long long xsum = 0;
    for(int i = 0;i < n;i++){
        xsum = (xsum + (x[i] * xa[i]) % MOD) % MOD;
    }

    long long ans = 0;
    for(int i = 0;i < m;i++){
        ans = (ans + (xsum * (yb[i] * y[i] % MOD) % MOD)) % MOD;
    }

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




Measured memory_bytes: 4992
#include <iostream>
#include <string>
#include <vector>
#include <stdio.h>
#include <algorithm>
#define _USE_MATH_DEFINES
#include <cmath>
#include <numeric>
#include <iomanip>
#include <deque>
#include <tuple>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_map>
#include <sstream>
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/multiprecision/cpp_dec_float.hpp>

#define rep(i, x) for (int i = 0; i < (int)(x); i++)
#define FOR(i, a, done) for (int i = (a); i < (done); ++i)
#define all(a) (a).begin(), (a).end()
#define F first
#define S second
#define pb push_back
#define pf push_front

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

ll M = 1000000007;
typedef pair<int, int> P;
int d[13];
int main()
{
	int n;
	cin >> n;
	rep(i,n){
		int m;
		cin>>m;
		d[m]++;
	}
	bool three=false;
	deque<int>either;
	 n=0;
	vector<bool>flg(25,false);
	flg[0]=true;
	rep(i,13){
		if(i==0&&d[i]>0){
			three=true;
		}
		if(i==12&&d[i]>1){
			three=true;
		}
		if(i==12&&d[i]>0){
			flg[12]=true;
		}
		if(d[i]>=3){
			three=true;
		}else if(d[i]==2){
			flg[i]=flg[24-i]=true;
		}else if(d[i]==1&&i!=12){
			either.push_front(i);
			n++;
		}
	}
	int ans=0;
	if(!three){
		rep(i,pow(2,n)+1){
			vector<bool>tmp(24);
			tmp=flg;
			rep(j,n){
				if(i&1<<j){
					tmp[either[j]]=true;
				}else{
					tmp[24-either[j]]=true;
				}
			}
			int dis=24;
			rep(j,24){
				rep(k,24){
					if(j!=k&&tmp[j]&&tmp[k]){
						//cout<<j<<" "<<k<<endl;
						dis=min(dis,min(abs(j-k),24-abs(j-k)));
					}
				}
			}
			if(dis!=24)
			ans=max(ans,dis);
		}
		cout<<ans<<endl;
	}else{
		cout<<0<<endl;
	}
}


Measured memory_bytes: 384
def main():
    N, K = map(int, input().split())
    S = input()
    cnt = 0
    for i in range(N-1):
        if S[i] == 'R' and S[i] == S[i+1]:
            cnt += 1

    for i in range(N-1,0,-1):
        if S[i] == 'L' and S[i] == S[i-1]:
            cnt += 1

    ans = min(N-1,cnt+2*K)
    print(ans)

if __name__ == "__main__":
    main()

Measured memory_bytes: 40176
#include <stdio.h>

int main(){
  long long int h, w;  scanf("%lld %lld", &h, &w);
  if(h==1 || w==1)
    printf("1\n");
  else if(h%2 && w%2)
    printf("%lld\n", (w*(h-1))/2+(w/2)+1);
  else
    printf("%lld\n", w*h/2);
  return 0;
}


Measured memory_bytes: 128
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cstring>
#include<queue>
#include<tuple>
#include<utility>
#include<map>
#include<math.h>
#include<iomanip>
#include<stdio.h>
#include<stdlib.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define FOR(i, a, b) for (ll i=a; i<(b); i++)
#define range(a) a.begin(), a.end()
#define endl "\n"
#define Yes() cout << "Yes" << endl
#define No() cout << "No" << endl
using Graph = vector<vector<int>>;
const unsigned long long mod = 1e9 + 7;
const long long INF = 1LL<<60;
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
void chmin(long long &a, long long b) { if (a > b) a = b; }
void chmax(long long &a, long long b) { if (a < b) a = b; }

vector<ll> a ;

// index が条件を満たすかどうか
bool isOK(ll index, ll key) {
	ll count = 0;
	for (int i = 0; i < a.size(); ++i)
	{
		ll u = 0;
		if(a.at(i) % index!=0)	u = a.at(i) / index;
		else	u = a.at(i) / index - 1;
		count += u;
	}
	if (count <= key) return true;
    else return false;
}

// 汎用的な二分探索のテンプレ
ll binary_search(ll key) {
    ll ng = 0; //「index = 0」が条件を満たすこともあるので、初期値は -1
    ll ok = 1e9; // 「index = a.size()-1」が条件を満たさないこともあるので、初期値は a.size()

    /* ok と ng のどちらが大きいかわからないことを考慮 */
    while (abs(ok - ng) > 1) {
        ll mid = (ok + ng) / 2;

        if (isOK(mid, key)) ok = mid;
        else ng = mid;
    }
    return ok;
}

int main() {
	ll N, K;
	cin >> N >> K;
	a.resize(N);
	FOR(i, 0, N)	cin>>a.at(i);
	cout << binary_search(K) << endl;
	


	return 0;
}




Measured memory_bytes: 4692
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;
#define ll long long
const int N=1e5+500;
const ll inf=9223372036854775807;
int n,k;
ll a[N],ans=inf;
inline ll mina(ll a,ll b){
	return (a<b)?a:b;
}
inline ll as(ll a){
	return (a>0)?a:(-1ll)*a;
}
int main(){
	scanf("%d%d",&n,&k);
	for(register int i=1;i<=n;i++)scanf("%lld",&a[i]);
	int l,r;
	for(register int i=1;i+k-1<=n;i++){
		l=i;
		r=i+k-1;
		ans=mina(ans,a[r]-a[l]+mina(as(a[l]),as(a[r])));
	}
	printf("%lld\n",ans);
	return 0;
} 

Measured memory_bytes: 1024
N,K,Q=map(int,input().split())
A=[]
for i in range(Q):
  A.append(int(input()))
           
point=[0]*N
for i in A:
  point[i-1]+=1
  
for i in point:
  if K+i-Q>0:
    print("Yes")
  else:
    print("No")

Measured memory_bytes: 8636