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

public class Main {
	private static void solve(){
	//Implement solution here.
		int a = ni();
		int b = ni();
		System.out.println(b % a ==0 ? a + b: b - a);
	}

    //Switch input source (stdin/file)
	private static Scanner scanner = new Scanner(System.in);
	public static void main(String[] args){
        String debugDataPath = System.getenv("DD_PATH");        
        if(debugDataPath != null){
            try{
                scanner = new Scanner(new BufferedReader(new InputStreamReader(new FileInputStream(new File(debugDataPath)))));
            }catch(Exception e){
                throw new RuntimeException(e);
            }
        }
        solve();
	}

    //Input read utility
	private static StringTokenizer tokenizer = null;
	public static String next() {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(scanner.nextLine());
			} catch (Exception e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	}
    //Get next single int
	private static int ni() {
		return Integer.parseInt(next());
	}
    //Get next single long
	private static long nl() {
		return Long.parseLong(next());
	}
    //Get next single double
	private static double nd() {
		return Double.parseDouble(next());
	}
    //Get next int array from one line
	private static int[] na(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = ni();
		return a;
	}
	//Get next char array from one line
	private static char[] ns() {
		return next().toCharArray();
	}
    //Get next long array from one line
	private static long[] nal(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = nl();
		return a;
	}
}

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


def is_ok(l):
    cnt = 0
    for L in a:
        cnt += L // l - 1
        if L % l != 0:
            cnt += 1
    return cnt <= k


def meguru_bisect(ng, ok):
    while abs(ok - ng) > 1:
        mid = (ok + ng) // 2
        if is_ok(mid):
            ok = mid
        else:
            ng = mid
    return ok


print(meguru_bisect(0, max(a)))

Measured memory_bytes: 30972
# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math
import sys

mod = 10**9+7
sys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000



#素因数分解
from collections import Counter



N = int(input())
table = []

def factorint(N):
    # table = []
    while(N > 1):
        for i in range(2,N+1):
            if N%i == 0:
                while N%i == 0:
                    N = N//i
                    table.append(i)
                break
    return table

for i in range(1,N+1):
    factorint(i)
table_ = Counter(table)

ans = 1
for key in table_.keys():
    ans = ans * (table_[key]+1) % mod

print(ans)


Measured memory_bytes: 5460
def yumiri(L, n):
  for i in range(len(L)):
    if L[i] > n:
      return i - 1

def naobou(d, q):
  newans = ans

  rd = t[d - 1] - 1
  rq = yumiri(ZL[rd], d)
  newans += SUMD[ZL[rd][rq] - ZL[rd][rq - 1] - 1] * c[rd]
  newans += SUMD[ZL[rd][rq + 1] - ZL[rd][rq] - 1] * c[rd]
  newans -= SUMD[ZL[rd][rq + 1] - ZL[rd][rq - 1] - 1] * c[rd] 
  del ZL[rd][rq]

  nd = q - 1
  nq = yumiri(ZL[nd], d)
  newans += SUMD[ZL[nd][nq + 1] - ZL[nd][nq] - 1] * c[nd]
  newans -= SUMD[d - ZL[nd][nq] - 1] * c[nd]
  newans -= SUMD[ZL[nd][nq + 1] - d - 1] * c[nd]
  ZL[nd].insert(nq + 1, d)

  newans -= s[d - 1][rd]
  newans += s[d - 1][nd]

  if newans < ans:
    ZL[rd].insert(rq, d)
    del ZL[nd][nq + 1]
    return ans
  else:
    t[d - 1] = q
    return newans 

def rieshon():
  ans = 0
  for i in range(D):
    ans += s[i][t[i] - 1]
    for j in range(26):
      if t[i] - 1 == j:
        L[j] = 0
        ZL[j].append(i + 1)
      else:
        L[j] += 1
        ans -= L[j] * c[j]
  for i in range(26):
    ZL[i].append(D + 1)
  return ans

import time
import random
startTime = time.time()

D = int(input())
c = list(map(int, input().split()))
s = [list(map(int, input().split())) for _ in range(D)]

L = [0] * 26
ZL = [[0] for _ in range(26)]
SUMD = [0] * (D + 1)
for i in range(1, D + 1):
  SUMD[i] = SUMD[i - 1] + i

RD = [0] * 26
t = [0] * D
for i in range(D):
  RD[0] += 1
  ma = s[i][0] + RD[0] * c[0]
  man = 0
  for j in range(1, 26):
    RD[j] += 1
    k = s[i][j] + RD[j] * c[j]
    if k > ma:
      ma = k
      man = j
  t[i] = man + 1
  RD[man] = 0

ans = rieshon()
while time.time() - startTime < 1.7:
  d = random.randrange(D) + 1
  q = random.randrange(26) + 1
  if t[d - 1] == q: continue
  ans = naobou(d, q)

for i in range(D):
  print(t[i])


Measured memory_bytes: 83804
#!/usr/bin/env python

from collections import deque
import itertools as it
import sys
import math

sys.setrecursionlimit(10000000)

for line in sys.stdin:
    V, d = map(int, line.split())
    N = [False for i in range(2000)]
    p = pp = 1
    for i in range(V):
        num = (p + pp) % 1001
        N[num] = True
        p = pp
        pp = num
    ans = 0
    p = -10000
    for i in range(2000):
        if N[i]:
            if i - p >= d:
                ans += 1
            p = i
    print ans


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

int main() {
  int N;
  cin >> N;
  vector<long> L(87);
  L.at(0) = 2;
  L.at(1) = 1;
  for (int i = 2; i < 87; i++) {
    L.at(i) = L.at(i-1) + L.at(i-2);
  }
  cout << L.at(N) << endl;
}

Measured memory_bytes: 256
import java.util.*;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.awt.Point;


public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        int[] nums = new int[n];
        String[] s = br.readLine().split(" ");
        
        for (int i = 0; i < n; i++) {
            nums[i] = Integer.parseInt(s[i]);
        }
        
        int count = 0;
        for (int i = 1; i < n-1; i++) {
            if (nums[i-1] < nums[i] && nums[i] < nums[i+1]) count++;
            else if (nums[i-1] > nums[i] && nums[i] > nums[i+1]) count++;
        }
        
        System.out.println(count);
    }
}





Measured memory_bytes: 21204
#![allow(unused_mut)]
#![allow(non_snake_case)]

//　高速 EOF要
//macro_rules! input {(source = $s:expr, $($r:tt)*) => {let mut iter = $s.split_whitespace();input_inner!{iter, $($r)*}};($($r:tt)*) => {let mut s = {use std::io::Read;let mut s = String::new();std::io::stdin().read_to_string(&mut s).unwrap();s};let mut iter = s.split_whitespace();input_inner!{iter, $($r)*}};}
//macro_rules! input_inner {($iter:expr) => {};($iter:expr, ) => {};($iter:expr, $var:ident : $t:tt $($r:tt)*) => {let $var = read_value!($iter, $t);input_inner!{$iter $($r)*}};}
//macro_rules! read_value {($iter:expr, ( $($t:tt),* )) => {( $(read_value!($iter, $t)),* )};($iter:expr, [ $t:tt ; $len:expr ]) => {(0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()};($iter:expr, chars) => {read_value!($iter, String).chars().collect::<Vec<char>>()};($iter:expr, usize1) => {read_value!($iter, usize) - 1};($iter:expr, $t:ty) => {$iter.next().unwrap().parse::<$t>().expect("Parse error")};}
// 低速 EOF不要
macro_rules! input {(source = $s:expr, $($r:tt)*) => {let mut iter = $s.split_whitespace();let mut next = || { iter.next().unwrap() };input_inner!{next, $($r)*}};($($r:tt)*) => {let stdin = std::io::stdin();let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));let mut next = move || -> String{bytes.by_ref().map(|r|r.unwrap() as char).skip_while(|c|c.is_whitespace()).take_while(|c|!c.is_whitespace()).collect()};input_inner!{next, $($r)*}};}
macro_rules! input_inner {($next:expr) => {};($next:expr, ) => {};($next:expr, $var:ident : $t:tt $($r:tt)*) => {let $var = read_value!($next, $t);input_inner!{$next $($r)*}};}
macro_rules! read_value {($next:expr, ( $($t:tt),* )) => {( $(read_value!($next, $t)),* )};($next:expr, [ $t:tt ; $len:expr ]) => {(0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()};($next:expr, chars) => {read_value!($next, String).chars().collect::<Vec<char>>()};($next:expr, usize1) => {read_value!($next, usize) - 1};($next:expr, $t:ty) => {$next().parse::<$t>().expect("Parse error")};}

// https://beta.atcoder.jp/contests/abc108/tasks/abc108_a
fn main(){
    input!(x1:i32,y1:i32,x2:i32,y2:i32);
    let (bx,by):(i32,i32) = (x1,y1);
    let p1:(i32,i32) = (x1 - bx,y1 - by);
    let p2:(i32,i32) = (x2 - bx,y2 - by);

    let p3:(i32,i32) = (p2.0-p2.1,p2.0+p2.1);
    let p4:(i32,i32) = (-p2.1,p2.0);

    println!("{} {} {} {}",p3.0+bx,p3.1+by,p4.0+bx,p4.1+by);
}

Measured memory_bytes: 4352
#include <iostream>
#include <string>
#include <vector>
#include <climits>
#include <set>
#include <algorithm>
#include <unordered_map>
#include <queue>
#include <iomanip>
#include <map>
#include <utility>
#include <numeric>
#include <chrono>
#include <ctime>

#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define P pair<int, int>
#define debug(x) cerr << #x << ": " << x << ", "
#define debugln(x) cerr << #x << ": " << x << '\n'

using namespace std;
using ll = long long;
const int mod = 1e9+7;

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

  int N; cin >> N;

  vector<int> cnt(100);

  for(int i=2; i<=N; i++) {
    int tmp = i;
    for(int j=2; j*j<=i; j++) {
      while (tmp%j == 0) {
        tmp /= j;
        cnt.at(j)++;
      }
    }
    if (tmp > 1) {
      cnt.at(tmp)++;
    }
  }

  int cnt74 = 0;
  int cnt24 = 0;
  int cnt14 = 0;
  int cnt4 = 0;
  int cnt2 = 0;
  rep(i, 100) {
    if (cnt.at(i) >= 74) {
      cnt74++;
    }
    if (cnt.at(i) >= 24) {
      cnt24++;
    }
    if (cnt.at(i) >= 14) {
      cnt14++;
    }
    if (cnt.at(i) >= 4) {
      cnt4++;
    }
    if (cnt.at(i) >= 2) {
      cnt2++;
    }
  }

  int ans = cnt74; // 1
  ans += cnt24*(cnt2-1); // 3*14 = 42
  ans += cnt14*(cnt4-1); // 4*8 = 32

  ans += (cnt4*(cnt4-1)/2)*(cnt2-2);

  cout << ans << endl;
}

Measured memory_bytes: 256
def main(N,A):
    B=[0]
    count = 0
    for i in range(N):
        T = A[i] + B[i]





            #print('count:',count)
#


    # B = [A[i] +B[i] for i in range(N)]
    #
    # count = [ count + 1 for m in range(len(B)) if B[i] - B[i-m] == 0]

        # for m in range(len(B)):
        #     if T - B[m] == 0:
        #         # print(i, m)
        #         # print(B[i],B[i-m])
        #         # print(T)
        #         # print("kore",B[i],B[i-m])
        #         count += 1
        B.append(T)


    B = sorted(B)
    # print(B)
    c = 0
    for i in range(len(B)):
        if i==0:
            continue
        if B[i] == B[i-1]:
            c+=1
            count +=c
            # print(c)
            # 
            # print(count)
        else:
            c = 0

    #
    # c = collections.Counter(B)
    # for i in range(len(c)):
    #     k, v = c.popitem()
    #     for z in range(v):
    #         count += z


    #print(count)
    #print(B)
    return print(count)

if __name__ == "__main__":
    N=int(input())
    A=list(map(int,input().split()))

    main(N,A)

Measured memory_bytes: 31576
#include<iostream>
#include<cstdio>
#include<cstring>

namespace test
{
	typedef long long ll;
	const int N=10005,M=N*6,MOD=998244353;
	inline void inc(int a,int &b){b=(a+b)%MOD;}

	ll inv(int x){return x==1?1:(-(MOD/x)*inv(MOD%x)%MOD);}
	ll qpow(ll a,ll b){ll c=1;for(;b;b>>=1,a=a*a%MOD)if(b&1)c=c*a%MOD;return c;}

	int dec[M];
	void getdec(int n){for(int i=1;i<n;i++)dec[i]=(dec[i>>1]>>1)+(i&1?n>>1:0);}
	void ntt(int *y,int n,int rag)
	{
		for(int i=0;i<n;i++)if(i<dec[i])std::swap(y[i],y[dec[i]]);

		int *y0,*y1,ny0,ny1;

		for(int len=2;len<=n;len<<=1)
		{
			int delta=qpow(3,(MOD-1)/len),h=len>>1,x;

			if(rag<0)delta=(inv(delta)+MOD)%MOD;

			for(int p=0;p<n;p+=len)
			{
				y0=y+p,y1=y0+h,x=1;
				for(int i=0;i<h;i++,x=(ll)x*delta%MOD)
				{
					ny0=(y0[i]+(ll)x*y1[i])%MOD;
					ny1=(y0[i]-(ll)x*y1[i])%MOD;
					y0[i]=ny0;
					y1[i]=ny1;
				}
			}
		}
	}

	int fact[N],ifact[N];

	void initialize()
	{
		fact[0]=1;
		for(int i=1;i<N;i++)fact[i]=(ll)fact[i-1]*i%MOD;
		ifact[N-1]=(inv(fact[N-1])+MOD)%MOD;
		for(int i=N-1;i;i--)ifact[i-1]=(ll)ifact[i]*i%MOD;
	}

	int g[M],f[M];

	void mul(int *u,int *v,int len)
	{
		static int A[M],B[M],C[M];

		int n=len*2;
		memcpy(A,u,len*4),memcpy(B,v,len*4);
		for(int i=len;i<n;i++)A[i]=B[i]=0;
		
		ntt(A,n,1),ntt(B,n,1);
		for(int i=0;i<n;i++)C[i]=(ll)A[i]*B[i]%MOD;
		ntt(C,n,-1);

		int dn=(inv(n)+MOD)%MOD;

		for(int i=0;i<len;i++)
			u[i]=(ll)C[i]*dn%MOD;
	}

	void calc(int k,int n)
	{
		getdec(n*2);

		f[0]=1;
		for(;k;k>>=1,mul(g,g,n))
			if(k&1)mul(f,g,n);
	}

	char s[N],t[N];
	int n,m,x,y;

	void solve()
	{
		initialize();

		scanf("%s",s+1);
		scanf("%s",t+1);

		n=strlen(s+1),x=y=0;

		for(int i=1;i<=n;i++)
			if(s[i]=='1' && t[i]=='1')y++;
			else if(s[i]=='1')x++;


		for(int i=0;i<=y;i++)g[i]=ifact[i+1];

		for(m=1;m<=y;m<<=1);

		calc(x,m);

		int ans=0;
		for(int i=0;i<=y;i++)
			inc(f[i],ans);

		ans=((ll)ans*fact[x]%MOD*fact[y]%MOD*fact[x+y]%MOD+MOD)%MOD;

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

int main()
{
	test::solve();
	return 0;
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<n; i++)
#define rep1(i, n) for(int i=1; i<=n; i++)
#define repr(i, n) for(int i=n-1; i>=0; i--)
#define repr1(i, n) for(int i=n; i>=1; i--)
#define all(v) v.begin(),v.end()
using ll = long long;
using pii = pair<int, int>;
using pil = pair<int, ll>;
using pli = pair<ll, int>;
using pll = pair<ll, ll>;
const int INF = 1e9;
const ll LLINF = 1e18;
const ll MOD = 1e9+7;
const double EPS = 1e-10;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int n, x, a[110];

int main() {
    cin >> n >> x;
    rep(i, n) cin >> a[i];
    sort(a, a+n);

    int ans = 0;
    rep(i, n) {
        if (i < n - 1) {
            if (x >= a[i]) {
                ans++;
                 x -= a[i];
            } else {
                break;
            }
        } else {
            if (x == a[i]) ans++;
        }
    }
    cout << ans << endl;
}


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

using namespace std;

int main() {
  int counter = 0;
  string input;
  int answer = 0;

  cin >> input;

  for (int i = 0; i < input.size(); i++) {
    if (input[i] == 'A' || input[i] == 'C' || input[i] == 'G' ||
        input[i] == 'T') {
      counter++;
      answer = max(answer, counter);
    } else {
      counter = 0;
    }
  }
  cout << answer;
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define USE_LLONG_AS_INT
#ifdef USE_LLONG_AS_INT
#define int long long
#define inf (1ll<<60)
#else
#define inf (1<<30)
#endif
#define rep(i,n) for(int i=0;i<(n);i++)
#define Rep(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,a,b) for(int i=(a);i<=(b);i++)
#define rev(i,n) for(int i=(n)-1;i>=0;i--)
#define vi vector<int>
#define vvi vector<vi>
#define vs vector<string>
#define pb push_back
#define eb emplace_back
#define pi pair<int,int>
#define vp vector<pair<int,int>>
#define mp make_pair
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define MEMSET(a) memset(a,0,sizeof(a))
#define Yes(f) cout<<(f?"Yes":"No")<<endl
#define yes(f) cout<<(f?"yes":"no")<<endl
#define YES(f) cout<<(f?"YES":"NO")<<endl
#define SORT(v) sort(all(v))
#define RSORT(v) sort(all(v), greater<int>())

using namespace std;

const int mod=1e9+7;
// const int mod=998244353;
const string sp=" ";

void run();

void init() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout<<fixed<<setprecision(12);
}

signed main(){
    init();
    run();
    return 0;
}

void run(){
    int a;
    cin>>a;
    cout<<a+a*a+a*a*a<<endl;
}

Measured memory_bytes: 3640
import java.util.Scanner;
class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		int b = scan.nextInt();
		System.out.println(euclid(Math.max(a, b), Math.min(a, b)));
	}
	public static int euclid(int a, int b){
		int c;
		while((c = a % b) != 0){
			a = b;
			b = c;
		}
		return b;
	}
}

Measured memory_bytes: 17212
#include<bits/stdc++.h>
#define INF 9223372036854775807LL
#define SYOU(x) setprecision(x+1)
#define abs(x,y) (max(x,y)-min(x,y))
#define lol long long
#define mp make_pair
#define fi first
#define se second
using namespace std;
signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,k;
    cin >>n>>k;
    int ans=0;
    while(n){
      ans++;
      n/=k;
    }
    cout <<ans<<'\n';
    return (0);
}


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

int main(){
    using namespace std;
    unsigned long H, W;
    cin >> H >> W;
    vector<vector<unsigned long>> maps(H + 2, vector<unsigned long>(W + 2)), dist(H + 2, vector<unsigned long>(W + 2, numeric_limits<unsigned long>::max() / 5));
    for(unsigned long i{1}; i <= H; ++i){
        string s;
        cin >> s;
        transform(s.begin(), s.end(), maps[i].begin() + 1, [](auto c){return c == '.';});
    }
    const auto& dist_calc = [&maps, &dist](unsigned long start_i, unsigned long start_j){
        queue<pair<pair<unsigned long, unsigned long>, unsigned long>> q;
        q.emplace(pair<unsigned long, unsigned long>{start_i, start_j}, 0);
        dist[start_i][start_j] = 0;
        while(!q.empty()) {
            auto t = q.front();
            unsigned long i{t.first.first}, j{t.first.second}, d{t.second};
            q.pop();
            for(const auto& dir : vector<pair<unsigned long, unsigned long>>{{1, 0}, {0, 1}, {~0UL, 0}, {0, ~0UL}})if(maps[i + dir.first][j + dir.second] && dist[i + dir.first][j + dir.second] > 1000000)q.emplace(pair<unsigned long, unsigned long>{i + dir.first, j + dir.second}, dist[i + dir.first][j + dir.second] = d + 1);
        }
    };
    const auto& max_calc = [&H, &W, &maps, &dist, &dist_calc](unsigned long start_i, unsigned long start_j) -> unsigned long {
        for(auto& i : dist)fill(i.begin(), i.end(), numeric_limits<unsigned long>::max() / 5);
        dist_calc(start_i, start_j);
        unsigned long max_dist{0};
        for(unsigned long i{0}; i < H + 2; ++i)for(unsigned long j{0}; j < W + 2; ++j)if(maps[i][j])max_dist = max(max_dist, dist[i][j]);
        return max_dist;
    };
    unsigned long max_dist{0};
    for(unsigned long i{0}; i < H + 2; ++i)for(unsigned long j{0}; j < W + 2; ++j)if(maps[i][j])max_dist = max(max_dist, max_calc(i, j));
    cout << max_dist << endl;
    return 0;
}

Measured memory_bytes: 256
// fn get_primes(mut n: usize) -> Vec<usize> {
//     let mut ps = vec![];
//     let mut d = 2;
//     while d * d <= n {
//         if n % d == 0 {
//             ps.push(d);
//             while n % d == 0 {
//                 n /= d;
//             }
//         }
//         d += 1;
//     }
//     if n != 1 {
//         ps.push(n);
//     }
//     ps
// }

fn solve() {
    let k: usize = read();
    if k % 2 == 0 {
        println!("{}", "-1");
    } else {
        // let prms = get_primes(k);
        let mut res = 1;
        let mut tmp = 7 % k;
        let mut s = HashSet::new();
        let mut no = false;
        while tmp != 0 {
            if s.contains(&tmp) {
                no = true;
                break;
            }
            s.insert(tmp);
            tmp *= 10;
            tmp += 7;
            tmp %= k;
            res += 1;
        }
        if no {
            println!("{}", -1);
        } else {
            println!("{}", res);
        }
    }
    // let mut tmp = 7;
    // for i in 0..20 {
    //     tmp *= 10;
    //     tmp += 7;
    //     println!("{:?}", (tmp, get_primes(tmp)));
    // }
    // println!("{:?}", get_primes(k));
}

fn main() {
    let stack_size = 104_857_600;
    let thd = std::thread::Builder::new().stack_size(stack_size);
    thd.spawn(|| solve()).unwrap().join().unwrap();
}

// =========
#[allow(unused_imports)]
use std::cmp::{max, min, Reverse};
#[allow(unused_imports)]
use std::collections::{BinaryHeap, HashMap, HashSet};
#[allow(unused_imports)]
use std::process::exit;

#[allow(dead_code)]
const MOD: usize = 1000000007;

fn read<T: std::str::FromStr>() -> T {
    use std::io::Read;
    let stdin = std::io::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")
}

// =========


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

int main(void){
  int ans;
  string s,t;
  
  cin >> s >> t;
  ans = 0;
  for (int i=0; i<s.size(); i++){
    if (s[i]!=t[i]) ans++;
  }
  cout << ans << endl;
  
  return 0;
}

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

using namespace std;

int main(void)
{
    int M, D;
    int count = 0;

    cin >> M;
    cin >> D;

    for (int i = 1; i <= M; i++)
    {
        for (int j = 1; j <= D; j++)
        {
            int d1 = j % 10;
            int d10 = j / 10;

            if (d1 < 2 || d10 < 2)
            {
                continue;
            }

            if (i == d1 * d10)
            {
                count++;
            }
        }
    }

    cout << count << endl;

    return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Security.Cryptography.X509Certificates;

namespace hello_world
{ class Program
	{
		static void Main(string[] args)
		{
			bool a = false;
			int n = int.Parse(Console.ReadLine());
			if ((n % 10) == 7)
				a = true;
			else if (((n % 100) / 10) == 7)
				a = true;
			else if (((n / 10) / 10) == 7)
				a = true;
			if (a == true)
				Console.WriteLine("Yes");
			else
				Console.WriteLine("No");
			
		}
	}

}




	



Measured memory_bytes: 27480
#include <bits/stdc++.h>
 
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,n) for(int i=1;i<=(n);i++)
#define lol long long
#define mp make_pair
#define fi first
#define se second
#define pu push_back
#define SYOU(x) setprecision(x+1)
#define abs(x,y) (max(x,y)-min(x,y))
#define SUM(n) ((n)+1)*(n)/2
const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fLL;
const int MOD = (1e9)+7;
#define all(v) v.begin(),v.end()
using namespace std;
using pii = pair<int,int>;
typedef vector<int> vit;

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

  int n, m, a, b;
  cin >> n >> m;
  vector<pii> pi;
  rep(i, n){
    cin >> a >> b;
    pi.emplace_back(a, b);
  }
  sort(all(pi));

  int p = 0;
  lol ans = 0;
  priority_queue<int> que;
  reps(i, m){
    while(pi[p].fi == i && p < n){
      que.push(pi[p].se);
      p ++;
    }
    if(!que.empty()){
      ans += que.top();
      que.pop();
    }
  }
  cout << ans << '\n';
  return 0;
}


Measured memory_bytes: 1908
#include <stdio.h>
 
int main(void){
int height, width;
int i, r;
 
while (1) {
scanf("%d %d", &height, &width);
 
if (height == 0 && width == 0) break;
 
for(i = 0; i < height; i++){
for(r = 0; r < width; r++) {
if ((i + r) % 2 == 0) printf("#");
else printf(".");
}
printf("\n");
}
 
printf("\n");
}
 
return 0;
}


Measured memory_bytes: 2108
#include <stdio.h>

#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))

int main(void) {
	int n, m;
	scanf("%d%d", &n, &m);

	int l = 1, r = n;
	while (m--) {
		int a, b;
		scanf("%d%d", &a, &b);
		l = MAX(a, l);
		r = MIN(b, r);
	}

	if (l > r) puts("0");
	else printf("%d\n", r-l+1);
}


Measured memory_bytes: 128
#include "bits/stdc++.h"
#define Rep(i,n) for(int i=0;i<(int)(n);i++)
#define For(i,n1,n2) for(int i=(int)(n1);i<(int)(n2);i++)
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define RREP(i,n) for(ll i=((ll)(n)-1);i>=0;i--)
#define FOR(i,n1,n2) for(ll i=(ll)(n1);i<(ll)(n2);i++)
#define RFOR(i,n1,n2) for(ll i=((ll)(n1)-1);i>=(ll)(n2);i--)
#define all(a)  (a).begin(),(a).end()
#define IOS std::cin.tie(0),std::ios::sync_with_stdio(false)

namespace idaten {

	using namespace std;
	using ll = int_fast64_t;
	using ull = uint_fast64_t;
	using P = std::pair<int64_t, int64_t>;
	template<typename T1, typename T2> inline bool chmin(T1& a, T2 b) { if (a > b) { a = b; return 1; }return 0; }
	template<typename T1, typename T2> inline bool chmax(T1& a, T2 b) { if (a < b) { a = b; return 1; }return 0; }
	template<class Type>struct is_vector : std::false_type {};
	template<class ValueType, class Alloc>struct is_vector<std::vector<ValueType, Alloc>> : std::true_type {};
	template <typename T> inline std::ostream& operator << (std::ostream& out, const std::vector<T>& v) {
		if (v.empty())return out;
		constexpr bool is_vector_v = is_vector<T>::value;
		if (is_vector_v)for (auto itr = v.begin(); itr != v.end();)out << (*itr), out << ((++itr != v.end()) ? "\n" : "");
		else for (auto itr = v.begin(); itr != v.end();)out << (*itr), out << ((++itr != v.end()) ? " " : "");
		return out;
	}
	inline void put() {}
	template<class T> inline void put(const T& first) { std::cout << first << "\n"; }
	template<class T, class... N> inline void put(const T& first, const N& ... rest) { std::cout << first << " "; put(rest...); }
	inline void putn() {}
	template<class T, class... N> inline void putn(const T& first, const N& ... rest) { std::cout << first << "\n"; putn(rest...); }

	void solve() {
		IOS;
		vector<int> pre;
		int m = 1e6;
		for (int i = 1;; i++) {
			int t = i * (i + 1) * (i + 2) / 6;
			if (t <= m) {
				pre.push_back(t);
			} else {
				break;
			}
		}
		vector<int> dp(m + 1, INT_MAX), dp2(m + 1, INT_MAX);
		dp[0] = 0;
		dp2[0] = 0;
		REP(i, m) {
			REP(j, pre.size()) {
				if (i + pre[j] <= m) {
					chmin(dp[i + pre[j]], dp[i] + 1);
					if (pre[j] % 2 == 1) {
						chmin(dp2[i + pre[j]], dp2[i] + 1);
					}
				} else {
					break;
				}
			}
		}
		int n;
		cin >> n;
		while (n) {
			put(dp[n], dp2[n]);
			cin >> n;
		}
	}
} // namespace idaten

int main() {
	idaten::solve();
	return 0;
}



Measured memory_bytes: 10584
n, m = map(int, input().split())
ipy = []

for i in range(m):
    p, y = map(int, input().split())
    ipy.append([i, p, y])

ipy.sort(key=lambda x:x[2])
count = {}
order = {}

for i in range(m):
    i, p, y = ipy[i]
    if not p in count:
        count[p] = 0
    count[p] += 1
    order[i, p] = count[p]
    
ipy.sort(key=lambda x: x[0])
    
for i, p, y in ipy:
    print('{:06}{:06}'.format(p, order[i, p]))

Measured memory_bytes: 44236
#include <stdio.h>

int main()
{
  int i,j;
  int board[3][3];
  for(i=0; i<3; ++i){
    for(j=0; j<3; ++j){
      scanf("%d",&board[i][j]);
    }
  }
  int c1=0; int c2=0;
  for(i=0;i<=board[0][0];++i){
    int a1= board[0][0]-i;
    int a2= board[1][0]-i;
    int a3= board[2][0]-i;
    if(board[0][1]-a1==board[1][1]-a2 && board[1][1]-a2==board[2][1]-a3) c1=1;
    if(board[0][2]-a1==board[1][2]-a2 && board[1][2]-a2==board[2][2]-a3) c2=1;
    if(c1==1 && c2==1)  break;
    c1=c2=0;
  }
  if(c1==1 && c2==1) printf("Yes\n");
  else printf("No\n");
  return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define FOR(i,b,e) for (common_type_t <decltype (b), decltype (e)> i = (b), i ## __end = (e); i < i ## __end; ++ i)
#define FORR(i,b,e) for (common_type_t <decltype (b), decltype (e)> i = (e), i ## __begin = (b); i -- > i ## __begin;)
#define rep(i,n) for (decay_t <decltype (n)> i = 0, i ## __len = (n); i < i ## __len; ++ i)
#define ALL(x) begin (x), end (x)
using namespace std;

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

  array <int, 5> v;
  size_t last_order = 0;
  rep (i, v.size ())
  {
    cin >> v [i];
    if ((v [last_order] - 1) % 10 > (v [i] - 1) % 10)
    {
      last_order = i;
    }
  }

  auto ans = 0;
  rep (i, v.size ())
  {
    if (i == last_order) continue;
    if (v [i] % 10 != 0)
    {
      ans += v [i] + (10 - (v [i] % 10));
    }
    else
    {
      ans += v [i];
    }
  }
  ans += v [last_order];
  cout << ans << endl;
}



Measured memory_bytes: 256
import std.stdio, std.conv, std.functional, std.string;
import std.algorithm, std.array, std.container, std.range, std.typecons;
import std.bigint, std.numeric, std.math, std.random;
import core.bitop;

string FMT_F = "%.10f";

static File _f;
void file_io(string fn) { _f = File(fn, "r"); }
static string[] s_rd;
T _RD(T = long)() { while(!s_rd.length) s_rd = readln.chomp.split; string res = s_rd[0]; s_rd.popFront; return res.to!T; }
T _RD(T = long)(File f) { while(!s_rd.length) s_rd = f.readln.chomp.split; string res = s_rd[0]; s_rd.popFront; return res.to!T; }
T[] _RDA(T = long)(T fix = 0) { auto r = readln.chomp.split.to!(T[]); r[] += fix; return r; }
T[] _RDA(T = long)(File f, T fix = 0) { auto r = f.readln.chomp.split.to!(T[]); r[] += fix; return r; }
T RD(T = long)() { if (_f.isOpen) return _RD!T(_f); else return _RD!T; }
T[] RDA(T = long)(T fix = 0) { if (_f.isOpen)  return _RDA!T(_f, fix); else return _RDA!T(fix); }

size_t[] MAKE_IDX(alias less = "a < b", Range)(Range range) { auto idx = new size_t[](range.length); makeIndex!(less)(range, idx); return idx;}
size_t MIN_POS(alias less = "a < b", Range)(Range range) { auto r = minPos!(less)(range); return range.length - r.length; }

void chmin(T)(ref T x, T y) { x = min(x, y); } void chmax(T)(ref T x, T y) { x = max(x, y); }
bool inside(T)(T x, T b, T e) { return x >= b && x < e; }
long lcm(long x, long y) { return x * (y / gcd(x, y)); }

long mod = 10^^9 + 7;
//long mod = 998244353;
//long mod = 1_000_003;
void moda(ref long x, long y) { x = (x + y) % mod; }
void mods(ref long x, long y) { x = ((x + mod) - (y % mod)) % mod; }
void modm(ref long x, long y) { x = (x * y) % mod; }
void modpow(ref long x, long y) { if (!y) { x = 1; return; } auto t = x; x.modpow(y>>1); x.modm(x); if (y&1) x.modm(t); }

void main()
{
	auto N = RD;
	auto P = RDA;
	auto Q = RDA;

	bool[] set1, set2;
	foreach (i; 0..N)
	{
		set1 ~= true;
		set2 ~= true;
	}
	long a = 1;
	long b = 1;
	foreach (i; 0..N)
	{
		long cnt = 1;
		foreach (j; 1..N-i)
		{
			cnt *= j;
		}
		long x, y;
		foreach (j; 0..P[i])
		{
			if (set1[j])
				++x;
		}
		foreach (j; 0..Q[i])
		{
			if (set2[j])
				++y;
		}
		set1[P[i]-1] = false;
		set2[Q[i]-1] = false;
		a += (x-1) * cnt;
		b += (y-1) * cnt;
	}
	
	debug writeln(a, ":", b);
	writeln(abs(a-b));
	stdout.flush;
	debug readln;
}


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

using namespace std;

const int MaxLimit = 1000001;
bool PrimeNumber[MaxLimit] = { false,false, true,true,false };
int Total[MaxLimit] = { 0,0,1,2,2 };

void findPrimeNumber() {
	int limit;
	bool flag;

	for (int i = 5; i < MaxLimit; i++) {
		if (i % 2 == 0) {
			PrimeNumber[i] = false;
			Total[i] = Total[i - 1];
			continue;
		}

		limit = sqrt(i) + 1;
		for (int j = 2; j < limit; j++) {
			if (i%j == 0) {
				flag = false;
				PrimeNumber[i] = false;
				Total[i] = Total[i - 1];
				break;
			}
			flag = true;
		}
		if (flag) {
			PrimeNumber[i] = true;
			Total[i] = Total[i - 1] + 1;
		}
	}
}

int main() {
	int n, p, m, minLimt, maxLimt, cnt, sum;

	findPrimeNumber();
	while (cin >> n, n) {
		sum = 0;
		for (int i = 0; i < n; i++) {
			cnt = 0;
			cin >> p >> m;
			minLimt = max(1, p - m);
			maxLimt = min(MaxLimit-1, p + m);
			cnt = Total[maxLimt] - Total[minLimt-1];
			//cout << p << ":" << m << " = " << cnt << endl;
			if (cnt == 0) {
				--sum;
			}
			else {
				sum += cnt - 1;
			}
		}
		cout << sum << endl;
	}

	return 0;
}



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

typedef long long ll;

int main()
{

    //freopen("input.txt", "r", stdin);

    ll a, b;
    scanf("%lld%lld", &a, &b);
    if (a > b)
        swap(a, b);
    if (a == 1)
    {
        if (b == 1)
            printf("1");
        else
            printf("%lld", b - 2);
    }
    else
        printf("%lld", (a - 2) * (b - 2));
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
#include<cstdio>
#include<bits/stdc++.h>
using namespace std;
using ll =long long;

int main (void) {
  string s;
  cin >> s;
  int ans=2;
  int num=0;
  num=s.size()/2-1;
  while(ans==2){
    for(int i=0;i<num;i++){
      if (s[i]==s[i+num]){
        if(i==num-1){
          cout << num*2;
          return 0;
        }
        continue;
      }
      else{
        break;
      }
    }
    num=num-1;
  }
}


Measured memory_bytes: 256
#include <iostream>
#include<queue>
using namespace std;
typedef long long ll;

ll gcd(ll a, ll b){
    if(b==0) return a;
    return gcd(b, a%b);
}

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

int main(){
    ll A, B, C, D;cin>>A>>B>>C>>D;  //4 9 2 3
    A--;
    ll until_B = B-(B/C+B/D-B/lcm(C, D));
    ll until_A = A-(A/C+A/D-A/lcm(C, D));
    ll ans = until_B - until_A;
    //cout<<until_B<<until_A<<endl;
    cout<<ans<<endl;
}


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

using namespace std;
using ll =long long;
typedef pair<int,int> P;
#define SORT(a) sort((a).begin(),(a).end())
#define REV(a) reverse((a).begin(),(a).end())
#define For(i, a, b)    for(int i = (a) ; i < (b) ; ++i)
#define rep(i, n)       For(i, 0, n)
#define debug(x)  cerr << #x << " = " << (x) << endl;
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; }

void coY() {cout <<"Yes"<<endl;}
void coN(){cout <<"No"<<endl;}
 
//Write From this Line

//const ll mod = 1e9+7;
//const ll mod = 998244353;
int main()
{
	int n;
	cin >> n;
	vector<int> a(n);
	rep(i, n)cin>>a[i];
	
	int cnt = 0;
	rep(i,n){
		if(a[i] != i + 1) cnt++;
	}
	if(cnt <= 2) cout << "YES" << endl;
	else cout << "NO" << endl;
}


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

int main() 
{
    vector<int> a{0, 1, 3, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1};
    int x,y;
    cin >> x >> y;
    if (a[x] == a[y]) {
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
}

Measured memory_bytes: 3624
n,m = map(int,input().split())
x_max = int(m/10000)
answer = '-1 -1 -1'
for i in range(x_max+1):
    for j in range(n-i+1):
        m_tmp = m
        flag=0
        m_tmp -= i*10000
        m_tmp -= j*5000
        k = int(m_tmp/1000)
        if i+j+k==n:
            answer = '{0} {1} {2}'.format(i,j,k)
            flag=1
            break
    if flag:
        break
print(answer)

Measured memory_bytes: 3064
n,q=map(int,input().split())
s=input()+'Z'
A=[0]*(n+1)
cnt=0
for i in range(n):
    A[i]=cnt
    if s[i]=='A' and s[i+1]=='C':
        cnt+=1
ANS=[]
for i in range(q):
    l,r=map(int,input().split())
    ANS.append(A[r-1]-A[l-1])
for ans in ANS:
    print(ans)

Measured memory_bytes: 10232
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int (i)=0;i<(n);i++)
#define REP(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
#define INF LLONG_MAX - 100
#define MOD 1000000007
#define fcout cout << fixed << setprecision(15)
#define int long long
#define yorn(f) puts((f)?"Yes":"No")
#define YORN(f) puts((f)?"YES":"NO")
#define sec second
#define fir first
typedef long long ll;
typedef pair<int, int> P;
typedef priority_queue<int> pque;
int gcd(int a,int b){return b?gcd(b,a%b):a;};
int lcm(int a,int b){return a/gcd(a,b)*b;};
int mod(int a,int b){return (a+b-1)/b;};
template<typename A, size_t N, typename T>
void Fill(A(&array)[N],const T &val){std::fill((T*)array,(T*)(array+N),val);}
template<class T>inline bool chmax(T& a,T b){if(a<b){a=b;return true;}return false;};
template<class T>inline bool chmin(T& a,T b){if(a>b){a=b;return true;}return false;};

int calc_xor(int n) {
    switch(n & 3) {
        case 0: return n;
        case 1: return 1;
        case 2: return n + 1;
        case 3: return 0;
    }
}

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

    int a, b;
    cin >> a >> b;
    int z = calc_xor(b) ^ calc_xor(a-1);
    cout << z << endl;
    return 0;
}

Measured memory_bytes: 256
n=int(input())
l=[]
for i in range(n):
  s=input()
  l.append(s)
  
ac=l.count('AC')
wa=l.count('WA')
tle=l.count('TLE')
re=l.count('RE')

print('AC ' +'x ' + str(ac))
print('WA ' +'x ' + str(wa))
print('TLE ' +'x ' + str(tle))
print('RE ' +'x ' + str(re))

Measured memory_bytes: 16152
// frogs.cpp
#include<iostream>
#include<cstring>
#include<climits>
using namespace std;

int main(){

int n,k;
cin >>n>>k;
int arr[n];
for(int i=0;i<n;i++) cin>> arr[i];
int dp[n];
memset(dp,0,sizeof(dp));
dp[0] = 0;
int ans = 0;

// cout << dp[0] << " ";
for(int i = 1;i<n;i++){
	dp[i] = INT_MAX;
	for(int j=1;j<=k;j++){

	// cout << "i "<<i <<endl;
	if(i-j >=0)
	dp[i] =  min(abs(arr[i-j]  - arr[i]) + dp[i-j], dp[i] );
	// else{
	// 	dp[i] = abs(arr[i-1] - arr[i]) + dp[i-1];
	// }
}
	// ans +=dp[i];

	// cout << dp[i] << " ";
}
// cout << endl;

cout << dp[n-1]<< endl;



return 0;
}

Measured memory_bytes: 4388
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
//マクロ
//forループ関係
//引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか
//Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
//xにはvectorなどのコンテナ
#define ALL(x) (x).begin(),(x).end() //sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x)) //最大値を求める
#define MIN(x) *min_element(ALL(x)) //最小値を求める
//定数
#define INF 1000000000000 //10^12:極めて大きい値,∞
#define inf 2147483647 //int値の最大値
#define MOD 1000000007 //10^9+7:合同式の法
#define MAXR 100000 //10^5:配列の最大のrange(素数列挙などで使用)
//略記
#define PB push_back //vectorヘの挿入
#define MP make_pair //pairのコンストラクタ
#define F first //pairの一つ目の要素
#define S second //pairの二つ目の要素
#define CST(x) cout<<fixed<<setprecision(x)//小数点以下の桁数指定
#define debug(x) cerr << #x << ": " << x << "\n"
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 gcd(int a, int b) {
    if (b==0) return a;
    else return gcd(b, a%b);
}
int lcm(int a, int b) {
    return a * b / gcd(a, b);
}
int two(int n){
	ll ans=1;
	rep(i,n){
		ans*=2;
	}
	return ans;
}


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

    int n,m;
    cin>>n>>m;
    int A[101][101];
    rep(i,n)rep(j,m)cin >>A[i][j];
    
   int b[101];

   rep(i,m)cin>>b[i];

   int sum[101];
   rep(i,m)sum[i]=0;

   rep(i,n){
       rep(j,m){
           sum[i]+=A[i][j]*b[j];

       }
       
       
   }
   rep(i,n)cout<< sum[i] <<endl;


    
}


Measured memory_bytes: 3224
using namespace std;

using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
#include <iostream>
#include <string>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <cmath>
#include <climits>
#define all(x) (x).begin(),(x).end()

void solve(){

}
int main(){
    int a,b,c;
    cin >> a >> b >> c;
    vector<int> ar(100);

    for (int i = 0; i < 100; i++){
        ar[i] = a * i % b;
    }
    sort(all(ar));

    if (binary_search(all(ar), c)){
        cout << "YES" << endl;
    } else {
        cout << "NO" << endl;
    }

}


Measured memory_bytes: 256
/// kazuki08
/*
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define int long long
typedef long long ll;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int,int> pi;
typedef vector<pi> vpi;
#define ar array
//#define inf 1000000000
#define mod 1000000007
#define dmp(x) cerr<<"line "<<__LINE__<<" "<<#x<<":"<<x<<endl
#define fs first
#define sc second
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define mt make_tuple
#define IOS ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
template<class S,class T> ostream& operator<<(ostream& o,const pair<S,T> &p){
    return o<<"("<<p.fs<<","<<p.sc<<")";
}
template<class T> ostream& operator<<(ostream& o,const vector<T> &vc){
    o<<"{";
    for(const T& v:vc) o<<v<<",";
    o<<"}";
    return o;
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int n,k;

signed main(){
IOS;
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
  

  
  cin >> n >> k;
  set<int> s;
  for(int i=1;i<=n;i++){
    s.insert(i);
  }
  for(int i=1;i<=k;i++){
    int d;
    cin >> d;
    for(int j=1;j<=d;j++){
      int x;
      cin >> x;
      if(s.find(x)!=s.end())s.erase(s.find(x));
    }
  }
  cout << s.size() << endl;


return 0;
}
///....


Measured memory_bytes: 3652
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i < (n); i++)
#define all(v) (v).begin(), (v).end()
#define pb(a) push_back(a)
#define mp(a, b) make_pair(a, b)
using namespace std;
typedef long long LL;
const int INF = 999999999;

int main(){
    int n, k, t, u, v, l;
    cin >> n >> k >> t >> u >> v >> l;
    vector<int> d(n+2);
    rep(i, n) cin >> d[i];
    d[n] = l;
    d[n+1] = INF;

    int now = d[0];
    int have = 0, pass = 0;
    int slow = d[0];
    while(now < l){
        now += v*t;
        while(d[pass+1] <= now){
            pass++;
            have++;
            if(have == k+1){
                now = d[pass];
                break;
            }
        }
        if(have == 0){
            slow += d[pass+1] - now;
            now = d[pass+1];
            pass++;
        }
        else have--;
    }
    int fast = l-slow;
    double ans = 1.*fast/v + 1.*slow/u;
    cout << fixed << setprecision(15) << ans << endl;

}




Measured memory_bytes: 3284
function main(input) {
    const args = input.split(' ');
    const a = parseInt(args[0], 10);
    const b = parseInt(args[1], 10);
 
    if ((a * b) % 2 === 0) {
        console.log('Even');
    } else {
        console.log('Odd');
    }
}
 
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

Measured memory_bytes: 20424
#include <iostream>
#include <algorithm>
#include <queue>

typedef long long ll;
const ll MOD = 1e9+7;

ll get_prod_top2(std::priority_queue<int> &pq) {
  if (pq.size() < 2)  return -MOD;
  ll a = pq.top();  pq.pop();
  ll prod = a * pq.top();
  pq.push(a);
  return prod;
}

int N, K;
ll A[200005];

int main () {
  std::cin >> N >> K;
  bool all_nonpos = true;
  ll all_prod = 1;
  int num_zero = 0;
  for (int i = 0; i < N; ++i) {
    std::cin >> A[i];
    if (A[i] > 0)
      all_nonpos = false;
    if (A[i] == 0)
      num_zero++;
    all_prod = (all_prod * A[i]) % MOD;
  }

  ll ans = 1;
  if (K == N) {
    ans = all_prod;
  } else if (K + num_zero > N) {
    ans = 0;
  } else if (all_nonpos) {
    if (K & 1)
      std::sort(A, A+N, std::greater<int>());
    else
      std::sort(A, A+N);
    for (int i = 0; i < K; ++i)
      ans = (ans * A[i]) % MOD;
  } else {
    std::priority_queue<int> negpq;
    std::priority_queue<int> pospq;
    for (int i = 0; i < N; ++i) {
      if (A[i] > 0)
        pospq.push(A[i]);
      else if (A[i] < 0)
        negpq.push(-A[i]);
    }
    if (K & 1) {
      ans = (ans * pospq.top()) % MOD;
      pospq.pop();
      K--;
    }
    while (K) {
      ll p2 = get_prod_top2(pospq);
      ll n2 = get_prod_top2(negpq);
      if (p2 > n2) {
        ans = (ans * (p2 % MOD)) % MOD;
        pospq.pop();
        pospq.pop();
      } else {
        ans = (ans * (n2 % MOD)) % MOD;
        negpq.pop();
        negpq.pop();
      }
      K -= 2;
    }
  }
  ans = (ans + MOD) % MOD;
  std::cout << ans << "\n";

  return 0;
}


Measured memory_bytes: 5876
a,b,x=map(int,input().split())
k=b-a+1
if a%x!=0 and a!=0:
  k2=x-(a%x)
elif a%x==0 and a!=0:
  k2=1
else:
  k2=1
k-=k2
if k<=0 and a%x!=0:
  print(0)
elif k<=0 and a%x==0:
  print(1)
else:
  print(k//x+1)



Measured memory_bytes: 3060
#include<iostream>
#include <algorithm>
#include <vector>
#include <string>
using namespace std;
int Max = 100000;
typedef pair<int, int> count_s;

int main(){
  int n;
  cin >> n;
  count_s E[Max], O[Max];

  for(int l=0;l<Max;l++){
    E[l] = make_pair(n/2,l);
    O[l] = make_pair(1+(n-1)/2,l);
  }

  for(int i=0;i<n;i++){
    int l;
    cin >> l;
    if(i%2==0){
      E[l-1].first--;
    }else{
      O[l-1].first--;
    }
  }
  sort(E,E+Max);
  sort(O,O+Max);

  int ans;
  if(E[0].second!=O[0].second){
    ans = E[0].first + O[0].first;
  }else{
    ans = min(E[1].first + O[0].first, E[0].first + O[1].first);
  }

  cout << ans <<endl;

  return 0;
}




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

using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); i++) 
#define ll long long
#define ld long double
#define repl(i, n) for (ll i = 0; i < (ll)(n); i++)  
#define outdeb(fir, sec, thr) cout << fir << ":" << sec << ":" << thr << endl
#define DEV_VAL 1000000007

string yesNo(bool val)
{
  if(val)
  {
    return "Yes";
  }
  else {
    return "No";
  }
}

int main()
{
  ll n,k;
  cin >> n >> k;
  vector<ll> ilist;
  repl(i, n)
  {
    ll tmp; cin >> tmp;
    ilist.push_back(tmp);
  } 
  for(ll i = k; i < n; i++)
  {
    cout << fixed << yesNo(ilist[i-k] < ilist[i]) << endl;
  }

  return 0;
}

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

int main() {
    vector<string> a(3);
    string ans = "";
    rep(i, 3) cin >> a.at(i);
    rep(i, 3) ans += a.at(i).at(0) + ('A' - 'a');
    cout << ans << endl;
}

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

using namespace std;
using ll = long long;
#define REP(i, n) for (int i = 0; i < n; ++i)
#define ALL(v) v.begin(), v.end()

struct E {
  int to, index;
};
using G = vector<vector<E>>;
int main() {
  int n;
  cin >> n;
  G g(n);
  REP(i, n - 1) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    g[a].push_back({b, i});
    g[b].push_back({a, i});
  }
  queue<int> q;
  q.push(0);
  vector<int> c(n - 1, -1);
  while (!q.empty()) {
    int p = q.front();
    q.pop();
    set<int> st;
    for (auto e : g[p]) {
      if (c[e.index] != -1) st.insert(c[e.index]);
    }
    int col = 0;
    for (auto e : g[p]) {
      if (c[e.index] == -1) {
        while (st.count(col)) col++;
        c[e.index] = col;
        col++;
        q.push(e.to);
      }
    }
  }
  cout << *max_element(c.begin(), c.end()) + 1 << endl;
  REP(i, n - 1) cout << c[i] + 1 << endl;
}


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

int main(){
  int a,b;
  cin >> a >> b;
  if((a+b)%2==0){
    cout << (a+b)/2 << endl;
  }else{
    int x=(a+b)/2;
    cout << x+1 << endl;
  }
}

Measured memory_bytes: 256
#include <cmath>
#include <iomanip>
#include <iostream>

using namespace std;
int main() {
	int N, K;
	cin >> N >> K;
	double answer = 0;
	for (int i = 1; i <= N; ++i) {
		int tmp     = i;
		int counter = 0;
		while (tmp < K) {
			tmp = tmp * 2;
			counter++;
		}
		answer += double(1) / double(N) * pow(0.5, counter);
	}

	cout << setprecision(12) << answer << endl;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int n, k;
  cin >> n >> k;
  vector<int> h(n);
  for (int i = 0; i < n; ++i) {
    cin >> h[i];
  }
  sort(h.begin(), h.end());
  ll ans = 0;
  for (int i = 0; i < n - k; ++i) {
    ans += h[i];
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 1024
A = []
ans = []
for i in range(int(input())):
    query = list(map(int, input().split()))
    if(query[0] == 0):
        A.append(query[1])
    elif(query[0] == 1):
        ans.append(A[query[1]])
    else:
        A.pop()
for i in range(len(ans)):
    print(ans[i])


Measured memory_bytes: 13364
import java.util.Scanner;

class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] a = new int[N];
	
		int check = 1;
		int count = 0;
		for(int i=0; i<N; i++) {
			a[i] = sc.nextInt();
			
			if(a[i]==check) {
				check ++;
				count++;
			}			
		}
		
		
		
		if(count==0) {
			System.out.println(-1);
		}else {
		System.out.println(N-count);
		}
                
	}


}



Measured memory_bytes: 65828