akhauriyash/Code-Regression huggingface dataset:
using System;
using System.Collections.Generic;
using System.Linq;

public static partial class Program
{
    public static void Main()
    {
        var ks = CRL().ArrayInts();
        var k = ks[0];
        var s = ks[1];

        var count = 0;
        for (int x = 0; x <= k; x++)
        {
            for (int y = 0; y <= k; y++)
            {
                var z = s - x - y;
                if (z >= 0 && z <= k)
                {
                    count++;
                }
            }
        }

        CWL(count);
    }
}

public static partial class Program
{
    //テンプレここから
    public static int ToInt(this double d) => (int) d;
    public static long ToLong(this double d) => (long) d;
    public static int ToInt(this string str) => int.Parse(str);
    public static long ToLong(this string str) => long.Parse(str);
    public static long[] ToLong(this IEnumerable<string> strs) => strs.Select(x => x.ToLong()).ToArray();
    public static int[] ToInt(this IEnumerable<string> strs) => strs.Select(x => x.ToInt()).ToArray();
    public static long[] ArrayLongs(this string str, char opr = ' ') => str.Split(opr).ToLong();
    public static int[] ArrayInts(this string str, char opr = ' ') => str.Split(opr).ToInt();
    public static string CRL() => Console.ReadLine();
    public static void CWL(object obj) => Console.WriteLine(obj);
    public static long Diff(long a, long b) => Math.Abs(Math.Max(a, b) - Math.Min(a, b));
    public static int Diff(int a, int b) => Math.Abs(Math.Max(a, b) - Math.Min(a, b));
    public static long Sign(this long i) => Math.Sign(i);
    public static bool IsEven(this long i) => i % 2 == 0;
    public static bool IsEven(this int i) => i % 2 == 0;
    public static long[] dx = new long[] {0, -1, 0, 1};
    public static long[] dy = new long[] {-1, 0, 1, 0};
    public static long mod = 1000000007;
    public static string alphabet = "abcdefghijklmnopqrstuvwxyz";
    public static long ToLong(this char c) => c.ToString().ToInt();
    public static long[] Sort(this long[] array) => array.OrderBy(x => x).ToArray();
    public static int[] Sort(this int[] array) => array.OrderBy(x => x).ToArray();
    public static long[] DSort(this long[] array) => array.OrderByDescending(x => x).ToArray();
    public static int[] DSort(this int[] array) => array.OrderByDescending(x => x).ToArray();
    public static string Join(this IEnumerable<string> array, string sep = "") => string.Join(sep, array);
    public static string Join(this IEnumerable<char> array, string sep = "") => string.Join(sep, array);
    public static long GCD(long a, long b) => b == 0 ? a : GCD(b, a % b);

    public static long LCM(long a, long b) => a * b / GCD(a, b);

    //テンプレここまで
}

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

#define debug(var)  do{std::cout << __LINE__ << "> " << #var << ": ";view(var);}while(0)
template<typename T> void view(T e){std::cout << e << std::endl;}
template<typename T> void view(const std::vector<T>& v){for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void view(const std::vector<std::vector<T> >& vv){ for(const auto& v : vv){ view(v); } }

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 namespace std;
using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vector<int>>;
using vvl = vector<vector<ll>>;

void Main() {
	int N; cin >> N;
	string c; cin >> c;
	vi w, r;
	REP(i,N) {
		if (c[i] == 'W') w.push_back(i);
		if (c[i] == 'R') r.push_back(i);
	}
	reverse(ALL(r));
	int ans = 0;
	REP(i,w.size()) {
		if (i >= r.size() || r[i] < w[i]) break;
		++ans;
	}
	cout << ans << endl;
}

int main() {
    cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	Main();
}


Measured memory_bytes: 4824
#include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>

using namespace std;

const int dy[]={1,0,1,-1,0,-1};
const int dx[]={0,1,1,0,-1,-1};
bool passed[20][20];
int n,c;
int field[12][12];

void dfs(int y,int x,int id,int &cnt,bool &ok){
    // eÓÖÚ®
    for(int i = 0; i < 6; i++){
        int ny=y+dy[i];
        int nx=x+dx[i];
        if(ny>=0&&nx>=0&&ny<n&&nx<ny+1&&!passed[ny][nx]){
            if(field[ny][nx]==id){
                passed[ny][nx]=true;
                cnt++;
                dfs(ny,nx,id,cnt,ok);
            }
            // óÌêÆ×Ú
            else if(field[ny][nx]==0){
                ok=true;
            }
        }
    }
}


int cntScore(){
    int res=0;
    for(int i = 0; i < n; i++){
        for(int j = 0; j < i+1; j++){
            if(!passed[i][j]&&field[i][j]!=0){
                passed[i][j]=true;
                int cnt=1;
                bool adjEmp=false;
                dfs(i,j,field[i][j],cnt,adjEmp);
                // íÎÛ
                if(!adjEmp){
                    if(field[i][j]==c)
                        res-=cnt;
                    else
                        res+=cnt;
                }
            }
        }
    }
    return res;
}

int main(){
    while(cin>>n>>c&&!(n==0&&c==0)){

        for(int i = 0; i < n; i++)
            for(int j = 0; j < i+1; j++)
                cin>>field[i][j];
        // ·×ÄÌ¨«ûð·
        int maxScore=-10000;
        for(int i = 0; i < n; i++){
            for(int j = 0; j < i+1; j++){
                if(field[i][j]==0){
                    memset(passed,0,sizeof(passed));
                    field[i][j]=c;
                    maxScore=max(maxScore,cntScore());
                    field[i][j]=0;
                }
            }
        }
        cout<<maxScore<<endl;
    }
    return 0;
}

Measured memory_bytes: 0
#include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;

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

int r0, w0, c, r, x;
double y;

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

    while (cin >> r0 >> w0 >> c >> r, r0 | w0 | c | r) {
        for (int i = 0; ; ++i) {
            y = (r0 + i*r) / c - w0;
            if (y >= 0.0) {
                cout << i << endl;
                break;
            }
        }
    }

    return 0;
}

Measured memory_bytes: 3108
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<(n); ++i)
#define chmin(x,y) x = min(x,y)
#define chmax(x,y) x = max(x,y)
using namespace std;
typedef long long ll;
typedef pair<int, int> P; 
const int inf = 1<<21;
const ll INF = 1LL << 60;
const ll mod = 1e9+7;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, -1, 0, 1};

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    double r;
    cin >> r;
    cout << setprecision(15) << 2*r*M_PI << endl;
    return 0;
}

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

int main(){
    int n, m;
    cin >> n >> m;
    int ans[51] = {};
    for (int i = 0; i < m; i++){
        int a, b;
        cin >> a >> b;
        ans[a]++;
        ans[b]++;
    }
    for (int i = 1; i <= n; i++){
        cout << ans[i] << endl;
    }
    
}

Measured memory_bytes: 3160
using System;
using System.Collections.Generic;
using System.Linq;
using static System.Console;
using static System.Convert;
using static System.Math;
//using static System.Globalization.CultureInfo;

class Program
{
    static void Main(string[] args)
    {
        var nab = Input.arL;
        if(nab[1]>nab[2]||nab[0]==1)
        {
            WriteLine(ToInt32(nab[1] == nab[2]));
            return;
        }
        WriteLine((nab[2] - nab[1]) * (nab[0] - 1) + nab[1] - nab[2] + 1);
    }
}

public class Input
{
    public static string read => ReadLine();
    public  static int[] ar => Array.ConvertAll(read.Split(' '), int.Parse);
    public  static int num => ToInt32(read);
    public  
static long[] arL => Array.ConvertAll(read.Split(' '), long.Parse);
    public  static long numL => ToInt64(read);
    public static int[][] twodim(int num)
        => Enumerable.Repeat(0, num).Select(v => ar).ToArray();
    public static long[][] twodimL(int num)
        => Enumerable.Repeat(0, num).Select(v => arL).ToArray();
    public  const string Alfa = "abcdefghijklmnopqrstuvwxyz";
    public  const int MOD = 1000000007;
}


Measured memory_bytes: 11220
N = int(input())
A = sorted(list(map(int, input().split())))
absA = [abs(a) for a in A]
if 0 in A:
    print(sum(absA))
else:
    num_minus = 0
    for a in A:
        if a < 0:
            num_minus += 1
        else:
            break

    if num_minus % 2 == 0:
        print(sum(absA))
    else:
        print(sum(absA) - 2 * min(absA))


Measured memory_bytes: 64752
import java.util.Scanner;

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

        String s = scanner.next();

        boolean alike = s.charAt(2) == s.charAt(3) && s.charAt(4) == s.charAt(5);
        System.out.println(alike ? "Yes" : "No");
    }
}


Measured memory_bytes: 21332
#include<cstdio>
#include<algorithm>
#include<cstring>
#define MN 405
using namespace std;
typedef long long ll;
int n,m,a[MN],b[MN];
ll f[MN][MN],g[MN][MN];
const int mod=1e9+7;
int pow(int x,int y){
	int tmp=1;
	while(y){
		if(y&1)tmp=1ll*tmp*x%mod;
		x=1ll*x*x%mod,y>>=1;
	}return tmp;
}
int main(){
	for(int i=0;i<=400;i++){f[i][0]=1;for(int j=1;j<=400;j++)f[i][j]=(f[i][j-1]+pow(j,i))%mod;}
	scanf("%d%d",&n,&m);
	for(int i=1;i<=n;i++)scanf("%d",&a[i]);
	for(int i=1;i<=n;i++)scanf("%d",&b[i]);g[0][0]=1;
	for(int i=1;i<=n;i++){
		for(int j=0;j<=m;j++)
			for(int k=0;k<=j;k++)g[i][j]+=g[i-1][k]*(f[j-k][b[i]]-f[j-k][a[i]-1])%mod,g[i][j]%=mod;
	}printf("%lld\n",(g[n][m]%mod+mod)%mod);
}

Measured memory_bytes: 2816
import java.util.*;
import java.io.*;
public class Main
{
    public static void main(String arggs[])throws Exception
    {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        PrintWriter pw=new PrintWriter(System.out);
        //int n=Integer.parseInt(br.readLine());
        //int arr[]=new int[n];
        String str[]=br.readLine().split(" ");
        //for(int i=0;i<n;i++)
        //arr[i]=Integer.parseInt(str[i]);
        int l=Integer.parseInt(str[0]);
        int r=Integer.parseInt(str[1]);
        int d=Integer.parseInt(str[2]);
        int cntr=0;
        for(int i=l;i<=r;i++)
        if(i%d==0)
        cntr++;
        pw.println(cntr);
        pw.flush();
        pw.close();
    }
}

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

#define TYPE(c)   remove_reference_t<decltype(c)>
#define REP(i, n) for(TYPE(n) i = 0; i < n; i++)
#define FOR(v, c) for(TYPE(c.begin()) v = c.begin(); v != c.end(); v++)
#define ALL(c)    c.begin(), c.end()
#define SORT(c)   sort(ALL(c))
#define RSORT(c)  sort(ALL(c), greater<TYPE(c)::value_type>())
#define UNIQUE(c) c.erase(unique(ALL(c)), c.end())

using namespace std;
using ll = long long;

constexpr int MOD  = (int)1e9 + 7;
constexpr int INF  = (int)1e9 + 1;
constexpr ll  LINF = (ll)1e18 + 1;
template<typename T> constexpr bool chmax(T& a, const T& b)
{ if(a < b) { a = b; return true; } else { return false; } }
template<typename T> constexpr bool chmin(T& a, const T& b)
{ if(b < a) { a = b; return true; } else { return false; } }
template<typename S, typename T> ostream& operator<<(ostream &os, const pair<S, T>& p)
{ return os << "(" << p.first << "," << p.second << ")"; }
ostream& operator<<(ostream &os, const string& s)
{ FOR(v, s) os << *v; return os; }
template<typename T> auto operator<<(ostream& os, const T& t)
    -> typename conditional<true, ostream&, decltype(*t.begin())>::type
{ os << "["; FOR(v, t) { if(v != t.begin()) os << ","; os << *v; } os << "]"; return os; }

class CombinationCalculator {
    using ull = unsigned long long;
public:
    /**
     *  組み合わせの数を求めるクラス
     *  @n_max: $ {}_n C_r $ における $ {}_n $ の最大値
     *  @mod:   組み合わせの数に対して取るMODの値
     */
    explicit CombinationCalculator(const ull& n_max,
                                   const ull& mod = (int)1e9 + 7):
        m_((mod != 0) ? mod : std::numeric_limits<uint>::max()),
        fact_(n_max + 1, 0),
        inv_fact_(n_max + 1, 0),
        inv_(n_max + 1, 0) {
        std::fill(fact_.begin(), fact_.begin() + 2, 1);
        std::fill(inv_fact_.begin(), inv_fact_.begin() + 2, 1);
        std::fill(inv_.begin(), inv_.begin() + 2, 1);
        for(ull i = 2; i <= n_max; i++) {
            fact_[i]     = (fact_[i - 1] * i) % m_;
            inv_[i]      = m_ - inv_[m_ % i] * (m_ / i) % m_;
            inv_fact_[i] = inv_fact_[i - 1] * inv_[i] % m_;
        }
    }

    /**
     *  $ {}_n C_r $ を求める
     *  @n:      $ {}_n $ の値
     *  @k:      $ {}_r $ の値
     *  @Return: $ {}_n C_r $
     */
    ull run(const ull& n,
            const ull& r) {
        if(n < r) {
            return 0;
        }
        else {
            return fact_[n] * (inv_fact_[r] * inv_fact_[n - r] % m_) % m_;
        }
    }

    ull m_;
    std::vector<ull> fact_;
    std::vector<ull> inv_fact_;
    std::vector<ull> inv_;
};

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

    ll N, M;
    std::cin >> N >> M;

    CombinationCalculator c(max(N, M));

    if(1 < abs(N - M)) {
        std::cout << 0 << std::endl;
    }
    else {
        std::cout << (((c.fact_[N] * c.fact_[M]) % MOD) * ((N == M) ? 2 : 1)) % MOD << std::endl;
    }

    return 0;
}


Measured memory_bytes: 2560
import sys

sys.setrecursionlimit(10 ** 9)

N = int(input())
T = [[] for _ in range(N)]
for i in range(1, N):
    x = int(input()) - 1
    T[x].append(i)


def f(x):
    candidates = sorted([f(y) for y in T[x]], reverse=True)
    return max((c + i for i, c in enumerate(candidates, 1)), default=0)


print(f(0))


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

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

  long long N;
  cin >> N;
  vector<long long> A(N);
  for(int i = 0; i < N; ++i) {
    cin >> A[i];
    if(A[i] == 0) {
      cout << 0 << endl;
      return 0;
    }
  }

  long long ans = 1;
  for(int i = 0; i < N; ++i) {
    if(A[i] <= 1000000000000000000 / ans) {
      ans *= A[i];
    }
    else {
      cout << -1 << endl;
      return 0;
    }
  }
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 3992
#include <iostream>
#include <stdlib.h>

using namespace std;

int main() {

	int n;
	int *array;

	cin >> n;
	array = (int *)malloc(sizeof(int) * n);
	if (array == NULL) {
		cout << "malloc null" << endl;
		exit(1);
	}

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

	for (int i = n-1; i >=0; i--) {
		cout << array[i];
		if (i != 0) {
			cout << " ";		
		}
	}
	//cout << "end" << endl;

	cout << endl;

	free(array);

	return 0;
}

Measured memory_bytes: 3108
n,m,x=map(int,input().split())
num=[]
c=[]
for i in range(n):
    c1=list(map(int,input().split()))
    c.append(c1.pop(0))
    num.append(c1)
ans=sum(c)+100
for i in range(2**n):
    num1=[0]*m
    num2=[]
    num3=0
    for j in range(n):
        if (i>>j) & 1:
            for k in range(m):
                num1[k]+=num[j][k]
            num2.append(j)
    if min(num1)>=x:
        for j in range(len(num2)):
            num3+=c[num2[j]]
        ans=min(ans,num3)
if ans==sum(c)+100:
    print(-1)
else:
    print(ans)


Measured memory_bytes: 8908
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<math.h>
#define Lens 1000
#define Maxi 10005

using namespace std;
int N,mini;
int A[Lens], B[Lens],C[Maxi];
bool V[Lens];

int solve()
{
	int total=0;
	for (int i = 0; i < N; i++)
	{
		B[i] = A[i];
		V[i] = false;
	}
	sort(B, B + N);
	mini = B[0];
	for (int i = 0; i < N; i++)
	{
		C[B[i]] = i;
		if (B[i] == A[i]) V[i] = true;
	}
	for (int i = 0; i < N; i++)
	{
		while (V[i] == false)
		{
			int tmp = A[i];
			int min_tmp;
			int next = C[A[i]];
			int sum =A[i];
			int n = 0;
			V[i] = true;
			min_tmp= min(A[i], A[next]);
			while (!V[next])
			{
				n++;
				V[next] = true;
				sum = sum + A[next];
				if (A[next] < min_tmp) 
					min_tmp = A[next];
				next= C[A[next]];
			}
			total = total + min(sum + (n - 1)*min_tmp, sum + min_tmp + (n + 2)*mini);
		}
		
	}
	return total;
}

int main()
{
	cin >> N;
	for (int i = 0; i < N; i++)
	{
		cin >> A[i];
	}
	int s = solve();
	cout << s << endl;
	return 0;
}


Measured memory_bytes: 3160
from collections import deque
n,q=map(int,input().split())
queue=deque([])
for _ in range(n):
  n,t=input().split()
  t=int(t)
  queue.append([n,t])
now=0
while queue:
  if queue[0][1]<=q:
    now+=queue[0][1]
    name=queue[0][0]
    queue.popleft()
    print(name,now)
  else:
    now+=q
    n,t=queue.popleft()
    t-=q
    queue.append([n,t])


Measured memory_bytes: 13280
#define _USE_MATH_DEFINES 
#include <iomanip> 
#include <cmath>  
#include<iostream>
#include <fstream>
#include<vector>
#include<algorithm>
#include<bitset>
#include<map>
#include<queue>
#include<stack>
using namespace std;
typedef long long ll;
#define repi(i,a,b) for(ll i = (ll)(a) ; i < (ll)(b) ; i++)
#define repd(i,a,b) for(ll i = (ll)(a) ; i > (ll)(b) ; i--)
#define rd(x) cin >> x
#define wr(x)  cout << x
#define wrln(x) cout << x << endl


int main() {
	string str1, str2;
	rd(str1);
	rd(str2);
	if (str1[0] == str2[2] && str1[1] == str2[1] && str1[2] == str2[0]) wrln("YES");
	else wrln("NO");
	return 0;
}

Measured memory_bytes: 256
using System;

public class Program
{
	public static void Main()
	{
		string line = Console.ReadLine();
		for (int i = 1; i < line.Length; i++)
		{
			if (line[i] == line[i - 1])
			{
				Console.WriteLine("{0} {1}", i, i + 1);
				return;
			}
			if (i > 1 && line[i] == line[i - 2])
			{
				Console.WriteLine("{0} {1}", i - 1, i + 1);
				return;
			}
		}
		Console.WriteLine("-1 -1");
	}
}

Measured memory_bytes: 3032
def main():
    footing, next_range = map(int, input().split())
    height = list(map(int, input().split()))
    result = abs(height[-1] - height[0])
    if next_range < footing:
        answer = [float("inf")] * footing
        answer[0] = 0
        answer[1] = abs(height[1] - height[0])
        for i in range(footing):
            for j in range(1, next_range + 1):
                answer[i] = min(answer[i], answer[i - j] + abs(height[i] - height[i - j]))
        result = answer[-1]
    print(result)


if __name__ == '__main__':
    main()



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

int main(){
    int n;
    cin >> n;
    vector<int> v;
    for(int i=0; i<n; i++){
        int aa;
        cin >> aa;
        v.push_back(aa);
    }
    decltype(v)::iterator result = unique(v.begin(), v.end());

    // [v.begin(), result)の範囲に、重複を除いた結果が入っている。
    // 不要になった要素を削除
    v.erase(result, v.end());

    for(int i=0; i<v.size()-1; i++) {
        cout << v[i] << " ";
    }
    cout << v.back() << endl;
    return 0;
}


Measured memory_bytes: 3524
use proconio::input;
use proconio::marker::Chars;
use std::cmp::min;

fn main() {
    input! {
        s: Chars,
        t: Chars,
    }

    let mut change = 10000;

    for i in 0..=s.len() - t.len() {
        let mut matched = 0;
        for j in 0..t.len() {
            if t[j] == s[j + i] {
                matched += 1;
            }
        }
        change = min(t.len() - matched, change);
    }

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


Measured memory_bytes: 2164
package main

import (
	"fmt"
	"sort"
)

func main() {
	var s, t string
	fmt.Scan(&s, &t)
	sr := make([]int, len(s))
	tr := make([]int, len(t))
	for i, v := range s {
		sr[i] = int(v)
	}
	for i, v := range t {
		tr[i] = int(v)
	}
	sort.Ints(sr)
	sort.Sort(sort.Reverse(sort.IntSlice(tr)))
	for i := 0; i < len(sr) && i < len(tr); i++ {
		if sr[i] < tr[i] {
			fmt.Println("Yes")
			return
		}
		if sr[i] > tr[i] {
			fmt.Println("No")
			return
		}
	}
	if len(sr) < len(tr) {
		fmt.Println("Yes")
		return
	}
	fmt.Println("No")
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int n;
ll a, b, c, d, ans;
int main()
{
	cin >> n >> a >> b;
	b += a;
	for(int i = 3; i <= n; ++i)
	{
		ll val;
		cin >> val;
		c ^= val;
	}
	if(b < c || ((b - c) & 1))
	{
		puts("-1");
		return 0;
	}
	d = (b - c) / 2;
	if((d & c) || d > a)
	{
		puts("-1");
		return 0;
	}
	ans = d;
	for(int i = 40; ~i; --i)
	{
		if(d & (1ll << i)) continue;
		if(c & (1ll << i))
		{
			if(ans + (1ll << i) <= a)
				ans += 1ll << i;
		}
	}
	if(!ans) puts("-1");
	else cout << a - ans << endl;
	return 0;
}

Measured memory_bytes: 3636
import java.util.*;
 

public class Main {
    public static void main(String[] args) {   
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();
        int X = 1;
        
        for(int i=0; i<N; i++){
        if(X*2>X+K)
         X += K;
         else
         X *= 2;
        }

        System.out.println(X);
    }    
}




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


void main() {
    int n;
    scan(n);
    auto a = readln.split.to!(int[]);
    auto b = a.group.array;
    debug {
        writeln(b);
    }
    int ans;
    foreach (bi ; b) {
        ans += bi[1] / 2;
    }
    writeln(ans);
}









































void scan(T...)(ref T args) {
    import std.stdio : readln;
    import std.algorithm : splitter;
    import std.conv : to;
    import std.range.primitives;

    auto line = readln().splitter();
    foreach (ref arg; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront();
    }
    assert(line.empty);
}



void fillAll(R, T)(ref R arr, T value) {
    static if (is(typeof(arr[] = value))) {
        arr[] = value;
    }
    else {
        foreach (ref e; arr) {
            fillAll(e, value);
        }
    }
}


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

void solve(){
	
	int n,k ;
	cin>>n>>k ;

	int h[n] ;

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

	}

	int dp[n] ;
	memset(dp,0,sizeof(dp)) ;

	dp[0]=0 ;

	int count=1 ;

	while(count<k && count<n){

		dp[count]=abs(h[count]-h[0]) ;
		count++ ;
	}


	for(int i=k;i<n;i++){
		dp[i]=INT_MAX ;
		int count1=0 ;
		for(int j=i-1;j>=0 && count1<k;j--){
			{dp[i]=min(dp[j]+abs(h[i]-h[j]),dp[i]) ;
			count1++ ; 
			}
		}
	}

	/*
	for(int i=0;i<n;i++){
		cout<<dp[i]<<" " ;
	}
	
	cout<<"\n" ;
	*/
	cout<<dp[n-1] ;
}

int main(){

	
	int y ;

	y=1 ;
	//cin>>y ;

	while(y--)
	{	
		solve() ;
	}

}

Measured memory_bytes: 4400
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<stack>
#include<queue>
#include<map>
#include<functional>
#include<math.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<(n);i++)
typedef long long ll;
typedef pair<ll, ll> p;
const int INF = 1001001001;
const double PI = acos(-1);

int main() {
	int n, k;
	cin >> n >> k;
	vector<int> p(n);
	rep(i, n) cin >> p[i];

	sort(p.begin(), p.end());
	int ans = 0;
	rep(i, k) {
		ans += p[i];
	}
	cout << ans << endl;

	return 0;
}

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

int main() {
  ll n; cin >> n;
  vector<ll> B(n-1);
  rep(i, n-1) cin >> B[i];
  
  ll ans = B[0] + B[n-2];
  rep(i, n-2)
    ans += min(B[i], B[i+1]);
  
  cout << ans << endl;
}

Measured memory_bytes: 3620
fn main() {
    let n: i32 = read();
    println!("{}", n + n*n + n*n*n);
}

fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}



Measured memory_bytes: 2128
sx, sy, tx, ty = map(int, input().split())
way = []
way += ['U' for _ in range(ty-sy)]
way += ['R' for _ in range(tx-sx)]
way += ['D' for _ in range(ty-sy)]
way += ['L' for _ in range(tx-sx+1)]
way += ['U' for _ in range(ty-sy+1)]
way += ['R' for _ in range(tx-sx+1)]
way += ['D','R']
way += ['D' for _ in range(ty-sy+1)]
way += ['L' for _ in range(tx-sx+1)]
way += ['U']
print(''.join(way))


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

int main() {
    
    int n; cin >> n;    
    for (int i = 1; i <= n; i++) {
        int ans = 0;
        int tmp;
        for (int x = 1; x * x <= i; x++) {
            for (int y = x; y * y <= i; y++) {
                for (int z = y; z * z <= i; z++) {
                    int tmp = 0;
                    tmp += x * x + y * y + z * z;
                    tmp += x * y + y * z + z * x;
                    if (tmp == i) {
                        if (x == y && y == z) {
                            ans++;
                        }
                        else if ((x == y && y != z) || (x != y && y == z)) {
                            ans += 3;
                        }
                        else {
                            ans += 6;
                        }
                    }
                }
            }
        }
        cout << ans << endl;
    }
    return 0;
}

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


int main()
{
	int n, m, l;
	long int a[100][100];
	long int b[100][100];
	long int c[100][100];

	cin >> n >> m >> l;
	for (int i = 0; i < n; i++){
		for (int j = 0; j < m; j++){
			cin >> a[i][j];
		}
	}
	for (int i = 0; i < m; i++){
		for (int j = 0; j < l; j++){
			cin >> b[i][j];
		}
	}
	for (int i = 0; i < n; i++){
		for (int j = 0; j < l; j++){
			c[i][j] = 0;
		}
	}

	for (int i = 0; i < n; i++){
		for (int j = 0; j < l; j++){
			for (int k = 0; k < m; k++){
				c[i][j] = c[i][j] + (a[i][k] * b[k][j]);
			}
			cout << c[i][j];
			if (j != l-1){
				cout << " ";
			}
		}
		cout << endl;
	}
	
	return 0;
}


Measured memory_bytes: 3292
#include<bits/stdc++.h>
using namespace std;
#define ll long long 
#define ld long double
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    ll n;
    cin>>n;
    ll mod=1e9+7;
    ll a[n];
    for(int i=0;i<n;i++){
        cin>>a[i];
    }    
    ll b[n][62];
    for(int i=0;i<n;i++){
        for(int j=0;j<62;j++){
            b[i][j]=0;
        }
    }
    for(int i=0;i<n;i++){
        ll l=0;
        ll j=a[i];
        while(j){
            if(j&1){
                b[i][l]=1;
            }
            j/=2;
            l++;
        }
        for(int j=0;j<62;j++){
            if(i>0){
                b[i][j]+=b[i-1][j];
            }
        }
    }
    ll ans=0;
    for(int i=0;i<n-1;i++){
        ll k=a[i];
        ll l=0;
        for(int j=0;j<62;j++){
            ll p=b[n-1][j]-b[i][j];
            if(k&1){
                ans=(ans+ ((n-i-1-p)*( ((ll)1<<j)%mod ))%mod  )%mod;
            }
            else{
                ans=(ans+ (p*( ((ll)1<<j)%mod ))%mod  )%mod;
            }
            k/=2;
        }
    }
    cout<<ans;
}

Measured memory_bytes: 147968
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def TUPLE(): return tuple(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7 
#mod = 998244353
from decimal import *
#import numpy as np
#decimal.getcontext().prec = 10

N = INT()
A = [INT() for _ in range(N)]

color_max = deque([])
cnt = 0

for a in A:
	idx = bisect_left(color_max, a)
	if idx == 0:
		color_max.appendleft(a) 
		cnt += 1
	else:
		color_max[idx-1] = a

print(cnt)

Measured memory_bytes: 15024
n = int(input())
s = [sorted(input()) for i in range(n)]

count = 0
dic1 = {}
# print(s)
for i in range(n):
    # print(s[i])
    so = ''.join(s[i])
    # print(so)
    if so in dic1:
        count += dic1[so]
        dic1[so] += 1
    else:
        dic1[so] = 1
    # print(count, dic1)
print(count)

Measured memory_bytes: 39040
#include<bits/stdc++.h>
using namespace std;
using ll  = long long;
using vl  = vector<ll>;
using vi  = vector<int>;
#define _GLIBCXX_DEBUG
#define IO_STREAM cin.tie(0);ios::sync_with_stdio(false)
#define all(x) x.begin(),x.end()
#define rep(i,sta,end) for(int i=sta;i<end;++i)
#define lcm(a,b) (a)/__gcd((a),(b))*(b)
#define pb push_back
const ll INF = 1000000000000000;
const ll MOD = 1000000007;
const double PI = acos(-1);
//||
#define DBG(a,b,c,d) //cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<endl
//DBG("","","","");

signed main(){
	IO_STREAM;
	int N,K;
	cin>>N>>K;
	vi p(N);
	rep(i,0,N){
		cin>>p[i];
	}
	sort(all(p));
	int sum=0;
	rep(i,0,K){
		sum+=p[i];
	}
	cout<<sum<<endl;
	return 0;
}


Measured memory_bytes: 3644
#include<cstdlib>
#include<string>
using namespace std;
string tbl01[]={
	"101","000000","000011","10010001","010001","000001","100101","10011010",
	"0101","0001","110","01001","10011011","010000","0111","10011000",
	"0110","00100","10011001","10011110","00101","111","10011111","1000",
	"00110","00111","10011100","10011101","000010","10010010","10010011","10010000"
};
string tbl01_idx=" ',-.?ABCDEFGHIJKLMNOPQRSTUVWXYZ";
string str_AB=" .,-'?";

string to01(string &s){
	string r;
	for(int i=0;i<s.size();i++)r+=tbl01[tbl01_idx.find(s[i])];
	while(r.size()%5)r+='0';
	return r;
}
string toAB(string &s){
	string r,t;
	for(int i=0;i<s.size();i+=5){
		t=s.substr(i,5);
		int c=strtol(t.c_str(),NULL,2);
		r+=c>25?str_AB[c-26]:c+'A';
	}
	return r;
}
int main(){
	string s;
	while(getline(cin,s))s=to01(s),cout<<toAB(s)<<endl;
	return 0;
}

Measured memory_bytes: 0
#include<algorithm>
#include<iostream>
#include<vector>
#include<string>
#include<cstring>
#include<utility>
#include<queue>
#include<cmath>
#include<cstdio>
using namespace std;
#define REP(i, a,b) for(i=a;i<b;i++) 
#define REP1(i,b,a) for(i=b-1;i>=a;i--)
#define output(x) cout<<x<<endl;
#define pb(x) push_back(x);
typedef long long int ll;


const int MAX = 510000;
const int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < MAX; i++) {
		fac[i] = fac[i - 1] * i % MOD;
		inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
		finv[i] = finv[i - 1] * inv[i] % MOD;
	}
}

// 二項係数計算
// 二項係数計算
long long COM(int n, int k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}




int main() {
	COMinit();
	ll i, j, k, l, m, n, sum, flag, cc,N,M,X,A,B,H,W;
	sum = 0;
	flag = 0;
	cin >> H >>W>>A>>B ;
	ll ans;
	ans = 0;
	REP(i, 1, H - A + 1) {
		ans += COM(B + i - 2, i - 1)*COM(W-B+H-i-1,W-B-1)%MOD;
		ans %= MOD;
	
		
	}
	output(ans);
	return 0;
}

Measured memory_bytes: 12160
import java.util.*;

public class Main{
  public static void main(String[]args){
    Scanner sc = new Scanner(System.in);
    int A = Integer.parseInt(sc.next());
    int B = Integer.parseInt(sc.next());
    int K = Integer.parseInt(sc.next());
    
    for(int i = 0; i < K; i++){
      if(i%2==0){
        if(A%2 == 1){
          A--;
        }
        A /= 2;
        B += A;
      }else{
        if(B%2 == 1){
          B--;
        }
        B /= 2;
        A += B;
      }
    }
    
    System.out.println(A+" "+B);
  }
}

Measured memory_bytes: 23764
h, w = gets.split.map(&:to_i)
a = []

f = Array.new(h+2){ Array.new(w+2, -1) }

h.times do |i|
	a[i] = gets.split.map(&:to_i)
end

h.times do |i|
	w.times do |j|
		f[i+1][j+1] = a[i][j]
 	end
end

ans = []

1.upto(h) do |i|
	1.upto(w) do |j|
		if f[i][j].even?
			next
		else
			if f[i][j+1] != -1
				f[i][j] -= 1
				f[i][j+1] += 1
				ans << "#{i} #{j} #{i} #{j+1}"
			end

			if f[i][j+1] == -1 && f[i+1][j] != -1
				f[i+1][j] += 1
				f[i][j] -= 1
				ans << "#{i} #{j} #{i+1} #{j}"
			end
		end
	end
end

puts ans.length
ans.length.times do |i|
	puts ans[i]
end


Measured memory_bytes: 20732
#include <bits/stdc++.h>
#define pb              push_back
#define ll              long long
#define scd(a)          scanf("%d",&a)
#define mp(a,b)         make_pair(a,b)
#define scl(w)          scanf("%lld",&w)
#define scdd(a,b)       scanf("%d %d",&a,&b)
#define srt(a)          sort(a.begin(),a.end())
#define rsrt(a)         sort(a.rbegin(),a.rend())
#define scll(a,b)       scanf("%lld %lld",&a,&b)
///4direction ->        int del_x[]={-1,0,1,0},del_y[]={0,1,0,-1};
#define input(v,n)      for (int i=0;i<n;i++){int a;cin >> a;v.push_back(a);}
#define inputll(v,n)    for (ll i=0;i<n;i++){ll a;cin >> a;v.push_back(a);}
#define vii             vector < int >
#define vll             vector < ll >
#define pii             pair < int , int >
#define pll             pair < ll , ll >
#define mk              make_pair
#define inf8            100000008

using namespace std;

ll A[100005] , sum=0;
vll v;

int main()
{
    ll n , total = 0;
    scl(n);

    for (int i=1;i<=n;i++){
        scl(A[i]);
        total+=A[i];
        A[i]+=A[i-1];
    }
    ll mn = 10000000000;
    for (int i=1;i<=n;i++){
            mn = min(mn,abs(A[i]-(total-A[i])));
    }
    cout << mn << endl;

    return 0;
}


Measured memory_bytes: 256
import sys
 
nums = []
 
 
for line in sys.stdin:
    nums.append(line)
 
for i in range(len(nums)):
    input_line = nums[i].split(" ")
    a = int(input_line[0])
    b = int(input_line[1])
 
    if a > b:
        num_bigger = a
        num_smaller = b
    else:
        num_bigger = b
        num_smaller = a

    r = 1   #?????????
    while r > 0:
        r = num_bigger % num_smaller
        num_bigger = num_smaller
        num_smaller = r

    max_common_div = num_bigger
    min_common_mpl = int((a * b)/max_common_div)
 
    print(str(max_common_div) + " " + str(min_common_mpl))

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

int main(){

int x,y;
cin >> x >> y;

for (int i=0; i<3000; i++){
    if ( x < y)
    cout << x << " " << y <<endl;
    
    else 
    cout << y << " " << x <<endl;
    
    cin >> x >> y;
    if(x == 0 && y == 0) break; 
}
}


Measured memory_bytes: 3092
def main():
    N, M = map(int, input().split())
    A = [0] * N
    for i in range(M):
        for s in list(map(int, input().split()))[1:]:
            A[s - 1] |= 1 << i
    p = 0
    for i, j in enumerate(list(map(int, input().split()))):
        p |= j << i
    ans = 0
    for s in range(1 << N):
        t = 0
        for i in range(N):
            if s >> i & 1:
                t ^= A[i]
        if t == p:
            ans += 1
    print(ans)


main()


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

char a[200010];
int ans, sst;

int main(){
    scanf("%s", a);
    int le = strlen(a);
    for(int i = 0; i < le; ++i){
        if(*(a + i) == 'S'){
            sst++;
        }else{
            if(sst != 0){
                sst--;
            }else{
                ans++;
            }
        }
    }
    printf("%d\n", sst + ans);
    return 0;
}


Measured memory_bytes: 384
($a, $b, $c, $d) = split(/ /, <STDIN>);

while(1){
	last if(($a <= 0) or ($c <= 0));
	$c -= $b;
	last if(($a <= 0) or ($c <= 0));
	$a -= $d;
}

if($a > 0){
	print "Yes\n";
}else{
	print "No\n";
}

Measured memory_bytes: 4756
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <complex>
#include <cstdlib>
#include <cstring>
#include <numeric>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <functional>
  
#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
  
using namespace std;
  
typedef    long long          ll;
typedef    unsigned long long ull;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      pii;
  
const int INF=1<<29;
const double EPS=1e-9;
  
const int dx[]={1,0,-1,0,1,1,-1,-1},dy[]={0,-1,0,1,1,-1,-1,1};


int main() {
    int K, S;
    cin >> K >> S;
    int ans = 0;
    for(int i = 0; i <= K; i++) {
        for(int j = 0; j + i <= S && j <= K; j++) {
            if (S - i - j <= K) ans++;
        }
    }
    cout << ans << endl;
    return 0;
}

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

int main(){
  int N,K;
  cin >> N >> K;
  vector<int> v(N+1,0);
  for(int i =0;i < N; i++){
    int n;
    cin >> n;
    v.at(n)++;
  }
  //実際に何種類あるか確認する
  int c = 0;
  for(auto x : v ){
    if( x != 0) c++;
  }
  //K種類以下の場合、書き換え不要
  if(c <= K ){
    cout << 0 << endl;
    return 0;
  }
  //昇順に並び替え
  sort(v.begin(),v.end());
  int ans = 0,del_c = 0;
  for(auto x : v){
    if( x == 0 ) continue;
    if( del_c == (c - K)) break;
    ans += x;
    del_c++;
  }
  cout << ans << endl;
}
  
  

Measured memory_bytes: 1024
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <queue>
#include <map>
#include <unordered_map>
#include <set>
#include <functional>
#include <iomanip>
#include <bitset>
using namespace std;

typedef long long ll;

int N, Q;
ll x;
ll a[100005], sum[100005], jmp[100005];

bool check(int idx) {
	if (a[idx] < x) return false;
	ll t = abs(a[idx] - x);
	int lo = -1, hi = idx + 1;
	while (hi - lo > 1) {
		int mid = lo + (hi - lo) / 2;
		if (t < abs(x - a[mid])) lo = mid;
		else hi = mid;
	}
	return N - 1 - idx < idx - lo;
}


int main() {
	cin >> N >> Q;
	for (int i = 0; i < N; i++) cin >> a[i];
	for (int i = 0; i < N; i++) sum[i + 1] = sum[i] + a[i];
	jmp[1] = a[0];
	for (int i = 1; i < N; i++) jmp[i + 1] = jmp[i - 1] + a[i];

	while (Q--) {
		cin >> x;

		int lo = 0, hi = N;
		while (hi - lo > 1) {
			int mid = lo + (hi - lo) / 2;
			if (check(mid)) hi = mid;
			else lo = mid;
		}
		//cout << lo << " " << hi << endl;
		ll ans = sum[N] - sum[hi];
		if (2*hi - N >= 0) ans += jmp[2 * hi - N];
		cout << ans << endl;
	}
	return 0;
}


Measured memory_bytes: 4096
#include <bits/stdc++.h>
using namespace std;
int n,ans,p=1,k;
signed main(){
    scanf("%d",&n);
    for(int i=1;i<=n;i++){
        if(i>=p) p*=10,k++;
        if(k&1) ans++;
    }
    printf("%d",ans);
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int N = 2e5 + 10;
#define fi first
#define se second
#define pb push_back
#define mp make_pair
int n,a[N];
int main() {
  	ios::sync_with_stdio(false);
  	cin>>n;
  	for(int i=1;i<=n;i++)cin>>a[i];
  	int mx=1e9,ans=0;
  	for(int i=1;i<=n;i++){
  		if(a[i]<mx)ans++;
  		mx=min(mx,a[i]);
  	}
  	cout<<ans<<'\n';
 	return 0;
}

Measured memory_bytes: 1024
#include<stdio.h>
int main(){
	int A[200010],B[200010],n,i,k,m;
	scanf("%d",&n);
	for(i=1;i<=n;i++) scanf("%d",&A[i]);
	k=1;
	m=n;
	if(n%2==0){
		for(i=n;i>=1;i--){
			if(i%2==0){
				B[k]=A[i];
				k++;
			}
			else{
				B[m]=A[i];
				m--;
			}
		}
	}
	else{
		for(i=n;i>=1;i--){
			if(i%2!=0){
				B[k]=A[i];
				k++;
			}
			else{
				B[m]=A[i];
				m--;
			}
		}
	}
	for(i=1;i<n;i++) printf("%d ",B[i]);
	printf("%d\n",B[n]);
	return 0;
}

Measured memory_bytes: 3712
#include<iostream>
using namespace std;
int main() {
    string S;
    cin >> S;
    char B=S[0];
    int L=S.length(), cnt=0;
    for (int i=1; i<L; i++) {
        if (B == S[i]) {
            cnt++;
            if (S[i]=='0') B='1';
            else B='0';
        } else {
            B = S[i];
        }
    }
    cout << cnt << endl;
    return 0;
}


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

#define mp make_pair
#define fst first
#define snd second
#define forn(i,n) for (int i = 0; i < int(n); i++)
#define forn1(i,n) for (int i = 1; i <= int(n); i++)
#define popcnt __builtin_popcount

using namespace std;

typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,int> pli;
typedef pair<int,ll> pil;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;

template <typename T> T id(T b) {return b;};
template <class It> bool all(It f,It l){return std::all_of(f,l,id<bool>);}
template <class It> bool any(It f,It l){return std::any_of(f,l,id<bool>);}
template <typename T> void chmax(T &x, T y) {if (x < y) x = y;}
template <typename T> void chmin(T &x, T y) {if (x > y) x = y;}

const int MAX_N = 200000;
int n;
ll a[MAX_N];
pli b[MAX_N];

int main()
{
#ifdef FASTIO
  ios_base::sync_with_stdio(false); cin.tie(nullptr);
#endif

  cin >> n;
  forn(i,n) {
    cin >> a[i] >> b[i].fst;
    b[i].snd = i;
  }

  sort(b,b+n);

  ll t = 0;
  forn(i,n) {
    t += a[b[i].snd];
    if (t > b[i].fst) {
      cout << "No" << endl;
      return 0;
    }
  }

  cout << "Yes" << endl;

  return 0;
}


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

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

int main(){
    int H,W,K; cin >> H >> W >> K;
    ll dp[H+1][W+1]={};
    dp[0][0]=1;
    for(int i=0;i<H;i++){
        for(int j=0;j<W;j++){
            for(int mask=0;mask<(1<<W-1);mask++){
                bool flag=true;
                for(int k=0;k<W-2;k++){
                    if((mask&(1<<k))&&(mask&(1<<(k+1)))){
                        flag=false;
                    }
                }
                if(!flag) continue;
                if(mask&(1<<j)){
                    dp[i+1][j]+=dp[i][j+1]%MOD;
                    dp[i+1][j]%=MOD;
                }else if(j>0&&mask&(1<<(j-1))){
                    dp[i+1][j]+=dp[i][j-1]%MOD;
                    dp[i+1][j]%=MOD;
                }else{
                    dp[i+1][j]+=dp[i][j]%MOD;
                    dp[i+1][j]%=MOD;
                }
            }
        }
        
    }
    cout << dp[H][K-1]%MOD << endl;
}

Measured memory_bytes: 256
#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>;

int main(){
  int h,w;
  cin >> h >> w;

  queue<P> q;
  vector<int> dx = {-1, 0, 1, 0};
  vector<int> dy = { 0, 1, 0,-1};
  //vector<vector<vector<P>>> to(h,vector<P>(w,vector<P>(0));
  //vector<vector<P>> to[100005][100005];
  P to[h][w][4];

  vector<string> a(h);
  rep(i,h){
    cin >> a[i];
    rep(j,w){
      if(a[i][j]=='#'){
        q.push(make_pair(i,j));
      }
      rep(k,4){
        if(i+dy[k]>=0&&i+dy[k]<h&&j+dx[k]>=0&&j+dx[k]<w){
          to[i][j][k] = make_pair(i+dy[k],j+dx[k]);
        }
        else{
          to[i][j][k] = make_pair(-1,-1);
        }
      }
    }
  }

  vector<vector<int>> dist(h,vector<int>(w,0));
  int ans = 0;
  while(!q.empty()){
    P v = q.front();
    q.pop();
    int yv = v.first;
    int xv = v.second;
    for(auto p : to[yv][xv]){
      int yu = p.first;
      int xu = p.second;
      if(xu==-1||yu==-1) continue;
      if(a[yu][xu]=='#') continue;
      a[yu][xu] = '#';
      dist[yu][xu] = dist[yv][xv] + 1;
      if(ans<dist[yu][xu]) ans = dist[yu][xu];
      q.push(make_pair(yu,xu));
    }
  }

  cout << ans << endl;

  return 0;
}


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

#define int             long long int
#define ld              long double
#define ff              first
#define ss              second
#define mp              make_pair
#define pb              push_back
#define si              set <int>
#define vi              vector <int>
#define pii             pair <int, int>
#define vpii            vector <pii>
#define vpp             vector <pair<int, pii>>
#define mii             map <int, int>
#define mpi             map <pii, int>
#define msi             map < string, int >
#define loop(i,s,e)     for(int i=s;i<e;i++)
#define rloop(i,e,s)    for(int i=e;i>=s;i--)
#define mset(a,f)       memset(a,f,sizeof(a))
#define spi             set <pii>
#define endl            "\n"
#define M               1000000007
#define sz(x)           ((int) x.size())
#define all(p)          p.begin(), p.end()
#define que_max         priority_queue <int>
#define que_min         priority_queue <int, vi, greater<int>>
#define bug(...)        __f (#__VA_ARGS__, __VA_ARGS__)
#define print(a)        for (auto x : a) cout << x << " "; cout << endl
#define Print(a,x,y)    for (int i=x; i<y; i++) cout<< a[i]<< " "; cout << endl

inline int power(int a, int b)
{
	int x = 1;
	while (b)
	{
		if (b & 1) x *= a;
		a *= a;
		b >>= 1;
	}
	return x;
}

template <typename Arg1>
void __f (const char* name, Arg1&& arg1) { cout << name << " : " << arg1 << endl; }
template <typename Arg1, typename... Args>
void __f (const char* names, Arg1&& arg1, Args&&... args)
{
	const char* comma = strchr (names + 1, ',');
	cout.write (names, comma - names) << " : " << arg1 << " | "; __f (comma + 1, args...);
}

const int N = 200005;
int arr[N];

void solve()
{
	int h, a;
	cin >> h >> a;
	int x = h / a;
	h = h - (x * a);
	if (h == 0) cout << x;
	else cout << x + 1;

	return;
}

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


	clock_t z = clock();
	int t = 1;
	//cin >> t;
	while (t--)
	{
		solve();
	}
	cerr << "Total Time : " << ((double)(clock() - z) / CLOCKS_PER_SEC);

	return 0;
}

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

void solve(){
  int n, k; cin >> n >> k;
  vector<int> h(n);
  for(int i = 0; i < n; i++) cin >> h[i];
  sort(h.begin(), h.end());
  int minh = h[h.size() - 1] - h[h.size() - 1 - k + 1];
  for(int i = h.size() - 1 - 1; i >= k - 1; i--){
    minh = min(h[i] - h[i - k + 1], minh);
  }
  cout << minh << endl;
  return;
}

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


Measured memory_bytes: 640
/*
confirm 0LL and 1LL
confirm cornercases such as 0
confirm times of cin < 10^6
*/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll, ll>;
using Pld = pair<ld, ld>;
using Vec = vector<ll>;
using VecP = vector<P>;
using VecB = vector<bool>;
using VecC = vector<char>;
using VecD = vector<ld>;
using VecS = vector<string>;
using Graph = vector<VecP>;
template <typename T>
using Vec1 = vector<T>;
template <typename T>
using Vec2 = vector<Vec1<T> >;
#define REP(i, m, n) for(ll (i) = (m); (i) < (n); ++(i))
#define REPN(i, m, n) for(ll (i) = (m); (i) <= (n); ++(i))
#define REPR(i, m, n) for(ll (i) = (m)-1; (i) >= (n); --(i))
#define REPNR(i, m, n) for(ll (i) = (m); (i) >= (n); --(i))
#define rep(i, n) REP(i, 0, n)
#define repn(i, n) REPN(i, 1, n)
#define repr(i, n) REPR(i, n, 0)
#define repnr(i, n) REPNR(i, n, 1)
#define all(s) (s).begin(), (s).end()
#define pb push_back
#define mp make_pair
#define fs first
#define sc second
template <typename T>
bool chmax(T &a, const T b){if(a < b){a = b; return true;} return false;}
template <typename T>
bool chmin(T &a, const T b){if(a > b){a = b; return true;} return false;}
template <typename T>
ll pow2(const T n){return (1LL << n);}
template <typename T>
void cosp(const T n){cout << n << ' ';}
template <typename T>
void co(const T n){cout << n << '\n';}
template <typename T1, typename T2>
void co(pair<T1, T2> p){cout << p.fs << ' ' << p.sc << '\n';}
template <typename T>
void co(const Vec1<T> &v){for(T i : v) cosp(i); cout << '\n';}
template <typename T>
void co(initializer_list<T> v){for(T i : v) cosp(i); cout << '\n';}
template <typename T>
void ce(const T n){cerr << n << endl;}
void sonic(){ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);}
void setp(const ll n){cout << fixed << setprecision(n);}
const ll INF = 1e9+1;
const ll LINF = 1e18+1;
const ll MOD = 1e9+7;
//const ll MOD = 998244353;
const ld PI = acos(-1);
const ld EPS = 1e-11;

int main(void){
	ll n, r;
	cin >> n >> r;
	if(n >= 10) co(r);
	else{
		r += 100*(10-n);
		co(r);
	}

	return 0;
}


Measured memory_bytes: 256