akhauriyash/Code-Regression huggingface dataset:
H, W, M = map(int, input().split())

Hc = [0 for i in range(H)]
Wc = [0 for i in range(W)]
B = []

for m in range(M):
  h, w = map(int, input().split())
  Hc[h - 1] += 1
  Wc[w - 1] += 1
  B.append((h - 1, w - 1))
Hcmax = max(Hc)
Hcmax_idx = [i for i, x in enumerate(Hc) if x == Hcmax] 
Wcmax = max(Wc)
Wcmax_idx = [i for i, x in enumerate(Wc) if x == Wcmax] 

ans = Hcmax + Wcmax - 1
B = set(B)
f = False
for i in Hcmax_idx:
  if f:
    break
  for j in Wcmax_idx:
    if (i, j) not in B:
      ans = Hcmax + Wcmax
      f = True
      break
print(ans)

Measured memory_bytes: 90156
n,k=map(int, input().split())
a=list(map(int, input().split()))
x=[1]
dp=[0]*(k+1)
#先手勝利1

for i in range(1,k+1):
    for j in range(n):
        if i>=a[j]:
            x.append(dp[i-a[j]])
    if min(x)==0:
        dp[i]=1
    else:
        dp[i]=0
    x=[1]
if dp[k]==1:
    print('First')
else:
    print('Second')

Measured memory_bytes: 43856
#include<cstdio>
#include<iostream>
using namespace std;
const int N=100010;
int n,k,q,pl[N];
int main()
{
	scanf("%d%d%d",&n,&k,&q);
	for(int i=1;i<=n;i++) pl[i]=k;
	for(int i=1;i<=q;i++)
	{
		int x;
		scanf("%d",&x);
		pl[x]++;
	}
	for(int i=1;i<=n;i++)
	{
		if(pl[i]-q>0) printf("Yes\n");
		else printf("No\n");
	}
	return 0;
}

Measured memory_bytes: 1024
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
    return list(map(int,input().split()))
def m(): #複数文字
    return map(int,input().split())
def onem(): #Nとかの取得
    return int(input())
def s(x): #圧縮
    a = []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): #listをスペースごとに分ける
    return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
    return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False
"""
def nibu(x,n,r):
    ll = 0
    rr = r
    while True:
        mid = (ll+rr)//2

    if rr == mid:
        return ll
    if (ここに評価入れる):
        rr = mid
    else:
        ll = mid+1
"""

a,b = m()

aaa = -(-a * 100 // 8)

aa = (a+1) * 100 // 8

bbb = -(-b * 100 // 10)

bb = (b+1) * 100 // 10


p = set(range(aaa,aa))
pp = set(range(bbb,bb))

ppp = p & pp

if len(ppp) != 0:
    print(min(ppp))
else:
    print(-1)








Measured memory_bytes: 38384
import java.io.PrintWriter

val pw = PrintWriter(System.out)
fun main(args: Array<String>) {
    func()
    pw.flush()
}
fun println(value: Any) { pw.println(value) }

//ABC129_A
fun func() {
    val PQR = listOfInt()
    val ans = PQR.sum() - PQR.max()!!
    println("${ans}")
}

fun next() = readLine()!!
fun listOfString() = next().split(" ")
fun listOfInt() = listOfString().map { Integer.parseInt(it) }



Measured memory_bytes: 37896
#include <iostream>
#include <cstdio>
#include <string>
#include <cmath>
#include <vector>
#include <algorithm>
#include <map>
#include <utility>

using namespace std;

int main(){
	int n,minv,maxv;
	vector<int> R;
	cin >> n;
	for(int i = 0; i < n; i++){
		int tmp;
		cin >> tmp;
		R.push_back(tmp);
	}
	minv = R[0];
	maxv = R[1] - R[0];
	for(int j = 1; j < n; j++){
		maxv = max(maxv,R[j]-minv);
		minv = min(minv,R[j]);
	}
	cout << maxv << endl;
	return 0;
}

Measured memory_bytes: 2068
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define MAXN   1000005
using namespace std;
typedef long long int lld;

const lld N = 200043;
const lld MOD = 1000000007;

lld add(lld x, lld y)
{
    x =((x%MOD)+(y%MOD))%MOD;
    while(x >= MOD) x -= MOD;
    while(x < 0) x += MOD;
    return x;
}

lld mul(lld x, lld y)
{
    return ((x%MOD)*(y%MOD))% MOD;
}

lld binpow(lld x, lld y)
{
    lld z = 1;
    while(y)
    {
        if(y & 1) z = mul(z, x);
        x = mul(x, x);
        y >>= 1;
    }
    return z;
}
lld spf[MAXN];
void sieve()
{
    spf[1] = 1;
    for (int i=2; i<MAXN; i++)
        spf[i] = i;

    for (int i=4; i<MAXN; i+=2)
        spf[i] = 2;

    for (int i=3; i*i<MAXN; i++)
    {
        if (spf[i] == i)
        {
            for (int j=i*i; j<MAXN; j+=i)


                if (spf[j]==j)
                    spf[j] = i;
        }
    }
}
lld inv(lld x)
{
    return binpow(x, MOD - 2);
}

lld divide(lld x, lld y)
{
    return mul(x, inv(y));
}
map<lld,lld>m;
void fun(lld x)
{
    unordered_set<lld>s;
    while (x != 1)
    {
        s.insert(spf[x]);
        x = x / spf[x];
    }
    for(lld x:s)
        m[x]++;
}
// Combinations

/*
lld fact[N];

void precalc()
{
    fact[0] = 1;
    for(lld i = 1; i < N; i++)
        fact[i] = mul(fact[i - 1], i);
}

lld C(lld n, lld k)
{
    return divide(fact[n], mul(fact[k], fact[n - k]));
}
*/
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    lld t,i,j;
    //cin>>t;
    t=1;
    while(t--)
    {
        lld n;
        cin>>n;
        lld ar[n];
        for(i=0;i<n;i++)
            cin>>ar[i];
        lld g=ar[0];
        for(i=1;i<n;i++)
            g=__gcd(g,ar[i]);
        if(g!=1)
        {
            cout<<"not coprime"<<endl;
            return 0;
        }
        sieve();
        for(i=0;i<n;i++)
            fun(ar[i]);
        lld ctr=1;
        for(auto x:m)
        {
            if(x.second>1)
            {
                ctr=0;
                break;
            }
        }
        if(ctr==1)
        {
            cout<<"pairwise coprime"<<endl;
            return 0;
        }
        else
            cout<<"setwise coprime"<<endl;
    }
}





Measured memory_bytes: 24016
#include<stdio.h>
#include<string.h>


int main(){
  char s[100001];
  scanf("%s",s);
  int ans=0;
  char m='a';
  for(int i=0;i<26;i++){
    if(strchr(s,m)==NULL){
      printf("%c\n",m);
      return 0;

  }else{
    m++;
  }
}
printf("None\n");

  return 0;
}


Measured memory_bytes: 256
#include <cstdio>

int si[2][4] = {0};

int main(){
	double d[2];
	while(scanf("%lf%lf",&d[0],&d[1]) != EOF){
		for(int i = 0; i < 2; i++){
			d[i] *= 10;
			if(d[i] >= 11){
				si[i][0]++;
			}
			else if(d[i] >= 6){
				si[i][1]++;
			}
			else if(d[i] >= 2){
				si[i][2]++;
			}
			else{
				si[i][3]++;
			}
		}
	}
	for(int i = 0; i < 4; i++){
		printf("%d %d\n",si[0][i],si[1][i]);
	}
	return 0;
}

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

const int INPUT_NUM_ARRAY_LENGTH = 3;

int main()
{
  string inputNumStr;
  int inputNumArray[INPUT_NUM_ARRAY_LENGTH];

  cin >> inputNumStr;
  
  int PlacingMarblesNum;

  for(int i = 0; i < INPUT_NUM_ARRAY_LENGTH; i++)
  {
      inputNumArray[i] = (int)(inputNumStr[i] - '0');

      if(inputNumArray[i] == 1)
      {
          PlacingMarblesNum++;
      }
  }
  
  cout << PlacingMarblesNum;
  return 0;
}

Measured memory_bytes: 256
#pragma GCC optmize ("O3,unroll-loops")
#include <bits/stdc++.h>
using namespace std;
#define spIO ios::sync_with_stdio(false);cin.tie(0)
typedef long long ll;
typedef long double ld;
const ll mod = 1000000000 + 7;

ll n, a, b, ans;

void exgcd(ll a, ll b, ll& x, ll& y)
{
	if (b == 0)
	{
		x = 1;
		y = 0;
		return;
	}
	ll tx, ty;
	exgcd(b, a % b, tx, ty);
	x = ty;
	y = tx - a / b * ty;
}

inline ll anti(ll a)
{
	ll x, y;
	exgcd(a, mod, x, y);
	return (x % mod + mod) % mod;
}
int main()
{
	spIO;
	while (cin >> n >> a >> b)
	{
		ans = 1;
		ll t = 2, tn = n;
		while (tn)
		{
			if (tn & 1)
			{
				ans *= t;
				ans %= mod;
			}
			t = t * t % mod;
			tn >>= 1;
		}
		ans--;
		//cout << ans << '\n';
		ll c1 = 1, c2 = 1;
		for (ll i = n; i > n - a; i--)
			c1 = c1 * i % mod;
		for (ll i = a; i >= 1; i--)
			c1 = c1 * anti(i) % mod;
		for (ll i = n; i > n - b; i--)
			c2 = c2 * i % mod;
		for (ll i = b; i >= 1; i--)
			c2 = c2 * anti(i) % mod;
		//cout << c1 << ' ' << c2 << '\n';
		cout << ((ans - c1 + mod) % mod - c2 + mod) % mod;
	}
}

Measured memory_bytes: 256
length=int(input())
firstArray=input()
listForArray=list(map(int,firstArray.split()))
listForPrint=[firstArray]


def insertionSort(list,length):
    index=1
    while index<length:
        if listForArray[index]<=listForArray[index-1]:
            for index2 in range(0,index):
                if listForArray[index2-1]<=listForArray[index] and listForArray[index]<=listForArray[index2] or index2==0 and listForArray[index]<=listForArray[index2]:
                    newCommer=listForArray[index]
                    n=index
                    while n>index2:
                        listForArray[n]=listForArray[n-1]
                        n-=1
                    listForArray[index2]=newCommer
                    break   
        nowArray=str(listForArray[0])
        for index3 in range(1,length):
            nowArray+=" "+str(listForArray[index3])
        listForPrint.append(nowArray)
        index+=1    
#---------------------main-------------------------
insertionSort(listForArray,length)
for array in listForPrint:
    print(array)


Measured memory_bytes: 5600
#include <iostream>
#include <vector>
#include <map>
#include <string>
#include <utility>
#include <algorithm>
#include <bitset>
#include <numeric>
#include <cmath>
#include <tuple>
#include <queue>
#include <set>
#include <functional>

using namespace std;

typedef long long ll;
const ll INF = 1LL<<60;

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


int main(){
    cin.tie(0);
   	ios::sync_with_stdio(false);
    
    string S;
    ll K;

    cin >> S >> K;

    // もし、K-1文字目まですべて1であったら、その文字を出力
    // そうでない場合は、はじめて1でないもの

    if( K <= 100){

        int min_KS = min(static_cast<int>(K), static_cast<int>(S.length()));        

        bool all_1 = true;
        for(int i = 0; i < min_KS-1; i++){
            if(S[i] != '1'){
                all_1 = false;
            }
        }

        if(all_1 == true){
            cout << S[min_KS-1] << endl;
        }else{

            for(int i = 0; i < S.length(); i++){
                if(S[i] != '1'){
                    cout << S[i] << endl;
                    break;
                }
            }
        }
    }else{
        for(int i = 0; i < S.length(); i++){
                        if(S[i] != '1'){
                            cout << S[i] << endl;
                            break;
                        }
                    }
    }


    return 0;
}


Measured memory_bytes: 256
import java.io.*;
import java.util.*;

public class Main {

    static int mod = 998244353;
    static int add(int a, int b) {
        int c = a + b;
        if (c >= mod) return c - mod;
        if (c < 0) return c + mod;
        return c;
    }
    static int mult(int a, int b) {
        long c = (long) a * b % mod;
        return (int) c;
    }
    public static int pow(int a, int b) {
        int ret = 1;
        while (b != 0) {
            if (b % 2 == 1) ret = mult(ret, a);
            a = mult(a, a);
            b >>= 1;
        }
        return ret;
    }
    static int count(int n) {
        int ch = pow(2, n);
        ch = add(ch, -1);
        ch = add(ch, -n);
        ch = add(ch, -n * (n - 1) / 2);
        return ch;
    }
    static boolean coline(int a1, int a2, int b1, int b2, int c1, int c2) {
        return (b1 - a1) * (c2 - a2) == (b2 - a2) * (c1 - a1);
    }
    static int segCount(int n) {
        int ch = pow(2, n);
        ch = add(ch, -1);
        return ch;
    }
    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[][] points = new int[n][2];
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < 2; j++) {
                points[i][j] = sc.nextInt();
            }
        }
        int tot = count(n);
        for (int i = 0; i < n; i++) {
            for (int j = i + 1; j < n; j++) {
                int col = 0;
                for (int k = j + 1; k < n; k++) {
                    if (coline(points[i][0], points[i][1], points[j][0], points[j][1], points[k][0], points[k][1])) {
                        col++;
                    }
                }
                if (col > 0) {
                    tot = add(tot, -segCount(col));
                }
            }
        }
        System.out.println(tot);
    }

    public static class Scanner {
        StringTokenizer st;
        BufferedReader br;
        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }
        public String next() throws IOException {
            while (st == null || !st.hasMoreTokens()) {
                st = new StringTokenizer(br.readLine());
            }
            return st.nextToken();
        }
        public int nextInt() throws IOException{
            return Integer.parseInt(next());
        }
    }
}

Measured memory_bytes: 22100
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin>>n;
        //数の入力
    set<string> vec;
    string s;
    for (int i = 0; i < n; i++) {
    cin >> s;
    vec.insert(s);
    }
    cout<<vec.size();
    }


Measured memory_bytes: 19256
#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 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(int x, int y) {
    if (y == 0)return x;
    return gcd(y, x % y);
}
signed lcm(int x, int 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+1);
    vector<int>B(N);
    long long ans = 0;
    rep(i, N + 1) {
        cin >> A[i];
        ans += A[i];
    }
    rep(i, N) {
        cin >> B[i];
        if (B[i] <= A[i])A[i] -= B[i];
        else if (B[i] > A[i] + A[i + 1]) {
            A[i] = 0;
            A[i + 1] = 0;
        }
        else {
            A[i + 1] -= B[i]-A[i];
            A[i] = 0;
        }
    }
    rep(i, N + 1)ans -= A[i];
    cout << ans << endl;
}

Measured memory_bytes: 4012
using System;
using System.Collections.Generic;
public class Aprob {
    public static void Main() {
        char[] alphabe = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' };
        int n = int.Parse(Console.ReadLine());
        int[] count = new int[alphabe.Length];
        int[] count2 = new int[alphabe.Length];
        for (int i = 0; i < alphabe.Length; i++) {
            count2[i] = 99999999;
        }
        string read = "";
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < alphabe.Length; j++) {
                count[j] = 0;
            }
            read = Console.ReadLine();
            for (int j = 0; j < read.Length; j++) {
                for (int k = 0; k < alphabe.Length; k++) {
                    if (read.Substring(j, 1) == alphabe[k].ToString()) {
                        count[k]++;
                        break;
                    }
                }
            }
            for (int k = 0; k < alphabe.Length; k++) {
                count2[k] = Math.Min(count[k], count2[k]);
            }
        }
        string outp = "";
        for (int i = 0; i < alphabe.Length; i++) {
            for (int j = 0; j < count2[i]; j++) {
                outp += alphabe[i];
            }
        }
        Console.WriteLine(outp);
    }
}

Measured memory_bytes: 11092
import sys

def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  #空白あり

N = I()
A = LI()

A = sorted(A,reverse=True)

a = (N-1)//2

b = 0
for i in range(a+1):
    b += A[i]

if N % 2 == 1:
    print(2*b-A[0]-A[a])
else:
    print(2*b-A[0])


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

int prime[1000000];

void init()
{
  for(int i = 2; i <= 1000000; i++)
  {
    if(prime[i])
      continue;
    prime[i] = 1;
    for(int j = i + i; j <= 1000000; j += i)
      prime[j] = 2;
  }
}

int main()
{
  init();
loop:
  int n, a, d, ans = 0;
  cin >> a >> d >> n;
  if(!n)
    return 0;
  for(int i = 0; ;)
  {
    if(prime[a] == 1)
      i++;
    if(i == n)
    {
      cout << a << endl;
      break;
    }
    a += d;
  }
  goto loop;
}

Measured memory_bytes: 5064
N = gets.to_i
ab = Hash.new
(N-1).times do
  a, b = gets.split(' ').map(&:to_i)
  ab[a] ||= []
  ab[a] << b
  ab[b] ||= []
  ab[b] << a
end

queue = []
queue << 1
stepF = []
stepF[1] = 0
while !queue.empty?
  cur = queue.shift
  # break if cur == N

  ab[cur].each do |to|
    if stepF[to] == nil
      stepF[to] = stepF[cur] + 1
      queue << to
    end
  end
end

queue << N
stepS = []
stepS[N] = 0
while !queue.empty?
  cur = queue.shift
  # break if cur == N

  ab[cur].each do |to|
    if stepS[to] == nil
      stepS[to] = stepS[cur] + 1
      queue << to
    end
  end
end

fp = 0
sp = 0
(2..N).each do |i|
  if stepF[i] <= stepS[i]
    fp += 1
  else
    sp += 1
  end
end

if fp >= sp
  print 'Fennec'
else
  print 'Snuke'
end

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

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++)
    cin >> a.at(i);
  
  sort(a.begin(), a.end());
  
  cout << a.at(n - 1) - a.at(0) << endl;
  
  return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            string[] s = Console.ReadLine().Split(' ');
            List<int> list = new List<int>();
            List<int> list_a = new List<int>();
            List<int> list_b = new List<int>();
            foreach (string s2 in s)
            {
                list.Add(int.Parse(s2));
            }
            list.Sort((a, b) => b - a);
            int flag = 1;
            foreach(int i in list)
            {
                if(flag == 1)
                {
                    list_a.Add(i);
                } else
                {
                    list_b.Add(i);
                }
                flag = -flag;
            }
            Console.WriteLine(list_a.Sum() - list_b.Sum());
            //Console.ReadLine();
        }
    }
}


Measured memory_bytes: 13268
#include <iostream>
#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <climits>
#include <vector>
#include <iomanip>
#include <string>
#include <queue>
#include <numeric>
#include <functional>
#include <array>
#include <map>
#include <set>

#define INF 1000000007 //1000000000000000003
#define MOD 1000000007
#define MAX 2000005

#define ll long long

//printf("%.10f", );
//cout << fixed << setprecision(10) << heikin << endl;
//vector<vector<int>> data(3, vector<int>(4, -1));
//left + 1 < top

using namespace std;
using P = pair<int, int>;
using Pc = pair<double, int>;
using T = tuple<int, int, int>;
using edge = struct { int to; long long dist; };
const double PI = 3.141592653589793;
long long fact[MAX], inv[MAX];
int dx[] = { -1,0,1,0 };
int dy[] = { 0,-1,0,1 };

//////////////////////////////////

vector<vector<int>> tree(100005);
int color[100005];
map<P, int>colorMap;
int m = 0;

struct BridgeInfo {
	int town1;
	int town2;
	int year;
	BridgeInfo(int t1, int t2, int y) {
		town1 = t1;
		town2 = t2;
		year = y;
	}
};

struct People {
	int index;
	int town;
	int year;
	People(int i, int t, int y) {
		index = i;
		town = t;
		year = y;
	}
};

bool compare_by_second(pair<int, int> a, pair<int, int> b) {
	if (a.second != b.second) {
		return a.second < b.second;
	}
	else {
		return a.first < b.first;
	}
}

struct UnionFind {
	vector<int>uf;
	
	UnionFind(int size) :uf(size, -1) {};

	int root(int target) {
		if (uf[target] < 0)return target;
		else return uf[target] = root(uf[target]);
	}

	void merge(int a, int b) {
		a = root(a);
		b = root(b);
		if (a == b)return;
		if (uf[b] < uf[a])swap(a, b);
		uf[a] += uf[b];
		uf[b] = a;
	}
};

ll CalcPow(ll num, ll power) {
	if (power == 0)return 1;
	if (power % 2 == 0) {
		ll half = CalcPow(num, power / 2);
		return (half * half) % MOD;
	}
	else return (num * CalcPow(num, power - 1)) % MOD;
}

ll combination(ll all, ll select) {
	if (all < select) return 0;
	if (all < 0 || select < 0) return 0;
	return fact[all] * (inv[select] * inv[all - select] % MOD) % MOD;
}

void initCombination(int max) {
	fact[0] = fact[1] = 1;
	for (int i = 2; i <= max; ++i) {
		fact[i] = fact[i-1] * i % MOD;
	}

	inv[max] = CalcPow(fact[max], MOD - 2);
	for (int i = max - 1; 0 <= i; --i) {
		inv[i] = (inv[i + 1] * (i + 1)) % MOD;
	}
}

void dfs(int from) {
	int c = 1;
	for (auto t : tree[from]) {
		c = c != color[from] ? c : c + 1;
		color[t] = c;
		colorMap[make_pair(from, t)] = c;
		m = max(c, m);
		dfs(t);
		c++;
	}
}

int dp[105][4][2];

int main() {
	int N;
	cin >> N;
	string ans = "APPROVED";
	for (int i = 0; i < N;++i) {
		int a;
		cin >> a;
		if (a % 2 == 0) {
			if (a % 3 != 0 && a % 5 != 0) {
				ans = "DENIED";
				break;
			}
		}
	}
	cout  << ans << endl;
}



Measured memory_bytes: 2560
list_ = [[int(x) for x in input().split()] for i in range(3)]
count = [0]*4
for i in range(3):
  count[list_[i][0]-1]+=1
  count[list_[i][1]-1]+=1
if 3 in count:
  print('NO')
else:
  print('YES')


Measured memory_bytes: 2940
/**
 *    author:  Baibhav Kumar
 *    created: 24.07.2020 19:00:00      
**/

#include <bits/stdc++.h>

using namespace std;

int main() {
	int k;
	cin >> k;
	int a , b;
	cin >> a >> b;
	for (int i = a;i <= b;i++){
		if(i % k == 0){
			cout << "OK" << endl;
			return 0;
		}
	}
	cout << "NG" << endl;
}


Measured memory_bytes: 3572
#include <stdio.h>
#define NIL 9999999

void MatrixChainOrder(void);
int Min(int, int);
int m[101][101];
int p[101];
int i,j,k,l,n,q;

int main(){
  int a;

  scanf("%d",&n);
  
  scanf("%d%d",&p[0],&p[1]);
  for(i=2; i <= n; i++){
    scanf("%d%d",&a,&p[i]);
  }

  MatrixChainOrder();

  return 0;
}

void MatrixChainOrder(void){

  for(i=1; i <= n; i++){
    m[i][i] = 0;
  }

  for(l=2; l <= n; l++){
    for(i=1; i <= n-l+1; i++){
      j = i + l - 1;
      m[i][j] = NIL;
      for(k=i; k <= j-1; k++){
	q = m[i][k] + m[k+1][j] + (p[i-1]*p[k]*p[j]);
	m[i][j] = Min(m[i][j],q);
      }
    }
  }
  printf("%d\n",m[1][n]);
}

int Min(int a,int b){
  if(a > b){
    return b;
  } else {
    return a;
  }
}



Measured memory_bytes: 2104
<?php
    $s = trim(fgets(STDIN));
    $t = trim(fgets(STDIN));
    $count = 0;
    $length = strlen($s);
    for($i = 0; $i < strlen($s); $i++){
        if($s[$i] != $t[$i]){
            $count++;
        }
    }
    echo($count);
?>

Measured memory_bytes: 16612
#include<iostream>
#include<string>
using namespace std;
int main(){
  int n;
  cin>>n;
  string s;
  cin>>s;
  if(n%2==1){
    cout<<"No"<<endl;
  }else{
    for(int i=0;i<n/2;i++){
      if(s[i]!=s[i+n/2]){
        cout<<"No"<<endl;
        return 0;
      }
    }
    cout<<"Yes"<<endl;
  }
    return 0;
  }

Measured memory_bytes: 256
import java.io.*;
import java.util.Arrays;
import java.util.StringTokenizer;
import java.util.stream.Collectors;

public class Main {

    private static FastReader in = new FastReader(System.in);
    private static PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args) {
        solve();
        out.flush();
    }

    private static void solve() {
        char c = in.next().toCharArray()[0];
        out.println(Character.toString((char) (c + 1)));
    }

    // https://www.geeksforgeeks.org/fast-io-in-java-in-competitive-programming/
    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        FastReader(InputStream inputStream) {
            br = new BufferedReader(new
                    InputStreamReader(inputStream));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException  e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

        // https://qiita.com/masakinpo/items/5f77f2a879578a85a0bb
        public int[] nextIntArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }

        public long[] nextLongArray(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nextLong();
            return a;
        }
    }
}


Measured memory_bytes: 21332
#include<iostream>
#include<math.h>
#include<vector>
#include<algorithm>
#include<cstdio>
#include <string>
#include <complex>
#include <functional>
using namespace std;
typedef pair<int,int> P;
int cnt[7];
int main(){
    int i,j,n,prime[1000001];
    prime[0]=prime[1]=-1;
    for(i=2;i<=1000000;i++){
        if(prime[i]!=-1){
            prime[i]=1;
            for(j=i+i;j<=1000000;j+=i)prime[j]=-1;
        }
    }
    while(cin>>n,n){
        int cnt=0;
        for(i=1;i<=n/2;i++){
            if(prime[i]==1&&prime[n-i]==1) cnt++;
        }
        cout<<cnt<<endl;
        }
    return 0;
}


Measured memory_bytes: 6988
#include <bits/stdc++.h>
using namespace std;
#define vsort(vec) sort(vec.begin(), vec.end())
#define vreverse(vec) reverse(vec.begin(), vec.end())
using ll =long long;
const ll INF =99999999999;

//最大公約数
ll gcd(ll a, ll b){
   if (a%b==0){
       return(b);
   }else{
       return(gcd(b,a%b));
   }
}
//最小公倍数
ll lcm(ll a, ll b){
   return a*b/gcd(a,b);
}

//素数判定
ll isprime(ll n){
  bool prime=true;
  for(int i=2;i<n;i++){
    if(n%i==0){
      prime=false; break;
    }
  }
if(prime){cout<<n<<" is prime"<<endl;
         }else{cout<<n<<" is not prime"<<endl;}

}
//階乗　20くらいが限界
ll factorial(ll n){
  ll a=1;ll b=n;
  for(int i=0;i<n;i++){
    a*=b;
    b--;
  }
  return a;
}

//組み合わせ　nCr
ll comb(ll a,ll b){
  ll c;
  c=factorial(a)/(factorial(a-b)*factorial(b));
  return c; 
}




//10億7。　　　100000007
//2*2行列 H*W
//vector<vector<int>> vec(H,vector<int>(W));
//for(int i=0;i<H;i++){
//for(int j=0;j<W;j++){
//cin>>vec[i][j];
//  }
//}

//文字列→数列
//string S;int A=atoi(S.c_str());
//数列→文字列
//int A;string S=to_string(A);
//数字判定　isdigit(a)
//pair宣言　pair<int,int> p(5,7);
//ソート　sort(vec.begin(),vec.end());



int main(){
cout<<fixed<<setprecision(10);
 
int N,i;cin>>N>>i;
cout<<N-i+1<<endl;
}


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

using namespace std;

typedef long long ll;
typedef pair<int,int> P;
typedef vector<int> VI;
typedef vector<VI> VVI;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const int INF = numeric_limits<int>::max() / 2;
const int NEG_INF = numeric_limits<int>::min() / 2;
const int MOD=1e9+7;

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

  ll n,m;
  while(true){
      cin>>n>>m;
      if(n==0&&m==0) break;
      std::vector<ll> v(n),kouho;
      for(int i=0;i<n;i++) cin>>v[i];
      v.push_back(0);
      for(int i=0;i<=n;i++)for(int j=0;j<=n;j++){
          kouho.push_back(v[i]+v[j]);
      }
      ll ma=-1;
      sort(kouho.begin(),kouho.end());
      for(int i=0;i<(int)kouho.size();i++){
          if(i>0&&kouho[i]==kouho[i-1]) continue;
          ll res=m-kouho[i];
          if(res<0) break;
          auto itr=upper_bound(kouho.begin(),kouho.end(),res);
          itr--;
          ma=max(kouho[i]+*itr,ma);
          //cout<<ma<<endl;
      }
      cout<<ma<<endl;
  }
  return 0;
}

Measured memory_bytes: 19004
n,a,b = list(map(int,input().split()))
output_list = [0] * n
def d1(x,y,a,b):
    return y - x
def d2(x,y,a,b):
    if x <= a and b <= y:
        return a - x + y - b + 1
    if x <= a and y < b:
        return a - x + b - y + 1
    if a < x and b <= y:
        return x - a + y - b + 1
    if a < x and y < b:
        return x - a + b - y + 1
def d(x,y,a,b):
    return min(d1(x,y,a,b),d2(x,y,a,b))
for x in range(1,n):
    for y in range(x + 1,n + 1):
        output_list[d(x,y,a,b)] += 1
for k in range(1,n):
    print(output_list[k])

Measured memory_bytes: 3444
#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 + 1; ++i)
#define repN(i, m, n) for (int i = m; i < n; ++i)
#define repR(i, n)    for (int i = n - 1; i >= 0; --i)

using namespace std;

int main() {
	int n, x, t;
	cin >> n >> x >> t;

	if (n % x == 0) {
		cout << n / x * t;
	} else {
		cout << (n / x + 1) * t;
	}

	return 0;
}


Measured memory_bytes: 3632
#include<cstdio>
#include<algorithm>
const int MaxN=100010;
int R,C,N,n,S[MaxN];
struct item{int ty,x;bool operator<(const item&it)const{return x<it.x;}}a[MaxN*2];
int id(int x,int y){
	if(!y)return x;
	if(x==R)return y+R;
	if(y==C)return R-x+R+C;
	if(!x)return C-y+R+C+R;
	return-1;
}
int main(){
	scanf("%d%d%d",&R,&C,&N);
	while(N--){
		int x1,y1,x2,y2,x,y;
		scanf("%d%d%d%d",&x1,&y1,&x2,&y2);
		x=id(x1,y1);
		y=id(x2,y2);
		if(x!=-1&&y!=-1){
			n++;
			a[n*2-2]=(item){n,x<y?x:y};
			a[n*2-1]=(item){-n,x>y?x:y};
		}
	}
	std::sort(a,a+n*2);
	int*tp=S;
	for(item*i=a;i<a+n*2;i++){
		if(i->ty>0)*tp++=i->ty;
		else if(i->ty!=-*--tp)return puts("NO"),0;
	}
	puts("YES");
}

Measured memory_bytes: 1920
#pragma GCC optimize("Ofast")  
#pragma GCC target("avx,avx2,fma")
#include<bits/stdc++.h>
using namespace std;
#define IO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define int long long 
#define endl "\n"
#define all(x) (x).begin(),(x).end()
const int MOD = 1e9+7;
const int mxN = 2e5+3;

void solve(){
	int n;
	cin >> n;
	int a[n];
	for(int i = 0; i < n; ++i)cin >> a[i];
	int ans = 0;
	for(int i = 1; i < n; ++i){
		if(a[i] < a[i - 1]){
			ans += (a[i - 1] - a[i]);
			a[i] = a[i - 1];
		}
	}
	cout << ans << endl;
}

int32_t main(){
	IO;
	
	int nT = 1;
	//cin >> nT;
	for(int i = 1; i <= nT; ++i)
		solve();
	return 0;
}


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

int main() {
	int a,b;
	cin >> a >> b;

	if (a==0 || b ==0) {
		cout << "Zero" << endl;
		return 0;
	} 
	if (a < 0 && b > 0) {
		cout << "Zero" << endl;
		return 0;
	}
	int c = (b - a) % 2;


	if (a < 0) {
		if (c == 0) {
			cout << "Negative" << endl;			
		} else {
			cout << "Positive" << endl;			
		}
	} else {
		cout << "Positive" << endl;			
	}
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
#include <climits>
#include <sstream>
#include <iterator>
#include <sstream>
#include <iomanip>
#include <istream>
#include <cstring>
#include <cstdio>
#include <cstdlib>
using namespace std;

int main()
{
    int x, y;
    cin >> x >> y;
    if(x == 2) {
        if(y == 2) cout << "Yes" << endl;
        else    cout << "No" << endl;

        return 0;
    }
    if(x == 4 || x == 6 || x == 9 || x == 11) {
        if(y == 4 || y == 6 || y == 9 || y == 11) {
            cout << "Yes" << endl;
        } else {
            cout << "No";
        }
        return 0;
    }
    
    if(y == 4 || y == 6 || y == 9 || y == 11 || y == 2) cout <<"No" << endl;
    else cout << "Yes" << endl;

    
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,h,w,ans=0;
  cin >> n >> h >> w;
  vector<int> H(n),W(n);
  for(int i=0;i<n;i++)
    cin >> H[i] >> W[i];
  for(int i=0;i<n;i++){
    if(W[i]>=w&&H[i]>=h)
      ans++;
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
import sys
sys.setrecursionlimit(10**9)

def main():
    N = int(input())
    S = input()

    ans = 0
    dp = [[0]*(N+1) for _ in range(N+1)]
    for i in reversed(range(N)):
        for j in reversed(range(N)):
            dp[i][j] = dp[i+1][j+1] + 1 if S[i] == S[j] else 0
            if not i+dp[i][j]-1 < j:
                dp[i][j] = 0
            ans = max(ans, dp[i][j])

    print(ans)

if __name__ == "__main__":
  main()

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

using namespace std ;

typedef long long LL ; 


int main() { 
#ifdef YJQ_LOCAL
		freopen(".in", "r", stdin);
#endif
		int n ; 
		scanf("%d", &n);
		LL cura = 1, curb = 1; 
		for (int i = 1; i <= n;i ++) {
				int l, r; 
				scanf("%d%d", &l, &r) ; 
				LL low = max(cura / l, curb / r) ;
				while (low * l < cura || low * r < curb) low ++ ; 
			    cura = low * l, curb = low * r ;
		}
		cout<<cura + curb << endl ; 
}	




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

namespace AtCoder2 {
	class Program {
		static void Main(string[] args) {

			//出力の都度更新をやめる
			var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
			Console.SetOut(sw);


			Ans();

			//更新する
			Console.Out.Flush();
			
		}

      public static void Ans() {

			var inputArray = retreiveLongArray();
			var inputCount = 1;

			// 不正な入力は処理しない
			if (inputArray.Length != inputCount) {
				Console.WriteLine("invalid input");
				return;
			}
			long N = inputArray[0];

			if (N <600) {
				Console.WriteLine(8);
				return;
			}

			if (N < 800) {
				Console.WriteLine(7);
				return;
			}

			if (N < 1000) {
				Console.WriteLine(6);
				return;
			}

			if (N < 1200) {
				Console.WriteLine(5);
				return;
			}

			if (N <1400) {
				Console.WriteLine(4);
				return;
			}

			if (N < 1600) {
				Console.WriteLine(3);
				return;
			}

			if (N < 1800) {
				Console.WriteLine(2);
				return;
			}

			if (N < 2000) {
				Console.WriteLine(1);
				return;
			}

	

		}

		/// <summary>
		/// スペースで区切られた文字列配列の入力を受け取る
		/// </summary>
		/// <returns></returns>
		private static string[] retreiveStringArray() {
			var inputArray = Console.ReadLine().Split(' ');
			return inputArray;
		}

		/// <summary>
		/// スペースで区切られた整数配列の入力を受け取る
		/// </summary>
		/// <returns></returns>
		private static long[] retreiveLongArray() {
			var inputArray = Console.ReadLine().Split(' ');
			var longArray = inputArray.Select(s => long.Parse(s));
			return longArray.ToArray();
		}


		/// <summary>
		/// 2組みずつの入力データ(数値)からTuppleListを作成する
		/// </summary>
		/// <param name="N"></param>
		/// <returns></returns>
		private static List<Tuple<long, long>> createLongTuppleList(long N) {
			var inpList = new List<Tuple<long, long>>();

			for (int i = 0; i < N; i++) {
				var inp = retreiveLongArray();
				var item1 = inp[0];
				var item2 = inp[1];
				inpList.Add(new Tuple<long, long>(item1, item2));
			}
			return inpList;
		}
	}
}


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

int main(){
    int N, M, temp, f, s;
    cin >> N;
    vector<int> box(N, 0);
    cin >> M;
    for(int i = 0; i < M; i++){
        cin >> temp;
        cin >> f;
        if(temp == 1){
            if(f == 0 && N != 1){
                cout << "-1" << endl;
                return 0;
            }
        }

        if(box.at(temp-1) != 0){
            if(box.at(temp-1) != f){
            cout << "-1" << endl;
            return 0;
            }
        } else {
            box.at(temp - 1) = f;
        }
    }
    if(N > 1 && box.at(0) == 0){
        box.at(0) = 1;
    }
    for(int i = 0; i < N; i++){
        s += box.at(i)*pow(10, N-i-1);
    }
        cout << s << endl;
}

Measured memory_bytes: 256
import std.stdio;
import std.conv;
import std.algorithm;
import std.string;
import std.file;
import std.math;
 
int main() {
        string l;
        int w, n;
        l = readln(), w = to!int(l.split("\n")[0]); // number of vertical lines (ranes)
        l = readln(), n = to!int(l.split("\n")[0]); // number of holizontal lines (bypasses)
        int[] state;
        for(int i=0; i<w; i++) state ~= i + 1;
        while((l = readln(), l.length)){
                l = l.split("\n")[0];
                int a, b;
                a = to!int(l.split(",")[0]) - 1, b = to!int(l.split(",")[1]) - 1;
                int r;
                r = state[a], state[a] = state[b], state[b] = r;
                }
        for(int i=0; i<w; i++) printf("%d\n", state[i]);
        return 0;
        }
 

Measured memory_bytes: 1104
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<cstdio>
#include<cmath>
#include<deque>
#include<numeric>
#include<queue>
#include<stack>
#include<cstring>
#include<limits>
#include<functional>
#include<unordered_set>
#include<iomanip>
#include<cassert>
#include<regex>
#include<bitset>
#include<complex>
#include<chrono>
#include<random>
#define rep(i,a) for(int i=(int)0;i<(int)a;++i)
#define pb push_back
#define eb emplace_back
#define all(x) x.begin(),x.end()
using ll=long long;
constexpr ll mod = 1e9 + 7;
constexpr ll INF = 1LL << 60;

ll gcd(ll n, ll m) {
	ll tmp;
	while (m!=0) {
		tmp = n % m;
		n = m;
		m = tmp;
	}
	return n;
}

ll lcm(ll n, ll m) {
	return abs(n * m) / gcd(n, m);//gl=xy
}
 
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;
}
 
using namespace std;

//ここから
void solve(){
  int n,k;
  cin>>n>>k;
  int ans=1e9;
  for(int bit=0;bit<(1<<n);++bit){
    int sum=1;
    rep(i,n){
      if(bit&(1<<i)){
        sum*=2;
      }
      else sum+=k;
    }
    chmin(ans,sum);
  }
  cout<<ans;
}

int main(){
	ios::sync_with_stdio(false);
  cin.tie(0);
	cout<<fixed<<setprecision(15);
  solve();
	return 0;
}

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

#define ll long long
#define fornum(A,B,C) for(A=B;A<C;++A)
#define pii pair<int,int>
#define pll pair<ll,ll>

using namespace std;

/////////////////////////////////////////////////////
ll A[5];
ll i, j, k;
int main(){
    fornum(i,0,3){
        scanf("%lld", &A[i]);
    }    
    sort(A,A+3);
    printf("%lld", A[2] * 10 + A[1] + A[0]);
    return 0;
}

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

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int H,W; cin >> H >> W;
    vector<string> S(H);
    for (int i=0;i<H;++i) cin >> S[i];
    ll ans0=0,ans1=0;
    for (int _=0;_<2;++_){
        vector<vector<ll>> sum(H+W-1,vector<ll>(H+1,0));
        for (int i=0;i<H;++i)
            for (int j=0;j<W;++j)
                sum[i+j][i+1]+=(S[i][j]=='#');
        for (int i=0;i<H+W-1;++i)
            for (int j=0;j<H;++j)
                sum[i][j+1]+=sum[i][j];
        for (int i=0;i<H;++i){
            for (int j=0;j<W;++j){
                if (S[i][j]!='#') continue;
                for (int k=1;i-k>=0&&j+k<W;++k){
                    if (S[i-k][j+k]!='#') continue;
                    if (i+j+2*k<=H+W-2) ans0+=sum[i+j+2*k][min(H,i+k)]-sum[i+j+2*k][i+1];
                    if (i+j-2*k>=0) ans0+=sum[i+j-2*k][i-k]-sum[i+j-2*k][max(0,i-2*k+1)];
                    ans1+=(i+k<H&&S[i+k][j+k]=='#');
                    ans1+=(j+2*k<W&&S[i][j+2*k]=='#');
                    ans1+=(i-k>=0&&j-k>=0&&S[i-k][j-k]=='#');
                    ans1+=(i-2*k>=0&&S[i-2*k][j]=='#');
                }
            }
        }
        for (int i=0;i<H;++i)
            reverse(S[i].begin(),S[i].end());
    }
    cout << ans0+ans1/2 << '\n';
}

Measured memory_bytes: 1792
#include <iostream>
#include <cmath>
#include <bits/stdc++.h>
#include <string>

using namespace std;

// stringをintに
// string a = "123";
// stoi(a)
//
// intをstringに
// int a = 123;
// to_string(a)
//
// charをintに
// char a = '1';
// (int)a - 48 // asciiコードを値にする

// stringのソート
// string str = "abccba";
// sort(str.begin(), str.end());
//
// ハッシュテーブル
// unordered_map<string, int> mp;
// mp["aabbcc"] = 0;

// 配列Aにcinする
//int main() {
//  int N;
//  cin >> N;
//  vector<int> A(N);
//  for (int i = 0; i < N; i++) {
//    cin >> A.at(i);
//  }
//  return 0;
//}

// 標準入出力
int main() {
	int N, K, Q;
	cin >> N >> K >> Q;

  vector<int> A(Q);
  for (int i = 0; i < Q; i++) {
    cin >> A.at(i);
  }

  vector<int> points(N);
  for (int i = 0; i < N; i++) {
    points.at(i) = 0;
  }

  for (int i = 0; i < Q; i++) {
    points.at(A.at(i) - 1) += 1;
  }

  for (int i = 0; i < N; i++) {
    if (K - Q + points.at(i) > 0) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }

  return 0;
}

// 文字列を1文字ずつループ
//int main() {
//  string str;
//  cin >> str;
//  int sum = 0;
//  for(int i = 0; i < (int)str.size(); ++i){
//    char ch = str[i];
//
//    if (ch == '1') {
//      sum++;
//    }
//  }
//  cout << sum << endl;
//  return 0;
//}



Measured memory_bytes: 1408
#include <bits/stdc++.h>
#define FOR(i,k,n) for(int i=(k);i<(int)(n);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(x) begin(x),end(x)

using namespace std;
const int mod = 2;
const int eps = 0;

struct Mod {
  int n;
  Mod () : n(0) {;}
  Mod (int m) : n(m) {
    if (n >= mod) n %= mod;
    else if (n < 0) n = (n % mod + mod) % mod;
  }
  Mod& operator=(const Mod&) = default;
  operator int() { return n; }
};

bool operator==(Mod a, Mod b) { return a.n == b.n; }
Mod operator+=(Mod &a, Mod b) { a.n += b.n; if (a.n >= mod) a.n -= mod; return a; }
Mod operator-=(Mod &a, Mod b) { a.n -= b.n; if (a.n < 0) a.n += mod; return a; }
Mod operator*=(Mod &a, Mod b) { a.n = ((long long)a.n * b.n) % mod; return a; }
Mod operator+(Mod a, Mod b) { return a += b; }
Mod operator-(Mod a, Mod b) { return a -= b; }
Mod operator*(Mod a, Mod b) { return a *= b; }
Mod operator^(Mod a, int n) {
  if (n == 0) return Mod(1);
  Mod res = (a * a) ^ (n / 2);
  if (n % 2) res = res * a;
  return res;
}

using ll = int64_t;
ll inv(ll a, ll p) {
  return (a == 1 ? 1 : (1 - p * inv(p%a, a)) / a + p);
}
Mod operator/(Mod a, Mod b) { return a * Mod(inv(b, mod)); }
Mod operator/=(Mod &a, Mod b) { a.n = ((long long)a.n / b.n); return a; }
typedef Mod Data;
typedef vector<Data> Array;
typedef vector<Array> Matrix;

bool is_zero(Data dat) { return dat == Mod(0); }

tuple<Matrix, int> solve(Matrix A) {
  const int n = A.size(), m = A[0].size();
  int r = 0;
  for (int i = 0; r < n && i < m; ++i) {
    int pivot = r;
    for (int j = r; j < n; ++j) {
      if (A[j][i]) {
        pivot = j;
        break;
      }
    }
    swap(A[pivot], A[r]);
    if (is_zero(A[r][i])) continue;
    for(int j = r+1; j < n; ++j)
      for(int k = m-1; k >= i; --k)
        A[j][k] -= A[r][k] * A[j][i];
    ++r;
  }
  return make_pair(A, r);
}

int main() {
  while(1) {
    int n,m,d;
    cin>>m>>n>>d;
    if (!n) break;
    vector<Mod> tb(n*m);
    REP(i,n)REP(j,m) {
      int v;
      cin>>v;
      tb[i*m+j] = v;
    }
    int dim = n*m;
    Matrix mat(dim, Array(dim+1));
    REP(i,n)REP(j,m) {
      REP(k,n)REP(l,m) {
        if (abs(k-i)+abs(l-j) == d) {
          mat[i*m+j][k*m+l] = 1;
        }
      }
      mat[i*m+j][i*m+j] = 1;
      mat[i*m+j][dim] = tb[i*m+j];
    }
    Matrix res;
    int rank;
    tie(res, rank) = solve(mat);
    bool ok = false;
    REP(i,dim) if (res[rank-1][i]) ok = true;
    if (ok) {
      cout << 1 << endl;
    } else {
      cout << 0 << endl;
    }
  }
  return 0;
}

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

int main(){
	int n;
	cin >> n;
	n = n/3;
	cout << n << endl;
	return 0;
}




Measured memory_bytes: 256
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")
    };
}
fn main() {
    input! {
        n: i32,
        m: i32,
    }

    let ans = if n == m { "Yes" } else { "No" };

    println!("{}", ans);
}


Measured memory_bytes: 4352
#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++)
typedef long long ll;

int main(){
  string a,b,c;
  cin >> a >> b >> c;
  cout << a[0] << b[0] << c[0] << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repI(i, d, n) for (int i = (d); i < (n); ++i)
#define reps1(i, n) for (int i = 1; i < (n); ++i)
using namespace std;
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; }

using ll = long long;
using P = pair<int, int>;
using Pl = pair<ll, ll>;
using M = map<int, int>;
using Ml = map<ll, ll>;
ll const INF = 1ll<<61;
double pi = 3.141592653589793238;

int main() {
  ll n;
  cin >> n;
  if (n % 2 == 0) cout << n << endl;
  else cout << n * 2 << endl;

  return 0;
}


Measured memory_bytes: 256
#encoding: utf-8

N, M = map(int, input().split())
X = list(map(int, input().split()))

X.sort()


if N >= M:
    print("0")
else:
    D = [0] * (M - 1)
    for i in range(M - 1):
        D[i] = X[i + 1] - X[i]
    D.sort()
    print(sum(D[:M-N]))

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

int main(){
	int k;
	cin>>k;
	int a,b;
	cin>>a>>b;
	for (int i = a; i<=b; i++){
		if (i%k == 0){
			cout<<"OK";
			return 0;
		}
	}
	cout<<"NG";
	return 0;
}

Measured memory_bytes: 3644