akhauriyash/Code-Regression huggingface dataset:
#[allow(unused_imports)]
use std::cmp::{Ordering};

#[allow(unused_imports)]
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};

#[allow(unused_imports)]
use std::io::{stdin, stdout, BufWriter, Write};

#[allow(unused_imports)]
use std::iter::FromIterator;

#[allow(unused_macros)]
macro_rules! min {
    ($x: expr) => ($x);
    ($x: expr, $($z: expr),+) => {{
        std::cmp::min($x, min!($($z),*))
    }}
}

#[allow(unused_macros)]
macro_rules! max {
    ($x: expr) => ($x);
    ($x: expr, $($z: expr),+) => {{
        std::cmp::max($x, max!($($z),*))
    }}
}

#[allow(unused_macros)]
macro_rules! get { 
    ([$t: ty]) => { 
        { 
            let mut line = String::new(); 
            stdin().read_line(&mut line).unwrap(); 
            line.split_whitespace().map(|t|t.parse::<$t>().unwrap()).collect::<Vec<_>>()
        }
    };
    ([$t: ty];$n: expr) => {
        (0..$n).map(|_|get!([$t])).collect::<Vec<_>>()
    };
    ($t: ty) => {
        {
            let mut line = String::new();
            stdin().read_line(&mut line).unwrap();
            line.trim().parse::<$t>().unwrap()
        }
    };
    ($($t: ty),*) => {
        { 
            let mut line = String::new();
            stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            ($(iter.next().unwrap().parse::<$t>().unwrap(),)*)
        }
    };
    ($t: ty; $n: expr) => {
        (0..$n).map(|_|get!($t)).collect::<Vec<_>>()
    };
    ($($t: ty),*; $n: expr) => {
        (0..$n).map(|_|get!($($t),*)).collect::<Vec<_>>()
    };
}

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        #[cfg(debug_assertions)]
        writeln!(&mut std::io::stderr(), concat!("[DEBUG] ", $(stringify!($a), "={:?} "),*), $($a),*).unwrap();
    }
}

const BIG_STACK_SIZE: bool = true;

#[allow(dead_code)]
fn main() {
    use std::thread;
    if BIG_STACK_SIZE {
        thread::Builder::new()
            .stack_size(32 * 1024 * 1024)
            .name("solve".into())
            .spawn(solve)
            .unwrap()
            .join()
            .unwrap();
    } else {
        solve();
    }
}

fn solve() {
    let n = get!(usize);
    let a = get!([usize]);

    let mut a = a.into_iter().enumerate().collect::<Vec<_>>();
    a.sort_by_key(|e| e.1);
    for (i,_) in a {
        print!("{} ", i+1);
    }
    println!("");
}


Measured memory_bytes: 12540
#include <iostream>
#include <string>
#include<iomanip>
#include <algorithm>
#include <map>
#include <vector>
#include<queue>
#include<math.h>
#include<cmath>
#include<sstream>
#include<set>
#include <map>
#include<string.h>
#include<sstream>
#include<stack>
#include<unordered_map>
#include <iostream>
#include <stdio.h>
#include <ctype.h>
#include <cstdio>
#include <cstdlib>
#define ll long long
#define ios ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;
const int N = 2e5 + 5, inf = 1e9 + 7;
const double ep = 0.0000000001;
const double pi = 3.14159265359;


ll com(const pair<ll, ll> &a,
	const pair < ll, ll > &b) {
	if (a.first == b.first) {
		if (a.second < b.second) {
			return 1;
		}
		else {
			return 0;
		}
	}
	else if (a.first > b.first) {
		return 1;
	}
	else {
		return 0;
	}
}


void fun(int ind, int i) {//get all combination with length 6
vector<vector<int>>v;
int k=0, arr[100];
vector <int>v1;
	if (ind == 6) {
		v.push_back(v1);
		return;
	}
	if (i >= k)
		return;
	v1[ind] = arr[i];
	fun(ind + 1, i + 1);
	fun(ind, i + 1);
}

int main()
{
	int n, k,arr[100005],ind,m=inf,ans=0,a,b;
	cin >> n >> k;
	for (int i = 0; i < n; ++i) {
		cin >> arr[i];
		if (arr[i] < inf)//ind of as8r rkm 
			ind = i;
	}
	a = ind;
	b = n - ind - 1;
		ans += a / (k - 1);
	if (a % (k - 1) != 0) {
		ans += 1;
	}
	ans+=b / (k - 1);
	if (b % (k - 1) != 0) {
		ans += 1;
	}
	cout << ans;
	return 0;
}




Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#ifdef tabr
#include "library/debug.cpp"
#else
#define debug(...)
#endif

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    vector<int> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    vector<vector<int>> g(n);
    for (int i = 0; i < n - 1; i++) {
        int x, y;
        cin >> x >> y;
        x--, y--;
        g[x].emplace_back(y);
        g[y].emplace_back(x);
    }
    vector<int> ans(n);
    vector<int> dp(n + 1, 2e9);
    dp[0] = 0;
    dp[1] = a[0];
    function<void(int, int)> dfs = [&](int v, int p) {
        ans[v] = lower_bound(dp.begin(), dp.end(), 2e9) - dp.begin() - 1;
        for (int to : g[v]) {
            if (to == p) {
                continue;
            }
            int pos = lower_bound(dp.begin(), dp.end(), a[to]) - dp.begin();
            int old = dp[pos];
            dp[pos] = a[to];
            dfs(to, v);
            dp[pos] = old;
        }
    };
    dfs(0, -1);
    for (int i = 0; i < n; i++) {
        cout << ans[i] << '\n';
    }
    return 0;
}

Measured memory_bytes: 33628
k,s = map(int,input().split())
ans = 0

'''from itertools import product
for x,y,z in product(range(k+1), repeat=3):
    #print(x,y,z)
    if x+y+z == s:
        ans += 1'''
for x in range(k+1):
    for y in range(k+1):
        if 0 <= s-x-y <= k:
            ans +=1
print(ans)


Measured memory_bytes: 9068
#include<bits/stdc++.h>
#define ii          int int
#define ll       	long long
#define pi       	pair<int,int>
#define pl       	pair<ll,ll>
#define ps       	pair<string,string>
#define mod      	1000000007
#define INF      	1e18
#define PI       	acos(-1)
#define si(a)    	scanf("%d",&a)
#define ss(a)           scanf("%s",a);
#define sii(a,b)  	scanf("%d%d",&a,&b)
#define siii(a,b,c)     scanf("%d%d%d",&a,&b,&c)
#define sl(a)    	scanf("%lld",&a)
#define sL(a)    	scanf("%I64d",&a)
#define sll(a,b) 	scanf("%lld%lld",&a,&b)
#define sLL(a,b)        scanf("%I64d%I64d",&a,&b)
#define slll(a,b,c)     scanf("%lld%lld%lld",&a,&b,&c)
#define sLLL(a,b,c)    scanf("%I64d%I64d%I64d",&a,&b,&c)

//geometry
#define EPS 1e-12
#define _abs(x)    (((x)>0)?(x):-(x))
#define _max(x,y)  ( ((x)>(y))?(x):(y))
#define _min(x,y)  ( ((x)<(y))?(x):(y))

#define E(x,y)	(_abs((x)-(y)) < EPS)
#define Z(x)	(_abs(x) < EPS)
#define ZN(x)	(x < 0 || Z(x))
#define ZP(x)	(x > 0 || Z(x))

//END
#define FR(i,a,b) 	for(ll i=(a);i<(b);i++)
#define F       	first
#define S        	second
#define pb       	push_back

#define mp       	make_pair
#define bg       	begin()
#define en       	end()
#define mem(a,b) 	memset(a,b,sizeof(a))
#define vsort(v)        sort(v.begin(),v.end())
#define REV(v)         reverse(v.begin(),v.end())
#define RET            return(0)
#define  _               ios_base::sync_with_stdio(0);cin.tie(0);
using namespace std;
int main()
{
    string a,b;
    cin>>a>>b;
    if(a.size()>b.size())
    {
        puts("GREATER");
    }
    else if(a.size()<b.size())
    {
        puts("LESS");
    }
    else{
        for(int i=0;i<a.size();i++)
        {
            if(a[i]>b[i])
            {
                puts("GREATER");
                RET;
            }
             else if(a[i]<b[i])
            {
                puts("LESS");
                RET;
            }
        }
        puts("EQUAL");


    }
    RET;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#define mod 1000000007
#define mod998 998244353
#define sp ' '
#define intmax 2147483647
#define llmax 9223372036854775807
#define mkp make_pair
typedef long long ll;
using namespace std;

string S;
bool f = true;
int main() {
	cin >> S;
	for (int i = 0; i < S.size(); i += 2) {
		if (S[i] == 'L')f = false;
	}
	for (int i = 1; i < S.size(); i += 2) {
		if (S[i] == 'R')f = false;
	}
	if (f) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
}

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

int main(){
  int N,i;
  char u[3];
  double x;
  double sum = 0;
  
  scanf("%d",&N);
  
  for(i=0;i<N;i++){
    scanf("%lf",&x);
  	scanf("%s",u);
    
    if(!strcmp(u,"JPY")){
      sum += x;
    }
    else{
      sum += x*380000;
    }
  }
  printf("%f",sum);
  
  return 0;
}


Measured memory_bytes: 128
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
int main() {
	int N;
	cin >> N;
	int h = 0;
	int ans = 0;
	for (int i = 0; i < N; i++) {
		int H;
		cin >> H;
		if (H >= h) ans++;
		h = max(h, H);
	}
	cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep_(i, n, m) for (int i = n; i < (int)(m); i++)
#define all(v) v.begin(), v.end()
#define int long long
#define stoi stoll

vector<int> prime(int N) {
  vector<bool> a(N, true);
  for(int i=1; i<sqrt(N); i++) {
    if(a[i]) for(int k=2; (i+1)*k-1<N; k++) a[(i+1)*k-1] = false;
  }
  vector<int> p;
  rep(i, N) if(a[i]) p.push_back(i+1);
  p.erase(p.begin());
  return p;
}

signed main() {
  int N; cin >> N;
  
  if(N == 1) {
    cout << 0 << endl;
    return 0;
  }
  
  vector<int> p = prime((int)(sqrt(N))+1);
  
  int ans = 0;
  rep(i, p.size()) {
    if(N < p[i]) {
      break;
    }
    if(N%p[i] == 0) {
      int k = 0;
      while(N%p[i] == 0) {
        N /= p[i];
        k++;
      }
      int n = 1;
      while((n+1)*(n+2)/2 <= k) n++;
      ans += n;
    }
  }
  
  if(N != 1) cout << ans+1 << endl;
  else cout << ans << endl;
  

}

Measured memory_bytes: 4444
#ifndef _TEMPLATE_ROOT
#define _TEMPLATE_ROOT
#include "bits/stdc++.h"
using namespace std;
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define repl(i, a, b) for(ll i = a; i < (b); ++i)
#define repd(i, a, b) for(int i = a; i >= (b); --i)
#define repdl(i, a, b) for(ll i = a; i >= (b); --i)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
template<typename H> bool chmin(H& v1, const H v2) { if (v1 > v2) { v1 = v2; return true; } return false; }
template<typename H> bool chmax(H& v1, const H v2) { if (v1 < v2) { v1 = v2; return true; } return false; }
#endif
#ifndef _TEMPLATE_IO
#define _TEMPLATE_IO

template<typename H> void read(H& head) { cin >> head; }
template<typename H, typename ...T> void read(H& head, T& ...tail) { cin >> head; read(tail...); }
template<typename H> void write(H head) { cout << head << '\n'; }
template<typename H, typename ...T> void write(H head, T ...tail) { cout << head << " "; write(tail...); }
template<typename ...T> void writef(T ...tail) { write(tail...); cout << flush; }
template<typename ...T> void die(T ...tok) { write(tok...); exit(0); }
template<typename T>
ostream& operator<<(ostream& out, const vector<T>& v) {
  if (v.size()) {
    rep(i, 0, sz(v) - 1)
      out << v[i] << " ";
    out << v.back();
  }
  return out;
}
#endif
#include <atcoder/convolution>
#include <atcoder/dsu>
#include <atcoder/fenwicktree>
#include <atcoder/lazysegtree>
#include <atcoder/math>
#include <atcoder/maxflow>
#include <atcoder/mincostflow>
#include <atcoder/modint>
#include <atcoder/scc>
#include <atcoder/segtree>
#include <atcoder/string>
#include <atcoder/twosat>
using namespace std;
using namespace atcoder;

int main() {
	cin.tie(0)->sync_with_stdio(0);
	cin.exceptions(cin.failbit);

  int t; read(t);
  rep(i, 0, t) {
    ll n, m, a, b; read(n, m, a, b);
    write(floor_sum(n, m, a, b));
  }
}



Measured memory_bytes: 3644
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define ld long double
#define mod 1000000007LL
#define eps 1e-13
// #define PI 3.141592653589793238L
#define INF 1000000011
#define INFLL 1000000000000000011LL
#define vi vector<int>
#define vll vector<long long>
#define pii pair<int, int>
#define pll pair<long long, long long>
#define pil pair<int, long long>
#define pli pair<long long, int>
#define mp make_pair
#define F first
#define S second
#define pb push_back
#define fo(i,a,n) for(i = (a); i < (n); i++)
#define gtl(x) getline(cin, (x))
#define flsh fflush(stdout)
#define sws ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define gcd __gcd
#define all(a) (a).begin(), (a).end()
#define sz(a) (int)((a).size())
#define io_file freopen("D:/Coding Problems/Contest/input_file.in", "r", stdin); freopen("D:/Coding Problems/Contest/output_file.out", "w", stdout)

ll modx(ll Base, ll exponent)
{
	ll ans = 1;
	if(Base == 1)
		return Base;
	while(exponent)
	{
		if(exponent & 1)
			ans = (ans * Base)%mod;
		Base = (Base * Base)%mod;
		exponent = exponent >> 1;
	}
	return ans;
}

ll inmodx(ll num)
{
	return (modx(num, mod-2LL));
}

bool cmp(pair < pii, int > a, pair < pii, int > b)//true for a before b
{
	if(a.F.F/300 < b.F.F/300)
		return 1;
	if(a.F.F/300 > b.F.F/300)
		return 0;
	if(a.F.S < b.F.S)
		return 1;
	if(a.F.S > b.F.S)
		return 0;
	if(a.F <= b.F)
		return 1;
	return 0;
}

const int N = (2e5) + 9;
const int M = (N<<2) + 9;
const int LOGN = ((int)log2(N)) + 3;
const int LOGM = ((int)log2(M)) + 3;
const int BUCK = 2*550;
const int SQRT = BUCK+9;

ll fact[N], ifact[N];
ll n, m;
ll k;

void pre()
{
	int i;
	fact[0] = ifact[0] = 1;
	fo(i,1,N)
	{
		fact[i] = (fact[i-1] * 1LL * i)%mod;
		ifact[i] = inmodx(fact[i]);
	}
	return;
}

ll choose(int n, int r)
{
	if(n < 0 || r < 0 || n < r)
		return 0;
	ll ans = (fact[n]*ifact[r])%mod;
	ans = (ans*ifact[n-r])%mod;
	return ans;
}

void solve()
{
	pre();
	ll ans = 0, cnt, val;
	cin >> n >> m >> k;
	cnt = choose((int)(n*m)-2,(int)(k)-2);
	val = (m*(n+1LL)*(n-1LL) + n*(m+1LL)*(m-1LL))%mod;
	ans = (cnt*val)%mod;
	ans = (ans*n)%mod;
	ans = (ans*m)%mod;
	ans = (ans * inmodx(6LL))%mod;
	cout << ans << '\n';
	return;
}

int main()
{
	sws;
	clock_t clk;
	clk = clock();
	// io_file;
	// srand (time(NULL));

	//Code here
	int t = 1, cs;
	cout << fixed << setprecision(9);
	// cin >> t;
	fo(cs,1,t+1)
	{
		// cout << "Case #" << cs << ": ";
		solve();
	}
	// Code ends here

	clk = clock() - clk;
	cerr << fixed << setprecision(6) << "Time: " << ((double)clk)/CLOCKS_PER_SEC << "\n";
	return 0;
}

Measured memory_bytes: 3328
#include<bits/stdc++.h>
 #define ll long long
 #define ii pair<int,int>
 #define endl '\n'
using namespace std;

void solve()
{ 
    int l, r, d;
    cin >> l >> r >> d;
    int cnt= 0;
    for(int i=l; i<=r; i++)
        if(i%d==0)
            cnt++;
    cout << cnt << endl;
}

int main(){
    std::ios_base::sync_with_stdio(false); 
    std::cin.tie(nullptr); std::cout.tie(nullptr);
    solve();
}

Measured memory_bytes: 3644
#E
h,n=map(int,input().split())
a=[]
#複数行　複数列入力listA
for i in range(n):
    a.append(list(map(int,input().split())))
s=[]
max_a=max(a for a,b in a)
dp=[10**18 for i in range(h+max_a)]
dp[0]=0
for i in range(1,h+max_a):
    dp[i]=min(dp[i-a]+b for a,b in a)
print(min(dp[h:]))

Measured memory_bytes: 3832
N, M = map(int, input().split())

L_list = []
R_list = []

for i in range(M):
    L, R =map(int, input().split())
    L_list.append(L)
    R_list.append(R)
    
L_max = max(L_list)
R_min = min(R_list)

if R_min >= L_max:
  print(R_min - L_max + 1)
else:
  print(0)

Measured memory_bytes: 10996
#!/usr/bin/env ruby

@h, @w = gets.strip.split.map(&:to_i)
@s = @h.times.map { gets.strip.split('') }

def paintable?(row_i, col_i)
  (col_i - 1 >= 0  && @s[row_i][col_i - 1] == '#') \
  || (row_i - 1 >= 0 && @s[row_i - 1][col_i] == '#') \
  || (col_i + 1 < @w && @s[row_i][col_i + 1] == '#') \
  || (row_i + 1 < @h && @s[row_i + 1][col_i] == '#')
end

@s.each_with_index do |row, row_i|
  row.each_with_index do |col, col_i|
    if col == '#' && !paintable?(row_i, col_i) then
      puts "No"
      exit
    end
  end
end
puts 'Yes'


Measured memory_bytes: 1916
N, A, B, C, D = map(int, input().split())
x = 0
y = 0
if N % A == 0:
    x = (N // A) * B
else:
    x = (N // A + 1) * B
    
if N % C == 0:
    y = (N // C) * D
else:
    y = (N // C + 1) * D

print(min(x, y))


Measured memory_bytes: 5596
/************************************/
/* NoobM							*/
/* File Name : abc.cpp				*/
/* Date : 25.07.2020 18:00:56 +06	*/
/************************************/

#include <bits/stdc++.h>

#define rr(i, b)    for (int i = 0; i < int(b); i++)
#define vi(n, a) vector <int> a(n); rr(i, n) cin >> a[i]
#define pvec(a) rr(i, a.size()) cout << a[i] << " "; cout << endl
#define bug(x) cout << #x << " " << x << endl
#define ll long long
#define vii vector <int>

using namespace std;

void solve() {
	int n;
	cin >> n;
	
	vi(n, a);
	
	ll money = 1000;
	ll stock = 0;
	
	vii na;
	
	rr(i, n) {
		if(i == n - 1 || a[i] != a[i + 1]) na.push_back(a[i]);
	}
	
	int nn = na.size();
	
	vii peak(nn, 0);
	
	rr(i, nn) {
		if(i == 0) continue;
		if(i == nn - 1 && na[i] > na[i - 1]) peak[i] = 1;
		else if(na[i] > na[i - 1] && na[i] > na[i + 1]) peak[i] = 1;
	}
	
	int inf = 0x3f3f3f3f;
	int small = inf;
	
	rr(i, nn) {
		if(peak[i]) {
			stock = money / small;
			money = money % small;
			money = money + stock * (ll)na[i];
			stock = 0;
			small = inf;
		}
		else {
			if(na[i] < small) small = na[i];
		}
	}
	
	
	cout << money << endl;
	
}
 
int main(){
    cin.tie(0);
    ios_base::sync_with_stdio(false);
	
	int t = 1;
	//cin >> t;
	
	while (t--) {
		solve();
	}
    return 0;
}


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

int main(){
	int a , b , C ;  //abc?????????C????§???????S?????¢??????L???????????????????????????h????????????
	double S , L , h, d;
	cin >> a >> b >> C;

	d = (acos(-1.0)*C)/180.0;
	S = a*b*sin(d)/2.0;
	L = a + b + sqrt(a*a + b*b - 2*a*b*cos(d));
	h = b*sin(d);

	printf("%lf\n%lf\n%lf\n" , S , L , h ) ;
}

Measured memory_bytes: 3548
#include <iostream>
#include <sstream>
#include <stdio.h>
#include<vector>
#include<climits>
#include<algorithm>
#include<bitset>
#include<cmath>
#include<functional>
#include <numeric>
#include <map>
#define FORi(N) for(int i=0;i<N;++i)
#define FORj(N) for(int j=0;j<N;++j)
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
ll gcd(ll m,ll n){
  if(n==0)return abs(m);
  return(gcd(n,m%n));
}
void putYN(bool b){
  if(b){
    cout<<"YES"<<endl;
  }else{
    cout<<"NO"<<endl;
  }
}
int main(){
  //ll N;
  //cin>>N;
  vector<ll> H(4);
  FORi(2){
    cin>>H[i];
  }
  FORi(2){
    H[i+2]=H[i]-1;
  }
  sort(H.begin(),H.end());
  cout<<H[2]+H[3]<<endl;
  return 0;
}


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

long long int const MOD = 1000000007;

vector<string> split(string s) {
    vector<string> ret;
    string temp;
    replace(s.begin(), s.end(), '+', ' ');
    replace(s.begin(), s.end(), '=', ' ');
    stringstream ss(s);
    while(ss >> temp) ret.push_back(temp);
    return ret;
}

bool solve(vector<string> vs, int x) {
    vector<long long int> res(3);
    for(size_t i=0; i<3; i++) {
        for(size_t j=0; j<vs[i].length(); j++) {
            if(vs[i][j] == 'X') {
                if(x == 0 && j == 0 && vs[i].length() != 1) return false;
                res[i] = (res[i] * 10 + x) % MOD;
            }
            else res[i] = (res[i] * 10 + (vs[i][j] -  '0')) % MOD;
        }
    }
    long long int ra = (res[0] + res[1]) % MOD, rb = res[2];
    return ra == rb;
}

int main() {
    string s;
    while(cin >> s) {
        vector<string> vs = split(s);
        bool ok = false;
        for(int i=0; i<10; i++) {
            if(solve(vs, i)) {
                cout << i << endl;
                ok = true; break;
            }
        }
        if(!ok) cout << "NA" << endl;
    }
}

Measured memory_bytes: 3060
n = int(input())
s = input()
t = input()
ans = len(s) + len(t)
c= 0
for i in range(n):
    j = n-i
    if s[i:] == t[:j]:
        ans = len(s[i:]) + len(t[:i]) + c
        break
    else:
        c+=1
print(ans)

Measured memory_bytes: 9084
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] array = new int[n];
        for (int i = 0; i < n; i++) {
            array[i] = sc.nextInt();
        }
        
        int count = 0;
        for (int i = 0; i < n; i++) {
            if (i % 2 == 0 && array[i] % 2 != 0) count++;
        }
        System.out.println(count);
    }
}


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

int main() {
  int N;
  cin>>N;
  vector<int>D(N);
  vector<int>E(N);
  
  int C=0;
  int MAX=0;
  for(int i=0;i<N;i++){
    cin>>D[i]>>E[i];
    if(D[i]==E[i]){
      C+=1;
      MAX=max(MAX,C);
    }
    else{
      MAX=max(MAX,C);
      C*=0;
    }
  }
  if(MAX>=3){
    cout<<"Yes"<<endl;
  }
  else{
    cout<<"No"<<endl;
  }
}

Measured memory_bytes: 3628
#!/usr/bin/env python3


def solv(r, d, x):
    ans = []

    for y in range(2001, 2011):
        x = r * x - d
        ans.append(str(x))
    return "\n".join(ans)


if __name__ == '__main__':

    r, d, x = map(int, input().split())

    ans = solv(r, d, x)

    print(ans)


Measured memory_bytes: 2940
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <vector>
#include <queue>
#include <cmath>

using namespace std;

int n, a[305], ans;

int main(){
	scanf("%d", &n);
	n *= 2;
	for(int i = 1 ; i <= n ; i++)scanf("%d", &a[i]);
	sort(a + 1, a + 1 + n);
	for(int i = 1 ; i <= n ; i += 2)ans += a[i];
	printf("%d\n", ans);
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <math.h>
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <map>
#include <set>
#include <queue>
#include <list>
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,a,b) for(int i=int(a);i<int(b);++i)
#define crep(i) for(char i='a';i<='z';i++)
#define psortsecond(A,N) sort(A,A+N,[](const pii &a, const pii &b){return a.second<b.second;});
#define psortfirst(A,N) sort(A,A+N,[](const pii &a, const pii &b){return a.first<b.first;});
#define ALL(x) (x).begin(),(x).end()
int ctoi(const char c){
  if('0' <= c && c <= '9') return (c-'0');
  return -1;
}
using namespace std;
using pii  = pair<int,int>;
long long gcd(long long a, long long b){return (b == 0 ? a : gcd(b, a%b));}
long long lcm(long long a, long long b){return a*b/gcd(a,b);}
typedef long long ll;
#define MOD 1000000007
#define EPS 10e-8

ll A[1007][1007];

int main(){
    queue<pii> Q1,Q2;
    ll H,W;cin>>H>>W;
    char S[1007][1007];
    rep(i,H){
        cin >> S[i];
    }
    rep(i,H){
        rep(j,W){
            if(S[i][j]=='#'){
                Q1.push(make_pair(i,j));
                A[i][j]=1;
            }
        }
    }
    ll C=0,T;
    while(Q1.empty()==false){
        T=Q1.size();
        rep(i,T){
            if(Q1.front().first-1>=0 && A[Q1.front().first-1][Q1.front().second]==0){
                A[Q1.front().first-1][Q1.front().second]=1;
                Q2.push(make_pair(Q1.front().first-1,Q1.front().second));
            }
            if(Q1.front().second-1>=0 && A[Q1.front().first][Q1.front().second-1]==0){
                A[Q1.front().first][Q1.front().second-1]=1;
                Q2.push(make_pair(Q1.front().first,Q1.front().second-1));
            }
            if(Q1.front().first+1<H && A[Q1.front().first+1][Q1.front().second]==0){
                A[Q1.front().first+1][Q1.front().second]=1;
                Q2.push(make_pair(Q1.front().first+1,Q1.front().second));
            }
            if(Q1.front().second+1<W && A[Q1.front().first][Q1.front().second+1]==0){
                A[Q1.front().first][Q1.front().second+1]=1;
                Q2.push(make_pair(Q1.front().first,Q1.front().second+1));
            }
            Q1.pop();
        }
        T=Q2.size();
        if(T==0){
            break;
        }
        rep(j,T){
            Q1.push(Q2.front());
            Q2.pop();
        }
        C++;
    }
    cout << C << endl;
}

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

int main() {
    int64_t H, W, K;
    cin >> H >> W >> K;
    vector<string> S(H);
    for (string& s : S) {
        cin >> s;
    }

    int64_t ans = INT_MAX;

    const int64_t BIT_MAX = (1ULL << (H - 1));
    for (int64_t i = 0; i < BIT_MAX; i++) {
        //1が立っている直後で切り発生
        int64_t one_num = __builtin_popcountll(i);
        int64_t curr_ans = one_num;
        int64_t cut_row_num = one_num + 1;
        vector<int64_t> white_choco_num(cut_row_num, 0);
        vector<int64_t> row2index(H);
        int64_t index = 0;
        for (int64_t j = 0; j < H; j++) {
            row2index[j] = index;
            if (i & (1LL << j)) {
                index++;
            }
        }

        for (int64_t j = 0; j < W; j++) {
            vector<int64_t> curr_add(cut_row_num, 0);
            for (int64_t k = 0; k < H; k++) {
                curr_add[row2index[k]] += (S[k][j] == '1');
            }

            bool abs_bad = false;
            bool ok = true;
            for (int64_t k = 0; k < cut_row_num; k++) {
                if (curr_add[k] > K) {
                    abs_bad = true;
                    break;
                }
                if (white_choco_num[k] + curr_add[k] > K) {
                    ok = false;
                    break;
                }
            }

            if (abs_bad) {
                curr_ans = INT_MAX;
                break;
            }

            if (!ok) {
                curr_ans++;
                white_choco_num = curr_add;
            } else {

                for (int64_t k = 0; k < cut_row_num; k++) {
                    white_choco_num[k] += curr_add[k];
                }
            }
        }

        ans = min(ans, curr_ans);
    }

    cout << ans << endl;
}

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

const int MOD = 1000000007;

//long long
using ll = long long;

//出力系
#define print(x) cout << x << endl
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl
 
// begin() end()
#define all(x) (x).begin(),(x).end()

//for
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)

//最大公約数 
unsigned gcd(unsigned a, unsigned b) {
  if(a < b) return gcd(b, a);
  unsigned r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b;
}

  
int main() {
int N;
cin >> N;
vector<int> A(N);
REP(i, N) cin >> A[i];

sort(all(A));
reverse(all(A));
int Alice = 0, Bob = 0;
REP(i , N){
  if(i % 2 == 0) Alice += A.at(i);
  else Bob += A.at(i);
}
int ans = Alice - Bob;
print(ans);

}


Measured memory_bytes: 256
#include<stdio.h>
 
int main (void)
{
  int n,j=0;
  int a[100];
  
  scanf("%d\n", &n);
  
  for (int i=0; i<n; i++){
    scanf("%d", &a[i]);
    
    if(a[i]%2==0&&a[i]%3!=0&&a[i]%5!=0){
	  printf("DENIED");
	  j++;
	  break;
	}
  }
  
  if (j==0)
    printf("APPROVED");
  
  return 0;
}

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

#ifndef ONLINE_JUDGE
    #include "debug.cpp"
#endif

#define int long long

void solve()
{
    string s;
    cin >> s;
    if(s[s.size() - 1] == 's')
        s += "es";
    else
        s += "s";
    cout << s << "\n";
}

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

    int t = 1;
    // cin >> t;
    while (t--)
        solve();
    return 0;
}

Measured memory_bytes: 3656
n = int(input())
A = list(map(int, input().split()))

ret = 1000
prev = A[0]
for i in range(1, n):
  if A[i] - prev > 0:
    ret = A[i] * (ret // prev) + ret % prev
  if A[i] != prev:
    prev = A[i]

print(ret)

Measured memory_bytes: 9024
#include<bits/stdc++.h>
using namespace std;
int main(){
  string s;
  cin >> s;
  if((s.at(0)==s.at(1) && s.at(1)==s.at(2)) || (s.at(3)==s.at(2) && s.at(1)==s.at(2))){
    cout << "Yes";
  }else{
    cout << "No";
  }
}
      

Measured memory_bytes: 256
n,m=map(int,input().split())
xy = [map(int, input().split()) for _ in range(m)]
x, y = [list(i) for i in zip(*xy)]
ans=0

l=[-1]*n

def rootfind(a):
    changelist=[]
    while 1:
        if l[a-1]>0:
            changelist.append(a)
            a=l[a-1]
        else:
            break
    for e in changelist:
        l[e-1]=a
    return a


def rootunion(c,d):
    cr=rootfind(c)
    dr=rootfind(d)
    if cr==dr:
        pass
    else:
        l[cr-1]=dr


for j in range(m):
    p=x[j]
    q=y[j]
    rootunion(p,q)

for o in l:
    if o<0:
        ans+=1

print(ans-1)

Measured memory_bytes: 112752
class prime_factorize_by_osa_k():
    def __init__(self, max_val):
        '''
        割ることが出来る最小の値を格納したリストを返す
        :param max_val:
        :return:
        '''
        self.minFactor = [-1] * (max_val + 1)
        for i in range(2, max_val + 1):
            if self.minFactor[i] == -1:
                self.minFactor[i] = i
                # エラトステネスの篩と同様の処理を行う
                for j in range(i * i, max_val + 1, i):
                    if self.minFactor[j] == -1:
                        self.minFactor[j] = i

    def osa_k(self, n):
        '''
        preprocessをしたあと、O(logN)で素因数分解を行う。nの最大値をn_maxとする。
        :param n:
        :return:
        '''
        from collections import defaultdict
        d = defaultdict(int)
        now = n
        while now > 1:
            d[self.minFactor[now]] += 1
            now //= self.minFactor[now]
        return d
def gcd(a, b):
    while b: a, b = b, a % b
    return a

N = int(input())
A = list(map(int, input().split()))
# N = 10 ** 6
# A = [10 ** 6] * N
ob = prime_factorize_by_osa_k(10 ** 6)
pairwise = False
prime_key = set(ob.osa_k(A[-1]).keys())
break_flag = False
prime_flags = [False] * (10 ** 6 + 1)
for i in range(N):
    for key in ob.osa_k(A[i]).keys():
        if prime_flags[key]:
            break_flag = True
            break
        else:
            prime_flags[key] = True
    if break_flag:
        break
else:
    pairwise = True
if pairwise:
    print('pairwise coprime')
    exit()
work = gcd(A[0], A[1])
for i in range(2, N):
    work = gcd(work, A[i])
if work != 1:
    print('not coprime')
else:
    print('setwise coprime')

Measured memory_bytes: 189308
local n = io.read("*n", "*l")
local s = io.read()
local bt = {}
local mma, mmi = math.max, math.min
for i = 1, n do
  bt[i] = s:sub(i, i):byte() - 97
end
local ret = 0
for i = 1, n do
  local cnt = 0
  for j = 1, n - i do
    if bt[j] == bt[j + i] then
      cnt = cnt + 1
    else
      cnt = 0
    end
    ret = mma(ret, mmi(i, cnt))
  end
end
print(ret)


Measured memory_bytes: 384
import java.util.*;

public class Main {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        int c = Integer.parseInt(sc.next());
        int x = Integer.parseInt(sc.next());
        int y = Integer.parseInt(sc.next());

        // 主処理
        int max = Math.max(x, y);
        int min = Math.min(x, y);
        int allHalf = c * max * 2;
        int noHalf = a * x + b * y;
        int both = c * min * 2 + a * (x - min) + b * (y - min);
        int result = Math.min(Math.min(allHalf, noHalf), both);

        // 出力
        System.out.println(result);
        sc.close();
    }
}


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

typedef long long int ll;

int main()
{
    ll n;
    cin >> n;
    vector<ll> s(n);
    ll m = 0;
    for(ll i = 0;i < n;i++){
        cin >> s[i];
        m += s[i];
    }

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

    for(ll i = 0;i < n;i++){
        if(m % 10 != 0){
            break;
        }
        if((m - s[i]) % 10 != 0){
            m -= s[i];
            break;
        }
    }

    if(m % 10 == 0){
        cout << 0;
    }
    else{
        cout << m;
    }

    return 0;
}

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

int main() {
  string s;
  cin >> s;
  
  string a;
  for (int i = 0; i < s.size(); i++) {
    if (s.at(i) != 'B') {
      a.push_back(s.at(i));          
    }
    else if (a.size() == 0) {
      a;
    }
    else {
      a.pop_back();
    }
  }
  
  cout << a << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cmath>
#include <set>
#include <map>
#include <queue>
#include <bitset>
#include <vector>
#include <string>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#define Rep(i,a) for(int i = 0; i < (a); i++)
#define rep(i,a,b) for(int i = (a); i <= (b); i++)//(a)!
#define dep(i,a,b) for(int i = (a); i >= (b); i--)
#define ab(a) ((a) > 0 ? (a) : -(a))
#define mp(a,b) make_pair((a),(b))
#define pb(a) push_back(a)
using namespace std;
typedef long long LL;
typedef unsigned long long uLL;
int main() {
	string s, t; s = "CODEFESTIVAL2016";
	cin >>t; int cnt = 0;
	rep(i,0,15) if (s[i] != t[i]) cnt++;
	cout <<cnt<<endl;
}

Measured memory_bytes: 256
def main():
  import sys
  n=int(input())
  v=list(map(int,sys.stdin.read().split()))
  w=sorted(v,reverse=False)

  ans=(w[0]+w[1])/2
  for i in range(2,n):
    ans=max(ans,ans/2+w[i]/2)
  print(ans)
  
if __name__=="__main__":
  main()

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b)
{if (a%b == 0){
  return(b);
   }
 else{
 return(gcd(b, a%b));
   }
}
int main () {
  long long N;
  cin>>N;
  long long a;
  cin>>a;
  long long ans;
ans=a;
	for(long long i=0;i<N-1;i++){
      long long b;
		cin>>b;
		ans=gcd(b,ans);
	}
  cout<<ans<<endl;
}
    
  
  
 

Measured memory_bytes: 256
#include<stdio.h>
int main(void){
  char *s="python3 -c\""
"class Factorial:\n"
"    def __init__(self,n,mod):\n"
"        self.f=[1]\n"
"        for i in range(1,n+1):\n"
"            self.f.append(self.f[-1]*i%mod)\n"
"        self.i=[pow(self.f[-1],mod-2,mod)]\n"
"        for i in range(1,n+1)[::-1]:\n"
"            self.i.append(self.i[-1]*i%mod)\n"
"        self.i.reverse()\n"
"    def factorial(self,i):\n"
"        return self.f[i]\n"
"    def ifactorial(self,i):\n"
"        return self.i[i]\n"
"    def comb(self,n,k):\n"
"        return self.f[n]*self.i[n-k]%mod*self.i[k]%mod\n"
"mod=10**9+7\n"
"h,w,a,b=map(int,input().split())\n"
"f=Factorial(h+w,mod)\n"
"ans=0\n"
"for i in range(b,w):\n"
"    ans=(ans+f.comb(h-a-1+i,i)*f.comb(a-1+w-i-1,w-i-1))%mod\n"
"print(ans)\n"
"\"";
  system(s);
  return 0;
}            

Measured memory_bytes: 19252
N=int(input())
A=sorted(list(map(int,input().split())))
while len(A)!=1:
    B=[A[0]]+[A[i]-(A[i]//A[0])*A[0] for i in range(1,len(A))]
    A=sorted(list(set(filter(lambda x:x>0, B))))
print(A[0])

Measured memory_bytes: 14224
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        List<Integer> gray = new ArrayList<Integer>();
        List<Integer> brown = new ArrayList<Integer>();
        List<Integer> green = new ArrayList<Integer>();
        List<Integer> cyan = new ArrayList<Integer>();
        List<Integer> blue = new ArrayList<Integer>();
        List<Integer> yellow = new ArrayList<Integer>();
        List<Integer> orange = new ArrayList<Integer>();
        List<Integer> red = new ArrayList<Integer>();
        List<Integer> gold = new ArrayList<Integer>();
        for (int i = 0 ; i < n ; i++) {
            int a = sc.nextInt();
            if ( a < 400) {
                gray.add(a);
            } else if (a < 800) {
                brown.add(a);
            } else if (a < 1200) {
                green.add(a);
            } else if (a < 1600) {
                cyan.add(a);
            } else if ( a < 2000) {
                blue.add(a);
            } else if (a < 2400) {
                yellow.add(a);
            } else if (a < 2800) {
                orange.add(a);
            } else if (a < 3200) {
                red.add(a);
            } else {
                gold.add(a);
            }
        }
        int color = 0;
        if (!gray.isEmpty()) {
            color++;
        }
        if (!brown.isEmpty()) {
            color++;
        }
        if (!green.isEmpty()) {
            color++;
        }
        if (!cyan.isEmpty()) {
            color++;
        }
        if (!blue.isEmpty()) {
            color++;
        }
        if (!yellow.isEmpty()) {
            color++;
        }
        if (!orange.isEmpty()) {
            color++;
        }
        if (!red.isEmpty()) {
            color++;
        }

        //最大値はcolor + gold.length()
        //最小値はレート3200未満がいるならばcolor いないならば1
        if (color > 0 ) {
            System.out.println(color  + " " + (color + gold.size()));
        } else {
            System.out.println(1+ " " + gold.size() );
        }

    }

}


Measured memory_bytes: 21076
#if 1
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <stack>
#include <array>
#include <deque>
#include <algorithm>
#include <utility>
#include <cstdint>
#include <functional>
#include <iomanip>
#include <numeric>
#include <assert.h>
#include <bitset>
#include <list>
#include <cmath>

auto& in = std::cin;
auto& out = std::cout;
#define all_range(C) std::begin(C), std::end(C)
const double PI = 3.141592653589793238462643383279502884197169399375105820974944;

int32_t N;
std::pair<int64_t, int64_t> score[100000];

int main()
{
	using std::endl;
	in.sync_with_stdio(false);
	out.sync_with_stdio(false);
	in.tie(nullptr);
	out.tie(nullptr);

	in >> N;
	int64_t s = 0;
	for (size_t i = 0; i < N; i++)
	{
		in >> score[i] .first>> score[i].second;
	}

	std::sort(score, score + N, [](auto& a, auto& b) { return (a.first + a.second) > (b.first + b.second); });

	auto iter_a = score;
	auto iter_b = score + N;
	while (iter_a != iter_b)
	{
		s += iter_a->first;
		++iter_a;
		if (iter_a != iter_b)
		{
			s -= iter_a->second;
			++iter_a;
		}
	}

	out << s << endl;

	return 0;
}
#endif


Measured memory_bytes: 1792
#include<iostream>
#include<string>
#include<algorithm>
#define SIZE_OF_ARRAY(array) (sizeof(array)/sizeof(array[0]))
#include<iostream>
#include<fstream>

using namespace std;

int main()
{

  int n, m;
  cin >> n >> m;

  int count = 1;
  int ans = 0;

  while(count < m)
  {
    count += n - 1; 
    ans++;
  }

  cout << ans << endl;
}

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

#define ll long long int
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

const int mod = 1e9 + 7;
const int N = 200001;


void solve() {
    int n;
    cin >> n;
    double ans = 2 * 22 * n;
    ans = ans / 7;
    cout << fixed << setprecision(10) << ans ;
}

/*
 */

int main()
{
    fastio
    int testcase = 1;
    //cin >> testcase ;
    
    while(testcase --) {
        solve();
        cout << '\n';
    }
    
    return 0;
}
 



Measured memory_bytes: 3800
//  Created by conan1024hao in 2020.
//  Copyright © 2020 conan1024hao. All rights reserved.
//  専用ライブラリです、自由にコピーして構いません。
//  感谢看我的代码！Wechat:conan1024hao Twitter/QQ:810396815
#pragma GCC optimize ("O3")
#include <iostream>
#include <iomanip>
#include <istream>
#include <ostream>
#include <sstream>
#include <iterator>
#include <vector>
#include <algorithm>
#include <queue>
#include <deque>
#include <list>
#include <stack>
#include <map>
#include <unordered_map>
#include <set>
#include <utility>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <string>
#include <ctime>
#include <cctype>
#include <cstdlib>
#define IINF 10e8
#define INF 10e16
#define MOD 1000000007
#define mod 1000000007
#define rep(i, a, n) for (ll i = a; i < (ll)(n); i++)
#define Endl endl
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define mmax(x,y)(x>y?x:y)
#define mmin(x,y)(x<y?x:y)
#define chmax(x,y) x=mmax(x,y)
#define chmin(x,y) x=mmin(x,y)
#define all(x) (x).begin(),(x).end()
#define siz(x) (ll)(x).size()
#define PI acos(-1.0)
using namespace std;
//using Int=int_fast64_t;
typedef long long int ll;
typedef long long int LL;
typedef pair<ll,ll>Pll;
typedef pair<int,int>Pin;
long long GCD(long long a, long long b) { return b ? GCD(b, a%b) : a; }
long long LCM(long long a, long long b)  {return a/GCD(a,b)*b;}
int dx[8]={-1,0,1,0,1,1,-1,-1};
int dy[8]={0,-1,0,1,1,-1,1,-1};
char dir[4]={'u','l','d','r'};
ll cmp1(pair<ll,string>a,pair<ll,string> b){
        if(a.fi!=b.fi)
        return a.fi<b.fi;
        else
        return a.se<b.se;
}

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

//---------------------------------------------------------------------------
int main(){//問題をちゃんと見ろ!!!!!!!!!!!!!!!!!      llか??????????统一类型        memset()!!!!!!!!!!!!       ペナを減らせ!!!!!!!!!!!!!
    cin.tie(0);
    ios::sync_with_stdio(false);
    //-------------------------------
    ll n,h,w;cin>>n>>h>>w;
    vector<ll>a(n),b(n);
    for(ll i=0;i<n;i++)cin>>a[i]>>b[i];
    ll ans=0;
    for(ll i=0;i<n;i++){
        if(a[i]>=h&&b[i]>=w)ans++;
    }
    cout<<ans<<endl;
    //-------------------------------
    return 0;
}
//---------------------------------------------------------------------------







Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<array>
#include<algorithm>
#include<map>
#include<cstdio>
#include<cstdlib>
#include<cstring>
using namespace std;

int main(){
  int h,w,i;
  cin >> h >> w;
  vector<int> cnt1(30,0),cnt2(3,0);
  char a;
  for(i=0;i<h*w;i++){
    cin >> a;
    cnt1[a-97]++;
  }
  for(i=0;i<26;i++){
    if(cnt1[i]%4==0) cnt2[0]++;
    else if(cnt1[i]%2==0) cnt2[1]++;
    else cnt2[2]++;
  }
  bool ans = false;
  if(h%2&&w%2){
    if(cnt2[2]==1){
      if(w/2+h/2>=cnt2[1]){
        ans = true;
      }
    }
  }else if(h%2){
    if(cnt2[2]==0&&w/2>=cnt2[1]) ans =true;
  }else if(w%2){
    if(cnt2[2]==0&&h/2>=cnt2[1]) ans =true;
  }else {
    if(cnt2[1]==0&&cnt2[2]==0){
      ans = true;
    }
  }
  puts(ans?"Yes":"No");
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long 
#define mod 1000000007
#define maxn 200015
#define PI 3.1415926535
#define all(x) x.begin(),x.end()
#define speedUp ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
void CyBerForCe()
{
	int n,x,t;
	cin>>n>>x>>t;
	int p=0,ans=0;
	if(n%x==0)
	p= n/x;
	else
	p= (n+x-1)/x;
	ans= p*t;
	cout<<ans<<"\n";
}
signed main()
{
    speedUp
    /*int t;
    cin>>t;
    while(t--)*/
    CyBerForCe();
    return 0;
}

Measured memory_bytes: 3628
N, M = map(int, input().split())
S = input()

steps = [[] for i in range(N+1)]
steps[0] = [0]
num_steps = 0
root = [0] + [-1]*N
pos = 1

while pos <= N:
  starts = steps[num_steps]
  if not starts:
    break
  for start in starts:
    end = min(start+M+1, N+1)
    for i in range(pos, end):
      if S[i] == '0':
        steps[num_steps+1].append(i)
        root[i] = start
    
    pos = end
  
  num_steps += 1


if root[N] == -1:
  ans = -1
else:
  pos = N
  ans = []
  while pos > 0:
    pre_pos = root[pos]
    ans.append(str(pos - pre_pos))
    pos = pre_pos
  
  ans = ans[::-1]
  ans = ' '.join(ans)


print(ans)

Measured memory_bytes: 25908
#include<bits/stdc++.h>
#define inf 999999999999999
using namespace std;
int n,m;
long long dis[105][105];
void init()
{
	for(int i=0;i<=n;i++)
	for(int j=0;j<=n;j++)
	dis[i][j]=(i==j)? 0:inf;
}
int main()
{
	cin>>n>>m;
	init();
	for(int i=0;i<m;i++)
	{
		int x,y,w;
		cin>>x>>y>>w;
		dis[x][y]=w;
	}
	for(int k=0;k<n;k++)
	for(int i=0;i<n;i++)
	for(int j=0;j<n;j++)
	if(dis[i][k]!=inf&&dis[k][j]!=inf) dis[i][j]=min(dis[i][j],dis[i][k]+dis[k][j]);
	for(int i=0;i<n;i++)
	if(dis[i][i]<0) {cout<<"NEGATIVE CYCLE"<<endl;return 0;}
	for(int i=0;i<n;i++)
	{
		for(int j=0;j<n;j++)
		{
			if(j) cout<<" ";
			if(dis[i][j]==inf) cout<<"INF";
			else cout<<dis[i][j];
		}
		cout<<endl;
	}
	return 0;
}


Measured memory_bytes: 3184
#include <bits/stdc++.h>
using namespace std;
using lint = long long int;

int main() {
    lint n, k;
    cin >> n >> k;

    lint r, s, p;
    cin >> r >> s >> p;

    string t;
    cin >> t;

    map<lint, vector<char>> mp; // rest -> {r, s, p, r, ... }
    for(lint i=0; i<n; i++) {
        mp[i%k].push_back(t[i]);
    }

    map<char, lint> score;
    score['r'] = p;
    score['s'] = r;
    score['p'] = s;

    lint ans = 0;
    for(auto e : mp) {
        auto vec = e.second;
        ans += score[vec[0]];
        for(lint i=1; i<vec.size(); i++) {
            if(vec[i-1] == vec[i]) {
                vec[i] = '$';
            } else {
                ans += score[vec[i]];
            }
        }
    }

    cout << ans << endl;
}

Measured memory_bytes: 9984
#include <iostream>
#include <stack>

using namespace std;

#define rep(i,n) for(int i=0;i<(n);++i)
#define out(v) cout<<v<<"\n"
const int INF = 1e6;

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

  bool edge[N][N];
  rep(i, N) rep(j, N) {
    char c; cin >> c;
    edge[i][j] = (c == '1');
  }

  int d[N][N];
  rep(i, N) rep(j, N) d[i][j] = edge[i][j] ? 1 : INF;
  rep(k, N) rep(i, N) rep(j, N) {
    d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
  }

  int color[N];
  rep(i, N) color[i] = INF;
  color[0] = 0;

  stack<int> st;
  st.push(0);
  while (!st.empty()) {
    int p = st.top(); st.pop();
    rep(i, N) {
      if (!edge[i][p])
        continue;
      if (color[i] == color[p]) {
        out(-1);
        return 0;
      }
      if (color[i] == INF) {
        color[i] = 1 - color[p];
        st.push(i);
      }
    }
  }

  int r = 0;
  rep(i, N) rep(j, N) {
    if (i == j)
      continue;
    r = max(r, d[i][j]);
  }
  out(r+1);
  return 0;
}


Measured memory_bytes: 512
n=int(input())
s=["S "+str(i+1) for i in range(13)]
h=["H "+str(i+1) for i in range(13)]
c=["C "+str(i+1) for i in range(13)]
d=["D "+str(i+1) for i in range(13)]
al=s.copy()
al.extend(h)
al.extend(c)
al.extend(d)

card = [input() for i in range(n)]

for item in al:
    if not item in card:
        print(item)


Measured memory_bytes: 5604
#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <iomanip>
#include <cmath>
#include <vector>
#include <set>
#include <algorithm>

using namespace std;

int main()
{
    string S, T;
    cin >> S >> T;
    int count = 0;
    for (int i = 0; i < S.length(); i++){
        if(S[i] !=T[i]){
            count++;
        }
    }
    cout << count << endl;
    return 0;
}

Measured memory_bytes: 3856
from collections import deque
x,y,a,b,c = map(int,input().split())
p = list(map(int,input().split()))
q = list(map(int,input().split()))
r = list(map(int,input().split()))
p.sort(reverse=True)
q.sort(reverse=True)
l = p[:x] + q[:y] + r
l.sort(reverse=True)
print(sum(l[:(x+y)]))

Measured memory_bytes: 111852
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <fstream>
#include <sstream>
#include <iomanip>
#define ll long long

using namespace std;

long long MOD = 1000000007;

int main(){
    int N, R;
    cin >> N >> R;
    if(N>=10){
        cout << R << endl;
    }else{
        cout << R+100*(10-N) << endl;
    }
}

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

int dp[41][4], p[41], t[41], Min;
int main() {
	int n;
	while (scanf("%d", &n), n) {
		rep(i, n) scanf("%d%d", &p[i + 1], &t[i + 1]);
		memset(dp, 0x3f, sizeof(dp));
		dp[0][0] = 0;
		rep(i, n) {
			bool ok = 0;
			rep(j, 4) {
				if (dp[i][j] == INF)continue;
				ok = 1;
				if (j + 1 < 4) {
					int l = t[i] + abs(p[i + 1] - p[i])*(j + 1);
					if (l <= t[i + 1])
						dp[i + 1][j + 1] = min(dp[i + 1][j + 1], dp[i][j] + abs(p[i + 1] - p[i]));
				}
				int l = t[i] + p[i] * (j + 1) + p[i + 1];
				if (l <= t[i + 1])
					dp[i + 1][1] = min(dp[i + 1][1], dp[i][j] + p[i] + p[i + 1]);
			}
			if (!ok) {
				printf("NG %d\n", i); goto g;
			}
		}
		Min = *min_element(dp[n], dp[n] + 4);
		if (Min == INF)printf("NG %d\n", n);
		else printf("OK %d\n", Min + p[n]);
	g:;
	}
}

Measured memory_bytes: 3112