akhauriyash/Code-Regression huggingface dataset:
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String args[]) {

		Scanner sc = new Scanner(System.in);
		String S = sc.nextLine();

		List<Character> c = new ArrayList<>();
		for(int i=0;i<S.length();i++) {
			if(!c.contains(S.charAt(i))) c.add(S.charAt(i));
		}
		Collections.sort(c);

		char x = 'a';
		int i=0;
		while(x <= 'z') {
			if(i >= c.size()) {
				break;
			}if(x == c.get(i)) {
				x++;
				i++;
			}else {
				break;
			}
		}

		if(x > 'z') {
			System.out.println("None");
		}else {
			System.out.println(x);
		}
	}
}

Measured memory_bytes: 26308
N = int(input())
cnt_max = 0
ans = 1
for n in range(1 , N+1):
    cnt = 0
    z = n
    while True:
        if z%2 == 0:
            cnt += 1
            z = z / 2
        else:
            break
    if cnt > cnt_max:
        cnt_max = cnt
        ans = n

print(ans)

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

#ifdef _DEBUG
#define dout cout
#define debug() if (true)
#define dvout(v) vout(v)
#else
#define dout if (false) cout
#define debug() if (false)
#define dvout(v) if(false) vout(v)
#endif

#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define all(x) (x).begin(), (x).end()
#define vout(v)           \
	for (auto &i : v)     \
	{                     \
		cout << i << " "; \
	}                     \
	cout << "\n"; //配列出力
#define vec(v, n) vector<int> v(n, 0);
#define vecll(v, n) vector<ll> v(n, 0);
#define vecvec(v,n,m) vector<vector<int>> v(n, vector<int>(m));
#define vin(v)        \
	for (auto &i : v) \
		cin >> i; //配列入力

#define mod (int)(1e9+7)
typedef long long ll;
typedef unsigned long long ull;
#define next asdnext
#define prev asdprev
#define _n "\n"
#define _n2 "\n\n"
#define _t "\t"

//	LLONG_MAX 9.2*1e18	9223372036854775807LL
//						999999999999999989
//	O(1e7) O(1e8)

void Main()
{
	int N,K;
	cin>>N>>K;
	vec(A,N);
	int longer=-1;
	rep(i,N){
		cin>>A[i];
		longer = max(longer, A[i]);
	}

	int l=0, r=longer+1;
	while(r-l>1){
		int mid=(l+r)/2;
		if(mid==0) mid=1;
		ll ans=0;
		rep(i,N){
			ans += (A[i]-1)/mid;
		}
		if(ans<=K)r=mid;
		else l=mid;
	}

	cout<<r<<_n;
}


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


Measured memory_bytes: 3960
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define bit(n) (1<<(n))
#define fi first
#define se second
#define ii(x) int x; cin >> (x)
#define ii2(x, y) int x, y; cin >> (x) >> (y)
#define ii3(x, y, z) int x, y, z; cin >> (x) >> (y) >> (z)
#define yn(x, ok, ng) cout << ((x)?(ok):(ng)) << endl
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<bool> vb;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
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;}
ll gcd(ll a, ll b) { return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) { return a/gcd(a,b)*b;}
int const INF = 1001001001;


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

ii(k);
ll ans = 0;
rrep(a, k) rrep(b, k) rrep (c, k) ans += gcd(a , gcd(b, c));
cout << ans << endl;

return 0;
}

Measured memory_bytes: 3612
#if !defined(__clang__) && defined(__GNUC__)
#include <bits/stdc++.h>
#else
#include <cstdlib>
#include <climits>
#include <iostream>
#include <cstdint>
#include <vector>
#include <string>
#include <complex>
#include <bitset>
#include <queue>
#include <deque>
#include <stack>
#include <utility>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <regex>
#endif //  !defined(__clang__) && defined(__GNUG__)
#include <boost/lexical_cast.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/multi_array.hpp>
#include <boost/optional.hpp>
#include <boost/math/common_factor_rt.hpp>

using namespace std;

/* エラトステネスのふるい

   O(n log log n) だいたい線形。 10万とかは余裕
*/
template<typename T>
std::vector<T> sieve(T n)
{
    std::vector<T> primes;
    std::vector<bool> is_prime(n, true);
    is_prime[0] = is_prime[1] = false;

    for (T i = 2; i <= n; ++i) {
        if (is_prime[i]) {
            primes.push_back(i);
            for (T j = 2 * i; j <= n; j += i) {
                is_prime[j] = false;
            }
        }
    }
    return primes;
}


int main()
{
    int64_t Q;
    std::cin >> Q;

    auto ps = sieve((int64_t)100000);

    std::vector<int64_t> s;

    for (auto p : ps) {
        auto pos = std::find(std::begin(ps), std::end(ps), (p+1)/2);
        if (pos != std::end(ps)) {
            s.push_back(p);
        }
    }

    for (decltype(Q) i = 0; i < Q; ++i) {
        int64_t l, r;
        std::cin >> l >> r;

        auto lit = std::lower_bound(s.begin(), s.end(), l);
        auto rit = std::upper_bound(s.begin(), s.end(), r);

        std::cout << std::distance(lit, rit) << std::endl;
    }

    return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
int main()
{
    int N, K;
    long result;
    std::cin >> N >> K;
    std::vector<int> H(N);
    for (int i = 0; i < N; i++)
    {
        std::cin >> H[i];
    }
    std::sort(H.begin(), H.end(), std::greater<int>());
    result = 0;
    if (K < N)
    {
        for (int i = K; i < N; i++)
        {
            result += H[i];
        }
    }
    std::cout << result << std::endl;
}

Measured memory_bytes: 1024
import java.io.*;
import java.io.IOException;
import java.util.*;

@SuppressWarnings({"rawtypes", "unchecked"})
class Main {
    final static int INF = 1 << 28;
    final static long LNF = 1L << 60;
    final static double EPS = 1e-9;
    final static double GOLDEN_RATIO = (1.0 + Math.sqrt(5)) / 2.0;

    static final long MOD = 1_000_000_007;

    public static void main(String[] args) throws Exception {
        final MyScanner sc = new MyScanner();
        long[] A = new long[(int)(3)];
        for(int i = 0 ; i < 3 ; i++){
                A[i] = sc.nextLong();
        }
        solve(A);
    }

    static void solve(long[] A){
        if(A[0] + A[1] + A[2] > 21) System.out.println("bust");
        else System.out.println("win");
    }


    static class MyScanner {
 
        BufferedReader br;
        StringTokenizer st;
 
        MyScanner(FileReader fileReader) {
            br = new BufferedReader(fileReader);
        }
 
        MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }
 
        String nn() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
 
        String next() {
            String ans = "";
            try {
                ans = br.readLine();
            } catch (IOException ex) {
                ex.printStackTrace();
            }
            return ans;
        }
 
        char nextChar() {
            return nn().charAt(0);
        }
 
        int nextInt() {
            return Integer.parseInt(nn());
        }
 
        long nextLong() {
            return Long.parseLong(nn());
        }
 
        double nextDouble() {
            return Double.parseDouble(nn());
        }
 
        Integer[] niArr0(int n) {
            Integer[] ar = new Integer[n];
            for (int i = 0; i < n; i++) {
                ar[i] = nextInt();
            }
            return ar;
        }
 
        Integer[] niArr1(int n) {
            Integer[] ar = new Integer[n + 1];
            for (int i = 1; i <= n; i++) {
                ar[i] = nextInt();
            }
            return ar;
        }
 
        Long[] nlArr0(int n) {
            Long[] ar = new Long[n];
            for (int i = 0; i < n; i++) {
                ar[i] = nextLong();
            }
            return ar;
        }
 
        Long[] nlArr1(int n) {
            Long[] ar = new Long[n + 1];
            for (int i = 1; i <= n; i++) {
                ar[i] = nextLong();
            }
            return ar;
        }
    }

}


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


int main(void){
    int n;
    cin >> n;
    vector<string> w;
    rep(i,n){
        string s;
        cin >> s;
        w.push_back(s);
    }
    bool flag = 0;
    rep(i,n-1){
        for(int j=i+1;j<n;j++){
            if(w[i]==w[j]){
                flag = 1;
            }
        }
    }
  	
    rep(i,n-1){
        if(w[i][w[i].length()-1] != w[i+1][0]){
            flag =1;
        }
    }
    
    
    
    if(flag) cout << "No" <<endl;
    else cout <<  "Yes" <<endl;
 
    return 0;
}














































Measured memory_bytes: 256
/*
 * Created by KeigoOgawa
 */


#include <cstdio>
#include <iostream>
#include <algorithm>
#include <queue>
#include <map>
#include <set>
#include <cassert>
#include <cmath>

#define INF (int)1e8
#define EPS 1e-10
#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define RFOR(i, a, b) for (ll i = (b)-1; i >= (a); i--)
#define REP(i, n) for (ll i = 0; i < (n); i++)
#define RREP(i, n) for (ll i = (n) - 1; i >= 0; i--)
#define MIN(a, b) (a > b ? b : a)
#define MAX(a, b) (a > b ? a : b)
#define debug(x) cerr << #x << ": " << x << endl
#define all(a) (a).begin(), (a).end()

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vi> vii;
typedef pair<int, int> PII;

// vector
template<typename T> ostream& operator<<(ostream& s, const vector<T>& v) {
    int len = v.size();
    for (int i = 0; i < len; ++i) {
        s << v[i]; if (i < len - 1) s << "\t";
    }
    return s;
}

// 2 dimentional vector
template<typename T> ostream& operator<<(ostream& s, const vector< vector<T> >& vv) {
    int len = vv.size();
    for (int i = 0; i < len; ++i) {
        s << vv[i] << endl;
    }
    return s;
}

int N;

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

    cin >> N;
    string in;
    int start = 1, end = N;
    cout << start-1 << endl;
    cin >> in;

    string zero;
    if (in == "Vacant") {
        return 0;
    } else {
        zero = in;
    }

    cout << N - 1 << endl;
    cin >> in;
    if (in == "Vacant") {
        return 0;
    }

    int med = (start + end) / 2;
    cout << med-1 << endl;
    while (cin >> in) {
        if (in == "Vacant") {
            return 0;
        } else if ((in == zero && (med % 2 == 1)) || (in != zero && (med % 2 == 0))) {
            start = med;
        } else {
            end = med;
        }
        med = (start + end) / 2;
        cout << med-1 << endl;
    }


    return 0;
}


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

int main(){
    string A,B;
    cin>>A>>B;
    if(A.size()<B.size()){
        cout<<"LESS"<<endl;
    }
    else if(A.size()>B.size()){
        cout<<"GREATER"<<endl;
    }
    else{
        if(A>B)
            cout<<"GREATER"<<endl;
        else if(A<B)
            cout<<"LESS"<<endl;
        else
            cout<<"EQUAL"<<endl;
    }
    return 0;
}

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

#define REP(i,n) REPN(i,0,n)
#define REPN(i,m,n) for(int i=m; i<(n); i++)

int n, A[50];

bool solve(int i, int m) {
    if (m == 0) {
        return true;
    }
    if (i >= n) {
        return false;
    }
    bool res = solve(i + 1, m) || solve(i + 1, m - A[i]);
    return res;
}

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

    int q, M, i;
    cin >> n;
    REP(i, n) {
        cin >> A[i];
    }
    cin >> q;
    REP(i, q) {
        cin >> M;
        if (solve(0, M)) {
            cout << "yes" << '\n';
        } else {
            cout << "no" << '\n';
        }
    }
}



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

int main()
{
    string s;
    cin >> s;
    int flag = 0;
    for(int i = 0; i < 3; i++)
    {
        if(s[i] == '7')
        {
            flag = 1;
        }
    }
    if(flag == 1)
    {
        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }
    return 0;
}


Measured memory_bytes: 3592
def maxHeapify(x)
  l = 2*x
  r = 2*x+1

  if l <= @n && @heap[l] > @heap[x]
    largest = l
  else
    largest = x
  end

  if r <= @n && @heap[r] > @heap[largest]
    largest = r
  end

  if largest != x
    @heap[x], @heap[largest] = @heap[largest], @heap[x]
    maxHeapify(largest)
  end
end

def buildMaxHeap
  (@n/2).downto(1){ |i| maxHeapify(i) }
end

@n = gets.chomp.to_i
@heap = gets.chomp.split.map(&:to_i)
@heap.unshift nil
buildMaxHeap
@heap.shift
@heap.each{ |i| print " ", i}
puts

Measured memory_bytes: 63052
#include <iostream>
#include <cstring>

using namespace std;

int main(int argc, char* argv[])
{
    char sikiri[] = "####################";
    int nyukyo[4][3][10];
    int b, f, r, v, n;

    for (int n = 0; n < 4; n++){
        for (int i = 0; i < 3; i++){
            for (int j = 0; j < 10; j++){
                nyukyo[n][i][j] = 0;
            }
        }
    }

    cin >> n;
    for (int i = 0; i < n; i++){
        cin >> b >> f >> r >> v;
        nyukyo[b - 1][f - 1][r - 1] += v;
    }

    for (int n = 0; n < 4; n++){
        for (int i = 0; i < 3; i++){
            for (int j = 0; j < 10; j++){
                cout << " " << nyukyo[n][i][j];
            }
            cout << "\n";
        }
        if (n < 3) cout << sikiri << endl;
    }
    return 0;
}



Measured memory_bytes: 3104
S = input()
K = int(input())

f = False
pre = S[0]
for s in S:
    if pre != s:
        break
else:
    f = True

def one(S):
    c = 0
    r = 1
    pre = ""
    for s in S:
        if pre == s:
            r += 1
        else:
            c += r // 2
            r = 1
        pre = s
    c += r // 2
    return c

def two(S):
    c = 0
    r = 1
    pre = ""
    for s in S*2:
        if pre == s:
            r += 1
        else:
            c += r // 2
            r = 1
        pre = s
    c += r // 2
    return c

o = one(S)
t = two(S)

if f:
    print(len(S)*K//2)
else:
    print(o*K + (t-o*2)*(K-1))



Measured memory_bytes: 3316
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cctype>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>
#include<complex>
#include <cassert>

using namespace std;

#define ll long long
#define ld long double
#define INF 1e9
#define LINF (ll)INF*INF
#define MOD 1000000007
#define rep(i,n) for(int i=0;i<(n);i++)
#define loop(i,a,n) for(int i=a;i<(n);i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)

#define int ll //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

const double PI=acos(-1);
const double EPS=1e-9; //うまくいかなかったらゆるめる

typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int,int> pii;
typedef pair<pii,int> ppi;
typedef pair<int,pii> pip;
typedef vector<pii> vp;
typedef vector<vi> vvi;

int gcd(int a, int b){if(b==0) return a;return gcd(b,a%b);}
int lcm(int a, int b){return a/gcd(a,b)*b;}

signed main(void) {
	int n,m;
	cin >> n >> m;
	vvi v(m);
	rep(i,m){
		int k;
		cin >> k;
		v[i] = vi(k);
		rep(j,k)cin >> v[i][j],v[i][j]--;
	}
	vi p(m);
	rep(i,m)cin >> p[i];
	int ans = 0;
	rep(bit, 1<<n){
		bool c = true;
		rep(i,m){
			int cnt = 0;
			rep(j,v[i].size())if(bit & (1<<v[i][j]))cnt++;
			if(cnt%2 != p[i])c = false;
		}
		if(c){
			ans++;
		}
	}
	cout << ans << endl;
}


Measured memory_bytes: 3152
import java.io.*;
import java.util.*;
class Main{
	static final long MOD = 1_000_000_007; // 10^9+7
    static final int MAX = 2_147_483_646; // intMax 
    static final int INF = 1_000_000_000; // 10^9  
    public static void main(String[] args) throws Exception {
		hayami saori = new hayami();
		int a = saori.saori_hayami();
		int b = saori.saori_hayami();
		int c = saori.saori_hayami();
		int d = saori.saori_hayami();
		int num = Math.max(b, d);
		int ans = 0;
		for(int i = 0;i <= num;i++){
			if(a <= i && i < b && c <= i && i < d){
				ans++;
			}
		}
		System.out.println(ans);
		saori.close();
    }
}

class hayami implements Closeable {
	private final InputStream in = System.in;
	private final byte[] hayami = new byte[1024];
	private int Hayami = 0;
	private int saori = 0;
	private boolean HayamiSaori() {
		if (Hayami < saori) {
			return true;
		}else{
			Hayami = 0;
			try {
				saori = in.read(hayami);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (saori <= 0) {
				return false;
			}
		}
		return true;
	}
	private int SaoriHayami() { 
		if (HayamiSaori()) {
            return hayami[Hayami++];
         }else{
             return -1;
         }
	}
	private static boolean hayami_saori(int hayami) { 
		return 33 <= hayami && hayami <= 126;
	}
	public boolean hayamisaori() { 
		while(HayamiSaori() && !hayami_saori(hayami[Hayami])) Hayami++; return HayamiSaori();
	}
	public String nextHayami() {
		if (!hayamisaori()) throw new NoSuchElementException();
		StringBuilder hayamin = new StringBuilder();
		int saori = SaoriHayami();
		while(hayami_saori(saori)) {
			hayamin.appendCodePoint(saori);
			saori = SaoriHayami();
		}
		return hayamin.toString();
	}
	public long saorihayami() {//nextLong
		if (!hayamisaori()) throw new NoSuchElementException();
		long hayami = 0;
		boolean misao = false;
		int saori = SaoriHayami();
		if (saori == '-') {
			misao = true;
			saori = SaoriHayami();
		}
		if (saori < '0' || '9' < saori) {
			throw new NumberFormatException();
		}
		while(true){
			if ('0' <= saori && saori <= '9') {
				hayami *= 10;
				hayami += saori - '0';
			}else if(saori == -1 || !hayami_saori(saori)){
				return misao ? -hayami : hayami;
			}else{
				throw new NumberFormatException();
			}
			saori = SaoriHayami();
		}
	}
	public int saori_hayami() {//nextInt
		long hayami = saorihayami();
		if (hayami < Integer.MIN_VALUE || hayami > Integer.MAX_VALUE) throw new NumberFormatException();
		return (int) hayami;
	}
	public double Hayamin() { //nextDouble
		return Double.parseDouble(nextHayami());
	}
	public void close() {
		try {
			in.close();
		} catch (IOException e) {
		}
    }
    
}

Measured memory_bytes: 22484
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <locale>
#include <iostream>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(x) (x).begin(),(x).end()

using namespace std;

using ll = long long;
using ld = long double;

template <typename T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template <typename T> T &chmax(T &a, const T &b) { return a = max(a, b); }
template <typename T> int len(const T &x) { return x.size(); }

template<typename T>
vector<T> table(int n, T v) { return vector<T>(n, v); }

template <class... Args>
auto table(int n, Args... args) {
  auto val = table(args...);
  return vector<decltype(val)>(n, move(val));
}

struct yes_no : numpunct<char> {
  string_type do_truename()  const { return "Yes"; }
  string_type do_falsename() const { return "No"; }
};

void solve(ll N, ll M) {
  cout << (ll(M * 1900 + (N - M) * 100) << int(M)) << endl;;
}

int main() {
  locale loc(locale(), new yes_no);
  cout << boolalpha << setprecision(12) << fixed;
  cout.imbue(loc);
	ll N;
	ll M;
	scanf("%lld", &N);
	scanf("%lld", &M);
	solve(N, M);
	return 0;
}


Measured memory_bytes: 256
n,c,k = map(int,input().split())
t = [0]*n
for i in range(n):
    t[i] = int(input())
t.sort()
ind = 0
ans = 0
bus = 0
while ind <= n-1:
    bus += 1
    ind_o = ind
    for i in range(c):
        if ind_o+i > n-1:
            ind_o += i-1
            break
        if t[ind_o+i] > t[ind_o]+k:
            break
        else:
            ind += 1
print(bus)

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

int main() {
  int n,k,d,e,r;
  cin >>n>>k;
  vector<int> vec = {};
  for (int i =0; i<k; i++) {
    cin>>d;
    for (int j=0;j<d;j++){
      cin>>e;
      vec.push_back(e);
    }
  }
  sort(vec.begin(), vec.end());
    vec.erase(unique(vec.begin(), vec.end()), vec.end());
      r=vec.size();
  cout<<n-r<<endl;
}

Measured memory_bytes: 3628
#include <iostream>
#include <string>

using namespace std;

long long getConCount(string S);

int main(void) {
  long long i, diff_even, diff_odd;
  long long con_count_S, con_count_SS, con_count_SSS;
  long long K;
  char prev_char, tmp_char;
  string S, _S;
  // get input --------------------------------------------
  cin >> _S >> K;
  // count consecutive characters -------------------------
  S = _S;
  con_count_S = getConCount(S);
  S += _S;
  con_count_SS = getConCount(S);
  S += _S;
  con_count_SSS = getConCount(S);
  // get difference --------------------------------------
  diff_even = con_count_SS - con_count_S;
  diff_odd = con_count_SSS - con_count_SS;
  // disp answer ------------------------------------------
  if(K%2 == 0) {
    cout << con_count_S + K/2*diff_even + (K/2 - 1)*diff_odd << endl;
  } else {
    cout << con_count_S + K/2*diff_even + K/2*diff_odd << endl;
  }
  return 0;
}

long long getConCount(string S) {
  long long i, tmp_count, con_count;
  char prev_char, tmp_char;
  // count consecutive characters -------------------------
  tmp_count = 1;
  con_count = 0;
  prev_char = 'A';
  for(i = 0; i < S.size(); i++) {
    tmp_char = S[i];
    if(prev_char == tmp_char) {
      tmp_count++;
    } else {
      con_count += tmp_count/2;
      tmp_count = 1;
    }
    prev_char = tmp_char;
  }
  con_count += tmp_count/2;
  
  return con_count;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define f first
#define s second
#define mp make_pair
#define ll long long 
int main() {
	int i,j,k,l,n,m;
	string s;
	cin>>n>>m;
	for(i=0;i<n;i++)
		s+='a';
	for(i=0;i<m;i++) {
		cin>>j>>k;
		if(s[j-1]=='a')
			s[j-1] = k+'0';
		else
			if(s[j-1]==k+'0');
			else {
				cout<<"-1\n";
				return 0;
			}
	}
	for(i=0;i<n;i++)
		if(s[i]=='a')
			if(i==0 && n!=1)
				s[i] = 1+'0';
			else
				s[i] = '0';
	if(s[0]=='0' && n>1) {
		cout<<"-1\n";
		return 0;
	}
	cout<<s<<endl;
	return 0;
}


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

namespace ASPC2019_C
{
    class Program
    {
        static char[][] S;
        static bool[,] isChecked = new bool[400, 400];
        static int[] xdir = new int[] { 0, 0, -1, 1 };
        static int[] ydir = new int[] { -1, 1, 0, 0 };

        static long cntb, cntw;
        static long H, W;

        static void Main(string[] args)
        {
            var HW = Console.ReadLine().Split().Select(int.Parse).ToArray();
            H = HW[0];
            W = HW[1];
            S = new char[H][];
            for (int i = 0; i < H; i++)
            {
                S[i] = Console.ReadLine().ToCharArray();
            }

            var startpoint = new List<Tuple<int, int>>();
            var endpoint = new List<Tuple<int, int>>();

            long sum = 0;
            for (int h = 0; h < H; h++)
            {
                for (int w = 0; w < W; w++)
                {
                    if (S[h][w] == '.' || isChecked[h, w]) continue;
                    cntb = 0;
                    cntw = 0;
                    DFS(h, w);
                    sum += cntb * cntw;
                }
            }

            Console.WriteLine(sum);
        }

        private static void DFS(int h, int w)
        {
            isChecked[h, w] = true;
            if (S[h][w] == '#') cntb++;
            else cntw++;

            for (int i = 0; i < xdir.Length; i++)
            {
                var neww = w + xdir[i];
                var newh = h + ydir[i];
                if (neww < 0 || neww >= W || newh < 0 || newh >= H) continue;
                if (S[newh][neww] == S[h][w]) continue;
                if (isChecked[newh, neww]) continue;
                DFS(newh, neww);
            }
        }
    }
}


Measured memory_bytes: 21332
#include<cstdio>
#include<algorithm>
using namespace std;
int n, A[101000], B[101000], C[101000];
int main() {
	int i;
	scanf("%d", &n);
	for (i = 1; i <= n; i++) {
		scanf("%d", &A[i]);
	}
	for (i = 1; i <= n; i++) {
		scanf("%d", &B[i]);
	}
	for (i = 1; i <= n; i++) {
		scanf("%d", &C[i]);
	}
	sort(A + 1, A + n + 1);
	sort(B + 1, B + n + 1);
	sort(C + 1, C + n + 1);
	long long res = 0;
	for (i = 1; i <= n; i++) {
		int p1 = lower_bound(A + 1, A + n + 1, B[i]) - A;
		int p2 = lower_bound(C + 1, C + n + 1, B[i] + 1) - C;
		res += 1ll * (p1 - 1) * (n - p2 + 1);
	}
	printf("%lld\n", res);
}

Measured memory_bytes: 1280
#include <bits/stdc++.h>
using namespace std;
#define reverse(vec) reverse(vec.begin(),vec.end())
#define unsort(vec); sort(vec);reverse(vec);
#define int long long
long long ans;

int gcd(int x,int y){
	if(y==0) return x;
	else return gcd(y,x%y);
}

int lcm(int x,int y){
	return x/gcd(x,y)*y;
}
 
signed main(){
	int n,m;
	cin>>n>>m;
	pair<int,int>ab[n];
	for(int i=0;i<n;i++){
		cin>>ab[i].first>>ab[i].second;
	}
	sort(ab,ab+n);
	for(int i=0;i<n;i++){
		if(m<=ab[i].second){
			ans+=m*ab[i].first;
			break;
		}
		ans+=ab[i].second*ab[i].first;
		m-=ab[i].second;
		//cout<<ans<<" "<<m<<endl;
	}
	cout<<ans<<endl;
}


Measured memory_bytes: 1792
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);++i)
#define vi vector<int>
#define vvi vector<vi >
using namespace std;

int main(){
	int h,w;
	cin>>h>>w;
	
	vector<string> s(h+2);
	s[0]="";
	s[h+1]="";
	REP(i,w+2){
		s[0]+='#';
		s[h+1]+='#';
	}
	for(int i=1;i<=h;++i){
		cin>>s[i];
		s[i]='#'+s[i]+'#';
	}
	
	vvi l(h+2,vi(w+2,0)),r(h+2,vi(w+2,0)),
		d(h+2,vi(w+2,0)),u(h+2,vi(w+2,0));
		
	for(int i=1;i<=h;++i){
		for(int j=w;j>=1;--j){
			if(s[i][j]=='#') l[i][j]=0;
			else l[i][j]=l[i][j+1]+1;
		}
		
		for(int j=1;j<=w;++j){
			if(s[i][j]=='#') r[i][j]=0;
			else r[i][j]=r[i][j-1]+1;			
		}
	}
	
	for(int j=1;j<=w;++j){
		for(int i=h;i>=1;--i){
			if(s[i][j]=='#') d[i][j]=0;
			else d[i][j]=d[i+1][j]+1;			
		}
		
		for(int i=1;i<=h;++i){
			if(s[i][j]=='#') u[i][j]=0;
			else u[i][j]=u[i-1][j]+1;			
		}
	}
	
	int ans=0;
	for(int i=1;i<=h;++i){
		for(int j=1;j<=w;++j){
			ans=max(ans,l[i][j]+r[i][j]+d[i][j]+u[i][j]-3);
		}
	}
	
	cout<<ans<<endl;
}//解説参考.

Measured memory_bytes: 71040
#include <stdio.h>
#define NM 20
#define QM 200
int solve(int ,int);
int n;
int A[NM];
main()
{
  int i;
  int q;
  int Q[QM];
  int ans;

  scanf("%d",&n);


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


  scanf("%d",&q);


  for(i = 0;i < q;i++)
    {
      scanf("%d",&Q[i]);
    }

 

  for(i = 0;i < q;i++)
    {
      ans =  solve(0,Q[i]);

      if(ans == 0)
	{
	  printf("no\n");
	}

      else if(ans == 1)
	{
	  printf("yes\n");
	}
    }

  return 0;

}



int solve(int i, int m)
{
  int res;

  if(m == 0)
    {
      return 1;
    }

  if(i >= n)
    {
      return 0;
    }

  res =  solve(i + 1, m) || solve(i + 1, m - A[i]);
  return res;
}

Measured memory_bytes: 580
//Author: Fuadul Hasan(fuadul202@gmail.com)
//BSMRSTU,Gopalganj
#include<bits/stdc++.h>
using namespace std;int tc = 1;
#define happy ios::sync_with_stdio(false);
#define coding  cin.tie(0);
#define mp make_pair
#define ll long long
#define Pi atan(1)*4
#define pb  push_back
#define vpr vector<pr> 
#define pr pair<int, int> 
#define vi std::vector<int>
#define vll std::vector<ll>
#define YES printf("YES\n");
#define NO printf("NO\n");
#define Yes printf("Yes\n");
#define No printf("No\n");
#define all(n) n.begin(),n.end()
#define point(x) setprecision(x)
#define Test printf("Case %d: ",tc++);
#define Unique(c) (c).resize(unique(all(c))-(c).begin())
#define vout(v) for (auto z: v) cout << z << " "; cout << endl;

const int M = 1e9 + 7;
const ll  Inf = (ll)2e18 + 5;
const int N   = 2e5 + 5;

int solve() 
{
	//happy coding

	int n,a,ar[10000],ar1[10000],sum=0;
    cin>>n;
    for(int i=0; i<n; i++)
    {
        cin>>ar[i];
    }
    sort(ar,ar+n);
    for(int i=0; i<n; i++)
    {
        for(int j=i+1; j<n-1; j++)
        {
            int s = ar[i]+ar[j];
            //sum = lowerBound(ar,n,s);
            int x1 = j+1;
            while(s>ar[x1])
            {
                sum++;
                //cout<<ar[x1]<<" ";
                if(x1==n-1) break;
                x1++;
        }
        //cout<<sum<<endl;
    }
    //cout<<sum<<endl;
    //cout<<upperBound(ar,n,a)<<endl;
    }
    cout<<sum<<endl;
	
	return 0;
}
int main(){
	int test = 1;
	//scanf("%d", &test);
	while (test--)solve();return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();scan.nextLine();
		String[] S = new String[n];
		for (int i = 0; i < n; i++) {
			S[i] = scan.nextLine();
		}
		long[] s = new long[5];
		for (int i = 0; i < n; i++) {
			if (S[i].charAt(0) == 'M') s[0]++;
			else if (S[i].charAt(0) == 'A') s[1]++;
			else if (S[i].charAt(0) == 'R') s[2]++;
			else if (S[i].charAt(0) == 'C') s[3]++;
			else if (S[i].charAt(0) == 'H') s[4]++;
		}

		long ans = 0;

		for (int i = 0; i < 5; i++) {
			for (int j = i + 1; j < 5; j++) {
				for (int k = j + 1; k < 5; k++) {
					ans += (s[i]*s[j]*s[k]);
				}
			}
		}
		System.out.println(ans);
	}
}


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

int main()
{
  ll x, t;
  cin >> x >> t;
  if(x>t)
    cout << x - t;
  else if(x == t)
    cout << 0;
  else
  {
    cout << 0;
  }

}


Measured memory_bytes: 3572
#include <cstdio>
#include <climits>
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <cmath>
#include <stack>
#include <algorithm>
#include <iomanip>
#include <map>
#include <queue>
#include <functional>
#include <numeric>
#include <chrono>
#include <cstdlib>
using ll = long long;
using namespace std;

const ll MOD = 1e9 + 7;
const double pi = acos(-1);
#define REP(i, n) for (int(i) = 0; (i) < (n); ++(i))
#define repi(i, a, b) for (int i = int(a); i < int(b); ++i)
#define EPS 1e-4
// bool operator<(const pair<int, int> &a, const pair<int, int> &b)
// {
//     if (a.first == b.first)
//         return a.second < b.second;
//     return a.first < b.first;
// };

/*unsigned int xor128(void)
{
    static unsigned int x = 123456789, y = 362436069, z = 521288629, w = 88675123;
    unsigned int t = (x ^ (x << 11));
    x = y;
    y = z;
    z = w;
    return (w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)));
}
unsigned int xor128rnd(unsigned int m)
{
    return xor128() % m;
}*/

/*bool operator<(const pair<int, int> &a, const pair<int, int> &b)
{
    if (a.first == b.first)
    {
        return a.second < b.second;
    }
    return a.first < b.first;
}*/


int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    //cout << fixed << setprecision(8);

    int a, b, c;
    cin >> a >> b >> c;
    cout << a * b / 2 << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for (int i=0;i<(n);i++)
//#define int long long  
int main(){
    int N,H;
    int a[114514],b[114514];
    int Ans=0;
    int amx=0;
    int point=0;
    cin >> N >> H;
    REP(i,N){
        cin >> a[i] >> b[i];
        b[i]*=-1;
    }
    sort(a,a+N);
    sort(b,b+N);
    amx=a[N-1];
    REP(i,N){b[i]*=-1;}
    
    REP(i,N){
        if(amx<=b[i]){
            Ans++;
            point+=b[i];
            if(point>=H){
                cout << Ans << endl;
                return 0;
            }
        }else{
            break;
        }
    }
    //cout << Ans <<" " << point << endl;
    Ans+=max((((H-point-1)/amx)+1),0);
    
    //cout << amx << endl;
    
    
    cout << Ans << endl;
	return 0;
}

Measured memory_bytes: 1024
#define _USE_MATH_DEFINES
#include "bits/stdc++.h"
using namespace std;

#define int long long
typedef pair<int, int> P;

int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};

/*
#define cin ifs
#define cout ofs
ifstream ifs("in.txt");
ofstream ofs("out.txt");
//*/

string S;
int ap[3];
int kind = 0;
int sum = 0;
int mod = 998244353;
int dp[220000][5][5];

int solve() {
    if (kind == 3) return 3;
    if (S[0] == S[2]) return 7;
    return 6;
}

signed main() {
    cin >> S;
    bool flag = false;
    for (int i = 0; i < S.length(); i++) {
        int k = S[i] - 'a';
        (sum += k) %= 3;
        if (!ap[k]) {
            kind++;
            ap[k] = true;
        }
    }
    for (int i = 1; i < S.length(); i++) {
        flag |= S[i] == S[i - 1];
    }
    if (kind == 1) {
        cout << 1 << endl;
        return 0;
    }

    if (S.length() == 3) {
        cout << solve() << endl;
        return 0;
    }
    int three = 1;
    for (int i = 1; i < S.length(); i++) {
        (three *= 3) %= mod;
    }
    dp[0][0][0] = 1, dp[0][1][1] = 1, dp[0][2][2] = 1;
    for (int i = 1; i < S.length(); i++) {
        dp[i][0][0] = (dp[i - 1][1][0] + dp[i - 1][2][0]) % mod;
        dp[i][0][1] = (dp[i - 1][1][2] + dp[i - 1][2][2]) % mod;
        dp[i][0][2] = (dp[i - 1][1][1] + dp[i - 1][2][1]) % mod;
        dp[i][1][0] = (dp[i - 1][0][2] + dp[i - 1][2][2]) % mod;
        dp[i][1][1] = (dp[i - 1][0][0] + dp[i - 1][2][0]) % mod;
        dp[i][1][2] = (dp[i - 1][0][1] + dp[i - 1][2][1]) % mod;
        dp[i][2][0] = (dp[i - 1][0][1] + dp[i - 1][1][1]) % mod;
        dp[i][2][1] = (dp[i - 1][0][2] + dp[i - 1][1][2]) % mod;
        dp[i][2][2] = (dp[i - 1][0][0] + dp[i - 1][1][0]) % mod;
    }
    int hik = (dp[S.length() - 1][0][sum] + dp[S.length() - 1][1][sum] + dp[S.length() - 1][2][sum]) % mod;
    int ans = (three - hik + mod + !flag) % mod;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 41476
N = int(input())
T = list(map(int,input().split()))
M = int(input())
P = [0]*M
X = [0]*M
for i in range(M):
	P[i],X[i] = map(int,input().split())

for i in range(M):         
	print(sum(T)-T[P[i]-1]+X[i])  

Measured memory_bytes: 3064
#include<bits/stdc++.h>
 using namespace std;
 
#define FIO                     ios_base::sync_with_stdio(false); cin.tie(0)
#define mod                     1000000007
#define setbits                 __builtin_popcount
#define gcd                     __gcd
#define rep(i,a,b)              for(int i=a;i<=b;i++)
#define repr(i,b,a)             for(int i=b;i>=a;i--)
#define forn(i,n)               for(int i=0;i<n;i++)
#define all(a)                  a.begin(), a.end()
#define in(a,b)                 ( (b).find(a) != (b).end())
#define pb                      push_back
#define fill(a,v)               memset(a, v, sizeof a)
#define endl                    "\n"
#define ff                      first
#define ss                      second
#define mp                      make_pair
#define minin(a)                *min_element (all(a))
#define maxin(a)                *max_element(all(a))
#define asort(c)                sort(all(c))
#define dsort(c)                sort(all(c), greater<int>()) 
typedef  long long                   ll;
typedef  vector<int>                 vi;
typedef  pair<int, int>              ii;
typedef  vector<ii>                 vii;
typedef  set<int>                    si;
typedef  unordered_map<int, int>    mii;
typedef  vector<ll>                 vll;



int main()
{
  FIO;
  
  
 
  ll n;
  cin>>n;
  if(n&1)
    cout<<2*n;
  else
    cout<<n;

 return 0;
}

Measured memory_bytes: 256
from sys import stdin, setrecursionlimit
from collections import defaultdict
from math import gcd

setrecursionlimit(10 ** 9)
INF = 1 << 60


def input():
    return stdin.readline().strip()


MOD = 1000000007
N = int(input())
d = defaultdict(int)
zeros = 0
for i in range(N):
    a, b = map(int, input().split())
    if a == 0 and b == 0:
        zeros += 1
    else:
        g = gcd(a, b)
        a //= g
        b //= g
        if a < 0:
            a *= -1
            b *= -1
        if a == 0 and b == -1:
            b = 1
        d[(a, b)] += 1


ans = 1
free = 0
keys = sorted(d.keys())
for a, b in keys:
    n = d[(a, b)]
    if b > 0:
        if (b, -a) in d:
            m = d[(b, -a)]
            ans = ans * (pow(2, n, MOD) + pow(2, m, MOD) - 1) % MOD
        else:
            free += n
    else:
        if (-b, a) not in d:
            free += n

ans = (ans * pow(2, free, MOD) + zeros - 1) % MOD
print(ans)


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

int main(int argc, char** argv){
  string S;
  cin >> S;
  int N = S.size();
  
  int ansA = 0;
  int ansB = 0;

  for(int cnt0=0; 2*cnt0<N; cnt0++){
    if(S[2*cnt0] == '0') ansA++;
  }
  for(int cnt0=0; 2*cnt0+1<N; cnt0++){
    if(S[2*cnt0+1] == '1') ansA++;
  }
  
  for(int cnt0=0; 2*cnt0<N; cnt0++){
    if(S[2*cnt0] == '1') ansB++;
  }
  for(int cnt0=0; 2*cnt0+1<N; cnt0++){
    if(S[2*cnt0+1] == '0') ansB++;
  }
  int ans = min(ansA, ansB);
  
  cout << ans << endl;
}


Measured memory_bytes: 512
# 最大公約数
def gcd(a, b)
  a, b = b, a if a > b
  until a == 0
    a, b = b % a, a
  end
  b
end

n, X = gets.chomp.split.map(&:to_i)
points = gets.chomp.split.map(&:to_i)
dif = points.map{ |p| (X - p).abs }.sort
m = dif.shift
dif.each do |k|
  m = gcd(m, k)
end

puts m


Measured memory_bytes: 11776
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> //tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <numeric>
using namespace std;

vector<string> numbers;

bool have_odd(int A, int B, int C) {
    if (A % 2 == 1) return true;
    if (B % 2 == 1) return true;
    if (C % 2 == 1) return true;
    return false;
}

bool check_numbers(string num_str) {
    for (auto str : numbers) {
        if (str == num_str) {return true;}
    }
    return false;
}

int main() {
    int A, B, C, ret = 0;
    cin >> A >> B >> C;
    while (! have_odd(A, B, C)) {
        string num_str = to_string(A) + "," + to_string(B) + "," + to_string(C);
        if (check_numbers(num_str)) {
            ret = -1;
            break;
        }
        numbers.push_back(num_str);

        int half_A = A / 2;
        int half_B = B / 2;
        int half_C = C / 2;

        A = half_B + half_C;
        B = half_C + half_A;
        C = half_A + half_B;

        ret++;
    }
    cout << ret << endl;
}

Measured memory_bytes: 256
#include <iostream>
//#include <iomanip>
//#include <string>
#include <vector>
#include <algorithm>
//#include <utility>
//#include <set>
//#include <map>
//#include <queue>
//#include <deque>
//#include <bitset>
//#include <math.h>
using namespace std ;
using ll = long long ;
//using ld = long double ;
using vll = vector<ll> ;
//using vvll = vector<vll> ;
//using vc = vector<char> ;
//using vvc = vector<vc> ;
//using vb = vector<bool> ;
//using vvb = vector<vb> ;
//using pll = pair<ll,ll> ;
#define all(v) v.begin(),v.end()
//ll mod = 1000000007 ;
//long double pie = acos(-1) ;
//ll INF = 1000000000000 ;

//void yorn(bool a){if(a) cout << "Yes" << endl ; else cout << "No" << endl ;}
//void YorN(bool a){if(a) cout << "YES" << endl ; else cout << "NO" << endl ;}
//ll gcd(long long a,long long b){if(b==0) return a ; return gcd(b,a%b) ;}
//ll lcm(long long a,long long b){return a/gcd(a,b)*b ;}
//ll sa(long long a,long long b){if(a>b) return a-b ; return b-a ;}
//void fix_cout(){cout << fixed << setprecision(20) ;}

int main(){
	ll n ; cin >> n ;
	vll a(n) ;
	for(auto &i:a) cin >> i ;
	sort(all(a)) ;
	ll ans = 0 ;
	for(int i=0;i+2<n;i++) for(int j=i+1;j+1<n;j++) for(int k=j+1;k<n;k++) if(a.at(i)!=a.at(j)&&a.at(j)!=a.at(k)&&a.at(i)+a.at(j)>a.at(k)) ans++ ;
	cout << ans << endl ;
}


Measured memory_bytes: 3624
#include <stdio.h> 
 int main(void){ 
 int a, b, c; 
     int tmp; 
     scanf("%d %d %d", &a, &b, &c); 
     if(a>b){ 
         tmp=a; 
         a=b; 
         b=tmp; 
     } 
     if(b>c){ 
         tmp=b; 
         b=c; 
         c=tmp; 
     } 
     if(a>b){ 
         tmp=a; 
        a=b; 
         b=tmp; 
     } 
     printf("%d %d %d\n", a, b, c); 
     return 0; 
 } 



Measured memory_bytes: 2680
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;int main(){int n;while(true){cin>>n;if(n==0)break;if(n%1111==0)cout<<"NA"<<endl;else{int ans=0,count,s[4];while(true){if(n==6174)break;int a=10;for(int i=0;i<4;i++){s[i]=n%a/(a/10);a*=10;}sort(s,s+4);count=0;a=1;for(int i=0;i<4;i++){count+=a*s[i]-a*s[3-i];a*=10;}n=count;ans++;}cout<<ans<<endl;}}return 0;}

Measured memory_bytes: 1176
using System;

class CircleInRectangle{
        static void Main(string[] args){
	  string[] str = Console.ReadLine().Split(' ');
	  int W = int.Parse(str[0]);
	  int H = int.Parse(str[1]);
	  int x = int.Parse(str[2]);
	  int y = int.Parse(str[3]);
	  int r = int.Parse(str[4]);
	  if((x + r <= W && x - r >= 0) && (y + r <= H && y - r >= 0)) Console.WriteLine("Yes");
	  else Console.WriteLine("No");
	}
}

Measured memory_bytes: 8932
#include<cstdio>
#include<cstring> 
#include<iostream>
#include<algorithm>
using namespace std;
const int M=1200000;
int n,k,ans,v[M],tmp[51],tot,sum;
int main(){
	scanf("%d%d",&n,&k);
	for(int i=1;i<=n;i++) scanf("%d",&v[i]);
	for(int i=1;i<=n;i++)
	for(int j=i;j<=n;j++){
		int last=k-i-(n-j);if(last<0) continue;memset(tmp,0,sizeof tmp);tot=0,sum=0;
		for(int q=1;q<=i;q++) tmp[++tot]=v[q];
		for(int q=j+1;q<=n;q++) tmp[++tot]=v[q];
		sort(tmp+1,tmp+tot+1);
		int t=lower_bound(tmp+1,tmp+tot+1,0)-tmp;
		for(int q=min(last+1,t);q<=tot;q++) sum+=tmp[q];
		ans=max(ans,sum);
	}
	printf("%d",ans);
		
	
}


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

int counter(vector<int> vnumbers) {
	int number;
	int cnt = 0;
	int flag = 0;

	while (flag == 0) {
		flag = 1;

		for (int i = 0; i < vnumbers.size(); i++) {
			number = vnumbers.at(i) % 2;
			if (number == 0) {
				vnumbers.at(i) /= 2;
				cnt++;
				flag = 0;
			}
		}

	
	}
	

	return cnt;
	
}

int main() {

	int N;
	int number;
	int result;

	cin >> N;

	vector<int> vnumbers;

	for (int i = 0; i < N; i++) {
		cin >> number;
		vnumbers.push_back(number);
	}

	result = counter(vnumbers);

	cout << result << endl;
	
	return 0;

}


Measured memory_bytes: 384
N,M=map(int, input().split())
G=[list() for i in range(N)]
for i in range(M):
    a,b=map(int,input().split())
    a-=1
    b-=1
    G[a].append(b)
    G[b].append(a)
ans=0
index=-1
for i in range(1,N):
    for p in G[i]:
        if index<p<i:
            ans+=1
            index=i-1
            break
print(ans)


Measured memory_bytes: 21424
#include <bits/stdc++.h> 
using namespace std;
#define rep(i, N) for(int i=0; i<N; i++)
typedef long long ll;
#define dump(x) cerr<<#x<<"="<<x<<endl
using P = pair<int, int>;

int main() {
    string s; cin >> s;
    string t;
    for(int i=0; i<s.size(); i++){
        if((i+1)%2){
            t+=s.at(i);
        }
    }

    cout << t << endl;
    return 0;
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
int p[1000001];
int main(){
  p[0]=p[1]=1;
  for(int i=2;i*i<=1000001;++i){
    if(!p[i]){
      for(int j=i+i;j<=1000001;j+=i) p[j]=1;
    }
  }
  int a,d,n;
  while(cin>>a>>d>>n,a){
    int cnt=0;
    for(int i=a;;i+=d){
      if(!p[i]) cnt++;
      if(cnt==n){
	cout<<i<<endl;
	break;
      }
    }
  }
  return 0;
}

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

int main(){
    int evenBallNum = 0, oddBallNum = 0;
    cin >> evenBallNum >> oddBallNum;

    int evenCombination = 0, oddCombination = 0;
    evenCombination = evenBallNum * (evenBallNum - 1) / 2;
    oddCombination = oddBallNum * (oddBallNum - 1) / 2;

    cout << evenCombination + oddCombination << endl;
}

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

n = int(input())
d = list(map(int, input().split()))

if n%2 == 0:
    d.sort()
    d_pre = d[n//2-1]
    d_nex = d[n//2]
    print(d_nex - d_pre)
else:
    print(0)

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

using namespace std;

using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i, n) for(ll i=0;i<(ll)(n);i++)
#define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int ddx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll MOD = 1000000007;
const ll INF = 1000000000000000000L;
#ifdef __DEBUG

/**
 * For DEBUG
 * https://github.com/ta7uw/cpp-pyprint
 */
#include "cpp-pyprint/pyprint.h"

#endif


void Main() {
    string S;
    ll K;
    cin >> S >> K;
    ll N = S.size();
    vector<vector<vector<ll>>> dp(N + 1, vector<vector<ll>>(2, vector<ll>(N + 1, 0)));
    dp[0][0][0] = 1;
    rep(i, N) {
        rep(k, i + 1) {
            rep(j, 2) {
                int d = S[i] - '0';
                if (j == 1) {
                    d = 9;
                }
                rep(m, d + 1) {
                    if (m == 0) {
                        if (j == 1) {
                            dp[i + 1][1][k + 1] += dp[i][1][k];
                        } else {
                            if (m < d) {
                                dp[i + 1][1][k + 1] += dp[i][0][k];
                            }else{
                                dp[i + 1][0][k + 1] += dp[i][0][k];
                            }
                        }
                    } else {
                        if (j == 1) {
                            dp[i + 1][1][k] += dp[i][1][k];
                        } else {
                            if (m < d) {
                                dp[i + 1][1][k] += dp[i][0][k];
                            }else{
                                dp[i + 1][0][k] += dp[i][0][k];
                            }
                        }
                    }
                }
            }
        }
    }
    ll ans = dp[N][1][N - K] + dp[N][0][N - K];
    if (N- K>=0) {
        cout << ans << '\n';
    }else{
        cout << 0 << '\n';
    }
}

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


Measured memory_bytes: 384