akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;

#define ff              first
#define ss              second
#define int             long long
#define pb              push_back
#define mp              make_pair
#define mt              make_tuple
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define range(a,b)		substr(a,b-a+1)
#define w(x)            int x; cin>>x; while(x--)
#define trace(x) 		cerr<<#x<<": "<<x<<" "<<endl;
#define FIO             ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
mt19937                 rng(chrono::steady_clock::now().time_since_epoch().count());

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;

int32_t main()
{
	FIO;
	int n; cin >> n;

	if (n < 3)
	{
		cout << 0 << '\n';
		return 0;
	}

	vector<vi> dp(n + 1, vi(n + 1, 0));
	int ans = 0;

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

	for (int i = 1; i <= n; ++i)
	{
		for (int s = 0; s <= n; ++s)
		{
			//cur 3<=cur<=s
			//ls = s - cur
			//s-s<=last_sum<=s-3

			int s_id = 0;
			int e_id = s - 3;

			if (s_id <= e_id)
			{
				dp[i][s] = dp[i - 1][e_id];

				if (s_id)
					dp[i][s] -= dp[i - 1][s_id - 1];

				dp[i][s] = (dp[i][s] + mod) % mod;
			}

			if (s)
			{
				dp[i][s] += dp[i][s - 1];
				dp[i][s] %= mod;
			}
		}

		ans += (dp[i][n] - dp[i][n - 1] + mod) % mod;
		ans %= mod;
	}

	cout << ans << '\n';
	return 0;
}

Measured memory_bytes: 34460
#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
#include<algorithm>//next_permutation
#define rep(i,n) for (int i = 0;i < (n);i++)
#define all(v) v.begin(),v.end()
#define dec(n) cout << fixed << setprecision(n);
#define large "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
#define small "abcdefghijklmnopqrstuvwxyz"
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
using vl = vector<ll>;
using vvl = vector<vl>;

ll gcd(ll a,ll b){
  if(b == 0) return a;
  return gcd(b , a % b);
}

ll mod(ll a){
  return (a % 1000000007);
}

ll lcm(ll a,ll b){
  return (a*b)/gcd(a,b);
}

ll nCr(ll n,ll r){
  if(r == 1) return n;
  else if(r == 0) return 1;
  else return nCr(n-1,r-1)*n/r;
}

int main(){
  ll n; cin >> n; ll nd = n; ll ans = 0; ll cnt = 0;
  
  while(nd != 0){
    ans += nd % 10;
    nd /= 10;
    cnt++;
  }
  
  rep(i,cnt-1) n /= 10;
    
  ans = max(ans,n-1+9*(cnt-1));
  
  cout << ans << endl;
  
}

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

typedef long long ll;
#define rep(i,s,n)for(ll i = s;i<n;i++)
#define repe(i,s,n)for(ll i = s;i<=n;i++)
#define rep_r(i,s,n)for(ll i = n;i>s;i--)
#define rep_re(i,s,n)for(ll i = n;i>=s;i--)
using namespace std;
static const ll MOD = 1e9 + 7;
static const ll INF = 1e25;
static const ll MAX_N = 100001;

int H, W, K;
int dp[101][8];
//---------------------------------------------------------------------------------------------------
int check(int msk) {
	rep(i, 0, W - 2) {
		int a = (msk >> i) & 1;
		int b = (msk >> (i + 1)) & 1;
		if (a and b) return 0;
	}
	return 1;
}
//---------------------------------------------------------------------------------------------------
int main() {
	cin >> H >> W >> K;
	K--;

	dp[0][0] = 1;
	rep(h, 0, H) rep(k, 0, W) rep(msk, 0, 1 << (W - 1)) if (check(msk)) {
		if (msk & (1 << k)) dp[h + 1][k + 1] = (dp[h + 1][k + 1] + dp[h][k]) % MOD;
		else if (0 < k and msk & (1 << (k - 1))) dp[h + 1][k - 1] = (dp[h + 1][k - 1] + dp[h][k]) % MOD;
		else dp[h + 1][k] = (dp[h + 1][k] + dp[h][k]) % MOD;
	}

	cout << dp[H][K] % MOD << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define fi first
#define se second
#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 srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)),x.end())
#define show(x) cout<<#x<<" = "<<x<<endl;
#define print(x)cout<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef tuple<int,int,int> T;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
typedef vector<T> vt;

int main() {
  ll a;
  cin >> a;
  ll ans = a + a*a + a*a*a;
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 3632
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <string>
#include <cstring>
#include <map>
#include <math.h>
#include <queue>
#include <set>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;
typedef pair<int, int> P;
#define rep(i,n) for (int i = 0; i < n; i++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const int INF = 1<<30;
const ll LINF = 1LL<<58;
const int mod = 1000000007;

int main(){
	int n, m;
	cin >> n >> m;
	int l = -INF, r = INF;
	rep(i,m){
		int x, y;
		cin >> x >> y;
		chmax(l, x); chmin(r, y);
	}
	int ans = 0;
	for (int i = 1; i <= n; i++) if(l <= i && i <= r)ans++;
	cout << ans << endl;
	return 0;

}


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


int main() {
  string S;
  cin >> S;
  if(S =="a" || S=="i" || S=="u" || S=="e" || S=="o"){
  cout << "vowel" << endl;
  }
  else{
  cout << "consonant" << endl;
  }
}


Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int A = sc.nextInt();
        int B = sc.nextInt();
        
        System.out.println(Math.min(A * N, B));
        
    }
}


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

int main(){
  int n;
  string s;
  cin>>n>>s;
  int num=s.size();
  rep(i,n-1){
    if(s[i]==s[i+1])num--;
  }
  cout<<num<<endl;
}

Measured memory_bytes: 512
#include <iostream>
using namespace std;
int main(){
    int a,b,c,x;
    cin >>a>>b>>c;
    if (a>b){
        x=a;
        a=b;
        b=x;
    }
    if (b>c){
        x=b;
        b=c;
        c=x;
    }
    if (a>b){
        x=a;
        a=b;
        b=x;
    }
    cout <<a<<" "<<b<<" "<<c<<endl;
    return 0;
}

Measured memory_bytes: 3128
#include "iostream"
#include <stdio.h>
#include <algorithm>
#include <stdlib.h>
#include <string>
#include <cctype>
#include <stack>
#include <vector>
#include <list>
#include <queue>
using namespace std;
using ll=long long;
#define mod  1000000007

int main(int argc, char const *argv[]) {
  int a,b;
  std::cin >> a >> b;
  if((a+b)%2==0) std::cout << (a+b)/2 << '\n';
  else std::cout << (a+b)/2 + 1 << '\n';


  return 0;
}


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

#define FOR(i, f, n) for(int (i) = (f); (i) < (n); (i)++)
#define RFOR(i, f, n) for(int (i) = (f); (i) >= (n); (i)--)
#define REP(i, n) for(int (i) = 0; (i) < (n); (i)++)
#define RREP(i, n) for(int (i) = (n); (i) >= 0; (i)--)
#define rep(i, n) for(int (i) = 0; (i) < (n); (i)++)
#define rrep(i, n) for(int (i) = (n); (i) >= 0; (i)--)
#define forin(i, a) for(auto i: (a))
#define p(...) printf(__VA_ARGS__); cout << endl;
#define in(...) __VA_ARGS__; input__(__VA_ARGS__);
#define input(...) in(__VA_ARGS__)
#define out(...) output__(__VA_ARGS__);
#define output(...) out(__VA_ARGS__)
#define list_input(x, n) x[(n)]; for(int (i) = 0; (i) < (n); (i)++) cin >> x[i];
#define lambda(a, b, c) [](auto const &a, auto const &b){ return c ;}
#define key(t, x, compare) [](const t &a, const t &b){ return a x compare b x ;}
#define unless(a) if(!(a))

using namespace std;

using pii = pair<int, int>;

template <class... T>
void input__(T &...a) {
  for(auto v: {&a...}) {
    cin >> *v;
  }
}

void output__(){
  cout << endl;
}

template <class Head, class... T>
void output__(Head const &v, T const &...a) {
  if(sizeof...(a) == 0) {
    cout << v;
  } else {
    cout << v << " ";
  }
  output__(a...);
}

int main(){
  long in(n, k);
  long list_input(a, n);

  long sum = 0;
  forin(v, a) {
    if(v > 0) {
      sum += v;
    }
  }

  long pl[n + 1];
  pl[0] = 0;
  pl[1] = max(a[0], 0L);

  long mi[n + 1];
  mi[0] = 0;
  mi[1] = min(a[0], 0L);

  FOR(i, 2, n + 1) {
    pl[i] = pl[i - 1] + max(a[i - 1], 0L);
    mi[i] = mi[i - 1] + min(a[i - 1], 0L);
  }

  long nflips[n - k + 1];
  rep(i, n - k + 1) {
    nflips[i] = 0;
    long black = pl[i + k] - pl[i];
    long white = mi[i + k] - mi[i];
    nflips[i] = max(-black, white);
  }

  out(sum + *max_element(nflips, nflips + (n - k + 1)));
}


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

const int N = 250010;
const int mod[] = {1000000007, 1000000009};
const int P[] = {131, 233};

typedef long long LL;

int Pow[2][N * 2]; char s[N];

inline int FUCK(int x, int y, int mod) {
    int res = 1;
    for (; y; y >>= 1, x = (LL)x * x % mod) if (y & 1) res = (LL)res * x % mod;
    return res;
}

struct Data {
    int val[2];

    Data(int a = 0, int b = 0) {val[0] = a, val[1] = b;} 

    Data operator + (const Data &b) {
        Data res;
        res.val[0] = (val[0] + b.val[0]) % mod[0];
        res.val[1] = (val[1] + b.val[1]) % mod[1];
        return res;
    }

    Data operator - (const Data &b) {
        Data res;
        res.val[0] = (val[0] - b.val[0] + mod[0]) % mod[0];
        res.val[1] = (val[1] - b.val[1] + mod[1]) % mod[1]; 
        return res;
    }

    Data operator * (const int b) {
        Data res = *this;
        int a = b >= 0 ? Pow[0][b] : FUCK(P[0], (LL)(mod[0] - 2) * (-b) % (mod[0] - 1), mod[0]);
        int c = b >= 0 ? Pow[1][b] : FUCK(P[1], (LL)(mod[1] - 2) * (-b) % (mod[1] - 1), mod[1]);
        res.val[0] = (LL)res.val[0] * a % mod[0];
        res.val[1] = (LL)res.val[1] * c % mod[1];
        return res;
    }

    bool operator < (const Data &b) const {
        if (val[0] != b.val[0]) return val[0] < b.val[0];
        return val[1] < b.val[1];
    }
};

map<Data, int> mp;

inline void increase(Data &a, int b) {
    a = a + (Data){Pow[0][b], Pow[1][b]};
}

inline void decrease(Data &a, int b) {
    a = a - (Data){Pow[0][b], Pow[1][b]};
}

int main() {
    int n; scanf("%d%s", &n, s + 1); Data all;
    Pow[0][0] = Pow[1][0] = 1;
    for (int i = 0; i <= 1; i++)
        for (int j = 1; j <= n * 2; j++)
            Pow[i][j] = (LL)Pow[i][j - 1] * P[i] % mod[i];
    for (int i = 1, ls = 0; i <= n; i++) {
        if (s[i] == '<') ls--;
        else if (s[i] == '>') ls++;
        else if (s[i] == '+') increase(all, ls + n);
        else decrease(all, ls + n);
    }
    Data fuck; mp[all] = 1; LL res = 0;
    for (int i = 1, ls = 0; i <= n; i++) {
        if (s[i] == '<') ls--;
        else if (s[i] == '>') ls++;
        else if (s[i] == '+') increase(fuck, ls + n);
        else decrease(fuck, ls + n);
        res += mp[fuck], mp[fuck + all * ls]++;
    }
    printf("%lld\n", res);
    return 0;
}


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

using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef pair<int, int> P;
typedef pair<ll, ll> PL;
#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define all(obj) (obj).begin(), (obj).end()
#define rall(obj) (obj).rbegin(), (obj).rend()
#define debug(x) cout << #x << ": " << x << endl
#define out(x) cout << x << endl
//#define int long long int
const int MOD = 1000000007;
const ll LINF = (ll)1e18 - 1;
const int INF = 1e9 - 1;
const double EPS = 0.000000001;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

void print(const vector<int> &v) {
  for(auto x : v) {
    cout << x << " ";
  }
  cout << endl;
}

signed main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  VI a(n);
  set<int> idx1;
  set<int, greater<int>> idx2;
  map<int, int> pos;
  rep(i, n) {
    cin >> a[i];
    idx1.insert(i+1);
    idx2.insert(i+1);
    pos[a[i]] = i+1;
  }
  ll ans = 0;
  for(int i = n; i >= 1; --i) {
    idx1.erase(pos[i]);
    idx2.erase(pos[i]);
    auto l = idx2.lower_bound(pos[i]);
    auto r = idx1.lower_bound(pos[i]);
    if(idx2.empty() && idx1.empty()) ans += 1LL * i * (n - pos[i] + 1) * pos[i];
    else if(l == idx2.end()) ans += 1LL * i * (*r - pos[i]) * (pos[i]);
    else if(r == idx1.end()) ans += 1LL * i * (pos[i] - *l) * (n - pos[i] + 1);
    else ans += 1LL * i * (*r - pos[i]) * (pos[i] - *l);
  }
  out(ans);
  return 0;
}


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

int main() {
    int a,b;
    std::cin>>a>>b;
    if (a>12){
        std::cout<<b<<'\n';
    }else if(a>5){
        std::cout<<b/2<<'\n';
    }else{
        std::cout<<0<<'\n';
    }
    return 0;
}


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

int32_t main()
{	
	IOS
	int n, k;
	cin >> n >> k;
	int a[k];
	for(int i = 0; i < k; i++)
	{
		cin >> a[i];
		if(a[i] >= n) a[i] -= n;
	}
	sort(a, a + k);
	int mx = -1;
	int ans = 0;
	for(int i = 0; i + 1 < k; i++) 
	{
		mx = max(mx, a[i + 1] - a[i]);
		ans += abs(a[i + 1] - a[i]);
	}
	mx = max(mx, n - abs(a[k - 1] - a[0]));
	ans += (n - abs(a[k - 1] - a[0]));
	cout << ans - mx << endl;
    return 0;
}

Measured memory_bytes: 1792
# -*- coding: utf-8 -*-
n, k = map(int, input().split())

sunuke_list = [False for i in range(n)]

for i in range(k):
    d = int(input())
    has_sunuke_list = input().split()
    for k in has_sunuke_list:
        sunuke_list[int(k)-1] = True

print(sunuke_list.count(False))


Measured memory_bytes: 9176
//インクルード(アルファベット順)
#include<algorithm>//sort,二分探索,など
#include<bitset>//固定長bit集合
#include<cmath>//pow,logなど
#include<complex>//複素数
#include<deque>//両端アクセスのキュー
#include<functional>//sortのgreater
#include<iomanip>//setprecision(浮動小数点の出力の誤差)
#include<iostream>//入出力
#include<iterator>//集合演算(積集合,和集合,差集合など)
#include<map>//map(辞書)
#include<numeric>//iota(整数列の生成),gcdとlcm(c++17)
#include<queue>//キュー
#include<set>//集合
#include<stack>//スタック
#include<string>//文字列
//#include<unordered_map>//イテレータあるけど順序保持しないmap
//#include<unordered_set>//イテレータあるけど順序保持しないset
#include<utility>//pair
#include<vector>//可変長配列
#include<valarray>//なんとなく追加
//メモ：表示桁数を大きくする　　cout << fixed << setprecision(20) << cm << endl;
using namespace std;
typedef long long ll;

//マクロ
//forループ関係
//引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか
//Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)
//xにはvectorなどのコンテナ
#define ALL(x) (x).begin(),(x).end() //sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x)) //最大値を求める
#define MIN(x) *min_element(ALL(x)) //最小値を求める
//定数
#define INF 1000000000000 //10^12:極めて大きい値,∞
#define MOD 1000000007 //10^9+7:合同式の法
#define MAXR 100000 //10^5:配列の最大のrange(素数列挙などで使用)
//略記
#define PB push_back //vectorヘの挿入
#define MP make_pair //pairのコンストラクタ
#define F first //pairの一つ目の要素
#define S second //pairの二つ目の要素
#define PI acos(-1.0)
#define answer(ans) cout<<ans<<endl;
#define input(N) cin >> N ;


signed main() {
ll N,ans=0,Wp=-1,Rp=-1,frag=0;
cin >> N;
vector<char> c(N);
REP(i,N){
    cin >>c[i];
    if(c[i]=='W'&& Wp==-1) Wp=i;
}
for(int i=N-1;i>=0;i--){
    if(c[i]=='R'&& Rp==-1) Rp=i;
}
while(frag==0){
if(Rp==-1||Wp==-1){
    answer(ans);
    return 0;
}
if(Rp==0||Wp==N-1||Rp<Wp){
    answer(ans);
    return 0;
}
c[Wp]='R';
c[Rp]='W';
ans++;

for(int i=Wp+1;i<N;i++){
if(c[i]=='W'){ 
    Wp=i;
    break;
}
if(i==N-1){
    
    frag=1;
}
}
for(int i=Rp-1;i>=0;i--){
if(c[i]=='R'){ 
    Rp=i;
    break;
}
if(i==0){
    frag=1;
}
}
if(Rp<Wp){
    frag=1;
}

}

answer(ans);
return 0;
}


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

using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define ll long long int
#define INF 1000000007
int main(){
int a[3];
rep(i,3){
  cin>>a[i];
}
sort(a,a+3);

cout<<a[0]*a[1]/2<<endl;

  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cmath>
#include<algorithm>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<iomanip>
#define _USE_MATH_DEFINES
#include <math.h>
#include <functional>
using namespace std;

#define rep(i,x) for(ll i=0;i<x;i++)
#define repn(i,x) for(ll i=1;i<=x;i++)

typedef long long ll;
const ll INF = 1e17;
const ll MOD = 1000000007;
const ll MAX = 1000001;

ll max(ll a, ll b) {
	if (a > b) { return a; }
	return b;
}

ll min(ll a, ll b) {
	if (a > b) { return b; }
	return a;
}

ll gcd(ll a, ll b) {
	if (b == 0) { return a; }
	if (a < b) { return gcd(b, a); }
	return gcd(b, a%b);
}

ll lcm(ll a, ll b) {
	return a / gcd(a, b) *b;
}

struct edge {
	ll ind;
	ll fr;
	ll to;
	ll d;
};


///////////////////////////

ll N, Q;
vector<ll> A;

bool ch(ll x, ll i) {
	if (A[i] < x) { return false; }
	ll y = 2 * x - A[i];

	auto itr = lower_bound(++A.begin(),A.end(), y);
	ll j = distance(A.begin(), itr);
	if (i - j >= N - i) { return true; }
	else return false;
}


int main() {
	cin >> N >> Q;
	A.assign(N + 1, 0);
	repn(i, N) cin >> A[i];

	vector<ll> sum(N + 1, 0);
	vector<ll> eachsum(N + 1, 0);
	sum[1] = A[1];
	eachsum[1] = A[1];

	for (ll i = 2; i <= N; i++) {
		sum[i] = sum[i - 1] + A[i];
		eachsum[i] = eachsum[i - 2] + A[i];
	}

	repn(i, Q) {
		ll x;
		cin >> x;

		ll l = 0;
		ll r = N + 1;

		while (r-l > 1) {
			ll m = (l + r) / 2;
			if (ch(x, m)) { r = m; }
			else { l = m; }
		}

		ll k = 2 * r - N - 1;

		ll ans = sum[N] - sum[l] + eachsum[max(k-1, 0)];

		cout <<ans<<endl;
	}
	
	
	system("PAUSE");
}


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

long long a, b;
long long ans;

void in();
void solve();
void out();

int main(){
    in();
    solve();
    out();
}

void in(){
    ios::sync_with_stdio(false);
    cout.tie(0);
    cin.tie(0);
    cin >> a >> b;
}

void solve(){
    ans = a * b / __gcd(a, b);
}

void out(){
    cout << ans;
}


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

public class AtCoderD
{
    private static int n;
    private static List<Tuple<int, long>>[] to;
    private static long[] d;

    static void Main()
    {
        int n;
        int k;
        {
            var line = Console.ReadLine();
            var words = line.Split(' ');
            n = int.Parse(words[0]);
            k = int.Parse(words[1]);
        }

        int blue = k;
        int red = n - k;
        int mod = 1000000007;

        for (int i = 1; i <= k; i++)
        {
            long answer = CombinationMod(red + 1, i, mod) * CombinationMod(blue - 1, i - 1, mod) % mod;
            Console.WriteLine(answer);
        }
    }

    private static long CombinationMod(long m, long n, long mod)
    {
        Func<long, long, long> ModPow = (x1, x2) => {
            long ans = 1;
            while (x2 > 0)
            {
                if (x2 % 2 == 1)
                {
                    ans = (ans * x1) % mod;
                }
                x1 = (x1 * x1) % mod;
                x2 /= 2;
            }
            return ans % mod;
        };

        var a = 1L;
        var b = 1L;
        for (long i = 1; i <= n; i++)
        {
            a = (a * (m - i + 1)) % mod;
            b = (b * i) % mod;
        }

        long bb = ModPow(b, mod - 2);
        return (a * bb) % mod;
    }

    // Comnibation（mod版）
    private static long Combination(int n, int k, int d)
    {
        long answer = 1;
        for (int i = n; i > n - k; i--)
        {
            answer = Mul(answer, i, d);
        }
        for (int i = 1; i <= k; i++)
        {
            answer = Div(answer, i, d);
        }
        return answer;
    }

    // 掛け算（mod版）
    private static long Mul(long a, long b, long c)
    {
        return ((a % c) * (b % c)) % c;
    }

    // 割り算（mod版）
    private static long Div(long a, long b, long c)
    {
        return Mul(a, Pow(b, c - 2, c), c);
    }

    // べき乗（mod版）
    private static long Pow(long a, long b, long c)
    {
        if (b == 0)
        {
            return 1;
        }
        else if (b == 1)
        {
            return a % c;
        }
        else if (b % 2 == 0)
        {
            long d = Pow(a, b / 2, c);
            return d * d % c;
        }
        else
        {
            return a * Pow(a, b - 1, c) % c;
        }
    }
}

Measured memory_bytes: 11220
import java.util.*;

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

      int a1 = Integer.parseInt(sc.next());
      int a2 = Integer.parseInt(sc.next());
      int a3 = Integer.parseInt(sc.next());

      int sum = a1+a2+a3;

      if(sum>=22){
        System.out.println("bust");
      }
      else{
        System.out.println("win");
      }

    }
}


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

int main() {
	int n, k, a[3];
	string s;
	cin >> n >> s;
	int sum = 0;
	for (int i = 0; i < 1000; i++) {
		a[0] = i / 100;
		a[1] = i / 10 - a[0] * 10;
		a[2] = i % 10;
		k = 0;
		for (int j = 0; j < s.length(); j++) {
			if (k > 2)break;
			if (s[j] - '0' == a[k]) {
				k++;
			}
			if (k == 3) {
				sum++;
			}
		}
	}
	cout << sum << endl;
	return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
#pragma GCC optimize "03"
using namespace std;

#define int long long int
#define pb push_back
#define pii pair<int,int>
#define fi first
#define se second
#define rep(i,a,b) for (int i = a; i < b; ++i)
#define dbg(x) { cerr<<"> "<<#x<<": "<<x<< endl; }
#define dbg2(x,y) { cerr<<"> "<<#x<<": "<<x<<" , "<<#y<<": "<<y<<endl; }
#define dbg3(x,y,z) { cerr<<"> "<<#x<<": "<<x<<" , "<<#y<<": "<<y<<" , "<<#z<<": "<<z<<endl; }
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#ifndef LOCAL
#define endl '\n'
#endif

const int inf = INT_MAX;
const int MOD = 1e9 + 7;
const int N = 2e5 + 5;



signed main(){
    #ifdef LOCAL
        freopen("input.txt", "r", stdin);
        //freopen("output.txt", "w", stdout);
    #endif  
    IOS;

    int a, b;
    cin >> a >> b;
    b--;
    a--;
    cout << (b+a-1)/a;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
#include<stdio.h>
#include<complex>
using namespace std;

int main(){
  string w;
  cin >> w;
  int n = 'a' - 'A';
  int ans = 0;
  while(true){
    string s;
    cin >> s;
    if(s == "END_OF_TEXT") break;
    for(int i = 0; i < s.size(); i++){
      if('A' <= s[i] && s[i] <= 'Z'){
        s[i] = s[i] + n;
      }else if(s[i] == '.'){
        s = s.substr(0,s.size()-1);
      }
    }
    if(s == w) ans++;
  }
  cout << ans << endl;
  return 0;
}



Measured memory_bytes: 3152
import java.util.Scanner;
 
      class Main {
        public static void main(String[] args) {
          Scanner sc = new Scanner(System.in);
 
          String A = sc.next();
          String B = sc.next();
          String C = sc.next();
 
          if(A.charAt(A.length() - 1) == B.charAt(0) && B.charAt(B.length() - 1) == C.charAt(0)) {
              System.out.println("YES");
          } else {
              System.out.println("NO");
          }
    }
}

Measured memory_bytes: 23892
//abc136c
#include<iostream>
#include<vector>

using namespace std;

int main(){
    int n;
    vector<int> h;
    
    cin>>n;
    h.resize(n);

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

    for(int i=0; i<n-1; i++){
        if(h[i]<h[i+1]){
            h[i+1]=h[i+1]-1;
        }else if(h[i]==h[i+1]){

        }else{
            cout<<"No"<<endl;
            return 0;
        }
    }

    cout<<"Yes"<<endl;
    return 0;
}


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

int N, A[200];

bool flag(){
    int n=0;
    for(int i =0;i <N;i++)
      if(A[i]%2 == 0)n++;
    if(n==N)return true;
    else return false;
}

int main(){
    scanf("%d",&N);
    for(int i =0;i <N;i++)scanf("%d",&A[i]);

    int a=0;
    while(flag()){
      a++;
      for(int i =0;i <N;i++)A[i]=A[i]/2;
    }

    printf("%d",a);

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define len(v) (int)(v).size()

using namespace std;

int main()
{
    while(1){
        string s;
        getline(cin,s);
        if(s == "."){
            break;
        }
        int a = 0, b = 0;
        stack<int> st;
        bool ok = true;
        rep(i,len(s)){
            if(s[i] == '('){
                a++;
                st.push(0);
            }else if(s[i] == ')'){
                a--;
                if(a < 0 || st.top() == 1){
                    ok = false;
                    break;
                }else{
                    st.pop();
                }
            }else if(s[i] == '['){
                b++;
                st.push(1);
            }else if(s[i] == ']'){
                b--;
                if(b < 0 || st.top() == 0){
                    ok = false;
                    break;
                }else{
                    st.pop();
                }
            }
        }
        if(ok && a == 0 && b == 0){
            cout << "yes\n";
        }else{
            cout << "no\n";
        }
    }
}



Measured memory_bytes: 3212
#include <iostream>


int main() {
	int A, B, C, D;
	std::cin >> A >> B >> C >> D;

	while (true) {
		C-=B;
		if (C <= 0) {
			std::cout << "Yes" << std::endl;
			return 0;
		}
		A-=D;
		if (A <= 0) {
			std::cout << "No" << std::endl;
			return 0;
		}
	}

	return 0;
}


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

int main() {
  int N, M, C, correct = 0, score, A;
  cin >> N >> M >> C;
  vector<int> B(M);
  for (int i = 0; i < M; i++) {
    cin >> B.at(i);
  }
  for (int i = 0; i < N; i++) {
    score = C;
    for (int j = 0; j < M; j++) {
      cin >> A;
      score += A * B[j];
    }
    if (score > 0) correct++;
  }
  cout << correct << endl;
}


Measured memory_bytes: 3168
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>

using namespace std;

int main(void)
{
  long long cnt = 0;
  int interval = 1, n, i = 0;
  int num[1000000] = {0};
  int G[13] = {0};

  cin >> n;

  while(interval <= n){
    G[i] = interval;
    interval = interval * 3 + 1;
    i++;
  }

  int Gstart = i;

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

  for(int k = Gstart - 1;k >= 0;k--){
    for(int i = G[k];i < n;i++){
      int v = num[i];
      int j = i - G[k];
      while(j >= 0 && num[j] > v){
	num[j + G[k]] = num[j];
	j -= G[k];
	cnt++;
      }
      num[j + G[k]] = v;
    }
  }

  cout << Gstart << endl;

  for(i = Gstart - 1;i >= 0;i--){
    cout << G[i] << ' ';
  }

  cout << endl << cnt << endl;

  for(i = 0;i < n;i++){
    cout << num[i] << endl;
  }
  
  return 0;
}



Measured memory_bytes: 7000
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author Sagor
 */

#include <fstream>
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <queue>
#include <deque>
#include <stack>
#include <vector>
#include <iomanip>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <unordered_set>
#include <unordered_map>

#define gap                        ' '
#define EPS                        1e-9
#define P_INF                      2e9+17
#define N_INF                     -2e9-17
#define MOD                        1000000007
#define PI                         2*acos(0.0)
#define All(x)                     x.begin(),x.end()
#define Mem(Name, type)            memset(Name, type, sizeof(Name))

template<typename T>
T GCD(T a, T b) { return a ? GCD(b % a, a) : b; }

template<typename T>
T LCM(T a, T b) { return (a * b) / GCD(a, b); }

template<typename T>
std::ostream &operator<<(std::ostream &os, const std::vector<T> &v) {
    for (auto ob : v) os << ob << " ";
    return os;
}

template<typename T, typename S>
std::ostream &operator<<(std::ostream &os, const std::map<T, S> &v) {
    for (auto ob : v) os << ob.first << " : " << ob.second << std::endl;
    return os;
}

using ld = double;
using ll = long long int;
using ul = unsigned long long int;
using namespace std;

class DKnapsack1 {
public:
    void solve(std::istream &in, std::ostream &out) {
        int n, w;
        in >> n >> w;
        vector<int> weight(n), value(n);
        vector<ll> dp(w + 1);
        for (int i = 0; i < n; ++i) {
            in >> weight[i] >> value[i];
        }
        for (int i = 0; i < n; ++i) {
            for (int j = w; j >= 0; --j) {
                if (j - weight[i] >= 0) {
                    dp[j] = max(dp[j], (value[i] + dp[j - weight[i]]));
                }
            }
        }
        out << dp[w] << endl;
    }
};


int main() {
    std::ios_base::sync_with_stdio(false);
    std::cin.tie(nullptr);
    DKnapsack1 solver;
    std::istream& in(std::cin);
    std::ostream& out(std::cout);
    solver.solve(in, out);
    return 0;
}


Measured memory_bytes: 4000
"use strict";
main(require("fs").readFileSync("/dev/stdin", "UTF-8"));

function main(input) {
  input = input.split("\n")[0].split(" ");
  let small = "";
  let big = "";
  if (input[0] > input[1]) {
    big = input[0];
    small = input[1];
  } else {
    big = input[1];
    small = input[0];
  }
  console.log(small.repeat(parseInt(big)));
}


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

ch_list=[]
for i in range(1,N):
  if S[i-1]!=S[i]:
    ch_list.append(i)
#print(ch_list)
len_ch=len(ch_list)

if len_ch>=2*K:
  print(N-1-len_ch+2*K)
elif len_ch==2*K-1:
  print(N-1-len_ch+2*K-1)
else:
  print(N-1)

Measured memory_bytes: 7108
import random


def gcd(a, b):
    if a == 0:
        return b
    return gcd(b % a, a)


def lcm(a, b):
    return (a * b) / gcd(a, b)

s=input()
if s[len(s)-1]!='s':
    s+='s'
else:
    s+='es'
print(s)


Measured memory_bytes: 9544
#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    int A, B;
    cin >> A >> B;
    
    int temp;
    if(A + B >= A - B)
        temp = A + B;
    else
        temp = A - B;
    
    if(temp >= A * B)
        cout << temp << endl;
    else
        cout << A * B << endl;
}


Measured memory_bytes: 256
import sys

S = [[[0 for k in xrange(10)] for j in xrange(3)] for i in xrange(4)]

n = input()

for l in xrange(n):
    b, f, r, v = map(int, raw_input().split())
    S[b - 1][f - 1][r - 1] += v
    
for k in xrange(4):
    for j in xrange(3):
        for i in xrange(10):
            tmp = ' ' + str(S[k][j][i]) 
            sys.stdout.write(tmp)
        print ""
    if k != 3:
        print "#" * 20

Measured memory_bytes: 6456
#include <iostream>
#include <string>
#include <cstdlib>
#include <cstdio>
#include <queue>
#include <stack>
#include <list>
#include <utility>
#include <vector>
#include <set>
#include <algorithm>
#include <cmath>
#include <climits>
#include <map>
#include <unordered_map>
#include <string.h>
#include<iomanip>
#include <iterator>
#include <locale>

#define all(a) a.begin(),a.end()
#define VV(T) vector<vector< T > >
#define rep(i,N) for(int i = 0; i <N; i++)
#define repsg(i,s,g) for(int i = s; i <g; i++)
#define name(x) #x
using namespace std;

const int INF = INT_MAX;
const long long INFL = 1LL<<40;
const double PI = atan(1)*4;
const int MOD = pow(10,9)+7;
int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

typedef long long ll,LL;
typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll, vLL;
typedef vector<vector<long long> > vvll, vvLL;
typedef pair<int,int> pii;
typedef pair<LL, LL> pLL;


// vector入力
template<typename T>
istream& operator >> (istream& is, vector<T>& vec){
    for(T& x: vec) is >> x;
    return is;
}
// vector出力
template<typename T>
ostream& operator << (ostream& os, vector<T>& vec){
    for(int i=0; i<vec.size(); i++){
        os << vec[i] << ( i+1 == vec.size() ? "" : " " );
    }
    return os;
}


string out(int a, int b, int c, int d){
    return to_string(a+1)+" " +to_string(b+1) +" " +to_string(c+1) + " "+to_string(d+1) + '\n';
}


int main() {
    int H, W; cin>>H>>W;
    vector<vector<int>> a(H);
    rep(i,H){a[i].resize(W);cin>>a[i];}
    vector<string> ans;
    int cnt=0;
    rep(w,W-1){
        
        if(w%2==0){
            rep(h,H-1){
                if(a[h][w]%2==0)continue;
                a[h+1][w]++;
                a[h][w]--;
                cnt++;
                ans.push_back(out(h,w,h+1,w));
            }
            if(a[H-1][w]%2==0)continue;
            a[H-1][w]--;
            a[H-1][w+1]++;
            ans.push_back(out(H-1,w,H-1,w+1));
        }else{
            for(auto h = H-1;h>=1;h--){
                if(a[h][w]%2==0)continue;
                a[h-1][w]++;
                a[h][w]--;
                ans.push_back(out(h,w,h-1,w));
                cnt++;
            }
            if(a[0][w]%2==0)continue;
            a[0][w]--;
            a[0][w+1]++;
            ans.push_back(out(0,w,0,w+1));
            
        }
        
    }
    
    if((W-1)%2==0){
        rep(h,H-1){
            if(a[h][W-1]%2==0)continue;
            a[h+1][W-1]++;
            a[h][W-1]--;
            ans.push_back(out(h,W-1,h+1,W-1));
        }

    }else{
        for(auto h = H-1;h>=1;h--){
            if(a[h][W-1]%2==0)continue;
            a[h-1][W-1]++;
            a[h][W-1]--;
            ans.push_back(out(h,W-1,h-1,W-1));
        }

        
    }
    
    cout<<ans.size()<<endl;
    for(auto s:ans){
        cout<<s;
    }
    
    return 0;
}








Measured memory_bytes: 11892
#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;

// nの自分自身以外の約数をすべて返す 
vi factors(int n){
  vi res;
  for(int i=1; i*i<=n; i++){
    if (n % i == 0){
      res.push_back(i);
      if(i != 1 && i*i != n) res.push_back(n/i);
    }
  }
  return res;
}

int main(){
  int N;
  vi a(200010);

  vi sum(200010, 0); // sum[i] : iの倍数の箱に入ったボールの総和
  vector<bool> res(200010, false); // res[i] : i番目の箱ボールを入れるときtrue
  int cnt; // ボールを入れる箱の個数
  
  cin >> N;
  
  for (int i=1; i<=N; i++) cin >> a[i];

  //後ろから決めていく
  for (int i=N; i>=1; i--){
    if(sum[i] % 2 != a[i]){
      res[i] = true;
      sum[i]++; cnt++;

      vi f = factors(i);
      for(int j=0; j<f.size(); j++){
        sum[f[j]]++;   
      }
      
    }
  }
  
  cout << cnt << endl;
  for(int i=1; i<=N; i++){
    if(res[i]) cout << i << " ";
  }
  cout << endl;
}

Measured memory_bytes: 2688
object Main extends App {
	override def main(args:Array[String]) = {
		val sc = new java.util.Scanner(System.in)
		val n = sc.nextInt
		
		val allCard = getAllCard
		
		val pw = new java.io.PrintWriter(System.out)
		val has = (1 to n).map(x => card(sc.next , sc.nextInt))
		printCards(allCard.filterNot(has.contains(_)), pw)
		pw.flush
		
	}
	
	case class card(suit:String, number:Int){
		def print :String = {
			suit + " " + number
		}
	}

	def getAllCard = 
		for(s <- List("S","H","C","D") ; n <- (1 to 13) ) yield card(s,n)
		
	def printCards(list:List[card], pw : java.io.PrintWriter):Unit = {
		list.foreach(card => pw.println(card.print))
	}
	
}

Measured memory_bytes: 45096
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i,n) for(ll i = 0; i<(ll)(n); i++)
#define REPS(i,n) for (ll i = 1; i<=(ll)(n); i++)
#define REPD(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=(a);i<=(b);i++)
#define FORD(i,a,b) for(ll i=(a);i>=(b);i--)
#define pb push_back
#define MOD 1000000007
#define MOD2 998244353
#define PI 3.141592653
#define INF 100000000000000
#define N 210000

vector<ll> ansl(N);//最初にn*n+n/2もっといてだめなルートを引いていく
vector<ll> plist(N,-1);//自分の親の番号、0の親は-1にしておく
vector<vector<ll>> conn(N);//枝リスト
vector<ll> colors(N);//色
vector<ll> reached(N,0);//dfsしたか
vector<ll> checking(N);
vector<vector<ll>> cnter(N);
vector<ll> desn(N,1);//子の個数

void dfs(ll x, ll p){
    reached[x]=1;
    ll y = checking[colors[x]];
    checking[colors[x]]-=y;
    REP(i,conn[x].size()) if (reached[conn[x][i]]==0){
        dfs(conn[x][i],x);
        ll cnt = desn[conn[x][i]]-checking[colors[x]];
        ansl[colors[x]]-=(cnt*cnt+cnt)/2;
        desn[x]+=desn[conn[x][i]];
        checking[colors[x]]=0;
    }
    checking[colors[x]]=y+desn[x];
}

int main(){
    ll n, a, b; cin >> n;
    REP(i,n){
        cin >> colors[i];
        colors[i]--;
    }
    REP(i,n) ansl[i]=(n*n+n)/2;
    REP(i,n-1){
        cin >> a >> b;
        conn[a-1].pb(b-1);
        conn[b-1].pb(a-1);
    }
    dfs(0,-1);
    REP(i,n) if (colors[0]!=i){
        ll cnt2 = n-checking[i];
        ansl[i]-=(cnt2*cnt2+cnt2)/2;
    }
    REP(i,n) cout << ansl[i] << endl;
}

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

int main() {
	int a,b,c,d,e,f,k;
  	cin >> a >>b >> c >>d >>e >>k;
  if(b-a<=k && c-a<=k && d-a<=k && e-a<=k && c-b<=k && d-b<=k && e-b<=k && d-c<=k)cout<< "Yay!"<<endl;
     else cout << ":("<<endl;
}
 


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


public class Main{
  
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int K = sc.nextInt();
    int [] l = new int[N];
    for(int i=0;i<N;i++){
      l[i] = sc.nextInt();
    }
    Arrays.sort(l);
    int sum =0;
    int count =0;
    int i=0;
    while(count!=K){
      sum +=l[N-i-1];
      i++;
      count++;
    }
    
    System.out.println(sum);
    
    
  }
}
                          
                         
                    
    
    
    
    
    
    


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

int main(int argc, char** argv){
  int a, b;
  
  while(cin >> a >> b) {
    if (a % 2 == 1 && b % 2 == 1)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }

  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdlib>
#include <algorithm>

using namespace std;

int main(){
  int a, b, c;
  cin >> a >> b >> c;
  if(a == b) cout << c << endl;
  if(b == c) cout << a << endl;
  if(c == a) cout << b << endl;

  return 0;
}


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

using namespace std;

#define ok1 printf("ok1\n");
#define ok2 printf("ok2\n");
#define M 1000000000000000000LL
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,s,n)　for(int i=(s);i<(n);i++)
#define repr(i,n) for(int i=n-1;i>=0;i--)
#define REPR(i,s,n) for(int i=(s);i>=(n);i--)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define pb push_back
#define pf push_front
#define MIN(a,b) a=min((a),(b))
#define MAX(a,b) a=max((a),(b))
#define SIZE(v) (int)v.size()
#define Eunique(v) v.erace(unique(all(v)),v.end())
#define pvec(v)　rep(i,v.size()){cout << v[i] << " ";}
#define INF 0x3f3f3f3f
#define mset(m,v) memset(m,v,sezeof(m))
#define mod 1e9 +7;

const double pi = acos(-1.0);

typedef string ss;
typedef vector<int> vi;
typedef vector<string> vs;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef deque<ll> dll;
typedef pair<ll,ll> P;
ll dx[4] = {1,0,-1,0},dy[4] = {0,1,0,-1};

ll gcd(ll x,ll y)
{
    ll r;
    while((r = x % y) != 0)
    {
        x = y;
        y = r;
    }
    return y;
}

ll lcm(ll x,ll y)
{
    x /= gcd(x,y);
    //y /= gcd(x,y);
    return (x*y);
}

#define WA printf("WA\n");
int main()
{
    ll n,m;
    cin >> n >> m;

    vll ax(n),ay(n),bx(m),by(m);
    rep(i,n)cin >> ax[i] >> ay[i];
    rep(i,m)cin >> bx[i] >> by[i];

    rep(i,n){
        ll min=M,place;
        rep(j,m){
            ll dis = abs(ax[i]-bx[j]) + abs(ay[i]-by[j]);
            if(dis < min){
                min = dis;
                place = j+1;
            }
        }
        cout << place << endl;
    }

    return 0;
}


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

const int MAX_N = 200005;

// auto mod int
// https://youtu.be/L8grWxBlIZ4?t=9858
// https://youtu.be/ERZuLAxZffQ?t=4807 : optimize
// https://youtu.be/8uowVvQ_-Mo?t=1329 : division
const int mod = 1000000007;
struct mint {
	ll x; // typedef long long ll;
	mint(ll x = 0) :x((x%mod + mod) % mod) {}
	mint operator-() const { return mint(-x); }
	mint& operator+=(const mint a) {
		if ((x += a.x) >= mod) x -= mod;
		return *this;
	}
	mint& operator-=(const mint a) {
		if ((x += mod - a.x) >= mod) x -= mod;
		return *this;
	}
	mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this; }
	mint operator+(const mint a) const { return mint(*this) += a; }
	mint operator-(const mint a) const { return mint(*this) -= a; }
	mint operator*(const mint a) const { return mint(*this) *= a; }
	mint pow(ll t) const {
		if (!t) return 1;
		mint a = pow(t >> 1);
		a *= a;
		if (t & 1) a *= *this;
		return a;
	}

	// for prime mod
	mint inv() const { return pow(mod - 2); }
	mint& operator/=(const mint a) { return *this *= a.inv(); }
	mint operator/(const mint a) const { return mint(*this) /= a; }
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x; }
ostream& operator<<(ostream& os, const mint& a) { return os << a.x; }

int main() {
	int N,K;
	cin >> N>>K;
	vector<long long>P;
	vector<long long>M;
	for (int n = 0;n<N;++n) {
		long long num;
		cin >> num;
		if (num > 0) {
			P.push_back(num);
		}
		else {
			M.push_back(-num);
		}
	}
	sort(P.begin(),P.end(),std::greater<int>());
	sort(M.begin(), M.end(), std::greater<int>());
	//例外処理答えがマイナスになる
	if (P.size() == 0 && 1 == K%2) {
		sort(M.begin(), M.end()); 
		mint ans = 1;
		for (int n = 0;n<K;++n) {
			ans *= (mint)M[n];
		}
		cout << -ans << endl;
		return 0;
	}
	if (M.size() + P.size() ==K &&1 == M.size()%2) {
		mint ans = 1;
		for (int n = 0; n < M.size(); ++n) {
			ans *= (mint)M[n];
		}	
		for (int n = 0; n < P.size(); ++n) {
			ans *= (mint)P[n];
		}
		cout << -ans << endl;
		return 0;
	}
	


	int p = 0;
	int m = 0;
	mint ans = 1;
	while (K != 0) {
		if (K == 1) {
			if (P.size() - p < 1) {
				ans *= (mint)M[m];
				m++;
			}
			else {
				ans *= (mint)P[p];
				p++;
			}

			K--;
		}
		else {
			if (P.size()-p < 2 ) {
				ans *= (mint)M[m];
				ans *= (mint)M[m + 1];
				m += 2;
			}
			else if (M.size() - m < 2) {
				ans *= (mint)P[p];
				ans *= (mint)P[p + 1];
				p += 2;
			}
			else {
				if (P[p] * P[p + 1] > M[m] * M[m + 1]) {
					ans *= (mint)P[p];
					ans *= (mint)P[p + 1];
					p += 2;
				}
				else {
					ans *= (mint)M[m];
					ans *= (mint)M[m + 1];
					m += 2;
				}
			}
			K -= 2;
		}
	}
	cout <<ans<<endl;
	return 0;
}

Measured memory_bytes: 5592
#pragma GCC optimize ("O3")

#include <bits/stdc++.h>

using namespace std;

#ifdef LOCAL
#include <prettyprint.hpp>
#define debug(...)  cerr << "[" << #__VA_ARGS__ << "]: ", d_err(__VA_ARGS__);
#else
#define debug(...) 83;
#endif

void d_err() {
    cerr << endl;
}

template <typename H, typename... T>
void d_err(H h, T... t) {
    cerr << h << " ";
    d_err(t...);
}

#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define REP(i, n) FOR(i, 0, n)
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define bcnt __builtin_popcountll

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<ll,ll> Pll;
typedef pair<int,int> Pin;

ll INF = 1e16;
int inf = 1e9;
ll MOD = 1e9+7;


int main(){
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(20);
    
    int H, W;
    cin >> H >> W;

    char M[H][W];
    REP(i, H) REP(j, W) cin >> M[i][j];

    int hw = H * W;
    int E[hw][hw];
    REP(i, hw) REP(j, hw) E[i][j] = inf;

    REP(i, H) REP(j, W) {
        if (M[i][j] == '#') continue;

        int hw_tmp = i * W + j;

        E[hw_tmp][hw_tmp] = 0;
        if (i < H - 1 && M[i+1][j] == '.') E[hw_tmp][(i+1) * W + j] = 1;
        if (i > 0 && M[i-1][j] == '.') E[hw_tmp][(i-1) * W + j] = 1;
        if (j < W - 1 && M[i][j+1] == '.') E[hw_tmp][i * W + j + 1] = 1;
        if (j > 0 && M[i][j-1] == '.') E[hw_tmp][i * W + j - 1] = 1;
    }


    REP(k, hw) REP(i, hw) REP(j, hw) {
        E[i][j] = min(E[i][j], E[i][k] + E[k][j]);
    }

    int ans = 0;
    REP(i, hw) REP(j, hw) {
        if (E[i][j] == inf) continue;
        ans = max(ans, E[i][j]);
    }

    cout << ans << endl;

}


Measured memory_bytes: 896
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line = null;

		try {
			while ((line = br.readLine()) != null) {
				line.trim();

				char[] decode = line.toCharArray();

				for (int j = 0; j < 26; j++) {
					int i = 0;
					for (char c : decode) {
						if (c >= 'a' && c <= 'z') {
							if(c == 'z')  decode[i] = 'a';
							else decode[i]++;
						}
						i++;
					}
					String str = new String(decode);
					 if (str.contains("this") || str.contains("the")
		                        || str.contains("that"))  break;
				}
				System.out.println(decode);
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}

Measured memory_bytes: 17788
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
static const int MAX=100000;
int N,a,b;
ll K,aa[MAX+1];
int main(){
    cin>>N>>K;

    while(N--){
        cin>>a>>b;
        aa[a]+=b;
    }
    for(int ans=1;ans<=MAX;ans++){
        K-=aa[ans];
        if(K<=0){
            cout<<ans<<"\n";
            return 0;
        }
    }
    return 0;

}



Measured memory_bytes: 1024
#include<stdio.h>
int main(){
  int n,m,c,b[100010],a,d=0,i,j,s;
  scanf("%d %d %d",&n,&m,&c);
  for(i=0;i<m;i++)scanf("%d",&b[i]);
  for(i=0;i<n;i++){
    for(j=s=0;j<m;j++){
      scanf("%d",&a);
      s+=a*b[j];
    }
    if(s+c>0)d++;
  }
  printf("%d\n",d);
  return 0;
}
	    


Measured memory_bytes: 128
def getTheNumberOfCoin(n,m,C):
    T=[float('inf')]*(n+1)
    T[0]=0

    T=[float('inf')]*(n+1)
    T[0]=0
    for i in range(m):
        for j in range(C[i],n+1):
            T[j] = min(T[j], T[j - C[i]] + 1)
    return T[n]

n,m = map(int,raw_input().split())
C = map(int,raw_input().split())
print getTheNumberOfCoin(n,m,C)

Measured memory_bytes: 7252