akhauriyash/Code-Regression huggingface dataset:
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author MaxHeap
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastReader in = new FastReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, FastReader in, PrintWriter out) {
            String s = in.next();
            int[] freq = new int[255];
            for (int i = 0; i < s.length(); i++) {
                freq[s.charAt(i)]++;
            }
            boolean ok = true;
            for (int i = 0; i < 255; i++) if (freq[i] > 1) ok = false;
            out.println(ok ? "yes" : "no");
        }

    }

    static class FastReader {
        BufferedReader reader;
        StringTokenizer st;

        public FastReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
            st = null;
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    String line = reader.readLine();
                    if (line == null) {
                        return null;
                    }
                    st = new StringTokenizer(line);
                } catch (Exception e) {
                    throw new RuntimeException();
                }
            }
            return st.nextToken();
        }

    }
}



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

using namespace std;


int n;
bool A[300050];
int B[300050];
int main(){
	//freopen("attention.in", "r", stdin);
	cin >> n;
	for(int i = 1; i<=n; i++){
		char x; cin >> x;
		if(x == 'W') A[i] = 0;
		else A[i] = 1;
	}
	for(int i = 1; i<=n; i++){
		B[i] = B[i-1] + A[i]; // B counts the number of easts
	}
	int ans = INT_MAX;
	for(int i = n; i>=1; i--){
		int temp = B[i];
		B[i] = B[i+1] + A[i]; // B counts the number of easts
		ans = min(ans, i-temp-1 + B[i]);
	}
	cout << ans;
}


Measured memory_bytes: 1664
#include <iostream>
#include <algorithm>
using namespace std;
long long l[2010],cnt[2010][2010] = {},ans = 0;
int main(){
	int i,j,n;
	cin >> n;
	for(i=0;i<n;i++){
		cin >> l[i];
	}
	sort(l,l + n);
	for(i=1;i<=n;i++){
		for(j=0;j<=1000;j++){
			cnt[i][j] = cnt[i - 1][j];
		}
		for(j=0;j<=l[i - 1];j++){
			cnt[i][j]++;
		}
	}
	for(i=n - 1;i>=0;i--){
		for(j=i - 1;j>=1;j--){
			int x = l[i] - l[j];
			ans += cnt[j][x + 1];
		}
	}
	cout << ans << endl;
}

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

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

  int count = 1;
  for (int i = 0; i < 3; i++) {
    if (N[i] == N[i+1]) {
      count++;
      if (3 <= count) {
        cout << "Yes" << endl;
        return 0;
      }
    } else {
      count = 1;
    }
  }
  cout << "No" << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <set>
#include <map>
#include <queue>
#include <iomanip>
#include <cassert>
#include <random>
#include <tuple>

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

using namespace std;
typedef long long ll;
typedef pair<int, int> P;

const int MOD = 1e9 + 7;

const int MAX = 1100;
ll 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;
    }
}

ll 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;
}

ll modpow(ll a, ll n, ll MOD) {
    ll res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % MOD;
        a = a * a % MOD;
        n >>= 1;
    }
    return res;
}


int main() {
    ll n, a, b, c, d;
    cin >> n >> a >> b >> c >> d;

    vector<ll> dp(n+1, 0);
    dp[0] = 1;

    COMinit();

    for (int i = a; i <= b; i++) {
        for (int j = n; j >= 0; j--) {
            for (int k = c; i*k <= j && k <= d; k++) {
                dp[j] += dp[j-i*k] * fac[n-(j-i*k)] % MOD * finv[n-j] % MOD * finv[k] % MOD * modpow(finv[i], k, MOD) % MOD;
                dp[j] %= MOD;
            }
        }
    }

    cout << dp[n] << endl;


    return 0;

}


Measured memory_bytes: 256
import java.util.*;

public class Main {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		while(true){
			int n = sc.nextInt();
			if(n==0) break;
			
			int[] m = new int[n];
			int[] a = new int[n];
			int[] b = new int[n];
			PriorityQueue<Integer> que = new PriorityQueue<Integer>();
			que.add(0);
			for(int i=0;i<n;i++){
				m[i] = sc.nextInt();
				a[i] = sc.nextInt();
				b[i] = sc.nextInt();
				if(que.contains(a[i])==false) que.add(a[i]);
				if(que.contains(b[i])==false) que.add(b[i]);
			}
			
			int s = que.size();
			int sum = 0;
			int p = 0;
			boolean flag = true;
			for(int i=0;i<s;i++){
				p = que.poll();
				sum = 0;
				for(int j=0;j<n;j++){
					if(a[j]<=p && p<b[j]) sum+=m[j];
				}
				if(sum>150){
					flag = false;
					break;
				}
			}
			if(flag==true) System.out.println("OK");
			else System.out.println("NG");
		}
	}	
}

Measured memory_bytes: 50188
#include <bits/stdc++.h>
#define ll long long
#define mod 1000000007
#define pb push_back
#define pint pair<int,int>
using namespace std;

ll seg[800000];
ll query(int pos, int l, int r, int h){
	if(h==0)	return 0;
	if(h<l)	return 0;
	if(h>=r || l==r)	return seg[pos];
	return max(query(2*pos+1, l, (l+r)/2, h), query(2*pos+2, (l+r)/2+1, r, h));
}

void add(int pos, int l, int r, int h, ll num){
	if(h<l || h>r)	return;
	if(l==r){
		seg[pos] = num;	return;
	}
	add(2*pos+1, l, (l+r)/2, h, num);
	add(2*pos+2, (l+r)/2+1, r, h, num);
	seg[pos] = max(seg[2*pos+1], seg[2*pos+2]);
}

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	int i,j,n;	cin>>n;
	int h[n],a[n];
	for(i=0;i<n;i++){
		cin>>h[i];
	}
	for(i=0;i<n;i++){
		cin>>a[i];
		ll temp = query(0, 1, n, h[i]-1);
		add(0, 1, n, h[i], temp+a[i]);
	}
	cout<<seg[0]<<endl;
	// for(i=0;i<10;i++){
	// 	cout<<seg[i]<<" ";
	// }
	return 0;
}

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

using namespace std;

int main() {

    int x, y, s;

    while(cin >> x >> y >> s, x | y | s) {

        int max_val = 0;

        for(int i = 1; i < s; ++i) {
            for(int j = 1; j < s; ++j) {
                int sum_before = i * (100 + x) / 100 + j * (100 + x) / 100;
                int sum_after = i * (100 + y) / 100 + j * (100 + y) / 100;
                if(sum_before == s && sum_after > max_val) {
                    max_val = sum_after;
                }
            }
        }

        cout << max_val << endl;

    }

}

Measured memory_bytes: 1160
# coding:utf-8

import sys
import numpy as np

INF = float('inf')
MOD = 10 ** 9 + 7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()


def main():
    n = II()
    P = LF()

    dp = np.zeros(n + 1, dtype=float)
    dp[0] = 1

    for p in P:
        tmp = dp * (1 - p)
        tmp[1:] += dp[:-1] * p
        dp = tmp

    return np.sum(dp[n // 2 + 1:])


print(main())


Measured memory_bytes: 21020
#include <bits/stdc++.h>
 
using namespace std;
 
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef pair<ll,ll> P;
typedef vector<P> vp;
typedef vector<string> vs;
typedef vector<bool> vb;

const ll mod=1e9+7;
const ll inf=1e16;

#define rep(i,m,n) for(ll i=m;i<n;i++)
#define repr(i,m,n) for(ll i=m-1;i>=n;i--)
#define fi first
#define se second
#define chmax(x,y) x=max(x,y)
#define chmin(x,y) x=min(x,y)
#define eb(x) emplace_back(x)
#define all(x) x.begin(),x.end()
#define allr(x) x.rbegin(),x.rend()
#define sum(x) accumulate(all(x),0)
#define pc(x) __builtin_popcount(x)
#define gll greater<ll>()

void solve(){
 ll n;
  cin >> n;
 vll a(n);
  rep(i,0,n) cin >> a[i];
  
 vll dp(n+1,0);
 dp[0]=1000;
  
 rep(i,0,n){
  dp[i+1]=dp[i]; 
  rep(j,0,i){ 
   ll num=dp[j]/a[j];
   chmax(dp[i+1],dp[j]+num*(a[i]-a[j])); 
  }
 }
  
    cout << dp[n] << endl;
}
int main(){
   cin.tie(nullptr);
  ios::sync_with_stdio(false);
  solve();
}

Measured memory_bytes: 3644
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main(){
  int N;
  vector<double> parts(1010);
  
  cin >> N;
  
  int tmp;
  for(int i=0; i<N; i++){
    cin >> tmp;
    parts.at(i) = double(tmp);
  }
  
  sort(parts.begin(), parts.end(), greater<int>());
  
  for(int i=N-1; i>0; i--){
      parts.at(i-1) = (parts.at(i) + parts.at(i-1))/2;
  }
  cout << parts.at(0) << endl;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		String t = sc.next();
		int a = sc.nextInt();
		int b = sc.nextInt();
		String u = sc.next();
		if(u.equals(s))a--;
		else b--;
		System.out.printf("%d %d",a,b);
		sc.close();
	}
}

Measured memory_bytes: 21716
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, a, b) for (int i = a; i < b; i++)
//'A' = 65, 'Z' = 90, 'a' = 97, 'z' = 122

int main() {
    int n;
    ll k;
    cin >> n >> k;
    vector<pair<int, int>> v(n);
    rep(i, 0, n) {
        int a, b;
        cin >> a >> b;
        v[i] = make_pair(a, b);
    }

    sort(v.begin(), v.end());

    ll sum = 0;
    int ans = 0;
    rep(i, 0, n) {
        sum += v[i].second;
        if (k <= sum) {
            ans = v[i].first;
            break;
        }
    }

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


Measured memory_bytes: 1024
import java.util.TreeMap;
import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);
        TreeMap<String, Integer> tm = new TreeMap<String, Integer>();
        int n = Integer.parseInt(stdIn.next());
        String s;
        for (int i = 0; i < n; i++) {
            s = stdIn.next();
            int count = 1;
            if (tm.containsKey(s)) {
                count += tm.get(s);
            }
            tm.put(s, count);
        }

        int maxValue = 0;
        for (int value : tm.values()) {
            if (value > maxValue) {
                maxValue = value;
            }
        }

        for (String key : tm.keySet()) {
            if (tm.get(key) == maxValue) {
                System.out.println(key);
            }
        }
    }
}

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

#define int         long long
#define mod         1000000007

int n;
int compatible[22][22];
int dp[22][(1<<22)];

int solve(int i,int wset){
    if(i == (n+1)){
        if(wset == 0)
            return 1;
        else
            return 0;
    }

    if(dp[i][wset] != -1)
        return dp[i][wset];

    int ans = 0;
    for(int j=0;j<n;j++){
        bool available = (((1<<j)&(wset)) == 0) ? 0 : 1;
        if(available && compatible[i][j]){
            ans = (ans + solve(i+1, (wset^(1<<j)) ) ) % mod;
        }
    }
    dp[i][wset] = ans;

    return ans;
}

int32_t main() {
    cin>>n;
    memset(dp,-1,sizeof(dp));

    for(int i=1;i<=n;i++){
        for(int j=0;j<n;j++){
            cin>>compatible[i][j];
        }
    }
    int x = (1<<n) - 1;
    cout<<solve(1,x);
}


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

A = []
for i in range(N):
    A.append(int(input()))

_A = sorted(A)

list_max = _A[N-1]
list_second_max = _A[N-2]

import copy

for i in range(N):
    if A[i] != list_max:
        print(list_max)
    else:
        print(list_second_max)


Measured memory_bytes: 14616
s = list(input())
t = list(input())
ans = float("INF")
for i in range(len(s)-len(t)+1):
    count = 0
    for j in range(len(t)):
        if s[i+j] == t[j]:
            continue
        count += 1
    ans = min(ans,count)
print(ans)

Measured memory_bytes: 9112
using System;
using System.Linq;

namespace AtCoder
{
	public class ProblemA
	{
		public static void Main(string[] args)
		{
			int n = int.Parse(Console.ReadLine());

			int[] dp = new int[n];
			int[] bars = new int[n];

			string[] line = Console.ReadLine().Split(' ');
			for (int i = 0; i < n; i++)
			{
				int h = int.Parse(line[i]);
				bars[i] = h;
			}

			dp[0] = 0;
			dp[1] = Math.Abs(bars[0] - bars[1]);
			for (int i = 2; i < n; i++)
			{
				int a = dp[i - 2] + Math.Abs(bars[i - 2] - bars[i]);
				int b = dp[i - 1] + Math.Abs(bars[i - 1] - bars[i]);
				dp[i] = Math.Min(a, b);
			}

			Console.WriteLine(dp.Last());
		}
	}
}


Measured memory_bytes: 35128
open System.Collections.Generic

type Scanner() = class
    let mutable hold = [||]
    let mutable index = 0
    member public this.Next() =
        if hold.Length > index
        then 
            index <- index + 1
            hold.[index - 1]
        else
            let mutable st = stdin.ReadLine()
            while st = "" do st <- stdin.ReadLine()
            hold <- st.Split(' ')
            if hold.Length = 0
            then
                this.Next()
            else
                index <- 1
                hold.[index - 1]
            
    member public this.NextI32() =
        this.Next() |> int

    member public this.ArrayI32(n: int) =
        [|for _ in 0 .. n - 1 -> this.NextI32()|]

    member public this.NextI64() =
        this.Next() |> int64
    
    member public this.ArrayI64(n: int) =
        [|for _ in 0 .. n - 1 -> this.NextI64()|]

    member public this.NextF32() =
        this.Next() |> float32
    
    member public this.ArrayF32(n: int) =
        [|for _ in 0 .. n - 1 -> this.NextF32()|]

    member public this.NextF64() =
        this.Next() |> double
    
    member public this.ArrayF64(n: int) =
        [|for _ in 0 .. n - 1 -> this.NextF64()|]

    member public __.Tuple2Array n (f : int -> 'a list) =
        [|for _ in 0 .. n - 1 -> f 2 |> fun x -> x.[0], x.[1]|]
    
    member public __.Tuple3Array n (f : int -> 'a list) =
        [|for _ in 0 .. n - 1 -> f 3 |> fun x -> x.[0], x.[1], x.[2]|]

    member public __.CountDic n (f : unit -> 'a) =
        let seqs = seq {for _ in 0 .. n - 1 -> f()}
        let dic = new Dictionary<'a, int64>();
        for i in seqs do
            if dic.ContainsKey(i)
            then dic.[i] <- dic.[i] + 1L
            else dic.Add(i, 1L)
        dic

end

[<EntryPoint>]
let main _ =
    let scanner = Scanner()
    let n = scanner.NextI32()
    let s1 = scanner.Next() |> Seq.toArray
    let s2 = scanner.Next() |> Seq.toArray
    [|0..n-1|]
    |> Array.tryFind (fun x -> s1.[x..n-1] = s2.[0..n-1-x])
    |> function
        | Some(x) -> x + n
        | None -> n + n
    |> printfn "%i"

    0


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

int main() {
	int a, b;
	cin >> a >> b;
	if (a > 12) {
		cout << b << endl;
	}
	else {
		if (a < 6) {
			cout << 0 << endl;
		}
		else {
			cout << b / 2 << endl;
		}
	}
}

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

namespace AtCoder
{
    class Program
    {
        private const int MODULO = 1000000007;
        private static string Read() { return Console.ReadLine(); }
        private static int ReadInt() { return int.Parse(Read()); }
        private static long ReadLong() { return long.Parse(Read()); }
        private static double ReadDouble() { return double.Parse(Read()); }
        private static int[] ReadInts() { return Array.ConvertAll(Read().Split(), int.Parse); }
        private static long[] ReadLongs() { return Array.ConvertAll(Read().Split(), long.Parse); }
        private static double[] ReadDoubles() { return Array.ConvertAll(Read().Split(), double.Parse); }

        static long Solve(int N, int[] A)
        {
            Array.Sort(A, (a, b) => b - a);
            long sum = 0;
            for (int i = 0; i < N; ++i) { sum += A[i * 2 + 1]; }
            return sum;
        }
        static void Main(string[] args)
        {
            var N = ReadInt();
            var A = ReadInts();
            Console.WriteLine(Solve(N, A));
        }
    }
}


Measured memory_bytes: 38604
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>

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

int main() {
    int a, b, c, d, e;
    cin >> a >> b >> c >> d >> e;

    if(a == 0) {
        cout << 1 << endl;
    } else if(b == 0) {
        cout << 2 << endl;
    } else if(c == 0) {
        cout << 3 << endl;
    } else if(d == 0) {
        cout << 4 << endl;
    } else {
        cout << 5 << endl;
    }

    return 0;
}

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

template <class T>
T gcd(T a, T b) {
	if (a % b == 0) return b;
	else return gcd(b, a%b);
}

ll calc(ll n, ll c, ll d) {
	ll l = c / gcd(c, d) * d;
	return n - n / c - n / d + n / l;
}

void solve() {
	ll A, B, C, D; cin >> A >> B >> C >> D;
	cout << calc(B, C, D) - calc(A-1, C, D) << endl;
}

int main(void) {
	solve();

	return 0;
}

Measured memory_bytes: 256
n = int(input())
S = [input() for i in range(n)]
import sys, copy, math, heapq, bisect
from itertools import accumulate
from collections import deque, defaultdict, Counter
input = sys.stdin.readline # 文字列の入力のとき'/n'まで受け取るので注意!!!
sys.setrecursionlimit(500000)

ans = [5000]*26
for i in range(n):
    a = [0]*26
    for j in range(len(S[i])):
        a[ord(list(S[i])[j])-ord('a')] += 1

    for j in range(26):
        ans[j] = min(ans[j],a[j])

print(''.join(sorted(list(''.join([chr(ord('a')+i)*ans[i] for i in range(26)])))))

Measured memory_bytes: 39024
#include<stdio.h>

int main()
{
	int input;
	int i,ans,power5;

	while(1)
	{
		scanf("%d",&input);
		if(input==0)break;
		ans=0;
		power5=1;
		for(i=1;(power5*=5)<=input;i++)
		{
			ans+=input/power5;
		}
		printf("%d\n",ans);
	}
	return 0;
}

Measured memory_bytes: 0
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);i++)
#define ALL(v) (v).begin(),(v).end()
#define int long long
#define INF 1e18
#define MOD 1000000007
#define SIZE 100005

using namespace std;
typedef pair<int,int> P;

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

int V,E;
vector<int> G[10005];
bool used[10005];
vector<int> ans;

void dfs(int v){
    used[v]=true;
    for(auto u:G[v]){
        if(!used[u]) dfs(u);
    }
    ans.push_back(v);
}

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

    cin>>V>>E;
    REP(i,E){
        int a,b; cin>>a>>b;
        G[a].push_back(b);
    }
    REP(i,V){
        if(!used[i]) dfs(i);
    }
    reverse(ALL(ans));
    REP(i,V) cout<<ans[i]<<endl;
    
 
}



Measured memory_bytes: 4092
import math

data = input().split()
a = float(data[0])
b = float(data[1])
c = math.radians(int(data[2]))

S = a * b * math.sin(c) * 0.5
print(S)
c = math.sqrt((a**2 + b**2 - 2*a*b*math.cos(c)))
print(a + b + c)
print(S/a * 2)


Measured memory_bytes: 5708
#include "bits/stdc++.h"
#include <iostream>
#include <string.h>
#include <stdio.h>
#include <map>
#include <vector>
#include <math.h>
#include <algorithm>
#include <queue>
#include <set>
#include <tuple>
using namespace std;

#define FOR(i,init,a) for(int i=init; i<a; i++)
#define rep(i,a) FOR(i,0,a)
#define rrep(i,a) for(int i=a; i>=0; i--)
#define rep1(i,a) for(int i=1; i<=a; i++)
#define cout1(a) cout << a << endl;
#define cout2(a,b) cout << a << " " << b << endl;
#define cout3(a,b,c) cout << a << " " << b << " " << c << endl;
#define cout4(a,b,c,d) cout << a << " " << b << " " << c << " " << d << endl;
#define mem(a,n) memset( a, n, sizeof(a))
#define all(a) a.begin(),a.end()
#define chmin(a,b) a=min(a,b);
#define chmax(a,b) a=max(a,b);

typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef vector<int> V;
typedef vector<V> VV;
typedef vector<VV> VVV;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LLINF = 1e18;
static const double pi = 3.141592653589793;

int N,A,B,ans=0;

void calc(int n){
    int x=n;
    int res=0;
    while(x>0){
        res+=x%10;
        x/=10;
    }
    if(res>=A&&res<=B) ans+=n;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    cin>>N>>A>>B;
    rep1(i,N) calc(i);
    cout1(ans)
}

Measured memory_bytes: 256
import java.util.*;

class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		
		int w = sc.nextInt();
		int h = sc.nextInt();
		int x = sc.nextInt();
		int y = sc.nextInt();
		int r = sc.nextInt();
		
		if(x - r >= 0 && y - r >= 0 && x + r <= w && y + r <= h)
			System.out.println("Yes");
		else
			System.out.println("No");
	}
}

Measured memory_bytes: 26224
#include<bits/stdc++.h>
using namespace std;
#define fr(x,i,n) for(int x = i; x < n; ++x)
#define fb(x,i,n) for(int x = i; x >= n; --x)
#define pr pair<int,int>
#define ll long long int
const int mod=1e9+7;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int k;
    cin>>k;
    int sum=0;
    fr(i,1,k+1)
    fr(j,1,k+1)
    fr(l,1,k+1)
    sum+=__gcd(__gcd(i,j),l);
    cout<<sum;
}


Measured memory_bytes: 3652
#include <stdio.h>

int dp[50];

int fib(int n){
  if(n==0||n==1) return dp[n]=1;
  if(dp[n]!=-1) return dp[n];
  return dp[n]=fib(n-1)+fib(n-2);
}

int main(){
  int n, i;

  for(i=0; i<50; i++) dp[i]=-1;

  scanf("%d", &n);

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



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

int main(){
  
  int n, k, ans = 0;
  cin >> n >> k;

  rep(i, n){
    int a;
    cin >> a;
    ans += min(a*2, abs(k-a)*2);
  }

  cout << ans << endl;

}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define INF 0x7fffffff
#define N 300001
typedef long long ll;
typedef long double ld;
 
#define fastIO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound

#define sz(x) (int)x.size()
#define beg(x) x.begin()
#define en(x) x.end()

int main()
{
	fastIO;
	
	int x;
	cin >> x;
	if(x >= 30) cout << "Yes" << endl;
	else cout << "No" << endl;

	return 0;
}

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

#define pb push_back
#define mk make_pair
#define lob lower_bound
#define upb upper_bound
#define fst first
#define scd second

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

inline int read(){
	int f=1,x=0;char ch=getchar();
	while(!isdigit(ch)){if(ch=='-')f=-1;ch=getchar();}
	while(isdigit(ch)){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}
inline ll readll(){
	ll f=1,x=0;char ch=getchar();
	while(!isdigit(ch)){if(ch=='-')f=-1;ch=getchar();}
	while(isdigit(ch)){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}

const int MAXN=305;
int n,K,MOD,c[MAXN][MAXN],f[MAXN][MAXN],g[MAXN][MAXN];
int main() {
	n=read();K=read();MOD=read();
	c[0][0]=1;
	for(int i=1;i<=n;++i){c[i][0]=1;for(int j=1;j<=i;++j)c[i][j]=(c[i-1][j]+c[i-1][j-1])%MOD;}
	for(int i=0;i<=K;++i)f[1][i]=1;
	for(int i=K;i>=0;--i)g[1][i]=(f[1][i]+g[1][i+1])%MOD;
	for(int i=2;i<=n+1;++i){
		for(int j=0;j<K;++j){
			for(int k=1;k<i;++k){
				f[i][j]=(f[i][j]+(ll)g[k][j+1]*f[i-k][j]%MOD*c[i-2][k-1]%MOD)%MOD;
			}
		}
		for(int j=K;j>=0;--j)g[i][j]=(f[i][j]+g[i][j+1])%MOD;
	}
	cout<<f[n+1][0]<<endl;
	return 0;
}

Measured memory_bytes: 1280
using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;

namespace DP
{
    using static Ex;
    public class Solve
    {
        public static void Main(string[] args)
        {
            new DP_A();
        }
    }
    public class DP_A
    {
        public DP_A()
        {
            var n = ReadInt;
            var arr = ReadIntArray();
            var dp = new long[n];

            for (int i = 0; i < n; i++)
            {
                dp[i] = long.MaxValue;
            }
            dp[0] = 0;
            for (int i = 0; i < n; i++)
            {
                var j = i + 1;
                if (j < n) dp[j] = Math.Min(dp[j], dp[i] + Math.Abs(arr[i] - arr[j]));
                j = i + 2;
                if (j < n) dp[j] = Math.Min(dp[j], dp[i] + Math.Abs(arr[i] - arr[j]));
            }

            dp[n - 1].Cw();
        }
    }

    public static class Ex
    {
        public static void Cw(this object s) { Console.WriteLine(s); }



        public static bool Mins<T>(ref T a, T b) where T : IComparable<T> { if (a.CompareTo(b) > 0) { a = b; return true; } return false; }
        public static bool Maxs<T>(ref T a, T b) where T : IComparable<T> { if (a.CompareTo(b) < 0) { a = b; return true; } return false; }
        public static void Swap<T>(ref T a, ref T b) { var t = b; b = a; a = t; }
        public static void Swap<T>(List<T> list, int i, int j) { T tmp = list[j]; list[j] = list[i]; list[i] = tmp; }


        static long Gcd(long m, long n) { if (n == 0) return m; return Gcd(n, m % n); }
        public static List<string> FastSort(this List<string> s) { s.Sort(StringComparer.Ordinal); return s.ToList(); }
        public static void yesno(this bool b) { (b ? "yes" : "no").Cw(); }
        public static void YesNo(this bool b) { (b ? "Yes" : "No").Cw(); }
        public static void YESNO(this bool b) { (b ? "YES" : "NO").Cw(); }

        public static string Read { get { return Console.ReadLine().Trim(); } }
        public static int ReadInt { get { return int.Parse(Read); } }
        public static long ReadLong { get { return long.Parse(Read); } }
        public static double ReadDouble { get { return double.Parse(Read); } }
        public static string[] ReadArray() { return Read.Split(' '); }
        public static int[] ReadIntArray() { return Read.Split(' ').Select(int.Parse).ToArray(); }
        public static long[] ReadLongArray() { return Read.Split(' ').Select(long.Parse).ToArray(); }
        public static string[] ReadArray(long N) { var v = new string[N]; for (long i = 0; i < N; ++i) v[i] = Read; return v; }
        public static int[] ReadIntArray(long N) { var v = new int[N]; for (long i = 0; i < N; ++i) v[i] = ReadInt; return v; }
        public static long[] ReadLongArray(long N) { var v = new long[N]; for (long i = 0; i < N; ++i) v[i] = ReadLong; return v; }

    }
}

Measured memory_bytes: 20448
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
#include <cstring>
#include<iostream>
using namespace std;
const int MAXV = 100005; //素数表范围
int main()
{
   string st;
    while(cin>>st)
    {
       for(int i=0;i<st.size();i++)
       {
           if(i%2==0)
            cout<<st[i];
       }
       cout<<endl;
    }
    return 0;
}


Measured memory_bytes: 512
import java.io.PrintWriter

//private val inp = java.io.File("in")
private val inp = System.`in`
private val reader = inp.bufferedReader()
private val wr = PrintWriter(System.out.bufferedWriter())

private fun readLn(): String = reader.readLine()
private fun readInt(): Int = readLn().toInt()
private fun readStrs(): List<String> = readLn().split(" ")
private fun readInts(): IntArray = readStrs().map { it.toInt() }.toIntArray()
private fun readChars(): CharArray = readStrs().map { it.single() }.toCharArray()

fun main() {
    val n = readInt()
    val a = readInts()

    val b = IntArray(n + 1)
    for (ai in a) {
        b[ai]++
    }

    for (i in 1..n) wr.println(b[i])
    wr.flush()
}

Measured memory_bytes: 65932
#include <iostream>
#include <vector>
#include <algorithm>
 
using namespace std;
 
int main() {
  int N; cin >> N;
  vector<int> v(N);
  for (int i = 0; i < N; ++i) cin >> v[i];
  sort(v.begin(), v.end());
  double ans = v[0];
  for (int i = 1; i < N; ++i) {
    ans = (ans + v[i]) / 2;
  }
  cout << ans << endl;
 
  return 0;
}

Measured memory_bytes: 256
import sys
input = sys.stdin.readline


def main():
    N, K, Q = map(int, input().split())
    A = [int(input()) for _ in range(Q)]
    cnt = [0] * N
    for a in A:
        cnt[a-1] += 1
    for i in range(N):
        if K - (Q - cnt[i]) <= 0:
            print("No")
        else:
            print("Yes")


if __name__ == "__main__":
    main()


Measured memory_bytes: 49244
#include <stdio.h>

int main(void){

	int S;
	int h,m,s;

    scanf("%d", &S);

    h =S/3600;
    m =(S-h*3600)/60;
    s =S-h*3600-m*60;

	printf("%d:%d:%d\n", h,m,s);

    return 0;
}

Measured memory_bytes: 592
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> P;
typedef pair<int,int> Pi;
#define rep(i, n) for (ll i = 0; i < n; i++)
#define FOR(i, a, b) for (ll i = a; i < b; i++)
#define fi first
#define se second
#define PI (acos(-1))

template<class T>
inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}
template<class T>
inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}
template<typename T> ostream& operator<<(ostream& s,const complex<T>& d) {return s<<"("<<d.real()<<", "<<d.imag()<< ")";}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const pair<T1,T2>& d) {return s<<"("<<d.first<<", "<<d.second<<")";}
template<typename T> ostream& operator<<(ostream& s, const vector<T>& d){
	int len=d.size();
	rep(i,len){
		s<<d[i];if(i<len-1) s<<" ";
	}
	return s;
}
template<typename T> ostream& operator<<(ostream& s,const vector<vector<T>>& d){
	int len=d.size();
	rep(i,len){
		s<<d[i]<<endl;
	}
	return s;
}
template<typename T> ostream& operator<<(ostream& s,const set<T>& v){
	s<<"{ ";
	for(auto itr=v.begin();itr!=v.end();++itr) {
		if (itr!=v.begin()) {s<< ", ";}
		s<<(*itr);
	}
	s<<" }";
	return s;
}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const map<T1,T2>& m){
	s<<"{"<<endl;
	for(auto itr=m.begin();itr!=m.end();++itr){
		s<<" "<<(*itr).first<<" : "<<(*itr).second<<endl;
	}
	s<<"}"<<endl;
	return s;
}

const ll mod=1e9+7;
const ll inf=1e15;
const int INF=1e9;

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n,m;
	cin>>n>>m;
	vector<Pi> g(n);
	rep(i,n){
		cin>>g[i].fi>>g[i].se;
	}
	priority_queue<int> que;
	sort(begin(g),end(g));
	int ans=0,ind=0;
	for(int i=m-1;i>=0;i--){
		FOR(j,ind,n){
			if(g[j].fi<=m-i){
				que.push(g[j].se);
				ind++;
			}else break;
		}
		if(que.size()){
			ans+=que.top();
			que.pop();
		}
	}
	cout<<ans<<endl;
}

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

#define int long long
#define rep(i, l, r) for (int i = (int)(l); i < (int)(r); i++)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)x.size())
template <class T> bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T> bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}

template <class T> using V = vector<T>;
using P = pair<int, int>;

/*
 *  */

class UnionFind
{
public:
  int n;
  vector<int> par, rnk, siz;

  UnionFind(int n_)
  {
    n = n_;
    par.resize(n);
    rnk.resize(n);
    siz.resize(n);
    for(int i = 0; i < n; i++){
      par[i] = i;
      rnk[i] = 0;
      siz[i] = 1;
    }
  }

  int find(int x)
  {
    if(par[x] == x) return x;
    return par[x] = find(par[x]);
  }

  void unite(int x, int y)
  {
    x = find(x);
    y = find(y);
    if(x == y) return;

    int sum = siz[x] + siz[y];
    siz[x] = siz[y] = sum;

    if(rnk[x] < rnk[y]){
      par[x] = y;
    }else{
      par[y] = x; 
      if(rnk[x] == rnk[y]) rnk[x]++;
    }
  }

  bool same(int x, int y)
  {
    return find(x) == find(y);
  }

  int size(int x){
    return siz[find(x)];
  }
};

V<int> fri[101010];
V<int> blo[101010];

signed main() {
  int n, m, k;
  cin >> n >> m >> k;

  UnionFind uf(n);
  rep(i, 0, m){
    int a, b;
    cin >> a >> b;
    a--; b--;
    uf.unite(a, b);
    fri[a].emplace_back(b);
    fri[b].emplace_back(a);
  }
  rep(i, 0, k){
    int a, b;
    cin >> a >> b;
    a--; b--;
    if(uf.same(a, b)){
      blo[a].emplace_back(b);
      blo[b].emplace_back(a);
    }
  }

  rep(i, 0, n){
    int ans = uf.size(i) - sz(fri[i]) - sz(blo[i]) - 1;
    cout << ans << " \n"[i==n-1];
  }

  return 0;
}


Measured memory_bytes: 15348
#include<deque>
#include<queue>
#include<vector>
#include<algorithm>
#include<iostream>
#include<set>
#include<cmath>
#include<tuple>
#include<string>
#include<chrono>
#include<functional>
#include<iterator>
#include<random>
#include<unordered_set>
#include<array>
#include<map>
#include<iomanip>
#include<assert.h>
#include<bitset>
#include<stack>
#include<memory>
using namespace std;
using namespace std::chrono;
typedef long long int llint;
typedef double lldo;
#define mp make_pair
#define mt make_tuple
#define pub push_back
#define puf push_front
#define pob pop_back
#define pof pop_front
#define fir first
#define sec second
#define res resize
#define ins insert
#define era erase

/*
cout<<fixed<<setprecision(20);
cin.tie(0);
ios::sync_with_stdio(false);
*/
const llint mod=1000000007;
const llint big=2.19e15+1;
const long double pai=3.141592653589793238462643383279502884197;
const long double eps=1e-15;
template <class T,class U>bool mineq(T& a,U b){if(a>b){a=b;return true;}return false;}
template <class T,class U>bool maxeq(T& a,U b){if(a<b){a=b;return true;}return false;}
llint gcd(llint a,llint b){if(a%b==0){return b;}else return gcd(b,a%b);}
llint lcm(llint a,llint b){if(a==0){return b;}return a/gcd(a,b)*b;}
template<class T> void SO(T& ve){sort(ve.begin(),ve.end());}
template<class T> void REV(T& ve){reverse(ve.begin(),ve.end());}
template<class T>llint LBI(vector<T>&ar,T in){return lower_bound(ar.begin(),ar.end(),in)-ar.begin();}
template<class T>llint UBI(vector<T>&ar,T in){return upper_bound(ar.begin(),ar.end(),in)-ar.begin();}
int main(void){
	cin.tie(0);
	ios::sync_with_stdio(false);
	llint gn=(mod+1)/2;
	int n,Q,i,j;cin>>n>>Q;
	static llint dp[3000][3000]={0};//A[前] < A[後]の確立
	vector<int>A(n);
	for(i=0;i<n;i++){cin>>A[i];}
	llint k=1;
	for(i=0;i<n;i++){
		for(j=0;j<n;j++){
			if(A[i]<A[j]){dp[i][j]=1;}
		}
	}
	while(Q--){
		k*=2;k%=mod;
		int x,y;cin>>x>>y;x--;y--;
		for(i=0;i<n;i++){
			if(i==x||i==y){continue;}
			llint w=(dp[i][x]+dp[i][y])*gn%mod;
			dp[i][x]=w;dp[i][y]=w;
			llint r=(dp[x][i]+dp[y][i])*gn%mod;
			dp[x][i]=r;dp[y][i]=r;
		}
		llint e=(dp[x][y]+dp[y][x])*gn%mod;
		dp[x][y]=e;dp[y][x]=e;
	}
	llint ans=0;
	for(i=0;i<n;i++){
		for(j=0;j<i;j++){ans+=dp[i][j];}
	}
	ans%=mod;ans*=k;ans%=mod;
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 70528
#include <iostream>
#include <string.h>
#include <vector>
#include <algorithm>
#include <cmath>
#include <map>
#include <functional>
#include <cassert>
#include <utility>
#include <stack>
#include <queue>
using namespace std;
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,n1,n2) for(int i=n1;i<n2;i++)
#define speed_up    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
typedef pair<int,int> Pi;
typedef long long int ll;
const int INF=(ll)(1<<30)-1;
const ll INFl=(ll)9223372036854775807;
const int MAX=10000;
const ll MOD=(ll)1e9+7;
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int lcm(int a,int b){return a/gcd(a, b)*b;}

int n;
vector<ll> rek;

void ins(ll k){
	if(k>1000000000){
		return;
	}
	rek.push_back(k);
	ins(k*10+3);
	ins(k*10+5);
	ins(k*10+7);
	return;
}

int main(){
	cin>>n;
	ins(3);
	ins(5);
	ins(7);
	ll ans=0;
	for(int i=0;i<rek.size();i++){
		int flag3=0;
		int flag5=0;
		int flag7=0;
		if(n>=rek[i]){
			while(rek[i]>0){
				int c=rek[i]%10;
				if(c==3)flag3++;
				if(c==5)flag5++;
				if(c==7)flag7++;
				rek[i]/=10;
			}
			if(flag3&&flag5&&flag7)ans++;
		}
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 640
#include <cstdio>
#include <cmath>
#include <iostream>
#include <set>
#include <algorithm>
#include <vector>
#include <map>
#include <cassert>
#include <string>
#include <cstring>
#include <queue>
#include <bitset> 

using namespace std;

#define rep(i,a,b) for(int i = a; i < b; i++)
#define S(x) scanf("%d",&x)
#define S2(x,y) scanf("%d%d",&x,&y)
#define P(x) printf("%d\n",x)
#define all(v) v.begin(),v.end()
#define FF first
#define SS second
#define pb push_back
#define mp make_pair

typedef long long int LL;
typedef pair<int, int > pii;
typedef vector<int > vi;

const int N = 2000 * 2001;
// const int N = 20;
bitset<N> b;

int main() {
  int n;
  S(n);
  int sm = 0;
  b.set(0,1);
  rep(i,0,n) {
    int x;
    S(x);
    b = b | (b << x);
    sm += x;
  }
  sm++; sm /= 2;
  rep(i,sm,N+1) if(b[i]) {
    P(i);
    return 0;
  }
  return 0;
}


Measured memory_bytes: 2176
#include <iostream>
#include <cstring>
#include <cstdio>
#include <algorithm>
#include <map>
#include <vector>
#include <queue>
#define maxn 100005
#define LL long long

using namespace std;

LL n,m,ans[maxn];
int ret=0;

LL phi(LL x)
{
	LL ret=x;
	for (LL i=2;i*i<=x;i++) if (x%i==0)
	{
		ret-=ret/i;
		while (x%i==0) x/=i;
	}
	if (x>1) ret-=ret/x;
	return ret;
}

LL solve(LL x)
{
	if (x==2) return 1;
	LL ret=0;
	for (LL i=2;i*i<=x-1;i++) if ((x-1) %i==0)
	{
		ret++;
		if (i*i!=x-1) ret++;
	}
	for (LL i=2;i*i<=x;i++)  if (x%i==0)
	{
		LL b=x,c=1;
		while (b%i==0)
		{
			c*=i; b/=i;
		}
		if (b==1 || b%i==1) ret++;
	}
	return ret+2;
}

int main()
{
	cin >>n;
	cout <<solve(n)<<endl;
	return 0;
}


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

class Main {

    static final int X = 0;
    static final int Y = 1;
    
    public static void main(String[] args) {

	final Scanner stdin = new Scanner(System.in);

	while( stdin.hasNextLine() ) {
	    String[] input = stdin.nextLine().split(",");

	    double[][] pos = new double[4][2];
	    for ( int i = 0; i < 4; i++ ) {
		for ( int j = 0; j < 2; j++ ) {
		    pos[i][j] = Double.parseDouble( input[i * 2 + j] );
		}
	    }

	    if ( solve( pos ) ) {
		System.out.println("YES");
	    } else {
		System.out.println("NO");
	    }
	}	
    }

    static boolean solve( double[][] pos ) {
	final boolean[] right = new boolean[4];
	
	for ( int i = 0; i < 4; i++ ) {
	    final int ni = (i + 1) % 4;
	    final int nni = (i + 2) % 4;
	    
	    final double dx1 = pos[ni][X] - pos[i][X];
	    final double dy1 = pos[ni][Y] - pos[i][Y];
	    final double dx2 = pos[nni][X] - pos[i][X];
	    final double dy2 = pos[nni][Y] - pos[i][Y];
	    
	    right[i] = dx2 * dy1 - dx1 * dy2 > 0;
	}

	return allSame( right );
    }

    static boolean allSame( boolean[] array ) {
	final boolean val = array[0];
	for ( boolean b : array ) {
	    if ( b != val ) {
		return false;
	    }
	}
	return true;
    }
    
}

Measured memory_bytes: 17168
#include <bits/stdc++.h>
#define F first
#define S second
using namespace std;
typedef long long ll;
int n, arr[55];
double sum;
int main()
{
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> n;
    for(int i = 0;i < n;++i)
        cin >> arr[i];
    sort(arr, arr + n);
    sum = arr[0];
    for(int i = 1;i < n;++i)
        sum = (sum + arr[i]) / 2;
    cout << fixed << setprecision(10) << sum;
    return 0;
}


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

using namespace std;

#define FOR(i,k,n) for(int i=k;i<n;i++)
#define FORR(i,k,n) for(int i=k;i<=n;i++)
#define scan(a) scanf("%d",&a)
#define scann(a,b) scanf("%d%d",&a,&b)
#define scannn(a,b,c) scanf("%d%d%d",&a,&b,&c)
#define mst(a,n)  memset(a,n,sizeof(a))
#define ll long long
#define N 55
#define mod 1000000007
#define INF 0x3f3f3f3f

const double eps=1e-8;
const double pi=acos(-1.0);

int n,m;
char a[N][N],b[N][N];

bool cmp(int x,int y)
{
    for(int i=0;i<m;i++)
    {
        for(int j=0;j<m;j++)
        {
            if(a[i+x][j+y]!=b[i][j])
                return false;
        }
    }
    return true;
}

int main()
{
    //freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);


    scann(n,m);
    getchar();
    for(int i=0;i<n;i++)
        scanf("%s",a+i);
    for(int i=0;i<m;i++)
        scanf("%s",b+i);
    for(int i=0;i<=n-m;i++)
    {
        for(int j=0;j<=n-m;j++)
        {
            if(a[i][j]==b[0][0])
            {
                if(cmp(i,j))
                {
                    printf("Yes\n");
                    return 0;
                }
            }
        }
    }
    printf("No\n");
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
int main(void)
{
	int r, c, i, j;
	
	scanf("%d %d", &r, &c);
	
	int sheet[r+1][c+1];
	
	for(i=0;i<=r;i++){
		for(j=0;j<=c;j++){
			sheet[i][j] = 0;
		}
	}
	
	for(i=0;i<r;i++){
		for(j=0;j<c;j++){
			scanf("%d ",&sheet[i][j]);
		}
	}
	//横の合計
	for(i=0;i<r;i++){
		for(j=0;j<c;j++){
			sheet[i][c] = sheet[i][c] + sheet[i][j];
		}
	}
	//縦の合計
	for(i=0;i<r;i++){
		for(j=0;j<c;j++){
			sheet[r][j] = sheet[r][j] + sheet[i][j];
		}
	}
	//全体の合計(縦)
	for(i=0;i<r;i++){
		sheet[r][c] = sheet[r][c] + sheet[i][c];
	}
	
	for(i=0;i<=r;i++){
		for(j=0;j<=c;j++){
			if(j<c)printf("%d ",sheet[i][j]);
			else printf("%d",sheet[i][j]);
		}
		putchar('\n');
	}
	return 0;
}


Measured memory_bytes: 2016
n,a,b =map(int, input().split())
al = list(map(int, input().split()))
newal = sorted(al,reverse = True)
ave = 0
ml = []
for i in range(a,b+1):
    avet = sum(newal[:i])/i
    if avet >= ave:
        ml.append(i)
        ave = max(ave,avet)
print(ave)

import collections
c = collections.Counter(al)

from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

res = 0
for j in ml:
    r = c[newal[j-1]]
    rr = newal.index(newal[j-1])
    res += cmb(r,j-rr)
print(res)

Measured memory_bytes: 3572
#include <bits/stdc++.h>
#define ri register
#define int long long
using namespace std;
inline int read()
{
    int s=0, w=1; ri char ch=getchar();
    while(ch<'0'||ch>'9') { if(ch=='-') w=-1; ch=getchar(); }
    while(ch>='0'&&ch<='9') s=(s<<3)+(s<<1)+(ch^48), ch=getchar();
    return s*w;
}
signed main()
{
    int n,k;
    n=read(), k=read();
    int res=0;
    for(ri int i=k+1;i<=n;i++)
    {
        int pp=i-k;
        res+=pp*(n/i);
        res+=max(n-n/i*i-max(k-1,0ll),0ll);
    }
    printf("%lld\n",res);
    return 0;
}

Measured memory_bytes: 3736
#pragma GCC optimize(2)
#include <cstdio>
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <vector>
#include <map>
#include <unordered_map>
#include <set>
#include <queue>
#include <deque>
#include <list>
#include <climits>
#include <bitset>
#include <fstream>
#include <algorithm>
#include <functional>
#include <stack>
#include <string>
#include <cmath>
#define fi first
#define se second
#define re register
#define ls i << 1
#define rs i << 1 | 1
#define pb push_back
#define pii pair<int,int>
#define ios ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define mod 1000000007

#define int long long

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const double eps = 1e-8;
const int inf = 0x3f3f3f3f;
const long long INF = 0x3f3f3f3f3f3f3f3f;
const double pi = acos(-1.0);
int tt;
inline int rd(){
  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;
}

void out(int a) {
  if (a < 0) putchar('-'), a = -a;
  if (a >= 10) out(a / 10);
  putchar(a % 10 + '0');
}
const int maxn = 1010;
char s[maxn], t[maxn];

void solve() {
  scanf("%s",s);
  scanf("%s",t);
  int lens = strlen(s), lent = strlen(t);
  int ans = inf;
  for (int i = 0; i + lent <= lens; i++) {
    int cnt = 0, pos = i;
    for (int j = 0; j < lent; j++,pos++) {
      if (s[pos] != t[j]) cnt++;
    }
    ans = min(ans, cnt);
  }
  cout << ans << '\n';
}

signed main(){
//  for (tt = rd(); tt--; )
  solve();
  return 0;
}

Measured memory_bytes: 3680
import java.util.Scanner;
class Main{
public static void main(String[]args){
Scanner sc=new Scanner(System.in);

int N =sc.nextInt();

if(N!=0){
     int ans =N/2;
     int answer=N%2;
     if(answer==0){
     System.out.println(ans);
     }else{
     System.out.println(ans+1);}
}else{
System.out.println(0);
}
}
}

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

int main() {
	int N, K;
	cin >> N >> K;
	bool num[10] = {false};
	int tmp;
	for (int i=0; i<K; i++) {
		cin >> tmp;
		num[tmp] = true;
	}

	while (1) {
		tmp = N;
		while (tmp > 0) {
			int n1 = tmp % 10;
			if (num[n1]) break;
			tmp /= 10;
		}
		if (tmp <= 0) break;
		N++;
	}

	cout << N << endl;
	return 0;
}


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

int main() {
  deque<char> d;
  int Q;
  string S;
  cin>>S>>Q;
  for(int i=0;i<S.size();i++){
   d.push_back(S.at(i)); 
  }
  int T,F;
  char C;
  int j=0;
  for(int i=0;i<Q;i++){
    cin>>T;
    if(T==1){
     j++;
    }
    else{
      cin>>F>>C;
      if((F==1&&j%2==0)||(F==2&&j%2==1)){
        d.push_front(C);
      }
      else{
        d.push_back(C);
      }
    }
  }
  if(j%2==0){
	while(d.size()>0){
		cout<<d.front();
      d.pop_front();
	}
  }
  else{
	while(d.size()>0){
		cout<<d.back();
      d.pop_back();
	}
  }
}


Measured memory_bytes: 896
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
using pint = pair<int,int>;
ll mod = 1000000007;
int dx[8] = {1,0,-1,0,1,1,-1,-1};
int dy[8] = {0,1,0,-1,1,-1,1,-1};
void chmin(long long &a, long long b) { if (a > b) a = b; }
const long long INF = 1LL<<60;
int main() {
    int a,b;
    cin >> a >> b;
    if((a+b) %2 == 0){
        cout << (a+b)/2 << endl;
    }else{
        cout << (a+b)/2+1 << endl;
    }
    return 0;
}

Measured memory_bytes: 256
fun main(args: Array<String>) {
    val (a, b, c, d) = readInputLine().toCharArray().map { it.toString().toInt() }
    
    for (i in 0..1) {
        for (j in 0..1) {
            for (k in 0..1) {
                var ans = a
                if (i == 0) {
                    ans += b
                } else {
                    ans -= b
                }
                if (j == 0) {
                    ans += c
                } else {
                    ans -= c
                }
                if (k == 0) {
                    ans += d
                } else {
                    ans -= d
                }
                
                if (ans != 7) {
                    continue
                }
                
                print(a)
                print(opToString(i))
                print(b)
                print(opToString(j))
                print(c)
                print(opToString(k))
                print(d)
                println("=7")
                
                return
            }
        }
    }
}
 
fun readInputLine(): String {
    return readLine()!!
}

fun opToString(op: Int): Char {
    if (op == 0) {
        return '+'
    } else {
        return '-'
    }
}


Measured memory_bytes: 33732