akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define INF 1e9;
typedef long long ll;
ll power(ll a,ll b){
 ll ans=1;
 for(ll i=1;i<=b;i++){
ans*=a;
  }
  return ans;
}

  
int main(){
ll D,G;
  cin>>D>>G;
  
  vector<ll>p(D);
  vector<ll>c(D);

  for(ll i=0;i<D;i++){
    cin>>p[i]>>c[i];
  
  }
  
  ll min=INF;
  for(ll i=0;i<power(2,D);i++){
    ll sum=0;
    ll count=0;
    ll max=0;
    bitset<11>A(i);
    string B=A.to_string();
    for(ll j=B.size()-1;j>=B.size()-D;j--){
      if(B[j]=='1'){
        sum+=((B.size()-j)*100*p[B.size()-j-1]+c[B.size()-j-1]);
        count+=p[B.size()-j-1];
      }
      else{
max=B.size()-j;
    }
    
    }
    ll a=0;
    if(sum<G){
      if((G-sum)%((max)*100)==0){
        a=(G-sum)/(max*100);
        count+=(G-sum)/(max*100);
        sum+=a*max*100;
      }
      else{
        count+=((G-sum)/(max*100)+1);
        a=((G-sum)/(max*100)+1);
        sum+=a*max*100;
      }
    }
    
    if(min>count&&a<p[max-1]&&sum>=G){
      min=count;
    }
  }

  cout<<min<<endl;

}

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

namespace test
{

    class Program
    {
        static void Main(string[] args)
        {
            List<string> resultList = new List<string>();

            string input;
            while ((input = Console.ReadLine()) != null)
            {
                char[] inputArray = input.ToCharArray();
                StringBuilder sb = new StringBuilder();

                for (int i = 0; i < inputArray.Length; i++)
                {
                    if (inputArray[i] == '@')
                    {
                        for (int k = 0; k < int.Parse(inputArray[i + 1].ToString()); k++)
                        {
                            sb.Append(inputArray[i + 2]);
                        }
                        i = i + 2;
                    }
                    else
                    {
                        sb.Append(inputArray[i]);
                    }
                }

                resultList.Add(sb.ToString());

            }

            foreach (string s in resultList)
            {
                Console.WriteLine(s);
            }


        }


        
    }
}

Measured memory_bytes: 5348
#include<iostream>
using namespace std;
int main()
{
    int n, x, y, z;
    cin >> n;
    x = n / 100;
    y = n % 100 / 10;
    z = n % 10;
    if (x == 1) x = 9; else if (x == 9) x = 1;
    if (y == 1) y = 9; else if (y == 9) y = 1; 
    if (z == 1) z = 9; else if (z == 9) z = 1; 
    cout << x << y << z << endl;
    return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <set>

#define fin stdin
#define fout stdout

#define ll long long

#define mult std::set <myc>

#define MAXN 100000

struct myc{
    ll x, y;
    myc(ll _x, ll _y){
        x = _x;
        y = _y;
    }
    inline bool operator < (const myc &u) const {
        return x > u.x;
    }
};

mult s;

ll st[MAXN + 2];
ll ans[MAXN + 1];

inline void baga(myc a){
    mult::iterator it = s.lower_bound(a);
    if (it != s.end() && it -> x == a.x) {
        a.y += it -> y;
        s.erase(it);
    }
    s.insert(a);
}

int main(){
    int n, q;
    fscanf(fin, "%d%d", &n, &q);

    int vf = 1;
    st[1] = n;
    for (int i = 0; i < q; i++) {
        ll x;
        fscanf(fin, "%lld", &x);

        while (vf > 0 && st[vf] >= x)
            vf--;

        st[++vf] = x;
    }

    s.insert(myc(st[vf], 1));

    for(int i = vf - 1; i > 0; i--){
        while ((*(s.begin())).x > st[i]) {
            myc a = *(s.begin());
            s.erase(s.begin());

            baga(myc(st[i], a.y * (a.x / st[i])));

            if (a.x % st[i])
                baga(myc(a.x % st[i], a.y));
        }
    }

    for (auto &u : s)
        ans[u.x] += u.y;

    for (int i = n - 1; i > 0; i--)
        ans[i] += ans[i + 1];

    for (int i = 1; i <= n; i++)
        fprintf(fout, "%lld\n", ans[i]);

    return 0;
}


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

int main() {

    int n;

    cin >> n;

    int a[n];
    int abs_max = 0,abs_itr = 0;
    vector<pair<int,int> > v;

    for(int i=0; i<n; i++){
        cin >> a[i];
        if(a[i] >= 0 && abs_max < a[i]){
            abs_max = a[i];
            abs_itr = i;
        }
        else if(a[i] < 0 && abs_max < -a[i]){
            abs_max = -a[i];
            abs_itr = i;
        }
    }

    for(int i=0; i<n; i++){
        if(abs_itr != i){
            a[i] += a[abs_itr];
            v.push_back(make_pair(abs_itr+1,i+1));
        }
    }

    if(a[abs_itr] >= 0){
        for(int i=0; i<n-1; i++){
            a[i+1] += a[i];
            v.push_back(make_pair(i+1,i+2));
        }
    }
    else if(a[abs_itr] < 0){
        for(int i=n; i>1; i--){
            a[i-1] += a[i];
            v.push_back(make_pair(i,i-1));
        }
    }

    cout << v.size() << endl;

    for(auto a : v){
        cout << a.first << ' ' << a.second << endl;
    }

    return 0;
}

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

int main(){
    int a;
    string s;
    cin >>a >>  s;
    if (a >= 3200) {
        cout << s << endl;
    }else {
        cout << "red" << endl;
    }
}

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


using namespace std;

int a, b, c;

int main()
{
	scanf("%d%d", &a, &b);
	if (a > b){
		int temp = a;
		a = b;
		b = temp;
	}
	
	if ((a == 1) && (b == 2)) {
		printf("3\n");
	} else if ((a == 1) && (b == 3)) {
		printf("2\n");
	} else if ((a == 2) && (b == 3)) {
		printf("1\n");
	}
		

	return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <vector>
using namespace std;
struct query{
    int v, d, c;
    query(int v, int d, int c) : v(v), d(d), c(c){}
};
vector< vector<int> > edg, clr;
void paint(int v, int d, int c){
    if(clr[v][d] > 0) return;
    for(int i=d;i>=0;i--){
        if(clr[v][i] > 0) break;
        clr[v][i] = c;
    }
    if(d <= 0) return;
    for(int i=0;i<edg[v].size();i++){
        paint(edg[v][i], d-1, c);
    }
}
int main(void){
    int n, m, q;
    vector<query> que;
    cin >> n >> m;
    edg.assign(n, vector<int>());
    clr.assign(n, vector<int>());

    for(int i=0;i<m;i++){
        int a, b;
        cin >> a >> b;
        a--;
        b--;
        edg[a].push_back(b);
        edg[b].push_back(a);
    }
    cin >> q;
    for(int i=0;i<q;i++){
        int v, d, c;
        cin >> v >> d >> c;
        que.push_back(query(--v, d, c));
    }
    for(int i=0;i<n;i++){
        clr[i].assign(11, 0);
    }
    for(int i=q-1;i>=0;i--){
        paint(que[i].v, que[i].d, que[i].c);
    }
    for(int i=0;i<n;i++){
        cout << clr[i][0] << endl;
    }
}


Measured memory_bytes: 16240
import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.PriorityQueue;
import java.util.Scanner;

public class Main {

    static Map<Integer, List<Integer>> workMap = new HashMap<>();

    /**
     * @param args
     */
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = 0;
        int m = 0;
        int i = 0;

        while (true) {
            String inputText = scanner.nextLine();
            String[] inputTextArr = inputText.split(" ");

            if (i == 0) {
                n = Integer.parseInt(inputTextArr[0]);
                m = Integer.parseInt(inputTextArr[1]);
            } else {
                Integer day = Integer.valueOf(inputTextArr[0]);
                Integer pay = Integer.valueOf(inputTextArr[1]);

                List<Integer> payList = workMap.get(day);
                if (payList == null) {
                    payList = new ArrayList<>();
                }
                payList.add(pay);
                workMap.put(day, payList);
            }

            if (i >= n) {
                break;
            }

            i++;

        }
        scanner.close();


        PriorityQueue<Integer> pq = new PriorityQueue<>(n, new Comparator<Integer>() {
            @Override
            public int compare(Integer o1, Integer o2) {
                return o2.compareTo(o1);
            }
        });

        int result = 0;
        for (int dayIdx = 1; dayIdx <= m; dayIdx++) {
            List<Integer> payList = workMap.get(dayIdx);
            if (payList != null && payList.size() > 0) {
                pq.addAll(payList);
            }
            if (pq.peek() != null) {
                result = result + pq.poll();
            }
        }

        System.out.println(result);
    }

}

Measured memory_bytes: 134616
#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(b) - 1;i>=(a);i--)
#define REP(i,n) for(int i=0;i<(n);i++)
#define RREP(i,n) for(int i=n-1;i>=0;i--)

#define PB push_back
#define INF (1<<29)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define CLR(a) memset(a,0,sizeof(a))
const int dx[] = {-1,0,0,1},dy[] = {0,1,-1,0};

typedef long long int ll;

using namespace std;

int main(){
    while(true){
	int n,m;
	string s,ss;
	ss = "I";
	cin >> n;
	if(n == 0) break;
	cin >> m >> s;
	REP(i,n){
	    ss += "OI";
	}
	int ans = 0;
	REP(i,m-ss.size()+1){
	    if(s.substr(i,ss.size()) == ss){
		ans++;
	    }	
	}
	cout << ans << endl;
    }
    return 0;
}

Measured memory_bytes: 3912
#include <iostream>
#include<vector>
#include<algorithm>
#include<map>
using namespace std;
typedef long long ll;

const ll MOD_CONST = 1000000007;

typedef pair<int, int> pii;



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

    vector<pii> req(m);

    for (int i = 0; i < m; i++) {
        int  a, b;
        cin >> a >> b;
        req[i] = make_pair(a, b);
    }


    sort(req.begin(), req.end(), greater<pii>());

    int l = req[0].first;
    int r = req[0].second;
    int cnt = 0;
    for (int i = 1; i < m; i++) {
        if (req[i].second <=l) {
            l = req[i].first;
            r = req[i].second;
            cnt++;
        }
        if (req[i].first < r) {
            r = req[i].second;
        }
        
        
    }

    cnt++;

    cout << cnt << endl;
}  


Measured memory_bytes: 1024
#include <cstdio>
#include <cstring>
#include <cmath>
#include <utility>
#include <iostream>
#include <functional>
#include <bitset>
#include <algorithm>
#include <vector>
#include <forward_list>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <tuple>
#include <numeric>
#define rep(i, s, g) for ((i) = (s); (i) < (g); ++(i))
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
const ll MOD = 1e9 + 7;
const ll INF = (1ll << 60);

int main(void)
{
    int n;
    cin >> n;

    cout << 1000 * ((n + 999) / 1000) - n << endl;
}


Measured memory_bytes: 3592
#define _USE_MATH_DEFINES

#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <list>

using namespace std;

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

long long int INF = 1e18;
long long int MOD = 1e9 + 7;

int main(){
	
	long long int n, k;
	cin >> n >> k;
	
	long long int ans = 1;
	for(int i = 0; i < n; i++){
		ans *= k;
		ans %= MOD;
	}
	
	cout << ans << endl;
	
	return 0;
}


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

int main() {
	int n, k, m;
	cin >> n >> m >> k;
	for (int i = 0;i <= n;i++) {
		for (int j = 0;j <= m;j++) {
			if (i*(m - j) + j * (n - i) == k) {
				cout << "Yes" << endl;
				return 0;
			}
		}
	}
	cout << "No" << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i = (a); i <= (b); i++)
#define rng(a) a.begin(), a.end()
#define ina(n,a) cin >> n; for(int i = 1; i <= n; i++) cin >> a[i]
#define sz(x) (int)(x).size()
#define se second
#define fi first
#define prev            coyhhhhhhyoc    
#define next          sdNNNmNNNNNNNmds  
#define y0           hNNNNy_yNNNNNN_sNh
#define y1          mNNNNNdtdNNNNNNtsNNm
#define yn          mNNNNNNNNy___smNNNms
#define tm            oooooosyysooooot 
#define read               tyhyt        
#define rank              ytmNmo         
#define index              yyy
#define pb push_back
#define pcnt __builtin_popcountll
#define rrep(i,a,b) for(int i = (b); i >= (a); i--)
#define rall(x,a) for(auto x : a)
#define MOD 1000000007
#define endl "\n"
typedef long long ll;
using namespace std;

const int N = 11;
int x[N], y[N];
int n;

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cin >> n;
    rep(i, 1, n) {
        cin >> x[i] >> y[i];
    }
    vector<int> ord;
    rep(i, 1, n) {
        ord.pb(i);
    }
    int cnt = 0;
    double ans = 0;
    do {
        cnt++;
        double cur = 0;
        rep(i, 1, n - 1) {
            int from = ord[i - 1], to = ord[i];
            double dx = x[to] - x[from], dy = y[to] - y[from];
            cur += sqrt(dx * dx + dy * dy);
        }
        ans += cur;
    } while(next_permutation(rng(ord)));
    ans /= cnt;
    cout << setprecision(13) << fixed << ans << endl;
    return 0;
}


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

using ll = long long;
using ull = unsigned long long;

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    string s;
    cin>>s;

    if(s[0] == '7' or s[1] == '7' or s[2] == '7')
        cout<<"Yes\n";
    else
        cout<<"No\n";

    return 0;
}


Measured memory_bytes: 3640
/* _________________________________________________________________________________________________
  |                                                                                                 |
  |                             Author      : Aditya Ahuja                                          |
  |                             Date        : Sun,  4th Aug 2019                                    |
  |_________________________________________________________________________________________________|
*/
 
#include<bits/stdc++.h>
using namespace std;

#define int long long

#define pb          push_back
#define F           first
#define S           second
#define endl        "\n"
#define rep(i,a,b)  for(int i = a; i < (int)b; i++)
#define req(i,a,b)  for(int i = (int)b - 1; i >= a; i--)
#define all(a)      (a).begin(),(a).end()
#define ret(x)      {cout << x << endl; return;}
#define sz(x)       (int)x.size()
#define type(x)     typeid(x).name()

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef vector<vector<int>> vii;

int gcd(int a, int b) {return b?gcd(b,a%b):a;}

#ifdef LOCAL
	#define wa(x)       cerr << (#x) << " --- " << (x) << endl
	#define pvi(v)      {for(auto it:v) cerr << it << " "; cerr << endl;}
	#define line1	    cerr << "---------------------------" << endl;
#else
	#define wa //
	#define line1 //
	#define pvi //
	#define printf //
#endif

void solve();
signed main() {
	ios_base::sync_with_stdio(false); cin.tie(NULL);
	cout << fixed << setprecision(10);

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

//___________________________________________________________________________________________________

void solve() {

	int n;
	cin >> n;

	vi a(n);
	rep(i,0,n) cin >> a[i];

	vii dp(n,vi(n,0));


	// dp[i][j] - difference of points for locations between i and j,

	rep(i,0,n) dp[i][i] = a[i];

	rep(interval,2,n+1){
		rep(start,0,n){

			int l = start;
			int r = start+interval-1;

			if(r > n-1) continue;

			dp[l][r] = max(a[l] - dp[l+1][r], a[r] -  dp[l][r-1]);
		}
	}

	cout << dp[0][n-1] << endl;
}


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

const int N = 2e5;
int n, a[N];
ll sum0[N+1], sum1[N+1];

int main() {
	cin >> n;
	rep(i,n) {
		cin >> a[i];
		sum0[i+1] = sum0[i];
		sum1[i+1] = sum1[i];
		if (i%2) sum1[i+1] += a[i];
		else sum0[i+1] += a[i];
	}

	ll ans = LLONG_MIN, mx = LLONG_MIN;
	if (n%2) {
		for (int i=n-1; i>=0; i-=2) {
			mx = max(mx, sum1[i]+sum0[n]-sum0[i+1]);
			ans = max(ans, sum0[i]+mx-sum1[i]);
		}
	}
	else {
		for (int i=n; i>=0; i-=2) {
			ans = max(ans, sum0[i]+sum1[n]-sum1[i]);
		}
	}

	printf("%lld\n", ans);
}

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

using namespace std;
using llong = long long;
using ldbl = long double;
using P = pair<llong, llong>;

#define ALL(x) x.begin(), x.end()

const llong inf = 1100100100100100ll;
const llong mod = 1e9+7;

int main() {
	llong N, M;
	vector<llong> bad, dp;

	cin >> N >> M;
	bad.resize(N+2, 0);
	dp.resize(N+2, 0);
	llong in;
	for (int i = 0; i < M; ++i) {
		cin >> in;
		bad[in]++;
	}

	dp[0] = 1;
	for (int i = 0; i <= N-1; i++) {
		dp[i] %= mod;
		if (bad[i+1] != 1)
			dp[i+1] += dp[i];
		if (bad[i+2] != 1)
			dp[i+2] += dp[i];
	}

	cout << dp[N]%mod << endl;

	return 0;
}

Measured memory_bytes: 1792
#define LOCAL
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<(n); ++i)
#define rrep(i, n) for(int i=(n-1); i>=0; --i)
#define rep2(i, s, n) for(int i=s; i<(n); ++i)
#define ALL(v) (v).begin(), (v).end()
#define memr(dp, val) memset(dp, val, sizeof(dp))
using namespace std;
typedef long long ll;
static const int INTINF = (INT_MAX >> 1); // 10^9 + 10^7
static const ll LLINF = (LLONG_MAX >> 1);
static const int MAX = 1e5+1;
static const ll MOD = 1e9+7;
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; }
template<class T> inline bool int_ceil(T a, T b) { T res = a / b; if(a % b != 0) res++; return res; }
template<typename T>
using min_priority_queue = priority_queue<T, vector<T>, greater<T> >;
string to_string(string s) { return '"' + s + '"'; }
string to_string(bool b) { return b ? "true" : "false"; }
template <size_t N> string to_string(bitset<N> bs) {
  string res;
  for (size_t i = 0; i < N; ++i) res += '0' + bs[i];
  return res;
}
string to_string(vector<bool> v) {
  string res = "{";
  for (bool e : v) res += to_string(e) + ", ";
  return res += "}";
}
template <class T, class U> string to_string(pair<T, U> p);
template <class C> string to_string(C c) {
  string res = "{";
  for (auto e : c) res += to_string(e) + ", ";
  return res += "}";
}
template <class T, class U> string to_string(pair<T, U> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
void debug() { cerr << '\n'; }
template <class Head, class... Tail> void debug(Head head, Tail... tail) {
  cerr << '\t' << to_string(head), debug(tail...);
}
#ifdef LOCAL
#define print(...) cerr << "[" << #__VA_ARGS__ << "]:", debug(__VA_ARGS__)
#else
#define print(...)
#endif

int main(int argc, const char * argv[]) {
	std::cout << std::fixed << std::setprecision(15);

	string v[3]; cin >> v[0] >> v[1] >> v[2];
	vector<int>  vn(3);

	int now = 0;
	while(1){
		int tmp = now;
		if(vn[now] == v[now].size()){
			cout << (char)(now + 'A') << endl;
			return 0;
		}
		now = v[now][vn[now]] - 'a';
		vn[tmp]++;
	}

	return 0;
}


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

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout.precision(12);
    cout.setf(ios_base::fixed, ios_base::floatfield);
    
    int x, y, z, k;
    cin >> x >> y >> z >> k;
    static int64_t a[1000], b[1000], c[1000];
    for(int i=0;i<x;i++) cin >> a[i];
    for(int i=0;i<y;i++) cin >> b[i];
    for(int i=0;i<z;i++) cin >> c[i];
    
    static int64_t ab[1000000], abc[3000000];
    for(int i=0;i<x;i++){
        for(int j=0;j<y;j++){
            ab[i*y+j] = a[i] + b[j];
        }
    }
    sort(ab, ab+x*y, greater<int64_t>());
    for(int i=0;i<min(k, x*y);i++){
        for(int j=0;j<z;j++){
            abc[i*z+j] = ab[i] + c[j];
        }
    }
    sort(abc, abc+min(k, x*y)*z, greater<int64_t>());
    for(int i=0;i<k;i++) cout << abc[i] << endl;
    
    return 0;
}

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

int main(void){
    // Your code here!
   int a, b, c;
   cin >> a >> b >> c;
   if(a+b == c || a+c ==b || b+c== a){
       cout << "Yes" << endl;
   }else {
       cout << "No" << endl;
   }
}


Measured memory_bytes: 256
let K = Int(readLine()!)!
var result = -1
var value: Int = 7
if value % K == 0 {
    print(1)
} else {
    for i in 1...K {
        if value == 0 {
            result = i
            break
        }
        value = (value * 10 + 7) % K
    }
    print(result)
}


Measured memory_bytes: 7716
Y=input()#1行に沢山の数値(または文字)が並んでいる場合にリストに格納していく
X=[]
X=list(Y) #文字列（単語）または数列を1文字ずつに分解

A=[]
A.append(X[0])
A.append(X[1])
a=''.join(A)
a=int(a)

B=[]
B.append(X[2])
B.append(X[3])
b=''.join(B)
b=int(b)


if 1<=a<=12 and 1<=b<=12:
    print('AMBIGUOUS')
elif 1<=a<=12 and 13<=b<=99:
    print('MMYY')
elif 13<=a<=99 and 1<=b<=12:
    print('YYMM')
elif 13<=a<=99 and 13<=b<=99:
    print('NA')
elif a==0 and 1<=b<=12:
    print('YYMM')
elif a==0 and 13<=b<=99:
    print('NA')

elif b==0 and 1<=a<=12:
    print('MMYY')
elif b==0 and 13<=a<=99:
    print('NA')
elif b==0 and a==0:
    print('NA')


Measured memory_bytes: 3064
import java.io.*;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {

    static class Task {

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int k = in.nextInt();
            int[] arr = new int[n];
            for (int i  = 0; i < n; i++) {
                arr[i] = in.nextInt();
            }

            sort(arr);

            int sum = 0;
            for (int i = 0; i < k; i++) {
                sum += arr[i];
            }

            out.println(sum);
        }
    }

    private static void sort(double[] arr) {
        Double[] objArr = Arrays.stream(arr).boxed().toArray(Double[]::new);
        Arrays.sort(objArr);
        for (int i = 0; i < arr.length; i++) {
            arr[i] = objArr[i];
        }
    }

    private static void sort(int[] arr) {
        Integer[] objArr = Arrays.stream(arr).boxed().toArray(Integer[]::new);
        Arrays.sort(objArr);
        for (int i = 0; i < arr.length; i++) {
            arr[i] = objArr[i];
        }
    }

    private static void sort(long[] arr) {
        Long[] objArr = Arrays.stream(arr).boxed().toArray(Long[]::new);
        Arrays.sort(objArr);
        for (int i = 0; i < arr.length; i++) {
            arr[i] = objArr[i];
        }
    }

    private static void solve() {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Task task = new Task();
        task.solve(1, in, out);
        out.close();
    }

    public static void main(String[] args) {
        new Thread(null, () -> solve(), "1", 1 << 26).start();
    }

    static class InputReader {

        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

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

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

    }

}

Measured memory_bytes: 35000
N = int(input())
A = list(map(int, input().split()))

ans, cnt, node = 0, sum(A), 1
for i in range(N + 1):
    ans += node
    cnt -= A[i]
    node = min(cnt, (node - A[i]) * 2)
    if node < 0:
        print(-1)
        break
else:
    print(ans)



Measured memory_bytes: 20000
n, k, q = map(int, input().split())

d = {}

for _ in range(q):
  a = int(input())
  d[a-1] = d.get(a-1, 0) + 1

scores = [k-q for _ in range(n)]
for key in d:
  scores[key] += d[key]

for s in scores:
  if s > 0:
    print("Yes")
  else:
    print("No")

Measured memory_bytes: 13016
n, m, c = map(int, input().split())
b = list(map(int, input().split()))
a = [list(map(int, input().split())) for _ in range(n)]
ans = 0
for i in range(n):
    total = c
    for j in range(m):
        total += a[i][j] * b[j]
    if total > 0:
        ans += 1
print(ans)

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

int main() {
    string s, t;
    cin >> s >> t;

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

    bool flag = true;
    for (int i = 0; i < min(s.size(), t.size()); i++) {
        if (s.at(i) < t.at(i)) {
            break;
        }
        else if (s.at(i) == t.at(i)) {
            if (i == min(s.size(), t.size()) - 1 && s.size() >= t.size()) {
                flag = false;
            }
            continue;
        }
        else {
            flag = false;
            break;
        }
    }

    if (flag) {
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }
}

Measured memory_bytes: 256
#include<stdio.h>
#include<vector>
#include<algorithm>
#include<math.h>
#include<stdlib.h>
#include<string>
#include<iostream>
using namespace std;
typedef long long ll;
ll mod = 1000000007;
int d[101010][33];
int main()
{
	int num, gen;
	scanf("%d%d", &num, &gen);
	for (int i = 0; i < num; i++)
	{
		int za, zb, zc;
		scanf("%d%d%d", &za, &zb, &zc);
		zc--;
		for (int j = za; j <= zb; j++)d[j][zc] = 1;
	}
	int maxi = 0;
	for (int i = 0; i <= 100010; i++)
	{
		int c = 0;
		for (int j = 0; j < gen; j++)c += d[i][j];
		maxi = max(maxi, c);
	}
	printf("%d\n", maxi);
}

Measured memory_bytes: 13312
#include "bits/stdc++.h"
#define rep(i,a,n) for(int i = (a);i < (n);i++)
typedef unsigned long long ull;
typedef long long ll;
using namespace std;

int main(){
    int a,b,c,d,e,ans = 0;
    cin >> a >> b >> c >> d >> e;
    
    if(a <= 0){
        ans += -1*a*c;
        ans += d;
        ans += e*b;
    }
    else{
        ans += e*(b-a);
    }
    
    
    
    cout << ans  << endl;
    
    return 0;
}


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


class Program
{
    static void Main(string[] args)
    {
        // 入力
        var s = Console.ReadLine();
        //var n = int.Parse(Console.ReadLine());
        //int[] n = Console.ReadLine().Split().Select(int.Parse).ToArray();
        var ans = "a";
        if (Char.IsUpper(s[0])) ans = "A";

        // 出力
        Console.WriteLine(ans);
    }
}

Measured memory_bytes: 25792
using System;
using System.Linq;//リストの使用
using System.Collections.Generic;
using System.Text;//テキストの高速出力に必要
class Program
{
	static void Main()
	{
		string[] input = Console.ReadLine().Split(' ');
		long r = long.Parse(input[0]);
		long d = long.Parse(input[1]);
		long x = long.Parse(input[2]);

		for(int i = 0; i < 10; i++)
		{
			x = r*x-d;
			Console.WriteLine(x);
		}
	}
}

Measured memory_bytes: 11092
#include <iostream>
#include <cmath>
#include <iomanip>

using namespace std;

int main(void) {
  double x1,y1,x2,y2;
  cin >> x1 >> y1 >> x2 >> y2;
  cout << setprecision(13) << sqrt(pow(x2 - x1, 2) + pow(y2 - y1, 2)) << endl;
  return 0;
}

Measured memory_bytes: 3244
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
// #include<ext/pb_ds/assoc_container.hpp>
// #include<ext/pb_ds/tree_policy.hpp>
// #include<ext/pb_ds/tag_and_trait.hpp>
// using namespace __gnu_pbds;
using namespace std;
using ll=long long;
#define double long double
using datas=pair<ll,ll>;
using ddatas=pair<double,double>;
using tdata=pair<ll,datas>;
using vec=vector<ll>;
using mat=vector<vec>;
using pvec=vector<datas>;
using pmat=vector<pvec>;
// using llset=tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update>;
#define For(i,a,b) for(i=a;i<(ll)b;i++)
#define bFor(i,a,b) for(i=a;i>=(ll)b;i--)
#define rep(i,N) For(i,0,N)
#define rep1(i,N) For(i,1,N)
#define brep(i,N) bFor(i,N-1,0)
#define all(v) (v).begin(),(v).end()
#define allr(v) (v).rbegin(),(v).rend()
#define vsort(v) sort(all(v))
#define vrsort(v) sort(allr(v))
#define endl "\n"
#define pb push_back
#define print(v) cout<<v<<endl
#define printyes cout<<"Yes"<<endl
#define printno cout<<"No"<<endl
#define printYES cout<<"YES"<<endl
#define printNO cout<<"NO"<<endl
#define output(v) do{bool f=0;for(auto outi:v){cout<<(f?" ":"")<<outi;f=1;}cout<<endl;}while(0)
const ll mod=1000000007;
const ll inf=1LL<<60;
const double PI = acos(-1);
const double eps = 1e-9;
template<class T> inline bool chmax(T& a,T b){bool x=a<b;if(x)a=b;return x;} 
template<class T> inline bool chmin(T& a,T b){bool x=a>b;if(x)a=b;return x;} 

void startupcpp(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout<<fixed<<setprecision(15);
}

double distance(ddatas x,ddatas y){
  double a=x.first-y.first,b=x.second-y.second;
  return sqrt(a*a+b*b);
}

ll modinv(ll a) {
  ll b=mod,u=1,v=0,t;
  while(b){
    t=a/b;
    a-=t*b; swap(a,b);
    u-=t*v; swap(u,v);
  }
  return (u+mod)%mod;
}

ll moddevide(ll a,ll b){return (a*modinv(b))%mod;}

vec modncrlistp,modncrlistm;

ll modncr(ll n,ll r){
  ll i,size=modncrlistp.size();
  if(size<=n){
    modncrlistp.resize(n+1);
    modncrlistm.resize(n+1);
    if(!size){
      modncrlistp[0]=modncrlistm[0]=1;
      size++;
    }
    For(i,size,n+1){
      modncrlistp[i]=modncrlistp[i-1]*i%mod;
      modncrlistm[i]=modinv(modncrlistp[i]);
    }
  }
  return modncrlistp[n]*modncrlistm[r]%mod*modncrlistm[n-r]%mod;
}

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

ll gcd(ll a,ll b){if(!b)return a;return (a%b==0)?b:gcd(b,a%b);}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
ll K;
ll countdigits(ll n){
  ll ans=0;
  while(n){n/=K;ans++;}
  return ans;
}

ll sumdigits(ll n){
  ll ans=0;
  while(n){ans+=n%10;n/=10;}
  return ans;
}

int main(){
  // startupcpp();
  // ll test;cin>>test;while(test--){
  ll i,j,N,a,b,ans=0;
  cin>>N>>a>>b;
  j=modncr(max(a,b),0);
  ans=(modpow(2,N)+mod-1)%mod;
  rep(i,a){
    j=j*(N-i)%mod;
  }
  j=j*modncrlistm[a]%mod;
  ans=(ans-j+mod)%mod;
  j=1;
  rep(i,b){
    j=j*(N-i)%mod;
  }
  j=j*modncrlistm[b]%mod;
  ans=(ans-j+mod)%mod;
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 3328
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
template<class T>
inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

template<class T>
inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
//const ll mod = 1000000007;

int main() {
    //cout.precision(10);
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a, b;
    cin >> a >> b; 
    a *= 10;
    if(b >= 10) a *= 10;
    if(b >= 100) a *= 10;
    int c = a + b;
    cerr << c << endl;
    for(int i = 1; i <= 1999; i++) {
        if(i * i == c) {
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;
    return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
using ll=long long;
#define print(n) cout<<n<<endl
#define rep(i,a,n) for(ll i=a;i<n;i++)
#define ALL(s) s.begin(),s.end()
#define P pair<ll,ll>
#define vl vector<ll>
#define vi vector<int>
#define vvl vector<vector<ll>>
#define vvi vector<vector<int>>
const int M=200111;
const int inf=1000000007;
const int mod=1000000007;
const double PI = 3.1415926535897932384626433;
const long long INF=1e18;
int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};
int ddx[8]={1,-1,0,0,1,-1,-1,1},ddy[8]={0,0,1,-1,1,-1,1,-1};


struct UnionFind {
	vector<int> par;
	UnionFind(int n) : par(n, -1) { }

	int root(int x) {
		if (par[x] < 0) return x;
		else return par[x] = root(par[x]);
	}

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

	bool merge(int x, int y) {
		x = root(x); y = root(y);
		if (x == y) return false;
		if (par[x] > par[y]) swap(x, y); // merge technique
		par[x] += par[y];
		par[y] = x;
		return true;
	}

	int size(int x) {
		return -par[root(x)];
	}
};

vvl comb(int n) {
	vvl v(n + 1,vl(n + 1, 0));
	for (int i = 0; i < v.size(); i++) {
		v[i][0] = 1;
		v[i][i] = 1;
	}
	for (int j = 1; j < v.size(); j++) {
		for (int k = 1; k < j; k++) {
			v[j][k] = (v[j - 1][k - 1] + v[j - 1][k]);
		}
	}
	return v;
}

void sosu(ll x,bool f[]){
	ll y=x;
	for(ll i=2;i<=sqrt(y);i++){
		if(x%i==0){
			x/=i;
			f[i]=true;
			i--;
		}
	}
}

ll gcd(ll x,ll y){
	if(y)return gcd(y,x%y);
	else return x;
}

int keta(ll a){
	int ke=1;
	while(a/=10)ke++;
	return ke;
}

vector<long long> enum_divisors(long long N) {
	vector<long long> res;
	for (long long i = 1; i * i <= N; ++i) {
		if (N % i == 0) {
			res.push_back(i);
			// 重複しないならば i の相方である N/i も push
			if (N/i != i) res.push_back(N/i);
		}
	}
	// 小さい順に並び替える
	sort(res.begin(), res.end());
	return res;
}

ll zyou(ll x,ll n){
	ll y=1;
	rep(i,0,n){
		y*=x;
	}
	return y;
}

vector<long long> enum_(long long N) {
	vector<long long> res;
	for (long long i = 1; i * i <= N; ++i) {
		if (N % i == 0) {
			res.push_back(i);
			// 重複しないならば i の相方である N/i も push
			if (N/i != i) res.push_back(N/i);
		}
	}
	// 小さい順に並び替える
	sort(res.begin(), res.end());
	return res;
}

int main() {
	ll n,a[M];
	int x[1000010]={};
	cin>>n;
	rep(i,0,n){
		cin>>a[i],x[a[i]]++;
	}
	sort(a,a+n);
	int ans=0;

	rep(i,0,n){
//		if(x[a[i]]>1)break;
		const auto &res = enum_(a[i]);
		bool f=true;
		for (int i = 0; i < res.size()-1; ++i){
			if(x[res[i]]>0){
				f=false;
				break;
			}
			//print(i);
		}
		if(f && x[a[i]]==1)ans++;
	}
	print(ans);


}


Measured memory_bytes: 9076
//マージソート
//2018-12-21
//Ebitani Akira

#include <stdio.h>
#include <stdlib.h>

#define N 500000
#define N2 1000000000

void Merge( int *, int, int, int );
void MergeSort( int *, int, int );

int count = 0;
int array[N];

int main (){
  int i, j, n;

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

  MergeSort( array, 0, n );
  
  for( i = 0 ; i < n ; i++ ){
    printf( "%d", array[i] );
    if( i != n - 1 ){
      printf( " " );
    }
  }

  printf( "\n" );
  printf( "%d\n", count );

  return 0;
}
    
void MergeSort( int array[], int left, int right ){
  int mid;

  if( left + 1 < right ){

    mid = ( left + right ) / 2;
    MergeSort( array, left, mid );
    MergeSort( array, mid, right );
    Merge( array, left, mid, right );
  }
}

void Merge( int array[], int left,int mid, int right ){
  int n_left, n_right;
  n_left = mid - left;
  n_right = right - mid;

  int i = 0, j = 0, k;

  int Left[n_left];
  int Right[n_right];
  
 for( i = 0 ; i < n_left ; i++ ){
    Left[i] = array[left + i];
  }
  for( i = 0 ; i < n_right ; i++ ){
    Right[i] = array[mid + i];
  }

  Left[n_left] = N2;
  Right[n_right] = N2;
  
  for( i = 0, j = 0, k = left ; k < right ; k++ ){
    count = count + 1;

    if( Left[i] <= Right[j] ){
      array[k] = Left[i];
      i++;
    }
    else{
      array[k] = Right[j];
      j++;
    }
  }
}




Measured memory_bytes: 5632
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <bitset>
#include <list>
#include <stdexcept>
#include <functional>
#include <utility>
#include <ctime>
#include <random>
#include <cassert>
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
#define MEM(a,b) memset((a),(b),sizeof(a))
const LL INF = 1e9 + 7;
const int N = 1e2 + 10;
int dp[N][10000];
int flag[10000];
void init()
{
	for (int i = 1; i < 10000; i++)
	{
		string str = to_string(i);
		int ok = 0;
		if (str.find("123") != str.npos)
		{
			flag[i] = 1;
			continue;
		}
		for (int j = 0; j + 1 < str.length(); j++)
		{
			swap(str[j], str[j + 1]);
			ok |= str.find("123") != str.npos;
			swap(str[j], str[j + 1]);
		}
		flag[i] = ok;
	}
}
int main()
{
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	int n;
	cin >> n;
	dp[0][0] = 1;
	init();
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < 10000; j++)
		{
			if (flag[j]) continue;
			if (dp[i][j] == 0) continue;
			int o = j % 1000 * 10;
			for (int k = 0; k < 4; k++)
			{
				int &tmp = dp[i + 1][o + k] += dp[i][j];
				if (tmp >= INF)
					tmp -= INF;
			}
		}
	}
	LL ans = 0;
	for (int i = 0; i < 10000; i++)
	{
		if (flag[i]) continue;
		ans += dp[n][i];
	}
	cout << ans % INF << endl;
	return 0;
}

Measured memory_bytes: 3200
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define fi first
#define se second
#define PI acos(-1.0)
template<typename A, typename B> inline bool chmax(A &a, B b) { if (a<b) { a=b; return 1; } return 0; }
template<typename A, typename B> inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; }
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, pii> pip;
const ll INF = 1e9+100;
const ll MOD = 1e9;
const double EPS = 1e-10;
const bool debug = 0;
//------------------------------//

template <typename T>
struct SegTree {
	T init_val;
	int n;
	vector<T> dat;
	
	SegTree(int _n, T init_val) : init_val(init_val) {
		n = 1;
		while (n < _n) n *= 2;
		dat.resize(n * 2 - 1, init_val);
	}
	
	void update(int i, T x) {
		i += n - 1;
		dat[i] = max(dat[i], x);
		while (i > 0) {
			i = (i - 1) / 2;
			dat[i] = max(dat[i * 2 + 1], dat[i * 2 + 2]);
		}
	}
	
	T query(int a, int b, int k = 0, int l = 0, int r = -1) {
		if (r < 0) r = n;
		
		if (r <= a || b <= l) return init_val;
		if (a <= l && r <= b) return dat[k];
		return max( query(a, b, k * 2 + 1, l, (l + r) / 2), query(a, b, k * 2 + 2, (l + r) / 2, r) );
	}
};

int stx, sty, edx, edy;
int N;
int X[212345], Y[212345];
vector<int> cx, cy;

int main() {
	cin >> stx >> sty >> edx >> edy;
	cin >> N;
	REP(i, N) scanf("%d %d", X + i, Y + i);
	
	// 座標の変換 (右上に進むようにし、stからの相対座標に変換する)
	if (stx > edx) {
		REP(i, N) X[i] = -X[i];
		stx = -stx; edx = -edx;
	}
	if (sty > edy) {
		REP(i, N) Y[i] = -Y[i];
		sty = -sty; edy = -edy;
	}
	
	REP(i, N) {
		X[i] -= stx; cx.push_back(X[i]);
		Y[i] -= sty; cy.push_back(Y[i]);
	}
	edx -= stx; edy -= sty;
	
	cx.push_back(stx); cx.push_back(edx);
	cy.push_back(sty); cy.push_back(edy);
	
	sort(ALL(cx)); cx.erase(unique(ALL(cx)), cx.end());
	sort(ALL(cy)); cy.erase(unique(ALL(cy)), cy.end());
	
	REP(i, N) {
		X[i] = lower_bound(ALL(cx), X[i]) - cx.begin();
		Y[i] = lower_bound(ALL(cy), Y[i]) - cy.begin();
	}
	////
	
	vector<pii> p(N);
	REP(i, N) p[i] = pii(X[i], Y[i]);
	sort(ALL(p));
	
	SegTree<int> seg(212345, 0);
	
	int info = -1; // 0-x=0 1-y=0
	int cnt = 0;
	
	REP(i, N) {
		if (cx[p[i].fi] < 0 || cx[p[i].fi] > edx || cy[p[i].se] < 0 || cy[p[i].se] > edy) continue;
		
		seg.update(p[i].se, seg.query(0, p[i].se) + 1);
	}
	
	int ma = seg.query(0, lower_bound(ALL(cy), edy) - cy.begin() + 1);
	
	double ans = (edx + edy) * 100.0;
	ans -= ma * (20 - 5*PI);
	if (ma == min(edx, edy) + 1) ans += 5 * PI;
	
	printf("%.15lf\n", ans);
	
	return 0;
}


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

using namespace std;
typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LINF = 1e18;

int main() {

    string s; cin >> s;

    if (s == "ABC") {
        puts("ARC");
    } else {
        puts("ABC");
    }
}

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

int N, cnt = 0;

int main () {
	cin >> N;
	for (int i = 1; i <= 9; i++){
		for (int j = 1; j <= 9; j++){
			if (N == i*j){
				cnt++;
			} else if (N == i*i || N == j*j){
				cnt = cnt + 2;
			}
		}
	}
	if (cnt > 1){
		cout << "Yes";
	} else {
		cout << "No";
	}
}

Measured memory_bytes: 3624
number=[]

while i = STDIN.gets
	if i == "\n"
		break
	end
	number.push(i.to_i)
end

mod=[]
for x in 0..number.size
	mod.push(number.count(number[x]))
end

answer=[]

for y in 0..number.size
	if number.count(number[y]) == mod.max
		answer.push(number[y])
	end
end

puts answer.sort.uniq

Measured memory_bytes: 8576
#include<iostream>
#include<string>
#include<map>
#include<vector>
#include<math.h>
#include<algorithm>
#include <iomanip>
using namespace std;
int main()
{
	double X;
	cin >> X;
	int N = X;
	if (N % 2==0)
	{
		cout << setprecision(10) <<(X / 2) / X;
	}
	if (N % 2 == 1)
	{
		cout << setprecision(10) << ((X + 1) / 2) / X;
	}
	return 0;
	
}

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

typedef struct pp{
	char name[100];
	int t;
}P;
P Q[LEN];
int head, tail,n;

void enqueue(P x){
	Q[tail]=x;
	tail=(tail+1)% LEN;
}
P dequeue(){
	P x=Q[head];
	head=(head+1)%LEN;
	return x; 
}
int min(int a,int b){
	return a<b ? a:b;
}
int main(void){
	int elaps=0,c;
	int i,q;
	P u;
	scanf("%d %d",&n,&q);
	for(i=1; i<=n; i++){
		scanf("%s",Q[i].name);
		scanf("%d", &Q[i].t);
	}
	head=1;
	tail=n+1;
	
	while(head!=tail){
		u=dequeue();
		c=min(q, u.t);
		u.t-=c;
		elaps+=c;
			if(u.t>0){enqueue(u);}
			else{printf("%s %d\n",u.name,elaps);
			}
	}
	return 0;
}


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

int main() {
  int N;
  cin >> N;
  
  vector<int> d(N);
  for (int i = 0; i < N; i++) {
    cin >> d.at(i);
  }
  
  sort(d.begin(), d.end());
  
  int ans = 1;
  for (int i = 0; i < N - 1; i++) {
    if (d.at(i) < d.at(i+1)) {
      ans += 1;
    }
  }
  cout << ans << endl;
  
  
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
const double eps = 1e-10;
const int MOD = 1000000007;
const int INF = 1000000000;
const ll LINF = 1ll<<50;
template<typename T>
void printv(const vector<T>& s) {
  for(int i=0;i<(int)(s.size());++i) {
    cout << s[i];
    if(i == (int)(s.size())-1) cout << endl;
    else cout << " ";
  }
}
int gcd(int a, int b) {
  return b == 0 ? a : gcd(b, a%b);
}
int main() {
  cin.tie(0);
  cout << fixed << setprecision(10);
  int n; cin >> n;
  vector<int> a(n);
  for(int i=0;i<n;++i) {
    cin >> a[i];
  }
  vector<int> l(n);
  vector<int> r(n);
  l[0] = a[0];
  r[n-1] = a[n-1];
  for(int i=1;i<n;++i) {
    l[i] = gcd(l[i-1], a[i]);
  }
  for(int i=n-1;i>=0;--i) {
    r[i] = gcd(r[i+1], a[i]);
  }
  int ans = max(l[n-2], r[1]);
  for(int i=1;i<n-1;++i) {
    ans = max(ans, gcd(l[i-1], r[i+1]));
  }
  cout << ans << endl;
}


Measured memory_bytes: 1408
#include<bits/stdc++.h> 
#define fo(i,a,b) for(i=a;i<=b;i++)
#define fd(i,a,b) for(i=a;i>=b;i--)
#define min(a,b) (a<b?a:b)
#define max(a,b) (a>b?a:b)
typedef long long ll;
using namespace std;
inline int read(){
	int n=0,f=1;char c;
	for(c=getchar();(c<'0'||c>'9')&&c!='-';c=getchar());
	if (c=='-') c=getchar(),f=-1;
	for(;c>='0'&&c<='9';c=getchar()) n=n*10+c-48;
	return n*f;
}
const int maxn=5e5+5;
int n,i,d,Q;
ll c[maxn],l[maxn],low[maxn];
int main(){
	n=read(),d=read();
	c[0]=d;
	fo(i,1,n) l[i]=read(),c[i]=min(c[i-1],abs(c[i-1]-l[i]));
	low[n+1]=1;
	fd(i,n,1) low[i]=(l[i]<low[i+1]*2)?low[i+1]+l[i]:low[i+1]; 
	Q=read();
	for(;Q--;){
		i=read();
		if (c[i-1]>=low[i+1]) puts("YES");else puts("NO");
	}
}

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

long long mod = 1000000007;

int main(void)
{
   long long N;
   cin >> N;
   long long result1 = 1;
   long long result2 = 2;
   long long result3 = 1;
   for (int i = 1; i <= N; i++)
   {
      result1 = result1 * 10;
      result1 = result1 % mod;
      result2 = result2 * 9;
      result2 = result2 % mod;
      result3 = result3 * 8;
      result3 = result3 % mod;
   }
   long long ans = result1 - result2 + result3;
   if (ans < 0)
   {
      cout << ans % mod + mod << endl;
   }
   else
   {
      cout << ans % mod << endl;
   }
   return 0;
}


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

int main() {
  int a, b, c;
  cin >> a >> b >> c;
  int n = a;
  for (int i = 0; i < b; i++) {
    if (n % b == c) {
      puts("YES");
      return 0;
    }
    n += a;
  }
  puts("NO");
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <cmath>
typedef long long ll;
using namespace std;

int main(){
  int N, K;
  cin >> N >> K;
  vector<int> A(N);
  for(int i = 0; i < N; ++i){
    cin >> A[i];
  }
  N--;
  int ans = (N + K - 2) / (K - 1);
  cout << ans << endl;
}


Measured memory_bytes: 640
#include <algorithm>
#include <iostream>
#include <vector>
#include <string>
#include <climits> // FOO_MAX, FOO_MIN
#include <cmath> 
#include <cstdlib> // abs(int)
#include <numeric>
#include <iomanip>

using namespace std;
#define roundup(n,d) ( ((n) + ((d)-1)) / (d) )
#define assign_max(into, compared) (into = max((into), (compared)))
#define assign_min(into, compared) (into = min((into), (compared)))
#define rep(i,n) for(long long i = 0;i < n;++i)
#define fast_io() ios::sync_with_stdio(false); cin.tie(nullptr)
#define fix(n) fixed << setprecision(n)

#define PI 3.14159265358979323846;

using ll = long long;
using ull = unsigned long long;
using vll = vector<long long>;


int main(void){
    fast_io();
    
    ll x,y,z;
    cin >> x >> y >> z;
    cout << z << " " << x << " " << y << endl;

    return 0;
}


Measured memory_bytes: 3156
import math

a, b, h, m = map(int, input().split())


a_theta = math.radians(30 * (h%12) + m/2)
b_theta = math.radians(6 * m)

if(a_theta >= b_theta and b_theta != 0):
    theta = a_theta - b_theta
else:
    theta = b_theta - a_theta

def yogen(a, b, theta):

    return a ** 2 + b ** 2 - 2 * a *  b * math.cos(theta)

print(yogen(a, b, theta) ** 0.5)


Measured memory_bytes: 9536