akhauriyash/Code-Regression huggingface dataset:
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.NoSuchElementException;

public class Main {

	public static void main(String[] args) {
		long n = sc.nextLong();
		double[] ia = new double[(int) n];
		double sum = 0.0d;
		for (int i = 0; i < n; i++) {
			sum += (double) 1 / (double) sc.nextLong();
		}

		pw.println((1 / sum));
		pw.flush();
	}

	static final FastScanner sc = new FastScanner();
	static final PrintWriter pw = new PrintWriter(System.out);

	static class FastScanner {
		private final InputStream in = System.in;
		private final byte[] buffer = new byte[1024];
		private int ptr = 0;
		private int buflen = 0;

		private boolean hasNextByte() {
			if (ptr < buflen) {
				return true;
			} else {
				ptr = 0;
				try {
					buflen = in.read(buffer);
				} catch (IOException e) {
					e.printStackTrace();
				}
				if (buflen <= 0) {
					return false;
				}
			}
			return true;
		}

		private int readByte() {
			if (hasNextByte())
				return buffer[ptr++];
			else
				return -1;
		}

		static boolean isPrintableChar(int c) {
			return 33 <= c && c <= 126;
		}

		private void skipUnprintable() {
			while (hasNextByte() && !isPrintableChar(buffer[ptr]))
				ptr++;
		}

		public boolean hasNext() {
			skipUnprintable();
			return hasNextByte();
		}

		public String next() {
			if (!hasNext())
				throw new NoSuchElementException();
			StringBuilder sb = new StringBuilder();
			int b = readByte();
			while (isPrintableChar(b)) {
				sb.appendCodePoint(b);
				b = readByte();
			}
			return sb.toString();
		}

		public long nextLong() {
			if (!hasNext())
				throw new NoSuchElementException();
			long n = 0;
			boolean minus = false;
			int b = readByte();
			if (b == '-') {
				minus = true;
				b = readByte();
			}
			if (b < '0' || '9' < b) {
				throw new NumberFormatException();
			}
			while (true) {
				if ('0' <= b && b <= '9') {
					n *= 10;
					n += b - '0';
				} else if (b == -1 || !isPrintableChar(b)) {
					return minus ? -n : n;
				} else {
					throw new NumberFormatException();
				}
				b = readByte();
			}
		}
	}
}


Measured memory_bytes: 21076
#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<int,int>;
const int di[] = {-1,0,1,0};
const int dj[] = {0,-1,0,1};


const int INF = 1001001001;

int main() {
    int h, w;
    cin >> h >> w;
    int si, sj;
    cin >> si >> sj;
    si--; sj--;
    int ti, tj;
    cin >> ti >> tj;
    ti--; tj--;
    vector<string> s(h);
    rep(i,h) cin >> s[i];
    vector<vector<int>> dist(h, vector<int>(w, INF));
    deque<P> q;
    dist[si][sj] = 0;
    q.emplace_back(si,sj);
    while (!q.empty()) {
        int i = q.front().first;
        int j = q.front().second;
        q.pop_front();
        int d = dist[i][j];
        rep(v,4) {
            int ni = i+di[v], nj = j+dj[v];
            if (ni < 0 || ni >= h || nj < 0 || nj >= w) continue;
            if (s[ni][nj] == '#') continue;
            if (dist[ni][nj] <= d) continue;
            dist[ni][nj] = d;
            q.emplace_front(ni,nj);
        }
        for (int ei = -2; ei <= 2; ei++) {
            for (int ej = -2; ej <= 2; ej++) {
                int ni = i+ei, nj = j+ej;
                if (ni < 0 || ni >= h || nj < 0 || nj >= w) continue;
                if (s[ni][nj] == '#') continue;
                if (dist[ni][nj] <= d+1) continue;
                dist[ni][nj] = d+1;
                q.emplace_back(ni,nj);
            }
        }
    }
    int ans = dist[ti][tj];
    if (ans == INF) ans = -1;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 9496
import numpy as np

h, w, k = map(int, input().split())
s = []
for i in range(h):
    string = input()
    temp = []
    for j in range(w):
        temp.append(int(string[j]))
    s.append(temp)

s_arr = np.array(s)

ans = 10**9
for i in range(2**(h-1)):
    bin_str = format(i, '0'+str(h-1)+'b')
    kouryo = np.array([[0 for _ in range(w)]])
    cnt = 0
    start = 0
    for j in range(h-1):
        if bin_str[j] == '1':
            cnt += 1
            kouryo = np.concatenate((kouryo, s_arr[start:j+1].sum(axis=0, keepdims=True)), axis=0)
            start=j+1
    kouryo = np.concatenate((kouryo, s_arr[start:].sum(axis=0, keepdims=True)), axis=0)

    if cnt > ans: continue
    if np.any(kouryo>k): continue

    wa = np.array([0 for _ in range(len(kouryo))])
    for j in range(w):
        wa += kouryo[:, j]
        if np.max(wa)>k:
            cnt += 1
            if cnt > ans: break
            wa = kouryo[:, j]
    ans = min(ans, cnt)
print(ans)

Measured memory_bytes: 13568
#include <bits/stdc++.h>
using namespace std;
 
int main(){
    int A[3];
    cin >> A[0] >> A[1] >> A[2];
    
    // 昇順ソート
    sort(A, A + 3);
    if(A[0] == 5 && A[1] == 5 && A[2] == 7)
        cout << "YES" << endl;
    else
        cout << "NO" << endl;
        
    return 0;
}

Measured memory_bytes: 256
n,m=list(map(int,input().split()))
l=[]
for i in range(n):
    a=input()
    p=[]
    for i in range(m):
        if a[i]=='#':
            p.append(-1)
        else:
            p.append(0)
    l.append(p)
dp=[[0 for j in range(m)]for i in range(n)]
for i in range(m):
    if l[0][i]!=-1:
        dp[0][i]=1
    else:
        break
for i in range(n):
    if l[i][0]!=-1:
        dp[i][0]=1
    else:
        break
mod=10**9+7
for i in range(1,n):
    
    for j in range(1,m):
        if l[i][j]!=-1:
            
            
                
                
                
            
            dp[i][j]+=((dp[i-1][j])%(mod) + (dp[i][j-1])%mod)%mod
        

print(dp[n-1][m-1])
        


Measured memory_bytes: 58144
#include<iostream>
#include<vector>
#include<string>
#include<cmath>
#include<algorithm>
#include<numeric>
#include<map>
#include<unordered_map>
#include<queue>
#include<deque>
 
using namespace std;
using ll=long long;
#define rep(i,n)  for(ll i=0;i<n;++i)
#define all_map(itr,mp) for(auto itr=mp.begin();itr!=mp.end();itr++)
#define ALL(a) (a).begin(),(a).end()

int main(){
    ll n;
    cin >> n;
    string s[n];
    ll t[n];
    rep(i, n)cin >> s[i] >> t[i];
    string x;
    cin >> x;

    ll time = 0;
    ll sum = 0;
    bool wake = true;
    rep(i, n){
        sum += t[i];
        if(wake)time+=t[i];
        if(s[i] == x)wake =false;
    }

    cout << sum - time << endl;

}

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

int main() {
  int N; cin >> N;
  int a; bool res = true;
  for (int i = 0; i < N; i++) {
    cin >> a;
    if (a % 2 == 0 && a % 3 != 0 && a % 5 != 0) res = false;
  }
  if (res) {
    cout << "APPROVED" << endl;
  } else {
    cout << "DENIED" << endl;
  }
}

Measured memory_bytes: 256
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    N=I()
    edge=[[]for _ in range(N)]
    for i in range(N):
        a=I()
        for _ in range(a):
            x,y = MI()
            edge[i].append((x-1,y))

    max_bit = 1<<N
    ans = 0
    for bit in range(max_bit):
        cnt = 0
        T = []
        people = [0]*N
        for i in range(N):
            if (1<<i)&bit:
                people[i]=True
                cnt += 1
                T.append(i)
            else:
                people[i]= 2
        ok = True
        visited = set()
        while T:
            u = T.pop()
            visited.add(u)
            for v,tf in edge[u]:
                if tf==1:
                    if people[v]==0:
                        ok = False
                        break
                    people[v] = True
                    if v not in visited:
                        T.append(v)
                        visited.add(v)
                else:
                    if people[v]==1:
                        ok=False
                        break
                    people[v] = False
        if ok:
            ans = max(ans,cnt)
    print(ans)


if __name__ == '__main__':
    main()

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

int main() {

  int n,x;
  cin >> n >> x;
  
  vector<int> t(n);
  rep(i,n) cin >> t[i];
  int ans = 1;
  int now = 0;
  
  rep(i,n) {
    now += t[i];
    if(now <= x) ans += 1;
  } 
  
  cout << ans << endl;
  
  
  
}


Measured memory_bytes: 256
import java.util.Arrays;
import java.util.Scanner;

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

		int AB[] = new int[2];

		for (int i = 0; i < 2; i++) {
			AB[i] = sc.nextInt();
		}

		Arrays.sort(AB);

		int s = 0;

		for (int i = 0; i < 2; i++) {
			s += AB[1];
			AB[1]--;
			Arrays.sort(AB);
		}
		System.out.println(s);
	}
}

Measured memory_bytes: 23764
#define _GLIBCXX_DEBUG
// header {{{
#include <bits/stdc++.h>
using namespace std;
#define CPP_STR(x) CPP_STR_I(x)
#define CPP_CAT(x,y) CPP_CAT_I(x,y)
#define CPP_STR_I(args...) #args
#define CPP_CAT_I(x,y) x ## y
#define ASSERT(expr...) assert((expr))
using i8  = int8_t;
using u8  = uint8_t;
using i16 = int16_t;
using u16 = uint16_t;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;
using f32 = float;
using f64 = double;
using f80 = __float80;
// }}}
constexpr i64 INF = 1'010'000'000'000'000'017LL;
constexpr i64 MOD = 1'000'000'007LL;
constexpr f64 EPS = 1e-12;
constexpr f64 PI = 3.14159265358979323846;
// util {{{
#define FOR(i, start, end) for(i64 i = (start), CPP_CAT(i,xxxx_end)=(end); i < CPP_CAT(i,xxxx_end); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(f,c,...) (([&](decltype((c)) cccc) { return (f)(std::begin(cccc), std::end(cccc), ## __VA_ARGS__); })(c))

template<typename C>
i64 SIZE(const C& c) { return static_cast<i64>(c.size()); }
template<typename T, size_t N>
i64 SIZE(const T (&)[N]) { return static_cast<i64>(N); }
template<typename T, typename U, typename Comp=less<>>
bool chmax(T& xmax, const U& x, Comp comp={}) {
    if(comp(xmax, x)) {
        xmax = x;
        return true;
    }
    return false;
}

template<typename T, typename U, typename Comp=less<>>
bool chmin(T& xmin, const U& x, Comp comp={}) {
    if(comp(x, xmin)) {
        xmin = x;
        return true;
    }
    return false;
}
// }}}

// init {{{
struct ProconInit {
    static constexpr int IOS_PREC = 15;
    static constexpr bool AUTOFLUSH = false;

    ProconInit() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(IOS_PREC);
        if(AUTOFLUSH)
            cout << unitbuf;
    }
} PROCON_INIT;
// }}}

//--------------------------------------------------------------------


    vector<int> a(15);
    vector<vector<int>> x(15);
    vector<vector<int>> y(15);
    int n;

int cntr(int bits){
    int counter = 0;
    REP(i,n){
        counter += (bits>>i) & 1;
    }
    return counter;
}

signed main() {
    cin>>n;

    for(int i=0;i<n;i++){
        cin>>a.at(i);
        x.at(i) = vector<int>(a.at(i));
        y.at(i) = vector<int>(a.at(i));
        for(int j=0;j<a.at(i);j++){
            cin>>x.at(i).at(j)>>y.at(i).at(j);
        }
    }

    bool flg = true;
    int mx = 0;

    REP(i,1LL<<n){
        flg = true;
        REP(j,n){
            int p = i>>j & 1;
            if(p == 0) continue;

            REP(k,a.at(j)){
                int pers = x.at(j).at(k) - 1;
                if( (i>>pers & 1) ^ y.at(j).at(k)){
                    flg = false;
                    break;
                }
            }
        }
        if(flg) mx = max(mx,cntr(i));
    }

    cout<<mx<<endl;

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

Measured memory_bytes: 256
M=99;main(n,i,j,k,a,b,c){
	float p=atan(1)*4,X[100],Y[100],x,y;
	for(;scanf("%d",&n),n;printf("%d\n",a)){
		for(i=0;i<n;i++)scanf("%f,%f",X+i,Y+i);
		for(a=i=0;i<n;a=a>b?a:b,i++)for(b=k=0;k<M;b=b>c?b:c,k++)for(x=X[i]+cos(p*k/M),y=Y[i]+sin(p*k/M),c=0,j=i;j<n;j++)
			if(hypot(X[j]-x,Y[j]-y)<1+1e-3)c++;
	}
exit(0);}

Measured memory_bytes: 652
#include <bits/stdc++.h>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
#define pll pair<ll,ll>
#define pint pll
using ll = long long;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=998244353 ;

int main(){
  ll a,b,c,k;
  cin >> a >> b >> c >> k;
  ll ans=0;
  ans+=min(k,a);
  k-=min(k,a);
  if(k==0){
    cout << ans << endl;
    return 0;
  }
  k-=min(k,b);
  if(k==0){
    cout << ans << endl;
    return 0;
  }
  cout << ans-min(c,k) << endl;
return 0;}

Measured memory_bytes: 3636
import java.util.Scanner;

public class Main {

    static int N;

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

        N = Integer.parseInt(sc.nextLine());
        int[][] grid = new int[2][N];
        for (int i = 0; i < N; i++) {
            grid[0][i] = Integer.parseInt(sc.next());
        }
        for (int i = 0; i < N; i++) {
            grid[1][i] = Integer.parseInt(sc.next());
        }

        int ans = 0;
        for (int i = 0; i < N; i++) {
            int tmp = 0;
            for (int j = 0; j <= i; j++) {
                // 右移動
                tmp += grid[0][j];
            }
            for (int j = i; j < N; j++) {
                // 下に移動して、あとは全部右移動
                tmp += grid[1][j];
            }

            ans = Math.max(tmp, ans);
        }

        System.out.println(ans);
    }
}



Measured memory_bytes: 21588
#include<bits/stdc++.h>
using namespace std;
int n;
long long dp[405][405],a[405],x[405];

int main(){
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		for(int j=1;j<=n;j++){
			dp[i][j]=1e18;
		}
	}
	for(int i=1;i<=n;i++) dp[i][i]=0;
	for(int i=1;i<=n;i++) scanf("%lld",&a[i]),x[i]=x[i-1]+a[i];
	for(int len=2;len<=n;len++){
		for(int l=1;l<=n-len+1;l++){
			int r=l+len-1;
			for(int p=l;p<r;p++){
				dp[l][r]=min(dp[l][r],dp[l][p]+dp[p+1][r]+x[r]-x[l-1]);
			}
		}
	}
	printf("%lld\n",dp[1][n]);
	
	return 0;
}

Measured memory_bytes: 1536
N,M = map(int,input().split())
A = [list(input().split()) for _ in range(M)]
C = {str(i):0 for i in range(1,N+1)}
for i in range(M):
    p,s = A[i]
    if s=="AC":
        C[p] = 1
D = {str(i):0 for i in range(1,N+1)}
cnt = 0
for i in range(M):
    p,s = A[i]
    if C[p]==1 and D[p]==0 and s=="WA":
        cnt += 1
    elif s=="AC":
        D[p] = 1
ac = 0
for i in range(1,N+1):
    ac += C[str(i)]
print(ac,cnt)

Measured memory_bytes: 132236
import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner scan = new java.util.Scanner(System.in);
        int p = scan.nextInt();
        int q = scan.nextInt();
        int r = scan.nextInt();
        int a = p + q;
        int b = q + r;
        int c = r + p;
        int out = a;
        if(a > b){
            out = b;
            if(b > c){
                out = c;
            }
        }
        if(a > c){
            out = c;
            if(c > b){
                out = b;
            }
        }
        System.out.println(out);
    }
}

Measured memory_bytes: 21844
#!/usr/bin/env python3
#CODEFESTIVAL2016 qualC C

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(1000000000)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

n = I()
t = LI()
a = LI()
x = [0]*n
y = [0]*n
if a[0] != t[-1]:
    print(0)
    quit()
for i in range(1,n):
    if t[i] > t[i-1]:
        x[i] = 1
for i in range(1,n)[::-1]:
    if a[i] < a[i-1]:
        y[i-1] = 1
ans = 1
for i in range(1,n-1):
    if x[i] == 1 and y[i] == 1:
        if t[i] != a[i]:
            print(0)
            quit()
        continue
    elif x[i] == 1:
        if a[i] >= t[i]:
            continue
        else:
            print(0)
            quit()
    elif y[i] == 1:
        if a[i] <= t[i]:
            continue
        else:
            print(0)
            quit()
    ans *= min(t[i],a[i])
    ans %= mod
print(ans)


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

int main() {
  int A,B;
  cin >> A>>B;
  if(A+B<A*B && A-B<A*B){
    cout << A*B;
  }
  else if(A+B<A-B){
    cout << A-B;
  }
  else cout << A+B;
}


Measured memory_bytes: 256
import sys
def input():
    return sys.stdin.readline()[:-1]
def main():
    N, T = map(int,input().split())
    t = list(map(int,input().split()))
    prev = 0
    end = 0
    ans = 0
    for e in t:
        if end < e:
            ans += end-prev
            prev = e
            end = e + T
        else:
            end = e + T
    ans += end - prev
    print(ans)
if __name__ == '__main__':
    main()


Measured memory_bytes: 25196
#include <iostream>
#include <string>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <functional>
#include <map>
#include <set>

using namespace std;

typedef long long i64;
typedef i64 int_t;
typedef vector<int_t> vi;
typedef vector<vi> vvi;

typedef pair<int_t, int_t> pi;

#define tr(c, i) for(auto i = (c).begin(); i != (c).end(); i++)
#define pb push_back
#define sz(a) int((a).size())
#define all(c) (c).begin(), (c).end()
#define REP(s, e, i) for(i=(s); i < (e); ++i)

int main(int argc, char *argv[]) {
  i64 N;
  cin >> N;
  getchar();
  string S;
  getline(cin, S);

  i64 ans = 1, i;
  char c_prev = S[0];
  REP(1, N, i) {
    if(S[i] != c_prev) {
      ++ans;
    }
    c_prev = S[i];
  }

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


Measured memory_bytes: 512
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define fi first
#define se second
#define pi acos(-1)
#define inf 0x3f3f3f3f
#define lson l,mid,rt<<1
#define rson mid+1,r,rt<<1|1
#define rep(i,x,n) for(int i=x;i<n;i++)
#define per(i,n,x) for(int i=n;i>=x;i--)
#define y1 Y1
using namespace std;
typedef pair<int,int>P;
const int MAXN=2010;
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int x1[MAXN], x2[MAXN];
int y1[MAXN], y2[MAXN];
int Hash(int a[], int b[], int w, int n)
{
	vector<int> h;
	for(int i = 0; i < n; i++)
	h.pb(a[i]), h.pb(b[i]);
	h.pb(0);
	h.pb(w);
	sort(h.begin(), h.end());
	h.erase(unique(h.begin(),h.end()), h.end());
	for(int i = 0; i < n; i++)
	{
		a[i] = lower_bound(h.begin(), h.end(), a[i]) - h.begin();
		b[i] = lower_bound(h.begin(), h.end(), b[i]) - h.begin();
	}
	return h.size() - 1;
}
int book[MAXN][MAXN];
int W, H;
int go[4][2] = {0, 1, 1, 0, 0, -1, -1, 0};
void dfs(int r, int c)
{
	if(r < 0 || c < 0 || r > H || c > W || book[r][c]) return ;
	book[r][c] = 1;
	for(int i = 0; i < 4; i++)
	dfs(r + go[i][0], c + go[i][1]);
}
int main()
{
	
	while(cin >> W >> H && W + H)
	{
		memset(book, 0, sizeof(book));
		int n, ans = 0;
		cin >> n;
		for(int i = 0; i < n; i++)
		scanf("%d %d %d %d", &x1[i], &y1[i], &x2[i], &y2[i]);
		W = Hash(x1, x2, W, n);
		H = Hash(y1, y2, H, n);
		//cout << W << " " << H << endl;
		//for(int i = 0; i < n; i++)
		//cout << x1[i] << " ";
		for(int i = 0; i < n; i++)
		{
			book[y1[i]][x2[i]]++;
			book[y1[i]][x1[i]]--;
			book[y2[i]][x1[i]]++;
			book[y2[i]][x2[i]]--;
		}
		for(int i = 0; i < H; i++)
		for(int j = 1; j < W; j++)
		book[i][j] += book[i][j - 1];
		for(int i = 1; i < H; i++)
		for(int j = 0; j < W; j++)
		book[i][j] += book[i - 1][j];
		//for(int i = 0; i <= H; i++)
		//for(int j = 1; j <= W; j++)
		//printf("%d%c", book[i][j], " \n"[j == W]);
		for(int i = 0; i < H; i++)
		for(int j = 0; j < W; j++)
		{
			if(book[i][j])continue;
			dfs(i, j);
			ans++;
		}
		cout << ans << endl;
	}
 	return 0;
}

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

int main() {
  int N, K, Q, p[100010];
  cin >> N >> K >> Q;
  for (int i = 1; i <= N; i++) p[i] = K - Q;
  
  for (int i = 1; i <= Q; i++) {
    int a; cin >> a;
    p[a] += 1;
  }
  for (int i = 1; i <= N; i++) {
    if (p[i] > 0) cout << "Yes" << endl;
    else cout << "No" << endl;
  }
  
  return 0;
}

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

int string_compar(const void * a, const void * b)
{
	return(strcmp((char*)a, (char*)b));
}

int main(void)
{
	int n,i,len;
	scanf("%d",&n);
	char s[n][11];
	scanf("%s",s[0]);
	for(i=1;i<n;i++){
		scanf("%s",s[i]);
		len=strlen(s[i-1]);
		if(s[i-1][len-1]!=s[i][0]){
			printf("No");
			return 0;
		}
	}
	
	qsort((void*)s, sizeof(s)/sizeof(s[0]), sizeof(s[0]), string_compar);
	
	for(i=0;i<n-1;i++){
		if(strcmp(s[i],s[i+1])==0){
			printf("No");
			return 0;
		}
	}
		  
    printf("Yes");
	return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <complex>
#include <fstream>
#include <cmath>

using namespace std;

int main(void){
    string n; cin >> n;
    if(n.front() == n.back()){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
    return 0;
}


Measured memory_bytes: 256
from collections import deque

h,w=map(int,input().split())
s=[list(input()) for i in range(h)]

cnt=0
for i in s:
    cnt+=i.count('.')

sy,sx=0,0
gy,gx=h-1,w-1

dist=[[-1]*w for i in range(h)]
dist[sy][sx]=0

que=deque()
que.append((sy,sx))

while que:
    y,x=que.popleft()

    if y==gy and x==gx:
        print(cnt-(dist[y][x]+1))
        exit()

    for dy,dx in [[1,0],[-1,0],[0,1],[0,-1]]:
        ny=y+dy
        nx=x+dx
        if 0<=ny<=h-1 and 0<=nx<=w-1 and s[ny][nx]=='.' and dist[ny][nx]==-1:
            que.append((ny,nx))
            dist[ny][nx]=dist[y][x]+1

print(-1)

Measured memory_bytes: 3316
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define ll long long
#define rep(i,n) for(ll i=0;i<(n);i++)
#define pll pair<ll,ll>
#define pq priority_queue
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define ios ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define lb(c,x) distance(c.begin(),lower_bound(all(c),x))
#define ub(c,x) distance(c.begin(),upper_bound(all(c),x))
 
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;}
 
const ll INF=1e15;
 
int main(){
    string s,t;
    cin >> s >> t;
    ll n=s.length();
    bool ok=true;
    rep(i,n){
        if(s[i]!=t[i]){
            ok=false;
            break;
        }
    }
    if(ok) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 3628
#include <bits/stdc++.h>
using namespace std;
using LL = long long;
#define REP(i, n) for (LL i = 0; i < (LL)(n); i++)
#define FOR(i, m, n) for (LL i = m; i < n; i++)
#define SORT(x) sort(x.begin(), x.end())
#define REVE(x) reverse(x.begin(), x.end())
#define ALL(x) (x).begin(), (x).end()
#define SUM(x) accumulate(x.begin(), x.end(),0)
#define vLL(v,n) vector<LL> v(n); REP(i,n)cin>>v[i];
#define vstr(v,n) vector<string> v(n); REP(i,n)REP(i,n)cin>>v[i];
LL INF = 1e9 + 1;
LL MOD = 1e9+7;
  LL a,b,c,d,e,n,m,l,r,x,y,z,ans=-INF,ans2=0,count=0;
string s,S,t;
int main() {
  cin >> n;
  for(int i = 1; i <= 1000000;i++){
    for(int j = 1; j <= 1000000;j++){
      if(i*j<n){ans2++;
         }else{
      break;
          }
      }
    }
    cout << ans2;
  }

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

#define ll long long
#define pb push_back
#define F first
#define S second

ll inf =1e16+10;
const int N=1e4+5, S = 102, D = 11, mod = 1e9+7;
int n, DIV;
int a[N];
string s;
int mem[N][S][3];

int dp(int i, int sum, bool f)
{
    if (i == n)
        return  f&&(sum%DIV == 0);

    int &ret = mem[i][sum%DIV][f];
    int leng = 0;

    if (ret != -1)
      return ret;
   // cout<<i-1<<" "<<sum<<" "<<dig <<"  "<<f<<"\n";
    for (int j = 0; j<=9; j++)
    {
        leng += dp(i+1, sum+j, j<a[i] || (j == a[i] && f));
        leng %= mod;

    }
    return  ret = leng;
}

int main()
{
#ifdef Mohammad
    freopen("input.in","r",stdin);
#endif
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    cin >> s >>DIV;
    n = s.size();
    reverse(s.begin() , s.end());
    for (int i =0; i<s.size() ; i++)
        a[i] = s[i]-'0';

    memset(mem, -1, sizeof mem);
    // for (int i = 0 ;i<=a[0];i++)
    cout<<(((dp(0, 0, 1)-1)%mod + mod ) %mod);
//    cout<<ans;
}


Measured memory_bytes: 13184
#include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;++i)
#include<string>
using namespace std;
typedef long long ll;
//max=({});


int main() {
	ll n, m;
	cin >> n >> m;
	if (n == 1 && m == 1)cout << 1 << endl;
	else if (n == 1 && m != 1)cout << m - 2 << endl;
	else if (n != 1 && m == 1)cout << n - 2 << endl;
	else {
		ll ans = (n - 2) * (m - 2);
		cout << ans << endl;
	}
	return 0;
}


Measured memory_bytes: 256
#@hoshikawa1309
# dfsを用いて累積和を計算する
import sys
sys.setrecursionlimit(10 ** 6)
def input():#入力方法にも注意
    return sys.stdin.readline()[:-1]
N , Q = map(int,input().split())
graph = [[] for _ in range(N)]
point = [0] * N
for _ in range(N - 1):
    a , b = map(int,input().split())
    graph[a - 1].append(b - 1)
    graph[b - 1].append(a - 1)
for _ in range(Q):
    a , b = map(int,input().split())
    a = a - 1
    point[a] += b
# 初期状態だと前の値がないためデフォルト引数に-1を代入
def dfs(now , prev = -1):
    for next in graph[now]:#いま見ているノードから行けるノードをチェック
        # 次のノードが前に参照した値の時はcontinue、逆走防止
        if next == prev:
            continue
        # 現在の値を次のポイントに加算することで累積和をとる
        point[next] += point[now]#実質的な処理は、これだけ
        # 次のノードと現在のノードを引数にdfsを継続する
        dfs(next , now)
dfs(0)
print(*point)

Measured memory_bytes: 268572
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#define ll long long

int n;
int f[11234];

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

  for(int x=1;x<=100;x++){
    for(int y=1;y<=100;y++){
      for(int z=1;z<=100;z++){
	int tmp = x*x+y*y+z*z+x*y+y*z+z*x;
	if(tmp<=10000) f[tmp]++;
      }}}
  

  
  
  
  for(int i=1;i<=n;i++){
    printf("%d\n",f[i]);}
  
  return 0;
}


Measured memory_bytes: 1724
N = int(input())

L = list(map(int, input().split()))

data = sorted(L, reverse=True)
count_A = 0
count_B = 0

for i, d in enumerate(data):
    if i%2 == 0:
        count_A += d
    else:
        count_B += d
        
print(count_A - count_B)

Measured memory_bytes: 3060
import numpy as np
from functools import *
import sys
sys.setrecursionlimit(100000)


def gcd(a, b):
	while b:
		a, b = b, a % b
	return a


def acinput():
    return list(map(int, input().split(" ")))


def II():
    return int(input())

A,B,H,M=acinput()



theta2=2*np.pi*(M/60)
H+=(M/60)
theta1=(H%12)*2*np.pi*(30/360)

print(np.sqrt(A**2+B**2-2*A*B*np.cos(np.abs(theta1-theta2))))

#print(theta2/(2*np.pi),theta1/(2*np.pi))

Measured memory_bytes: 27208
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
 
int N, M;
vector<vector<int>> v(51);
 
int main(void){
	
	scanf("%d %d", &N, &M);
	for(int i = 0; i < M; ++i){
	    int a, b; scanf("%d %d", &a, &b);
	    v[a].push_back(b), v[b].push_back(a);
	}
	
	for(int i = 1; i <= N; ++i) printf("%d\n", (int)v[i].size());
	
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define int long long

const int N = 2e5 + 5;

int n, k;
int a[N];
bool vis[N];

int32_t main()
{
	IOS;
	cin >> n >> k;
	for(int i = 1; i <= n; i++)
		cin >> a[i];
	int take = min(k, 200000LL);
	k -= take;
	int cur = 1;
	while(take > 0)
	{
		cur = a[cur];
		take--;
	}
	if(k == 0)
	{
		cout << cur;
		return 0;
	}
	int len = 0;
	while(!vis[cur])
	{
		vis[cur] = 1;
		len++;
		cur = a[cur];
	}
	k %= len;
	while(k > 0)
	{
		cur = a[cur];
		k--;
	}
	cout << cur;
	return 0;
}


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

const long long MOD = 1000000007;
const long long INF = 1LL << 60;

int main()
{
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int N;
  cin >> N;
  int ans = (N + 1) / 2;
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#define fios ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
typedef long long ll;
#ifdef LOCAL
mt19937 rng(unsigned(70));
#else
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#endif
#define rand rng


int main() {
	// fios;
	string s;
	cin >> s;
	if(s == "ABC") puts("ARC");
	else puts("ABC");

}

Measured memory_bytes: 3632
#include <iostream>
#define int long long

using namespace std;

signed main() {
	int k;
	cin >> k;
	
	int i, hoge = 0;
	for (i = 1; i < 1000000; ++i) {
		hoge *= 10;
		hoge += 7;
		hoge %= k;
		if (hoge == 0) break;
	} 
	if (i < 1000000) cout << i << '\n';
	else cout << -1 << '\n';
	
	return 0;
}

Measured memory_bytes: 3644
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define zero_pad(num) setfill('0') << std::right << setw(num)
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;

int main() {
    ll n, m;
    cin >> n >> m;
    if(n == 1 && m == 1) cout << 1 << endl;
    else if(min(n, m) == 1) cout << max(n, m) - 2 << endl;
    else{
        cout << (n - 2) * (m - 2) << endl;
    }
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    // 入力
    try (Scanner sc = new Scanner(System.in);) {
      int a = sc.nextInt();
      int b = sc.nextInt();
      int c = sc.nextInt();

      int max = b / a;

      int answer = c < max ? c : max;
      System.out.println(answer);
    }
  }
}

Measured memory_bytes: 21588
n, k = map(int, input().split())

a = list(map(int, input().split()))

plus = -1
for i in range(n):
    if a[i] > 0:
        plus = i
        break
    plus = n    
record = 10**10
for i in range(k+1):
    if i>plus or k-i>n-plus:
        continue
    if i == 0:
        record = a[plus+k-i-1]
    elif i==k:
        r = -a[plus-i]
        if r<record:
            record = r
    else:
        u  = a[plus+k-i-1]
        v = -a[plus-i]
        r1 = 2*u+v
        r2 = 2*v+u
        if r1<record:
            record = r1
        if r2<record:
            record = r2
            
print(record)

Measured memory_bytes: 14664
#include<bits/stdc++.h>
#define ll long long
#define clr(x,i) memset(x,i,sizeof(x))
using namespace std;
const int N=200005;
const ll mod=1e9+7;
inline int read()
{
    int x=0,f=1; char ch=getchar();
    while(ch<'0'||ch>'9') {if(ch=='-') f=-1; ch=getchar();}
    while(ch>='0'&&ch<='9') {x=x*10+ch-'0',ch=getchar();}
    return x*f;
}
int n,m,s,a[N];
int main()
{
	n=read(); m=read();
	for(int i=1; i<=n; i++) a[i]=read(),s+=a[i];
	int cnt=0;
	for(int i=1; i<=n; i++){
		if(a[i]*4*m>=s) cnt++;
	}
	if(cnt>=m) puts("Yes");
	else puts("No");
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<stack>
#include<algorithm>
using namespace std;

bool barrier[2000][2000];
long long hist_barrier[2000][2001];
char S[2000][2001];

int main(){
    int H, W;
    cin >> H >> W;
    for(int i = 0; i < H; i++){
        cin >> S[i];
    }
    for(int h = 0; h < H - 1; h++){
        for(int w = 0; w < W - 1; w++){
            int cnt_black = 0;
            for(int i = 0; i < 4; i++){
                cnt_black += (S[h + (i / 2)][w + (i % 2)] == '#') ? 1 : 0;
            }
            barrier[h][w] = (cnt_black % 2 == 1);
        }
    }
    for(int h = 0; h < H; h++){
        hist_barrier[h][0] = h + 1;
    }
    for(int w = 0; w < W; w++){
        hist_barrier[0][w] = 1;
    }
    for(int h = 1; h < H; h++){
        for(int w = 1; w < W; w++){
            if(barrier[h-1][w-1]){
                hist_barrier[h][w] = 1;
            }else{
                hist_barrier[h][w] = hist_barrier[h-1][w] + 1;
            }
        }
    }

    long long ans = 0;
    for(int h = 0; h < H; h++){
        stack<pair<long long, int> > st;
        for(int w = 0; w < W + 1; w++){
            if(st.empty()){
                st.push(make_pair(h + 1, w));
            }else if(st.top().first > hist_barrier[h][w]){
                int last_pos;
                while(!st.empty() && st.top().first >= hist_barrier[h][w]){
                    ans = max(ans, (w - st.top().second) * st.top().first);
                    last_pos = st.top().second;
                    st.pop();
                }
                st.push(make_pair(hist_barrier[h][w], last_pos));
            }
            if(st.top().first < h + 1){
                st.push(make_pair(h + 1, w));
            }
        }
    }
    cout << ans << endl;

            
}


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

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
const int N = 2e5+5 ;
//😁😁😁😁😁😁😁😁😁😁😁

void Never_give_up()

{
     string s; cin>>s;

     if(s[s.size()-1]=='3') cout<<"bon";
     else if( s[s.size()-1]=='2' ||s[s.size()-1]=='4' ||s[s.size()-1]=='5'|| s[s.size()-1]=='7' || s[s.size()-1]=='9')
        cout<<"hon";
     else cout<<"pon";
}

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


Never_give_up();


 return 0;
}




Measured memory_bytes: 3612
// Problem : B - Postdocs
// Contest : AtCoder - NOMURA Programming Competition 2020
// URL : https://atcoder.jp/contests/nomura2020/tasks/nomura2020_b
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include<bits/stdc++.h>
#include<set>
#include<map>
#include<bitset>
#define rep(i,a,b)  for(i=a;i<b;i++)
#define Sort(a)	sort(a.begin(),a.end())
#define rev(a)	reverse(a.begin(),a.end())
#define all(a)	(a).begin(),(a).end()
#define vll vector<long long int>
#define lli long long int
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define db double
#define M 1000000007
#define pi 3.1415926535897932384626433832795028841971
#define INF 1e18

#define MAX 200005

using namespace std;
lli min(lli a,lli b){return a<b?a:b;}
lli min(lli a,lli b,lli c){a=min(a,b);a=min(a,c);return a;}
lli max(lli a,lli b){return a>b?a:b;}
lli max(lli a,lli b,lli c){a=max(a,b);a=max(a,c);return a;}
lli dsum(lli n){lli ans=0;while(n){ans+=(n%10);n/=10;}return ans;}
lli power(lli a,lli b){lli res=1;while(b){if(b&1) res=res*a;a=a*a;b>>=1;}return res;}
lli Ceil(lli a,lli b){lli res=a/b;if(a%b!=0)	res++;return res;}

template<typename T>istream &operator>>(istream &is, vector<T> &v) { for (T &t : v) is >> t; return is; }
template<typename T>ostream &operator<<(ostream &os, const vector<T> &v) { for (const T &t : v) {os << t <<" ";} os << '\n'; return os; }

struct pll{
	lli x,y;
};
bool comp(pll a,pll b){
	if(a.x==b.x)	return a.y<b.y;
	else	return a.x<b.x;
}
void solve(lli the)
{
	char ch;
	db aa,bb,cc,dd,xx;
	string s1,s2,s3,str;
    lli i,j,k,a,b,c,d,n,m,l,r,x,y,z,low,high,mid,sum=0,ans=0,temp,t;
    cin >> s1;
    n=s1.length();
    for(i=0;i<n;i++){
    	if(s1[i]=='?')	s1[i]='D';
    }
    cout<<s1;
    
    
}













int main()
{
	long long int t=1,c=1;
	// scanf("%lld",&t);
	while(t--){
		solve(c);
		c++;
	}
	return 0;
}
/* UJJWAL KESHRI */

Measured memory_bytes: 3704
#include<bits/stdc++.h>
#include<iostream>
#include<fstream>
#define ll long long
using namespace std;

int main(){
    int N, M;
    cin >> N >> M;
    vector<int> cnt(N+2,0);
    for(int i=0; i<M; i++){
        int L, R;  cin >> L >> R;
        cnt[L]++;
        cnt[R+1]--;
    }
    for(int i=1; i<N+2; i++){
        cnt[i] += cnt[i-1];
    }

    int ans = 0;
    for(int i=1; i<=N; i++){
        if(cnt[i]==M){
            ans++;
        }
    }
    cout << ans << endl;
}


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

int main(void){

  int i,j;
  char str[1000][32];
  int num[1000];
  int maxlen;
  int maxnum;
  int fre;
  int frenum;
  int len;

  for(i=0;i<1000;i++)num[i] = 1;

  i = 0;
  maxlen = 0;

  while(fscanf(stdin,"%s ",str[i]) != EOF){
    len = strlen(str[i]);
    if(maxlen < len){
      maxlen = len;
      maxnum = i;
    }
    for(j=0;j<i;j++){
      if( !strcmp(str[i],str[j]) ){
	num[j]++;
	i--;
	break;
      }
    }
    i++;
  }

  fre = 0;
  for(j=0;j<i;j++){
    if(fre < num[j]){
      fre = num[j];
      frenum = j;
    }
  }

  printf("%s %s\n",str[frenum],str[maxnum]);

  return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
#define ll long long

#define INF 999999999

using namespace std;

// input
string a, b, c;

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

    cin >> a >> b >> c;

    if(a[a.length()-1] == b[0] && b[b.length()-1] == c[0]){
        cout << "YES" << "\n";
    }
    else{
        cout << "NO" << "\n";
    }

    
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Text;

namespace AtCoder
{
  class Program
  {
    static void Main(string[] args)
    {
      string[] ss = Console.ReadLine().Split(' ');
      long a = long.Parse(ss[0]);
      long b = long.Parse(ss[1]);
      long c = long.Parse(ss[2]);
      long d = a % b;
      long amount = 0;
      for(int i = 0; i < b; i++)
      {
        amount += d;
        if(amount >= b)
          amount = amount % b;
        if(amount == c)
        {
          Console.WriteLine("YES");
          Console.ReadLine();
          return;
        }
      }

      Console.WriteLine("NO");
      Console.ReadLine();
    }

  }
}

Measured memory_bytes: 27284
N, K = map(int, input().split())

# 確率
per = 0

for i in range(N):
	# 初期値
	tmp_val = i + 1

	# Kを超えたら終了
	tmp_cnt = 0
	while(tmp_val < K):
		tmp_val *= 2
		tmp_cnt += 1
	
	per += 1 / (N * 2**tmp_cnt)

print(per)

Measured memory_bytes: 2940
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

class Program
{
    void Calc()
    {
        var sc = new Scanner();
        int a = sc.NextInt();
        int b = sc.NextInt();
        Console.WriteLine(a*b +" "+(a+b)*2 );

    }

    static void Main()
    {
        new Program().Calc();
    }

    class Scanner
    {
        string[] s = new string[0];
        int i = 0;
        char[] cs = new char[] { ' ' };

        public string Next()
        {
            if (i < s.Length) return s[i++];
            s = Console.ReadLine().Split(cs, StringSplitOptions.RemoveEmptyEntries);
            i = 0;
            return s[i++];
        }
        public int NextInt() { return int.Parse(Next()); }
       public long NextLong() { return long.Parse(Next()); }
        public double NextDouble() { return double.Parse(Next()); }
    }
}

Measured memory_bytes: 5604
#include <bits/stdc++.h>
using namespace std;
long long gcd (long long x, long long y) {
    if (x < y) swap(x, y);
    if (y == 0) return x;
    return gcd(x % y, y);
}
long long lcm (long long x, long long y) {
    return x/gcd(x, y)*y;
}

int main() {
    int N;
    cin >> N;
    long long  ans;
    cin >> ans;
    for(int i = 0; i < N-1; i++) {
        long long T;
        cin >> T;
        ans = lcm(ans, T);
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
#include <cstdio>



int count[10][10];
int N;


int main(){
    scanf("%d",&N);

    for(int i=1;i<=N;i++){
        int lsb=i%10,msb;
        int temp=i;
        while(temp>=10) temp/=10;
        msb=temp;
        count[msb][lsb]++;
    }

    int ans=0;
    for(int i=1;i<=9;i++){
        for(int j=1;j<=9;j++){
            ans+=(count[i][j]*count[j][i]);
        }
    }

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


    return 0;
}

Measured memory_bytes: 1700
#include <algorithm>
#include <iostream>
#include <vector>
#include <numeric>

int main()
{
    int N;
    std::cin >> N;
    std::vector<int> ps{};
    for (int i = 0; i < N; i++) {
        int p;
        std::cin >> p;
        ps.emplace_back(p);
    }
    std::cout << std::accumulate(ps.begin(), ps.end(), 0) - (*std::max_element(ps.begin(), ps.end())) / 2 << std::endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, a, b) for(ll i = ll(a); i < ll(b); i++)
#define rer(i, a, b) for(ll i = ll(a) - 1; i >= ll(b); i--)
#define sz(v) (int)(v).size()
#define pb push_back
#define sc second
#define fr first
#define sor(v) sort(v.begin(),v.end())
#define rev(s) reverse(s.begin(),s.end())
#define lb(vec,a) lower_bound(vec.begin(),vec.end(),a)
#define ub(vec,a) upper_bound(vec.begin(),vec.end(),a)
#define uniq(vec) vec.erase(unique(vec.begin(),vec.end()),vec.end())
using namespace std;
class ParseError {};
typedef long long int ll;
typedef pair <int, int> P;

vector<string> v;
int n;
int getlevel(string s){
    rep(i,0,s.length()){
        if(s[i]!='.') return i;
    }
    return 0;
}
char get(string s){
    return s[getlevel(s)]=='+'||s[getlevel(s)]=='*';
}
ll solve(char c, int &x, int level) {
    ll ret;
    if(c=='*'){
        ret=1;
        while(x<=n-1&&getlevel(v[x])>level){
            if(get(v[x])){
                if(v[x][getlevel(v[x])]=='+') ret*=solve('+', ++x ,level+1);
                else ret*=solve('*', ++x,level+1);
            }
            else{
                ret*=v[x][getlevel(v[x])]-'0';
                x++;
            }
        }
        return ret;
    }
    else{
        ret=0;
        while(x<=n-1&&getlevel(v[x])>level){
            if(get(v[x])){
                if(v[x][getlevel(v[x])]=='+') ret+=solve('+', ++x,level+1);
                else ret+=solve('*',++x,level+1);
            }
            else{
                ret+=v[x][getlevel(v[x])]-'0';
                x++;
            }
        }
        return ret;
    }
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    for(;;){
        cin>>n;
        if(!n) return 0;
        v.clear();
        v.resize(n);
        rep(i,0,n) cin>>v[i];
        int x=1, level=0;
        if(n==1) cout<<v[0]<<"\n";
        else{
            if(v[0]=="*") cout<< solve('*', x, level) <<"\n";
            else cout<<solve('+',x,level)<<"\n";
        }
    }
}


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

#define _USE_MATH_DEFINES
#include<cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <deque>
#include <algorithm>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <iterator>
#include<iomanip>
#include<unordered_set>
#include<bitset>
#include<complex>

using namespace std;

#define rep(i,a,b) for(int i=(a), i##_len=(b);i<i##_len;i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)

#define int ll
#define SZ(x) ((int)(x).size())
#define pb push_back
#define mp make_pair

//typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<double, double> pdd;
typedef vector< vector<int> > mat;

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

const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD =  (int)1e9 + 7;
const double EPS = 1e-9;

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

	string S;
	cin >> S;

	map<char, int> cmap;
	rep(i, 0, SZ(S))
	{
		cmap[S[i]]++;
	}

	bool ok = true;
	for (auto p : cmap)
	{
		if (p.second % 2 == 1)ok = false;
	}

	if (ok)
	{
		cout << "Yes" << endl;
	}
	else
	{
		cout << "No" << endl;
	}

	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <string.h>
#include <vector>
#include <queue>
#include <cmath>
#include <bitset>
#include <complex>
#include <functional>
#include <numeric>
#include <iomanip>

#define SPBR(w, n) std::cout<<(w + 1 == n ? '\n' : ' ');
#define YES cout << "YES" << endl
#define Yes cout << "Yes" << endl
#define NO cout << "NO" << endl
#define No cout << "No" << endl
#define ALL(i) (i).begin(), (i).end()
#define FOR(i, a, n) for(int i=(a);i<(n);++i)
#define RFOR(i, a, n) for(int i=(n)-1;i>=(a);--i)
#define REP(i, n) for(int i=0;i<int(n);++i)
#define RREP(i, n) for(int i=int(n)-1;i>=0;--i)
#define IN(a, x, b) (a<=x && x<b)
#define OUT(a, x, b) (x<a || b<=x)
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; }

#define int ll
using ll = long long;
using ull = unsigned long long;
using ld = long double;
const int MOD = 1000000007;
/* const int MOD = 998244353; */
const int INF = 1e18;
const double PI = acos(-1);

using namespace std;
struct INIT { INIT(){
  cin.tie(0); ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);
}}INIT;


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

  bool ans = false;
  int now = 0;
  REP(i, N){
    int a, b;
    cin >> a >> b;

    if(a == b) now++;
    else now = 0;

    if(now >= 3) ans = true;
  }

  if(ans) Yes;
  else No;

  return 0;
}


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

string S;
int main(){
	cin >> S;
	long long pat1 = 0; //010101
	long long pat2 = 0; //101010
	for(long long i = 0; i < S.size(); i++){
		if(i%2 == 0){
			if(S[i] == '1'){
				pat1++;
			}else{
				pat2++;
			}
		}else{
			if(S[i] == '1'){
				pat2++;
			}else{
				pat1++;
			}
		}
	}
	cout << min(pat1, pat2) << endl;

}


Measured memory_bytes: 512
import java.util.*;
import java.math.BigDecimal;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long k = sc.nextLong();
        
        if(n%k == 0){
            System.out.println(0);
        }
        else{
            n = n % k;
            if(n > Math.abs(n-k)){
                System.out.println(Math.abs(n-k));
            }
            else{
                System.out.println(n);
            }
        }
    }
}

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

ll C[60][60]={};
ll com(int n, int r){
    if(C[n][r]!=0) return C[n][r];
    else if(n==r || r==0) return C[n][r]=1;
    else if(r==1 || r==n-1) return C[n][r]=n;
    else return  C[n][r] = C[n][n-r] = com(n-1,r-1) + com(n-1,r);
}

int main(void){
    int N,P,A;
    ll even=0,odd;
    cin>>N>>P;
    rep(i,N){
        cin>>A;
        if(A%2==0)even++;
    }
    ll oddsum=0,evensum=0;
    odd = N-even;
    if(P==0){
        for(int i=0;i*2<=odd;i++){
            oddsum += com(odd,i*2);
        }
        for(int i=0;i<=even;i++){
            evensum += com(even,i);
        }
    }else{
        for(int i=0;i*2+1<=odd;i++){
            oddsum += com(odd,i*2+1);
        }
        for(int i=0;i<=even;i++){
            evensum += com(even,i);
        }
    }
    cout<<evensum*oddsum<<endl;

    return 0;
}


Measured memory_bytes: 256