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

using namespace std;

struct UnionFind
{
  vector< int > data;

  UnionFind(int sz)
  {
    data.assign(sz, -1);
  }

  bool unite(int x, int y)
  {
    x = find(x), y = find(y);
    if(x == y) return (false);
    if(data[x] > data[y]) swap(x, y);
    data[x] += data[y];
    data[y] = x;
    return (true);
  }

  int find(int k)
  {
    if(data[k] < 0) return (k);
    return (data[k] = find(data[k]));
  }

  int size(int k)
  {
    return (-data[find(k)]);
  }
};

int main()
{
  int N, A[100001], B[100001];

  cin >> N;
  for(int i = 0; i < N; i++) cin >> A[i];
  for(int i = 0; i < N; i++) cin >> B[i];

  A[N] = B[N] = 0;
  for(int i = 0; i < N; i++) A[N] ^= A[i];
  for(int i = 0; i < N; i++) B[N] ^= B[i];

  if(multiset< int >(A, A + N + 1) != multiset< int >(B, B + N + 1)) {
    cout << -1 << endl;
    return (0);
  }


  int ret = 0;

  if(A[N] != B[N]) {
    ++ret;
    for(int i = 0; i < N; i++) {
      if(A[i] != B[i] && B[i] == A[N]) {
        swap(A[i], A[N]);
        break;
      }
    }
  }
  vector< int > es;
  for(int i = 0; i < N; i++) {
    if(A[i] != B[i]) {
      ++ret;
      es.emplace_back(A[i]);
    }
  }
  sort(begin(es), end(es));
  es.erase(unique(begin(es), end(es)), end(es));
  UnionFind uf(es.size());
  for(int i = 0; i < N; i++) {
    if(A[i] == B[i]) continue;
    uf.unite(lower_bound(begin(es), end(es), A[i]) - begin(es),
             lower_bound(begin(es), end(es), B[i]) - begin(es));
  }
  for(int i = 0; i < es.size(); i++) {
    ret += i == uf.find(i);
  }
  for(int i = 0; i < N; i++) {
    if(A[i] != B[i] && B[i] == A[N]) {
      --ret;
      break;
    }
  }
  cout << ret << endl;
}

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

int main(){
  long n, count=0, ans=0;
  cin >> n;
  vector<long> a(n);
  for(int i=0;i<n;i++){
    cin >> a[i];
    if(a[i]<=0){
      count+=1;
    }
  }
  if(count%2==0){
    for(int i=0;i<n;i++){
      if(a[i]<0){
        a[i] = (-1) * a[i];
      }
      ans+=a[i];
    }
  }else{
    ans=0;
    for(int i=0;i<n;i++){
      if(a[i]<0){
        a[i] = (-1) * a[i];
      }
      ans+=a[i];
    }
    sort(a.begin(), a.end());
    ans -= 2*a[0];
  }
  cout << ans << endl;
}
      

Measured memory_bytes: 1024
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define RREP(i,n) for(int i=n;i>=0;i--)
#define FOR(i,m,n) for(int i=m;i<n;i++)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
using namespace std;
typedef long long ll;



int main(void){
    int n;
    cin >> n;
    vector<int> v(100000+1);
    ll sum=0;
    REP(i,n){
        int a;
        cin >> a;
        v[a]++;
        sum+=a;
    }
    
    int q;
    cin >> q;
    REP(i,q){
        int b,c;
        cin >> b >> c;
        sum+=((c-b)*v[b]);
        v[c]+=v[b];
        v[b]=0;
        cout << sum << endl;
    }
    
    return 0;
}

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

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
//const ll mod = 1000000007;

int main() {
    //cout.precision(10);
    int n;
    cin >> n;
    int k = 1;
    while(k * (k - 1) < 2 * n){
        k++;
    }
    if(k * (k - 1) > 2 * n){
        cout << "No" << endl;
        return 0;
    }
    vector<int> ans[1000];
    int index = 1;
    for(int i = 1; i < k; i++){
        for(int j = i + 1; j <= k; j++){
            ans[i].push_back(index);
            ans[j].push_back(index);
            index++;
        }
    }
    cout << "Yes" << endl;
    cout << k << endl;
    for(int i = 1; i <= k; i++){
        int number = ans[i].size();
        cout << number << " ";
        for(int j = 0; j < number; j++){
            cout << ans[i][j];
            if(j < number - 1){
                cout << " ";
            }
        }
        cout << endl;
    }
    return 0;
}


Measured memory_bytes: 2304
import sys

sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return list(map(int, sys.stdin.readline().split()))
def II(): return int(sys.stdin.readline())
def LS(): return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]

def main():
    n = II()
    a_s = LI()
    d = [0, 0, 0]
    ans = 1
    for i in a_s:
        flag = True
        tmp = 0
        for index, j in enumerate(d):
            # print(i, j)
            if j == i:
                tmp += 1
                if flag:
                    d[index] += 1
                    flag = False
        ans = ans * tmp % MOD
        # print(d, tmp, i, ans)
    print(ans)





if __name__ == '__main__':
    main()

Measured memory_bytes: 53084
#include<iostream>
#include<algorithm>
#include<functional>
#include<cmath>
#include<string>
#include<vector>
using namespace std;
const int mod = 1000000007;
#define ll long long

int main()
{
	int H, W;
	string A[10];
	cin >> H >> W;
	int count = 0;
	for (int i = 0; i < H; i++) cin >> A[i];
	for (int i = 0; i < H; i++) {
		for (int j = 0; j < W; j++) {
			if (A[i][j] == '#') {
				count++;
			}
		}
	}
	if (count == H + W - 1) cout << "Possible" << endl;
	else cout << "Impossible" << endl;
}

Measured memory_bytes: 256
package main

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

var (
	scanner = bufio.NewScanner(os.Stdin)
)

func readInt() (read int) {
	scanner.Scan()
	read, err := strconv.Atoi(scanner.Text())
	if err != nil {
		panic(err)
	}
	return
}

const (
	initialBufSize = 2e8
	maxBufSize     = 2e8
)

func main() {
	buf := make([]byte, initialBufSize)
	scanner.Buffer(buf, maxBufSize)
	scanner.Split(bufio.ScanWords)

	n := readInt()
	prev := readInt()
	total := 0
	for i := 1; i < n; i++ {
		val := readInt()
		if prev < val {
			prev = val
		} else {
			total += (prev - val)
		}
	}

	fmt.Println(total)
}


Measured memory_bytes: 13568
S = input()

MOD = 10 ** 9 + 7
N = len(S)
dp = [[0] * 4 for _ in range(N + 1)]
dp[-1][-1] = 1

for i in reversed(range(N)):
    m = 3 if S[i] == '?' else 1
    for j in reversed(range(4)):
        dp[i][j] = m * dp[i + 1][j]
        if (j < 3) and (S[i] == '?' or S[i] == 'ABC'[j]):
            dp[i][j] += dp[i + 1][j + 1]
        dp[i][j] %= MOD
            
print(dp[0][0] % MOD)



Measured memory_bytes: 54508
N, M = map(int, input().split())
Hs = list(map(int, input().split()))

is_good_Hs = [True for _ in range(N)]

for _ in range(M):
    A, B = map(int, input().split())
    A = A - 1
    B = B - 1
    if Hs[A] > Hs[B]:
        is_good_Hs[B] = False
    elif Hs[A] < Hs[B]:
        is_good_Hs[A] = False
    elif Hs[A] == Hs[B]:
        is_good_Hs[A] = False
        is_good_Hs[B] = False


count = 0
for i in range(N):
    if is_good_Hs[i]:
        count += 1

print(count)


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

#define ll long long
int main()
{
	ll n, m; cin >> n >> m;
	ll a[n];
	ll sum=0;
	for(int i=0;i<n;++i){
		cin >> a[i];
		sum += a[i];
	}
	ll MIN = ceil((long double)sum/(long double)(4*m));
	int counter=0;
	for(int i=0;i<n;++i){
		if(a[i]>=MIN) counter++;
	}

	if(counter>=m) cout << "Yes";
	else cout << "No";
}


Measured memory_bytes: 256
/*{{{*/
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<string>
#include<iostream>
#include<sstream>
#include<set>
#include<map>
#include<queue>
#include<bitset>
#include<vector>
#include<limits.h>
#include<assert.h>
#define SZ(X) ((int)(X).size())
#define ALL(X) (X).begin(), (X).end()
#define REP(I, N) for (int I = 0; I < (N); ++I)
#define REPP(I, A, B) for (int I = (A); I < (B); ++I)
#define FOR(I, A, B) for (int I = (A); I <= (B); ++I)
#define FORS(I, S) for (int I = 0; S[I]; ++I)
#define RS(X) scanf("%s", (X))
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define CASET int ___T; scanf("%d", &___T); for(int cs=1;cs<=___T;cs++)
#define MP make_pair
#define PB push_back
#define MS0(X) memset((X), 0, sizeof((X)))
#define MS1(X) memset((X), -1, sizeof((X)))
#define LEN(X) strlen(X)
#define F first
#define S second
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<PII> VPII;
typedef pair<LL,LL> PLL;
typedef vector<PLL> VPLL;
template<class T> void _R(T &x) { cin >> x; }
void _R(int &x) { scanf("%d", &x); }
void _R(LL &x) { scanf("%lld", &x); }
void _R(double &x) { scanf("%lf", &x); }
void _R(char &x) { scanf(" %c", &x); }
void _R(char *x) { scanf("%s", x); }
void R() {}
template<class T, class... U> void R(T &head, U &... tail) { _R(head); R(tail...); }
template<class T> void _W(const T &x) { cout << x; }
void _W(const int &x) { printf("%d", x); }
void _W(const LL &x) { printf("%lld", x); }
void _W(const double &x) { printf("%.16f", x); }
void _W(const char &x) { putchar(x); }
void _W(const char *x) { printf("%s", x); }
template<class T,class U> void _W(const pair<T,U> &x) {_W(x.F); putchar(' '); _W(x.S);}
template<class T> void _W(const vector<T> &x) { for (auto i = x.begin(); i != x.end(); _W(*i++)) if (i != x.cbegin()) putchar(' '); }
void W() {}
template<class T, class... U> void W(const T &head, const U &... tail) { _W(head); putchar(sizeof...(tail) ? ' ' : '\n'); W(tail...); }
#ifdef HOME
 #define DEBUG(...) {printf("# ");printf(__VA_ARGS__);puts("");}
#else
 #define DEBUG(...)
#endif
int MOD = 1e9+7;
void ADD(LL& x,LL v){x=(x+v)%MOD;if(x<0)x+=MOD;}
/*}}}*/
const int SIZE = 1e6+10;
LL ss,an[SIZE],A[SIZE];
int main(){
    int N;
    R(N);
    FOR(i,1,N){
        R(A[i]);
        ss+=A[i];
    }
    LL now=0;
    FOR(i,1,N/2-1)now+=A[i*2-1];
    REP(i,N){
        now+=A[(i*2+N-3)%N+1];
        an[i*2%N]=ss-2*now;
        now-=A[i*2%N+1];
    }
    an[N]=an[0];
    W(VL(an+1,an+N+1));
    return 0;
}


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

using namespace std;

typedef long long int64;

string S, T = "+-*";
int ts[3], idx;

int64 latte();


int64 calc(int64 a, char b, int64 c)
{
  if(b == '+') return (a + c);
  if(b == '-') return (a - c);
  return (a * c);
}

int64 ei()
{
  if(S[idx] == '(') {
    ++idx;
    int64 ret = latte();
    ++idx;
    return (ret);
  } else {
    int64 ret = 0;
    while(idx < S.size() && isdigit(S[idx])) {
      ret = ret * 10 + S[idx++] - '0';
    }
    return (ret);
  }
}

int64 beet()
{
  int64 ret = ei();
  while(idx < S.size() && T.find(S[idx]) != string::npos && ts[T.find(S[idx])] == 2) {
    char op = S[idx++];
    auto get = ei();
    ret = calc(ret, op, get);
  }
  return (ret);
}

int64 malta()
{
  int64 ret = beet();
  while(idx < S.size() && T.find(S[idx]) != string::npos && ts[T.find(S[idx])] == 1) {
    char op = S[idx++];
    auto get = beet();
    ret = calc(ret, op, get);
  }
  return (ret);
}

int64 latte()
{
  int64 ret = malta();
  while(idx < S.size() && T.find(S[idx]) != string::npos && ts[T.find(S[idx])] == 0) {
    char op = S[idx++];
    auto get = malta();
    ret = calc(ret, op, get);
  }
  return (ret);
}

int main()
{
  cin >> S;
  int64 ret = numeric_limits< int64 >::min();
  for(ts[0] = 0; ts[0] < 3; ts[0]++) {
    for(ts[1] = 0; ts[1] < 3; ts[1]++) {
      for(ts[2] = 0; ts[2] < 3; ts[2]++) {
        idx = 0;
        ret = max(ret, latte());
      }
    }
  }
  cout << ret << endl;
}

Measured memory_bytes: 3216
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        String[] order = s.split("");
        int sum = 700;
        for (int i = 0; i < order.length; i++) {
            if ("o".equals(order[i])) {
                sum += 100;
            }
        }
        System.out.println(sum);
    }

}


Measured memory_bytes: 21844
import itertools
a = input()
n = len(a)
s = int(a)
num =[x for x in range(n-1)]
for i in range(1,n):
    position = list(itertools.combinations(num,i))
    for next in position:
        t=''
        for j in range(n):
            t+=a[j]
            if j in next:
                s+=int(t)
                t=''
        s+=int(t)
print(s)

Measured memory_bytes: 3060
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define RREP(i,n) for(int i=n;i>=0;i--)
#define FOR(i,m,n) for(int i=m;i<n;i++)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
using namespace std;
typedef long long ll;



int main(void){
    int x,n;
    cin >> x >> n;
    vector<bool> v(101+1);
    REP(i,101+1)
        v[i]=true;

    REP(i,n){
        int p;
        cin >> p;
        v[p]=false;
    }
    
    int ans=x;

    for(int i=0;i<101+1;i++){
        if(v[x-i]==true){
            ans=x-i;
            break;
        }
        if(v[x+i]==true){
            ans=x+i;
            break;
        }
    }

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

Measured memory_bytes: 3628
import sys
 
stdin = sys.stdin
inf = 1 << 60
mod = 1000000007
 
ni = lambda: int(ns())
nin = lambda y: [ni() for _ in range(y)]
na = lambda: list(map(int, stdin.readline().split()))
nan = lambda y: [na() for _ in range(y)]
ns = lambda: stdin.readline().rstrip()
nsn = lambda y: [ns() for _ in range(y)]
nsl = lambda y: [list(ns()) for _ in range(y)]
nas = lambda: stdin.readline().split()

H, W = na()
m = nsl(H)

for i in range(W):
    flag = True
    for j in range(H):
        if m[j][i] != '.':
            flag = False
    if flag:
        for j in range(H):
            m[j][i] = '$'

for i in range(H):
    flag = True
    for j in range(W):
        if m[i][j] != '.' and m[i][j] != '$':
            flag = False
    if flag:
        for j in range(W):
            m[i][j] = '$'

o = [[] for i in range(H)]
for i in range(H):
    for j in range(W):
        if m[i][j] != '$':
            o[i].append(m[i][j])

for i in o:
    if len(i) >= 1:
        for j in i:
            print(j, end="")
        print()

Measured memory_bytes: 43480
#include <iostream>
#include <string>
#include <vector>
#include <map>

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

using std::cin;
using std::cout;
using std::endl;
using std::string;
using std::vector;

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

  std::map<int, int> even;
  std::map<int, int> odd;
  rep(i, n)
  {
    int v;
    cin >> v;
    if (i % 2 == 0)
    {
      even[v]++;
    }
    else
    {
      odd[v]++;
    }
  }

  int even_mx_1 = 0;
  int even_mx_2 = 0;
  int even_mx_num = 0;
  for (auto i = even.begin(); i != even.end(); i++)
  {
    if (even_mx_1 < i->second)
    {
      even_mx_num = i->first;
      even_mx_2 = even_mx_1;
      even_mx_1 = i->second;
    }
    else if (even_mx_2 < i->second)
    {
      even_mx_2 = i->second;
    }
  }

  int odd_mx_1 = 0;
  int odd_mx_2 = 0;
  int odd_mx_num = 0;
  for (auto i = odd.begin(); i != odd.end(); i++)
  {
    if (odd_mx_1 < i->second)
    {
      odd_mx_num = i->first;
      odd_mx_2 = odd_mx_1;
      odd_mx_1 = i->second;
    }
    else if (odd_mx_2 < i->second)
    {
      odd_mx_2 = i->second;
    }
  }

  if (odd_mx_num != even_mx_num)
  {
    cout << n - odd_mx_1 - even_mx_1 << endl;
  }
  else
  {
    cout << n - std::max(odd_mx_1 + even_mx_2, odd_mx_2 + even_mx_1) << endl;
  }

  return 0;
}


Measured memory_bytes: 4992
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

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

        Scanner sc = new Scanner(System.in);
        long a = Long.parseLong(sc.next());
        long b = Long.parseLong(sc.next());
        List<Integer> lista = new ArrayList<Integer>();
        long rangeStart = Math.round(a * 12.5);
        long rangeEnd = (Math.round((a + 1)* 12.5));
        for(int i = (int)rangeStart; i<rangeEnd;i++){
            lista.add(i);
        }
        List<Integer> listb = new ArrayList<Integer>();
        rangeStart = b * 10;
        rangeEnd = (b + 1 ) * 10;
        for(int i = (int)rangeStart; i<rangeEnd;i++){
            listb.add(i);
        }
        for(int j=0;j<lista.size();j++){
            for(int k=0;k<listb.size();k++){
                if(lista.get(j).equals(listb.get(k))){
                    System.out.println(lista.get(j));
                    return;
                }
            
            }

        }
        System.out.println("-1");


    }
}

Measured memory_bytes: 23764
n = io.read("*n")
t = {}
for i = 1, n do
  t[i] = io.read("*n")
end
local mma = math.max
left = {t[1]}
for i = 2, n do
  left[i] = mma(left[i - 1], t[i])
end
local right = {}
for i = 1, n do right[i] = 0 end
right[n] = t[n]
for i = n - 1, 1, -1 do
  right[i] = mma(right[i + 1], t[i])
end
print(right[2])
for i = 2, n - 1 do
  print(math.max(left[i - 1], right[i + 1]))
end
print(left[n - 1])


Measured memory_bytes: 14612
def m(L,R):
 global c;c+=len(L)+len(R)
 T=[]
 for l in L[::-1]:
  while R and R[-1]>l:T+=[R.pop()]
  T+=[l]
 return R+T[::-1]
def d(A):s=len(A)//2;return m(d(A[:s]),d(A[s:]))if len(A)>1 else A
c=0
input()
print(*d(list(map(int,input().split()))))
print(c)


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

int main() {
	int n, m, a, b, c, d, i, j, k, x[21][21];
	cin >> n >> m;
	for(i = 1; i <= n; i++)
		for(j = 1; j <= n; j++)
			x[i][j] = 1001;
	for(i = 0; i < m; i++) {
		scanf("%d,%d,%d,%d", &a, &b, &c, &d);
		x[a][b] = c;
		x[b][a] = d;
	}
	for(k = 1; k <= n; k++)
		for(i = 1; i <= n; i++)
			for(j = 1; j <= n; j++)
				if (x[i][j] > x[i][k] + x[k][j]) x[i][j] = x[i][k] + x[k][j];
	scanf("%d,%d,%d,%d", &a, &b, &c, &d);
	cout << c - d - x[a][b] - x[b][a] << endl;
	return 0;
}

Measured memory_bytes: 3132
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;

public class Main {
	
    public static void main(String[] args) throws IOException {
    	Scanner s = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		String[] input;
		long a = s.nextInt(), b = s.nextInt(), c = s.nextInt();
		int k = s.nextInt();
		while (b <= a) {
			b *= 2;
			k--;
		}
		while (c <= b) {
			c *= 2;
			k--;
		}
		out.print(k < 0 ? "No" : "Yes");
		out.flush();
		out.close();
    }
}


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

int main(){

    long K,N;
    cin >> K >> N;

    vector<long> A(N, 0);

    long tmpmin=K;
    cin >> A[0];
    for(size_t i=1;i<N;i++){
        cin >> A[i];
        tmpmin = min(tmpmin,K-(A[i]-A[i-1]));
    }
    tmpmin = min(tmpmin,A[N-1]-A[0]);

    cout << tmpmin << endl;

    return 0;
}


Measured memory_bytes: 1792
#include <iostream>
#include <algorithm>
#include <string>
#include <numeric>
#include <vector>
#include <queue>
#define rep(i,n) for(int i=0;i<n;i++)
#define ll long long int
#define ii pair<int,int>
#define MAX 1000000007

using namespace std;


int main(void){
  int n;
  cin >> n;
  vector<ll> work(5,0);

  rep(i,n){
	string s;
	cin >> s;
	if(s[0] == 'M') work[0]++;
	if(s[0] == 'A') work[1]++;
	if(s[0] == 'R') work[2]++;
	if(s[0] == 'C') work[3]++;
	if(s[0] == 'H') work[4]++;
  }

  ll ans = 0;
  for(int i=0;i<5;i++){
	for(int j=i+1;j<5;j++){
	  for(int k=j+1;k<5;k++){
		ans += work[i]*work[j]*work[k];
	  }
	}
  }

  cout << ans << endl;
  return 0;

}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
ll MaxCD(ll a, ll b) {
  if (a < b)
    swap(a, b);
  ll r = a % b;
  while (r != 0) {
    a = b;
    b = r;
    r = a % b;
  }
  return b;
}
int main(void){
	int j,i,n,f=1;
	cin>>n;
	string s[n];
	for(i=0;i<n;i++)cin>>s[i];
	for(i=0;i<n;i++){
		for(j=0;j<n;j++){
			if(s[i]==s[j]&&i!=j)f=0;
		}
	}
	for(i=1;i<n;i++){
		if(s[i][0]!=s[i-1][s[i-1].size()-1])f=0;
	}
	if(f)cout<<"Yes\n";
	else cout<<"No\n";
}


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

typedef long long int ll;

ll MOD = 1000000007;
ll INF = 100000000000;
double PI = 3.1415926535;

int main(){
 ll N;cin >> N;
 vector<ll> A(N),B(N),C(N);
 for(int i = 0;i < N;i++)cin >> A[i];
 for(int i = 0;i < N;i++)cin >> B[i];
 for(int i = 0;i < N;i++)cin >> C[i];
 sort(A.begin(),A.end());
 sort(B.begin(),B.end());
 sort(C.begin(),C.end());
 ll ans = 0;
 for(int i = 0;i < N;i++){
    ll S,T;
    int L = -1,R = N;
    while(R-L>1){
       int mid = (R+L)/2;
       if(A[mid] < B[i]){
          L = mid;
       }else{
          R = mid;
       }
    }
    //cout << R <<' ';
    S = R;
    L = -1;R = N;
    while(R-L>1){
       int mid = (R+L)/2;
       if(C[mid] > B[i]){
          R = mid;
       }else{
          L = mid;
       }
    }
    T = N-R;
    ans += S*T;
    //cout << R << endl;
 }
 cout << ans << endl;
}

Measured memory_bytes: 3200
#include <iostream>
#include <numeric>
#include <stdio.h>
#include <iomanip>
#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
using namespace std;
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)






int main() {
	int a,b,c,d;
	
	cin >>a>>b>>c>>d;
	
	cout <<max(a*b,c*d)<< endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<math.h>
#include<iomanip>
#include<algorithm>

using namespace std;

int main(){


    string a,b,ans;
    cin >> a >> b;
    int x = stoi(a) ;
    int y = stoi(b);
    if(a<=b){
        for(int i=0;i<y;i++){
            ans+=a;
        } 
    }
    else{
        for(int j=0;j<x;j++){
            ans+=b;}
    }
    cout << ans << endl;

}
    

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

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

  int n;
  cin >> n;
  vector<int> v(n);
  vector<int> c(n);
  for (int i = 0; i < n; i++) cin >> v[i];
  for (int i = 0; i < n; i++) cin >> c[i];
  int res = 0;
  for (int i = 0; i < n; i++) {
    res += max(0, v[i] - c[i]);
  }
  cout << res << '\n';
  return 0;
}

Measured memory_bytes: 256
function Main(input) {
    input = input.split(" ");
    if(input[1] == "+"){
      var s = parseInt(input[0])+parseInt(input[2]);
    } else if(input[1] == "-"){
      var s = parseInt(input[0])-parseInt(input[2]);
    } else {
       var s = 0;
    }
    console.log('%s', s);
}

function debug(){
	var input = document.getElementById("input").value;
	Main(input);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 13816
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define FUP(i, a, b) for(int i = a; i <= b; i++)
#define FDOWN(i, a, b) for(int i = a; i >= b; i--)
#define MS(a, b) memset(a, b, sizeof(a))
#define ALL(v) v.begin(), v.end()
#define CIN(a) cin >> a;
#define CIN2(a, b) cin >> a >> b
#define CIN3(a, b, c) cin >> a >> b >> c
#define COUT(a) cout << a
#define COUT2(a, b) cout << a << ' ' << b
#define COUT3(a, b, c) cout << a << ' ' << b << ' ' << c
#define ENDL cout << '\n'
int dy[4] = { -1, 1, 0, 0 };
int dx[4] = { 0, 0, 1, -1 };

string T, S;
int ans = 1001;

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

	CIN2(S, T);
	FUP(i, 0, S.length() - T.length())
	{
		int cnt = 0;
		FUP(j, 0, T.length() - 1)
		{
			if (S[i + j] != T[j]) cnt++;
		}
		ans = min(ans, cnt);
	}
	COUT(ans);

	return 0;
}

Measured memory_bytes: 3624
n = int(input())
a = list(map(int, input().split()))

cs = [0]*(n+1)
cs[0] = a[0]
for i in range(1, n+1):
    cs[i] += cs[i-1] + a[i-1]
cs.sort()
total = 0
focus = None
count = 0
for s in cs:
    if s == focus:
        count += 1
    else:
        total += count * (count-1)//2
        focus = s
        count = 1
total += count * (count-1)//2
print(total)


Measured memory_bytes: 31564
#include<stdio.h>
int main()
{
	int l,r,d;
	scanf("%d %d %d", &l,&r,&d);
	int k=0;
	for(int i=l; i<=r; i++)
	{
		if(i%d==0 && d!=0)
		{
			k+=1;
		}
	}printf("%d\n",k);
	return 0;
}

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

struct loop_info {
    lint loop_len;
    lint prefix_len;
    lint unit;
    loop_info() {}
    loop_info(lint l, lint p, lint u) : loop_len(l), prefix_len(p), unit(u) {}
};

lint n, x, m;

lint f(lint z) {
    return z * z % m;
}

loop_info get_loop() {
    vector<lint> appear_time(m, -1);
    lint now = x;
    lint time = 0;
    loop_info res;
    lint start_val;
    while (true) {
        if (appear_time[now] == -1) {
            appear_time[now] = time;
            time++;
            now = f(now);
        } else {
            res.loop_len = time - appear_time[now];
            res.prefix_len = appear_time[now];
            start_val = now;
            break;
        }
    }
    lint unit = 0;
    lint val = start_val;
    for (int i = 0; i < res.loop_len; i++) {
        unit += val;
        val = f(val);
    }
    res.unit = unit;
    return res;
}

lint simple_solve(lint k) {
    lint now = x;
    lint res = 0;
    for (int i = 0; i < k; i++) {
        res += now;
        now = f(now);
    }
    return res;
}

int main() {
    cin >> n >> x >> m;
    auto loop = get_loop();
    if (n < loop.prefix_len) {
        cout << simple_solve(n) << endl;
    } else {
        lint loop_num = (n - loop.prefix_len) / loop.loop_len;
        lint rem = n - loop_num * loop.loop_len;
        lint ans = simple_solve(rem) + loop.unit * loop_num;
        cout << ans << endl;
    }
}

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

int main() {
  int N, P;
  string S;
  cin >> N >> P >> S;
  ll ans = 0;
  if (P == 2 || P == 5) {
    rep(i, N) {
      if ((S[i] - '0') % P == 0) ans += i + 1;
    }
  } else {
    vector<int> mod(N + 1);
    int ten = 1;
    for (int i = N - 1; i >= 0; i--) {
      int a = (S[i] - '0') * ten % P;
      mod[i] = (mod[i + 1] + a) % P;
      ten = ten * 10 % P;
    }
    vector<int> cnt(P);
    rep(i, N + 1) {
      ans += cnt[mod[i]];
      cnt[mod[i]]++;
    }
  }
  cout << ans << endl;
  return 0;
}

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

int main() {
  int n, r;
  while(cin >> n >> r) {
    deque<int> d;
    for(int i = 0; i < n; i++) {
      d.push_back(i);
    }

    for(int i = 0; i < r; i++) {
      deque<int> a, b;
      for(int j = 0; j < n; j++) {
        if(j < n/2) {
          b.push_back(d.front());
        } else {
          a.push_back(d.front());
        }
         d.pop_front();
      }

      int x; cin >> x;
      while(true) {
        if(a.empty()) break;
        for(int i = 0; i < x; i++) {
          if(a.empty()) break;
          d.push_back(a.front());
          a.pop_front();
        }
        if(b.empty()) break;
        for(int i = 0; i < x; i++) {
          if(b.empty()) break;
          d.push_back(b.front());
          b.pop_front();
        }
      }
    }
    cout << d.back() << endl;
  }
}

Measured memory_bytes: 1212
s=input()
if s[0]=="M":
  print(6)
elif s[0]=="W":
  print(4)
elif s[0]=="F":
  print(2)
else:
  if s=="SUN":
    print(7)
  elif s=="TUE":
    print(5)
  elif s=="THU":
    print(3)
  else:
    print(1)

Measured memory_bytes: 3060
#include <iostream>
#include <string>
#include <cstdio>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <utility>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
using namespace std;
#define INF 1000000007
#define LINF 1000000000000000007
#define MOD 1000000007
#define int long long
#define rep(i, n) for (int i = 0; i < n; i++)
#define repb(i, n) for (int i = n - 1; i >= 0; i--)
#define MODE 1
#ifdef MODE
#define DEB(X) cout << #X << ": " << X << " ";
#define ARDEB(i, X) cout << #X << "[" << i << "]: " << X[i] << " ";
#define END cout << endl;
#else
#define DEB(X) \
    {          \
    }
#define ARDEB(i, X) \
    {               \
    }
#define END \
    {       \
    }
#endif
typedef pair<int, int> P;
struct edge{int to,cost;};

typedef long long ll;

int ans,ans2;

signed main(){

	int n;
	cin>>n;
	cout<<3*n*n<<endl;
	
	
}


Measured memory_bytes: 764
"""
https://atcoder.jp/contests/abc153/tasks/abc153_e

個数制限なしDP
一次元の配列を使うパターン。
"""

H, N = list(map(int, input().split()))
A = []
B = []
for i in range(N):
    a, b = list(map(int, input().split()))
    A.append(a)
    B.append(b)

INF = float('INF')
MAX_J = 10 ** 4 + 1

# DP[j]: ダメージの総和をjにする魔力の最小値
DP = [INF] * MAX_J
DP[0] = 0

# 計算済みのDP[j]にA[i]の魔法を使った場合を計算して、もしそれが最少だったら更新していく

for i in range(N):
    for j in range(MAX_J):
        # nj: 求める添字
        # nj: i番目の魔法を使った後のダメージの総和（Hがmax）
        nj = min(j+A[i], H)
        # DP[nj]はすでに入っている値か、i番目の魔法を使った場合か
        DP[nj] = min(DP[nj], DP[j] + B[i])

print(DP[H])

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

int main(){
  int64_t a, b, c;
  cin >> a >> b >> c;
  c -= (a+b);
  if(c <= 0) cout << "No" << endl;
  else{
    c = c*c;
    c -= (4*a*b);
    if(c <= 0) cout << "No" << endl;
    else cout << "Yes" << endl;
  }
}

Measured memory_bytes: 256
object Main extends App {
  val (r, g, b, n) = scala.io.StdIn.readLine.split(' ').map(_.toInt) match { case Array(ir, ig, ib, in) => (ir, ig, ib, in) }

  var count = 0

  for {
    i <- 0 to n / r
    j <- 0 to n / g
  } {
    val remain = n - (r * i) - (g * j)
    if (remain >= 0 && remain % b == 0) count = count + 1
  }

  println(count)
}


Measured memory_bytes: 27284
#include<bits/stdc++.h>
using namespace std;
int main(){
	long long i,sum,n;
	cin>>n;
	long long a[n+1];
	a[0]=2;a[1]=1;
	for(i=2;i<=n;i++){
		a[i]=a[i-1]+a[i-2];
	}
	cout<<a[n];
}

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

int main() {
    long n, T;
    cin >> n >> T;
    pair<long, long> P[100];
    for (long i = 0; i < n; i++) {
        cin >> P[i].first >> P[i].second;
    }

    sort(P, P + n);

    for (long i = 0; i < n; i++) {
        if (P[i].second <= T) {
            cout << P[i].first << endl;
            return 0;
        }
    }

    cout << "TLE" << endl;

    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#define rep(i,n) for(i=0;i<n;i++)
#define PI 3.14159265358979323846264338327950L
// xが素数か判定する(素数なら1, 非素数は0)
int prime( int x )
{
    int n;

    if( x == 2 ) return 1;
    if( x < 2 || x % 2 == 0 ) return 0;
    for( n = 3; n <= sqrt((double)x); n += 2 )
        if( x % n == 0 ) return 0;
    return 1;
}
int main(){
    int i,x;
    scanf("%d",&x);
    for(i=0;i<x;i++){
        if(prime(x+i)) break; 
    }
    printf("%d",x+i);
    return 0;
}

Measured memory_bytes: 2136
#include <cstdio>
using namespace std;

int main(){
  long long A, B; scanf("%lld%lld", &A, &B);
  long long Z = B / A;

  int ans = 0; while(Z > 0){ ans++; Z >>= 1; }

  printf("%d\n", ans);
  return 0;
}

Measured memory_bytes: 128
"use strict";
function Main(input) {
  const reverse = function (str) {
    return str.split("").reverse().join("");
  };
  const arr = ["dream", "dreamer", "erase", "eraser"];

  for (let i in arr) {
    arr[i] = reverse(arr[i]);
  }
  // console.log(input);
  // input = reverse(input);
  input = reverse(input.split("\n")[0]);

  if (input.length == 0) {
    console.log("NO");
    return;
  }
  while (true) {
    let flag = false;
    for (let s of arr) {
      if (input.slice(0, s.length) == s) {
        input = input.substr(s.length);
        flag = true;
      }
    }
    if (flag == false) break;
  }
  if (input.length == 0) {
    console.log("YES");
  } else {
    console.log("NO");
  }
}

Main(require("fs").readFileSync("/dev/stdin", "utf-8"));


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

using namespace std;

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

long long cnt;
int A[1000000];
vector<int> G;

void insertionSort(int A[], int n, int g) {
    for (int i = g; i < n; i++) {
        int v = A[i];
        int j = i - g;
        while (j >= 0 && A[j] > v) {
            A[j + g] = A[j];
            j -= g;
            cnt++;
        }
        A[j + g] = v;
    }
}

void shellSort(int A[], int n) {
    for (int h = 1;;) {
        if (h > n) break;
        G.push_back(h);
        h = 3 * h + 1;
    }
    for (int i = G.size() - 1; i >= 0; i--) {
        insertionSort(A, n, G[i]);
    }
}

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

    int n;
    cin >> n;
    REP(i, n) cin >> A[i];
    cnt = 0;
    shellSort(A, n);

    cout << G.size() << endl;
    for (int i = G.size() - 1; i >= 0; i--) {
        cout << G[i];
        if (i != 0) cout << " ";
    }
    cout << endl;
    cout << cnt << endl;
    REP(i, n) cout << A[i] << endl;
    return 0;
}

Measured memory_bytes: 7076
#include <stdio.h>
#include <iostream>

using namespace std;

#define SIZE 500

class point
{
public:
	int n;
	int d[SIZE * 2 + 1];
	int minw;
};

#define SIZE2 (200000 / SIZE + 10)

point m[SIZE2];

int p[200000];

int N;

void atu()
{
	int now = 0;
	for(int i = 0; i < SIZE2; i++)
	{
		for(int ii = 0; ii < m[i].n; ii++)
		{
			p[now] = m[i].d[ii];
			now++;
		}
	}
}

int getm(int x,int a,int b)
{
	int w = 2000000000;
	for(int i = a; i <= b; i++)
	{
		w = min(w,m[x].d[i]);
	}
	return w;
}

void bun()
{
	for(int i = 0; i < SIZE2; i++)
	{
		m[i].n = 0;
	}
	int now = 0;
	for(int i = 0; i < SIZE2; i++)
	{
		for(int ii = 0; ii < SIZE; ii++)
		{
			if(now >= N)
			{
				m[i].n = ii;
				goto aa;
			}
			m[i].d[ii] = p[now];
			now++;
			m[i].n++;
		}
	}
aa:
	for(int i = 0; i < SIZE2; i++)
	{
		m[i].minw = getm(i,0,m[i].n - 1);
	}
}

pair<int,int> findw(int a)
{
	int now = 0;
	for(int i = 0; i < SIZE2; i++)
	{
		if(now + m[i].n > a)
		{
			return make_pair(i,a - now);
		}
		now += m[i].n;
	}
}

void insert(int a,int x)
{
	pair<int,int> w = findw(a);
	for(int i = m[w.first].n; i > w.second; i--)
	{
		m[w.first].d[i] = m[w.first].d[i - 1];
	}
	m[w.first].d[w.second] = x;
	m[w.first].n++;
	if(m[w.first].n > SIZE * 2 + 1)
	{
		atu();
		bun();
	}
	else
	{
		m[w.first].minw = getm(w.first,0,m[w.first].n - 1);
	}
}

int erase(int a)
{
	pair<int,int> ww = findw(a);
	int w = m[ww.first].d[ww.second];
	for(int i = ww.second; i < m[ww.first].n - 1; i++)
	{
		m[ww.first].d[i] = m[ww.first].d[i + 1];
	}
	m[ww.first].n--;
	m[ww.first].minw = getm(ww.first,0,m[ww.first].n - 1);
	return w;
}

void shift(int a,int b)
{
	int w = erase(b);
	insert(a,w);
}

int minw(int a,int b)
{
	pair<int,int> aw = findw(a);
	pair<int,int> bw = findw(b);
	int w;
	if(aw.first == bw.first)
	{
		w = getm(aw.first,aw.second,bw.second);
	}
	else
	{
		w = min(getm(aw.first,aw.second,m[aw.first].n - 1),getm(bw.first,0,bw.second));
		for(int i = aw.first + 1; i < bw.first; i++)
		{
			w = min(w,m[i].minw);
		}
	}
	return w;
}

void oki(int a,int x)
{
	pair<int,int> w = findw(a);
	m[w.first].d[w.second] = x;
	m[w.first].minw = getm(w.first,0,m[w.first].n - 1);
}

int main()
{
	int q;
	scanf("%d%d",&N,&q);
	for(int i = 0; i < N; i++)
	{
		int w;
		scanf("%d",&w);
		p[i] = w;
	}
	bun();
	for(int i = 0; i < q; i++)
	{
		int a,b,c;
		scanf("%d%d%d",&a,&b,&c);
		if(a == 0)
		{
			shift(b,c);
		}
		else if(a == 1)
		{
			printf("%d\n",minw(b,c));
		}
		else
		{
			oki(b,c);
		}
	}
	return 0;
}

Measured memory_bytes: 3576
use std::io::*;
use std::str::*;

fn main() {
    let n: usize = read_one();
    let m: u32 = read_one();
    let q: u32 = read_one();

    let lr: Vec<(usize, usize)> = read2_lines(m);
    let pq: Vec<(usize, usize)> = read2_lines(q);

    let mut mat1: Vec<Vec<u32>> = vec![vec![0; n]; n];
    let mut mat2: Vec<Vec<u32>> = vec![vec![0; n]; n];

    for &(l, r) in lr.iter() {
        mat1[l - 1][r - 1] += 1;
    }

    for r in 0..n {
        for l in (0..n).rev() {
            let r_ofst = if r == 0 { 0 } else { mat2[l][r - 1] };
            mat2[l][r] += mat1[l][r] + r_ofst;
        }
    }

    for l in (0..n).rev() {
        for r in 0..n {
            let l_ofst = if l == n - 1 { 0 } else { mat2[l + 1][r] };
            mat2[l][r] += l_ofst;
        }
    }

    for &(p, q) in pq.iter() {
        println!("{}", mat2[p - 1][q - 1]);
    }
}

fn read_one<T: std::str::FromStr>() -> T {
    let s = stdin().bytes().map(|c| c.unwrap() as char)
                   .skip_while(|c| c.is_whitespace())
                   .take_while(|c| !c.is_whitespace())
                   .collect::<String>();
    s.trim().parse().ok().unwrap()
}

fn read2<T: FromStr, T2: FromStr>() -> (T, T2) {
    let mut s = String::new();
    stdin().read_line(&mut s).ok();
    let mut iter = s.trim().split_whitespace();
    (iter.next().unwrap().parse().ok().unwrap(), iter.next().unwrap().parse().ok().unwrap())
}

fn read2_lines<T: FromStr, T2: FromStr>(n: u32) -> Vec<(T, T2)> {
    (0..n).map(|_| read2()).collect()
}

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

using namespace std;

int ans[100005];
bool vis[100005];
vector <int> edge[100005];

int main() {
	int n, m;
	scanf("%d%d", &n, &m);
	
	for (int i = 0; i < m; i++) {
		int x, y;
		scanf("%d%d", &x, &y);
		edge[x].push_back(y);
		edge[y].push_back(x);
	}
	
	queue <int> que;
	que.push(1);
	vis[1] = 1;
	
	while (que.size()) {
		int now = que.front();
		que.pop();
		
		for (int i = 0; i < edge[now].size(); i++) {
			int to = edge[now][i];
			if (vis[to]) continue;
			ans[to] = now;
			que.push(to);
			vis[to] = 1;
		}
	}
	
	printf("Yes\n");
	for (int i = 2; i <= n; i++) printf("%d\n", ans[i]);
}


Measured memory_bytes: 10624
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define N 100005
#define MOD 1000000007
#define dd double
#define vi vector<int>
#define vll vector<ll>
#define forr(i, n) for(ll i=0;i<n;i++)
#define revf(i,n) for(ll i=n-1;i>=0;i-=2)
#define REP(i,a,b) for(ll i=a;i<b;i++)
#define rep1(i,b) for(ll i=1;i<=b;i++)
#define inp(a,n) for(ll i=0;i<n;i++)cin>>a[i]
#define outp(a,n) for(ll i=0;i<n;i++)cout<<a[i]<<" "
#define outp1(a,n) for(ll i=1;i<n;i++)cout<<a[i]<<" "
#define gcd(a,b) __gcd((a),(b))
#define lcm(a,b) (((a)*(b))/gcd((a),(b)))
#define pb push_back
#define mp make_pair
#define mem(x,n) memset(x,n,sizeof(x))
#define BINSC binary_search
#define BITOUT __builtin_popcount
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL);
#define test ll t; cin>>t; while(t--)
#define cn cout<<"\n";
int main()
{
     fast;
     ll n,x,t;
     cin>>n>>x>>t;
     ll q=n/x;
     if(n%x!=0)
     q++;
     cout<<t*q;
}

Measured memory_bytes: 3608
#include <cstring>
#include <cstdio>
#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
#include <unordered_map>
#include <cmath>
#include <queue>
#include <set>
#include <stack>

using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define repr(i, n) for(ll i = n - 1; i >= 0; i--)
#define repone(i, n) for(ll i = 1; i <= (ll)(n); i++)
#define each(i, mp) for(auto i:mp)
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
const ll mod = 1000000007;
const ll inf = ll(1e9);
const ll half_inf = ll(1e5);
const ll ll_inf = ll(1e9) * ll(1e9);


int main() {
    int a, b, c;
    cin >> a >> b >> c;
    if (c >= a && c <= b) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
main(){
  int64_t k,x,ans=1;
  std::cin>>k;
  x = 7%k;
  for(int i=0;i<1e7;++i){
    if(x==0)break;
    x = (x*10+7)%k;
    ans++;
  }
  std::cout<<(x==0?ans:-1)<<std::endl;
}

Measured memory_bytes: 3636
#include <algorithm>
#include <bitset>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <cctype>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <limits>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#define ArraySizeOf(array)     (sizeof(array) / sizeof(array[0]))
#define res(i,n) for(int i=n;;i++)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i,n) for(int i=1;i<n;i++)
#define rev(i,n) for(int i=n-1;i>=0;i--)
#define REV(i,n) for(int i=n-1;i>0;i--)
#define req(i,n,m) for(int i=n;i<m;i++)
#define REQ(i,n,m,l) for(int i=n;i<m;i+=l) 
#define _GLIBCXX_DEBUG
int INF = 1e9 + 7;
unsigned NthDayOfWeekToDay(unsigned n, unsigned dow, unsigned dow1)
{
    unsigned day;
    if (dow < dow1) dow += 7;
    day = dow - dow1;
    day += 7 * n - 6;
    return day;
}
signed gcd(long long x, long long y) {
    if (y == 0)return x;
    return gcd(y, x % y);
}
signed lcm(long long x, long long y) {
    return x / gcd(x, y) * y;
}
unsigned DayToWeekNumber(unsigned day)
{
    return (day - 1) / 7 + 1;
}
unsigned AnotherDayOfWeek(unsigned day, unsigned day0, unsigned dow0)
{
    return (dow0 + 35 + day - day0) % 7;
}
using namespace std;
signed main() {
    int N; cin >> N;
    vector<int>A(N * 3);
    long long ans = 0;
    rep(i, N * 3)cin >> A[i];
    sort(A.begin(), A.end());
    reverse(A.begin(), A.end());
    rep(i, N)ans += A[i * 2 + 1];
    cout << ans << endl;
}

Measured memory_bytes: 4584
#include<bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
const int MAXN=30;
const int INF=1e9;
int n;
bool dp[1<<24];
double x[25],y[25],r[25];
int c[25];
double ans=INF;
template<typename A,size_t N,typename T>
void Fill(A (&array)[N],const T &val)
{
  std::fill( (T*)array,(T*)(array+N),val );
}

bool distjudge(double x,double y,double r)
{
  if(sqrt(x*x+y*y)>=r) return true;
  else return false;
}

int bitcount(int x,int n)
{
  int ret=0;
  for(int i=0;i<n;i++)
  {
    if(x&(1<<i)) ret++;
  }
  return ret;
}

int main(void)
{
  while(cin >> n)
  {
    memset(dp,false,sizeof(dp));
    dp[(1<<n)-1]=true;
    for (int i = 0; i < n; i++)
    {
      cin >> x[i] >> y[i] >> r[i] >> c[i];
    }
    int ans=0;
    for(int i=(1<<n)-1;i>=0;i--)
    {
      if(dp[i])
      {
        for(int j=0;j<n;j++)
        {
          bool canj=true;
          for(int l=0;l<j;l++) if((i&(1<<l)) && !distjudge(abs(x[j]-x[l]),abs(y[j]-y[l]),r[j]+r[l])) canj=false;
          if(canj && i&(1<<j))
          {
            for(int k=j;k<n;k++)
            {
              bool cank=true;
              for(int l=0;l<k;l++) if((i&(1<<l)) && !distjudge(abs(x[k]-x[l]),abs(y[k]-y[l]),r[k]+r[l])) cank=false;
              if(cank && j!=k && i&(1<<k) && distjudge(abs(x[j]-x[k]),abs(y[j]-y[k]),r[j]+r[k]))
              {
                if(c[j]==c[k])
                {
                  int mask=i;
                  mask&=~(1<<j);
                  mask&=~(1<<k);
                  dp[mask]=true;
                }
              }
            }
          }
        }
      }
      if(dp[i]==true) ans=max(ans,n-bitcount(i,n));
    }
    if(n!=0) cout << ans << endl;
  }
  return 0;
 
}



Measured memory_bytes: 19592
s=input()
acgt=["A","C","G","T"]
s=[s[i] in acgt for i in range(len(s))]
max_len=0
flag=False
for n in range(len(s),0,-1):
  for i in range(len(s)-n+1):
    if all(s[i:i+n]):
      max_len=n
      flag=True
      break
  if flag:
    break
print(max_len)

Measured memory_bytes: 3188
N = int(input())
X = list(map(int, (input().split())))

distance = lambda Xi, P: (Xi - P) ** 2

X_max = max(X)

answer = None
for P in range(1, X_max + 1):
    total = 0
    for Xi in X:
        total += distance(Xi, P)
    answer = min(total, answer) if answer is not None else total

print(answer)


Measured memory_bytes: 3060
from itertools import accumulate
from operator import add
N,K=map(int,input().split())
L=2*K
Map=[[0]*L for i in range(L)]

for i in range(N):
  x,y,c=input().split()
  x,y=int(x),int(y)
  if c=="W":
    x-=K
  x,y=x%L,y%L
  if y>=K:
    x,y=(x-K)%L,y-K
    
  Map[x][y]+=1
  Map[x][y-K]+=-1
  if x!=K:
    Map[x-K][y-K]+=1
    Map[x-K][y]+=-1
  if x>K:
    Map[0][y]+=1
    Map[0][y-K]+=-1

Map=[accumulate(i) for i in Map]
Map=[accumulate(i) for i in zip(*Map)]
Map=list(map(list,zip(*Map)))
Map=[map(add, Map[i][:K], Map[i-K][K:]) for i in range(L)]

print(max(map(max,Map)))

    
  
  


Measured memory_bytes: 220532
#include <iostream>

using namespace std;

static bool np[1000000];

int main()
{
	np[0] = np[1] = true;
	for (int i = 2; i * i < 1000000; i++)
	{
		if (np[i]) continue;
		for (int j = 2 * i; j < 1000000; j += i) np[j] = true;
	}

	int A,D,N;
	while(cin>>A>>D>>N, A && D && N)
	{
		int c = 0;
		for(;;)
		{
			if (!np[A]) if (++c == N) break;
			A += D;
		}
		cout << A << endl;
	}
	return 0;
}

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

int main(){
int i, j, k, N, X, Y; cin >> N >> X >> Y; int s=N, A[N]={};
for(i=1; i<=N-1; i++){ for(j=i+1; j<=N; j++){
if(i<=X&&Y<=j){ s=(X-i)+1+(j-Y); A[s]++; }
else if(i<=X&&j<Y){ s=min(j-i, (X-i)+1+(Y-j)); A[s]++; }
else if(X<i&&Y<=j){ s=min(j-i, (i-X)+1+(j-Y)); A[s]++; }
else if(X<i&&j<Y){ s=min(j-i, (i-X)+1+(Y-j)); A[s]++; }
}  }
for(k=1; k<=N-1; k++){ cout << A[k] << "\n"; }
}

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

int main() {
  int a, b, c, d;
  
  cin >> a >> b >> c >> d;
  if((a+b) > (c+d)) cout << "Left" << endl;
  else if((a+b) < (c+d)) cout << "Right" << endl;
  else cout << "Balanced" << endl;
}

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

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

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

typedef long long ll;

int n, c[4];
double f[301][301][301];
double dfs(int x, int y, int z) {
	if (!x && !y && !z) return 0;
	double &r = f[x][y][z];
	if (r) return r;
	if(x) r += dfs(x - 1, y, z) * x;
	if(y) r += dfs(x + 1, y - 1, z) * y;
	if(z) r += dfs(x, y + 1, z - 1) * z;
	r += n;
	return r /= (x + y + z);
}
int main() {
	n = rd;
	REP(i, 1, n) ++c[(int)rd];
	printf("%.15f", dfs(c[1], c[2], c[3]));
	return 0;
}



Measured memory_bytes: 213248
using System;

namespace A
{
	class Program
	{
		static void Main(string[] args)
		{
			string[] tmp = Console.ReadLine().Split(' ');
			int a = int.Parse(tmp[0]);
			int b = int.Parse(tmp[1]);
			int c = int.Parse(tmp[2]);

			Console.WriteLine(c + " " + a + " " + b);
		}
	}
}


Measured memory_bytes: 11092
N, M = map(int, input().split())
D = [[] for _ in range(N)]
for i in range(M):
    P, Y = map(int, input().split())
    D[P - 1].append((Y, i))
ans = [None] * M
for i, d in enumerate(D):
    d.sort()
    for k, (Y, j) in enumerate(d):
        ans[j] = "%06d%06d" % (i + 1, k + 1)
print(*ans, sep='\n')


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


int main() {

	string s;
	cin >> s;

    int64_t sum=0;
    for(int i=0;i<s.size();i++){
        char wk = s.at(i);
        sum+=int(wk-'0');
    }
    
    if(stol(s)%sum==0)
        cout<<"Yes"<<endl;
    else
        cout<<"No"<<endl;

	return 0;
}

Measured memory_bytes: 3620