akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define vll vector<ll>
#define vllv vector<vector<ll>> 
#define sz size()
#define pb push_back
#define ff first
#define ss second
#define all(v) v.begin(),v.end()
#define allr(v) v.rbegin(),v.rend()
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)

ll ceil1(ll n,ll m){if(n%m==0){return n/m;}return n/m +1;}
vll factor(ll n){
    vll ans;
    if(n>0)ans.pb(1);if(n==2)ans.pb(2);
    for(ll i=2;i*i<=n;i++){if(n%i==0){ans.pb(i);if(n/i!=i)ans.pb(n/i);}}if(n>2)ans.pb(n);
    return ans;
}
ll fact(ll n){
	
    ll res = 1; 
    for (ll i = 2; i <= n; i++) 
        res = res * i; 
    return res; 
} 
  
int nCr(ll n, ll r) 
{ 
    return fact(n) / (fact(r) * fact(n - r)); 
} 
  
void dfs(vllv &v,ll k,vll &par,vll &dis,ll p)
{
 
    par[k]=p;
    dis[k]=dis[p]+1;
    for(ll i=0;i<v[k].sz;i++){
        if(v[k][i]!=p){
            dfs(v,v[k][i],par,dis,k);
        }
    }
}
bool sortbysec(const pair<int,int> &a,const pair<int,int> &b){return (a.second<b.second);} 


void solve()
{
	ll a,b,c,d;
	ll n;
	cin>>n;
	set<string> st;
	for(ll i=0;i<n;i++)
	{
		string s;
		cin>>s;
		st.insert(s);
	}
	cout<<st.sz;
	return;
}

int main()
{
    ll q;
    q=1;
    // cin>>q;
    while(q--)
    {
        solve();
    }
    return 0;
}

Measured memory_bytes: 19228
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <functional>
#include <vector>
#define nummax 11000
using namespace std;


int main() {
	int N, i, j, lentmp, Anum = 0, Bnum = 0, ABnum = 0, caution1 = -1;
	bool caution2 = false;
	string s[nummax];
	cin >> N;
	for (i = 0; i < N; i++)
	{
		cin >> s[i];
		lentmp = s[i].length();
		if (s[i][0] == 'B' && s[i][lentmp - 1] == 'A')
		{
			Anum++;
			Bnum++;
			caution2 = true;
		}
		else if (s[i][lentmp - 1] == 'A')
		{
			Anum++;
			caution1 = 0;
		}
		else if (s[i][0] == 'B')
		{
			Bnum++;
			caution1 = 0;
		}
		for (j = 1; j < lentmp; j++)
		{
			if (s[i][j - 1] == 'A' && s[i][j] == 'B')
				ABnum++;
		}
	}
	if (caution1 == -1 && !caution2)
		caution1 = 0;
	ABnum += min(Anum, Bnum);
	ABnum += caution1;
	cout << ABnum << endl;
}

Measured memory_bytes: 896
#include<stdio.h>
#include<stdlib.h>
int main() {
	int n, l;
	scanf("%d %d", &n, &l);

	int taste[400], sum = 0;
	for (int i = 0; i < n; i++) {
		taste[i] = l + (i + 1) - 1;
		sum += taste[i];
	}
	
	int min = 999999;
	for (int i = 0; i < n; i++) {
		if (min > abs(taste[i]))min = abs(taste[i]);
	}
	if (sum < 0)printf("%d\n", sum + min);
	else printf("%d\n", sum - min);
	return 0;
	
	
}
/*#include<stdio.h>
int main(void) {
	int n, l;

	scanf("%d", &n);
	scanf("%d", &l);

	int i;

	int azi[1000];;

	for (i = 1; i <= n; i++) {
		azi[i-1] = i + l-1;
	}


	int max = 0;
	int hako = 0;
	int j;
	int min = 100000000;


	for (i = 0; i < n; i++) {
		max = max + azi[i];
	}

	for (i = 0; i < n; i++) {
		for (j = 0; j < n; j++) {
			if (i != j) {
				hako = hako + azi[i];
			}
		}
		hako = max - hako;
		if (min < hako) {
			min = hako;
		}
		hako = 0;
	}



	return 0;
}*/

Measured memory_bytes: 128
#include <algorithm>
#include <iostream>
#include <map>
#include <vector>

using namespace std;

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

#define MOD 1000000007
#define REP(i, N) for (int i = 0; i < N; ++i)
#define REP1(i, N) for (int i = 1; i <= N; ++i)
#define RREP(i, N) for (int i = N - 1; i >= 0; --i)
#define ALL(a) a.begin(), a.end()

int main() {
  int n;
  cin >> n;
  map<string, ll> mp;
  REP(i, n) {
    string s;
    cin >> s;
    sort(ALL(s));
    mp[s]++;
  }
  ll ans = 0;
  for (auto a : mp) {
    ans += a.second * (a.second - 1) / 2;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 11136
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast", "unroll-loops")
using namespace std;
#define ll long long
#define FOR(i,a,b) for (int i = (a); i<(b); i++)
#define REP(i,n) FOR(i,0,n)
#define REP1(i,n) FOR(i,1,n+1)
#define RREP(i,n) for (int i=(n)-1; i>=0; i--)
#define f first
#define s second
#define pb push_back
#define ALL(x) x.begin(),x.end()
#define SZ(x) (int)(x.size())
#define SQ(x) (x)*(x)
#define pii pair<int, int>
#define endl '\n'
//#define TOAD
#define int ll
#ifdef TOAD
#define bug(x) cerr<<__LINE__<<": "<<#x<<" is "<<x<<endl
#define IOS() 
#else
#define bug(...)
#define IOS() ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#endif
const ll inf = 1ll<<60;
const int iinf=2147483647;
const ll mod = 998244353;
const ll maxn=300005;

signed main (){
  IOS();
  int a,b,c,k; cin>>a>>b>>c>>k;
  if (k%2==0){
    cout<<a-b<<endl;
  }
  else cout<<b-a<<endl;
 }

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <complex>
#include <vector>
#include <algorithm>
#include <cmath>
#define EPS 1e-8
using namespace std;
typedef complex<double> P;
struct C{
    P p;
    double r;
    C(const P& p, const double& r):
        p(p), r(r) {}
};

P center(const P& a, const P& b, int lr){
    P mid = (a+b)/P(2,0);
    P len(sqrt(1-abs(b-mid)*abs(b-mid)),0);
    P rot = P(imag(b-a),-real(b-a)) / P(abs(a-b),0);
    if(lr==0){
        return len*rot+mid;
    }else{
        return len*rot*P(-1,0)+mid;
    }
}

int main(){
    while(1){
        int n;
        cin >> n;
        if(n==0) break;

        vector<P> pset(n);
        for(int i=0; i<n; i++){
            double x,y;
            cin >> x >> y;
            pset[i] = P(x,y);
        }

        int mnop=0;
        for(int i=0; i<n-1; i++){
            for(int j=i+1; j<n; j++){
                if(abs(pset[i]-pset[j]) < 2+EPS){
                    for(int lr=0; lr<2; lr++){
                        int count=0;
                        P mid = center(pset[i], pset[j], lr);
                        for(int k=0; k<n; k++){
                            if(abs(pset[k]-mid) < 1+EPS){
                                count++;
                            }
                        }
                        mnop = max(mnop, count);
                    }
                }
            }
        }

        if(mnop==0) mnop=1;
        cout << mnop << endl;
    }
            
    return 0;
}

Measured memory_bytes: 3120
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD = 1e9 + 7;
const ll INF = 1LL << 60;
ll mod_pow(ll, ll, ll);
ll mod_fact(ll, ll);
ll mod_inv(ll, ll);
//

int main(){
    string s;
    cin >> s;
    if(s == "ABC") cout << "ARC";
    else cout << "ABC";
}

Measured memory_bytes: 3596
from math import ceil
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines

def main():
    h,w = map(int, readline().split())

    if h == 1 or w == 1:
        print(1)
        exit()

    print(ceil(h/2)*ceil(w/2) + (h//2) * (w //2) )



if __name__ == "__main__":
    main()


Measured memory_bytes: 3060
#include<iostream>
#include<string>
#include<cmath>
#include<cctype>
#include<vector>
#include<numeric>
using namespace std;
int main(){
        while(1){
            string w;
            int a;
            cin >> w;
                if(w=="-") break;
            scanf("%d",&a);
            for(int i=0;i<a;i++){
                    int b;
                    scanf("%d",&b);
                    string left=w.substr(0,b);
                    string right=w.substr(b,w.size());
                    w=right+left;
            }
           cout << w << endl;
        }
        return 0;
}

Measured memory_bytes: 1236
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdint>
#include <cstdio>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <tuple>
#include <utility>
#include <vector>
using namespace std;

using i64 = int64_t;

int main() {
    int N, P, a[50];
    cin >> N >> P;
    for (int j = 0; j < N; ++j) cin >> a[j];
    
    i64 count[2][2];
    count[0][0] = 1; count[0][1] = 0;

    for (int j = 0; j < N; ++j) {
        int nj = (j+1)%2;
        int z = a[j]%2;

        count[nj][0] = count[j%2][0] + count[j%2][(0+z)%2];
        count[nj][1] = count[j%2][1] + count[j%2][(1+z)%2];
    }

    cout << count[N%2][P] << endl;

    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void){
	char s[4] = "000";
	int r = 0, i = 0;
	
	scanf("%s", s);
	
	while(s[i] != 0){
		if(s[i] == '1')
			r++;
		i++;
	}
	
	printf("%d\n", r);
	
	return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b;
  cin>>a>>b;
  if(a==b) cout<<"Draw"<<endl;
  else if(a==1)cout<<"Alice"<<endl;
  else if(b==1) cout<<"Bob"<<endl;
  else if(a>b) cout<<"Alice"<<endl;
  else cout<<"Bob"<<endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
using namespace std;
typedef long long ll;
int main(void){
  	string s;
  	ll ans = 1;
  	cin >> s;
  	if(s.at(0)==s.at(1)&&s.at(1)==s.at(2))ans=0;
      
      if(ans){
  	cout << "Yes" << endl;
      }
  	else cout << "No" << endl;
}

Measured memory_bytes: 256
long a,v,c;f(char*x,char*y){c=*y-*x;}main(){for(;read(c=0,&c,1),v=a=v>>8|c<<56;v&66&&printf(a==0x414144494e4e5559?v=0,"AIZUNYAN":"%c",v))qsort(&a,8,1,f);}

Measured memory_bytes: 524
import math

inputa = input().split()

# inputb = input()


a = int(inputa[0])
b = int(inputa[1])
c = int(inputa[2])

# inputList = list(inputb)
#
# inputList[b-1] = inputList[b-1].lower()
#
# ans = "".join(inputList)
time = float(c)+0.5
ans = math.floor(time / float(a))
ans = int(ans)*b

print(ans)

# inputList.sort()
#
# list = [a+b, b+c ,c+a]
#
# ans = min(list)
# print(ans)



# flg = 1
# for i in range(0, len(inputList)-1):
#     if inputList[i] == inputList[i + 1]:
#         flg = 0
#         break
#
# if flg == 0:
#     print("Bad")
# else:
#     print("Good")


Measured memory_bytes: 38512
#include <stdio.h>

int gcd(int a,int b){int r,tmp;if(a < b){tmp = a;a = b;b = tmp;}r = a % b;while(r != 0){a = b;b = r;r = a % b;}return b;}


int main()
{
    int a,b,k,r,cnt = 0,ans = 0,i;
    scanf("%d %d %d",&a,&b,&k);
    r = gcd(a,b);
    i = r;
    while (cnt < k)
    {
        if(r % i == 0)
        {
            cnt++;
            ans = i;
        }
        i--;
    }
    
    printf("%d",ans);
}

Measured memory_bytes: 128
#include <iostream>

using namespace std;

int main() {
  int K;
  cin >> K;
  int A,B;
  cin >> A >> B;
  bool a = false;
  for(int i=A;i<=B;i++){
    if(i%K==0){
      a = true;
      break;
    }
  }
  cout << (a ? "OK":"NG") << endl;
}


Measured memory_bytes: 3636
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String S = scanner.next();
		long K = scanner.nextLong();
		scanner.close();
		char[] charArray = S.toCharArray();
		long cnt = 0;

		for (int i = 1; i < charArray.length; i++) {
			if (charArray[i - 1] == charArray[i]) {
				charArray[i] = '0';
				cnt++;
			}
		}
		if (charArray[0] == charArray[charArray.length - 1]) {
			cnt *= K;
			cnt += bonus(S, K);

		} else {
			cnt *= K;
		}
		if (isSameChar(S)) {
			long tmp = K * S.length();
			if (tmp % 2 == 1) {
				tmp--;
			}
			System.out.println(tmp / 2);
		} else if (charArray.length != 1) {
			System.out.println(cnt);
		} else if (K == 1) {
			System.out.println(0);
		} else {
			if (K % 2 == 1) {
				K++;
			}
			System.out.println(K / 2);
		}

	}

	public static boolean isSameChar(String S) {
		boolean flag = true;
		char[] charArray = S.toCharArray();
		char tmp = charArray[0];
		for (int i = 0; i < charArray.length; i++) {
			if (tmp != charArray[i]) {
				flag = false;
			}
		}
		return flag;
	}

	public static long bonus(String S, long K) {
		int count_a = 1;
		int count_b = 1;
		char[] charArray = S.toCharArray();
		char tmp = charArray[0];
		boolean flag = isSameChar(S);
		if (!flag) {
			for (int i = 1; i < charArray.length; i++) {
				if (tmp == charArray[i]) {
					count_a++;
				} else {
					break;
				}
			}
			for (int i = charArray.length - 2; 0 <= i; i--) {
				if (tmp == charArray[i]) {
					count_b++;
				} else {
					break;
				}
			}
		} else {
			int middle = charArray.length / 2;
			for (int i = 1; i < middle; i++) {
				if (tmp == charArray[i]) {
					count_a++;
				} else {
					break;
				}
			}
			for (int i = charArray.length - 2; middle <= i; i--) {
				if (tmp == charArray[i]) {
					count_b++;
				} else {
					break;
				}
			}
		}
		int count = count_a + count_b;
		if (count % 2 == 0) {
			return K - 1;
		} else {
			return 0;
		}
	}
}

Measured memory_bytes: 21844
#ifndef LOCAL
#pragma GCC optimize("O3")
#endif
#include "bits/stdc++.h"
using namespace std;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
typedef long long ll;

int main(){
	int n , k ; 
	cin >> n >> k ; 
	int cnt = 0 ;
	for(int i=0;i<=n;i++){
		for(int j=0;j<=n;j++){
			int c = k - (i+j) ; 
			debug() << imie(c) ; 
			if ( c >=0 && c <= n) cnt++ ; 
		}
	}
	cout << cnt << endl;
    return 0 ;
}


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

"""

"""

tot = 1
n = int(input())
arr = map(int, input().split())

for v in arr:
    if v == 0:
        tot = 0
        break
    if tot <= 10**18:
        tot *= v
    

if tot > 10**18:
    print(-1)
else:
    print(tot)


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

using namespace std;

int dp[1010][1010];
const int mod = 1000000007;


void solve(){
    int n, m;
    string s;
    
    cin >> n >> m;
    
    dp[1][1] = 1;
    
    for(int i = 1;i <= n;++i){
        cin >> s;
        for(int j = 1;j <= m;++j){
            if(s[j - 1] == '.' && !(i == 1 && j == 1)){
                dp[i][j] = (dp[i - 1][j] + dp[i][j - 1]) % mod;
            }
        }
    }
    
    cout << dp[n][m];
}

int main(){
    int t = 1;
    // cin >> t;
    while(t--){
        solve();
    }
}
	

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

#define For(i, j, k) for (int i = j; i <= k; i++)

using namespace std;

const int N = 2010;

int A[N], rk[N];
int n, k, q;

bool cmp(int x, int y) {
	return A[x] < A[y];
}

int bel[N], cnt[N];

int main() { 

	scanf("%d%d%d", &n, &k, &q);
	For(i, 1, n) scanf("%d", &A[i]), rk[i] = i;
	sort(rk + 1, rk + n + 1, cmp);

	int ans = 1e9;
	For(i, 1, n - q + 1) {
		For(j, 0, n) cnt[j] = 0;
		For(j, 0, n) {
			bel[j] = A[j] < A[rk[i]] ? j : bel[j - 1];
			if (bel[j] != j) ++cnt[bel[j]];
		}
		int ret = 0;
		For(j, i, n) 
			if (cnt[bel[rk[j]]] >= k) {
				++ret, --cnt[bel[rk[j]]];
				if (ret >= q) {
					ans = min(ans, A[rk[j]] - A[rk[i]]);
					break;
				}
			}
	}
	printf("%d\n", ans);

	return 0;
}

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

typedef long long ll;
typedef long double ld;
typedef double db;
typedef string str;
typedef pair<int, int> pi;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pd;

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef vector<ld> vld;
typedef vector<str> vs;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<pi> vpi;
typedef vector<pll> vpll;

#define forr(i, a, b, s) for (int i = (a); (s) > 0 ? i < (b) : i > (b); i += (s))
#define f0(i, n) forr(i, 0, (n), 1)
#define f1(i, n) forr(i, 1, ((n) + 1), 1)
#define fo(i, b, e) forr(i, (b), (e), 1)
#define trav(a, x) for (auto &a : x)

#define mp make_pair
#define pb push_back
#define eb emplace_back
#define ff first
#define ss second

#define sz(x) (int)x.size()
#define all(x) begin(x), end(x)
#define rall(x) rbegin(x), rend(x)
#define rsz resize
#define ins insert

#define sll unordered_set<ll>
#define sii unordered_set<int>
#define mll unordered_map<ll, ll>
#define mii unordered_map<int, int>
#define pqb priority_queue<ll>
#define pqs priority_queue<ll, vll, greater<ll>>

#define zerobits(x) __builtin_ctzll(x)
#define setbits(x) __builtin_popcountll(x)
#define ps(x, y) fixed << setprecision(y) << x
#define mem(arr, x) memset(arr, x, sizeof(arr))
#define endl '\n'

const ll INF = 9e18;
ll mod = 1000000007;

template <typename T>
ostream &operator<<(ostream &stream, vector<T> &v)
{
    for (T &x : v)
        stream << x << " ";
    return stream;
}

template <typename T>
istream &operator>>(istream &stream, vector<T> &v)
{
    for (T &x : v)
        stream >> x;
    return stream;
}

template <typename T>
void sort(vector<T> &v)
{
    std::sort(v.begin(), v.end());
    return;
}

template <typename T>
T max(vector<T> &v)
{
    return *(max_element(v.begin(), v.end()));
}

template <typename T>
T min(vector<T> &v)
{
    return *(min_element(v.begin(), v.end()));
}

// =============== !!! ~ ~ ~ code starts here ~ ~ ~ !!! ===============

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
#ifdef RAGHAV
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("error.txt", "w", stderr);
#endif
    clock_t t1, t2;
    t1 = clock();
    int tc = 1;
    // cin >> tc;
    while (tc--)
    {

        int n, k;
        cin >> n >> k;
        vi arr(n);
        cin >> arr;
        vi dp(n, 999999999);
        dp[n - 1] = 0;
        forr(i, n - 2, -1, -1)
        {
            fo(j, 1, k + 1)
            {
                if (i + j >= n)
                    break;
                dp[i] = min(dp[i], dp[i + j] + abs(arr[i + j] - arr[i]));
            }
        }
        cout << dp[0] << endl;
    }
#ifdef RAGHAV
    t2 = clock();
    cout << "\n\ntime taken: " << (t2 - t1) / (long double)CLOCKS_PER_SEC;
#endif
    return 0;
}


Measured memory_bytes: 4048
#include <stdio.h>

int mod(int a, int b) {
	if (a == 0) {
		return b;
	}
	else {
		return mod(b%a, a);
	}
}

int main()
{
	long a,b;
	
	scanf("%ld", &a);
	scanf("%ld", &b);

	if (a > b) {
		long tmp = a;
		a = b;
		b = tmp;
	}
	
	int  c = mod(a, b);
	long d = a * b /c;
	printf("%ld",d);
	


	 
}

Measured memory_bytes: 128
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

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

#[allow(unused_imports)]
use std::cmp::{min, max};

#[allow(unused_imports)]
use std::io::Write;
const MOD: u64 = 1e9 as u64 + 7;

#[derive(Debug,Clone)]
pub struct BIT {
    bits: Vec<u64>,
}
impl BIT {
    pub fn new(size: usize) -> Self {
        let mut bit_size = 1;
        while bit_size <= size {
            bit_size *= 2;
        }
        BIT {
            bits: vec![0; bit_size + 1],
        }
    }
    pub fn sum(&mut self, i: usize) -> u64 {
        let mut i = i as i64;
        let mut ret = 0;
        while i > 0 {
            ret += self.bits[i as usize];
            ret %= MOD;
            i -= i & -i;
        }
        ret
    }
    pub fn add(&mut self, i: usize, value: u64) {
        assert!(i > 0);
        let n = self.bits.len() as i64;
        let mut i = i as i64;
        while i <= n {
            self.bits[i as usize] += value;
            self.bits[i as usize] %= MOD;
            i += i & -i;
        }
    }
}

fn main() {
    input!{
      n: usize,
      k: usize,
      aa: [usize; n],
    }
    let mut dp = vec![BIT::new(k+1); n+1];
    dp[0].add(k+1, 1);

    for i in 0..n {
        for j in 1..k+2 {
            let upper = min(j+aa[i], k+1);
            let val = dp[i].sum(upper) + MOD - dp[i].sum(j-1);
            dp[i+1].add(j, val%MOD);
        }
    }
    println!("{}", dp[n].sum(1) % MOD);
}


Measured memory_bytes: 209148
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func nextFloat64() float64 {
	sc.Scan()
	i, e := strconv.ParseFloat(sc.Text(), 64)
	if e != nil {
		panic(e)
	}
	return i
}

func nextString() string {
	sc.Scan()
	return sc.Text()
}

func main() {
	sc.Split(bufio.ScanWords)
	//sc.Buffer(nil, 100000000)

	s, t := nextString(), nextString()

	ans := len(t)

	lenk := len(s)
	lent := len(t)

	for k := range s {
		if (k + lent) > lenk {
			break
		}
		max := len(t)
		for k2, v2 := range t {
			if rune(s[k+k2]) == v2 {
				max--
			}
		}
		if ans > max {
			ans = max
		}
	}
	fmt.Println(ans)

}


Measured memory_bytes: 1776
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <stdio.h>
#include <vector>
#include <map>
#include <string>
#include <set>
#include <stack>
#include <queue>
#include <bitset>
#include <algorithm>
#include <cmath>
#include <iterator>
#include <iomanip>
#include <cassert>
using namespace std;
#pragma GCC optimize("O3")
#pragma GCC target("sse4")

typedef double LD;
typedef long long LL;
typedef pair<int, int> PII;
typedef pair<LD, LD> PDD;
typedef pair<LL, LL> PLL;
typedef vector<int> VI;
typedef vector<LL> VLL;
#define MP make_pair
#define PB push_back
#define X first
#define Y second
#define next fake_next

#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define RFOR(i, b, a) for(int i = (b) - 1; i >= (a); --i)
#define REP(i, t) FOR(i, 0, t)
#define ALL(a) a.begin(), a.end()
#define SZ(a) (int)((a).size())
#define FILL(a, value) memset(a, value, sizeof(a))

const LD PI = acos(-1.0);
const LD EPS = 1e-9;
const LL INF = 1e9;
const LL LINF = 1e18;
const LL mod = 1e9 + 7;
const LL MAX = 1e5 + 47;

int main()
{
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	//freopen("In.txt", "r", stdin);

	int a, b;
	cin >> a >> b;
	int ans = 0;

	if (a <= b)
		ans = a;
	else
		ans = a - 1;

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

Measured memory_bytes: 256
// AtCoder Beginner Contest 111 - Problem A: AtCoder Beginner Contest 999 (https://beta.atcoder.jp/contests/abc111/tasks/abc111_a)
#include <bits/stdc++.h>

using namespace std;

void solve(int N)
{
    auto ans = 0, base = 1;

    while (N)
    {
        auto d = N % 10;
        N /= 10;

        ans += (10 - d)*base;
        base *= 10;
    }

    cout << ans << endl;
}

int main()
{
    ios::sync_with_stdio(false);

    int N;
    cin >> N;

    solve(N);

    return 0;
}


Measured memory_bytes: 256
/*
 * Grouping.cpp
 *
 *  Created on: 2020/03/01
 *      Author: black
 */
#include <iostream>
using namespace std;

int main(){
	int x, y;
	cin >> x >> y;

	int a[] = {1, 3, 5, 7, 8, 10, 12};
	int b[] = {4, 6, 9, 11};

	int count = 0;

	for (int i = 0; i < 7; ++i){
		if (a[i] == x || a[i] == y){
			count++;
		}
	}

	if (count == 2){
		cout << "Yes";
		return 0;
	}
	count = 0;

	for (int i = 0; i < 4; ++i){
		if (b[i] == x || b[i] == y){
			count++;
		}
	}

	if (count == 2){
		cout << "Yes";
		return 0;
	}

	cout << "No";

	return 0;
}





Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
)

func main() {
	x, y, z := ScanInt(), ScanInt(), ScanInt()
	P(z, x, y)
}

/*********************** I/O ***********************/

var in *bufio.Scanner
var P func(a ...interface{}) (n int, err error)

func init() {
	P = fmt.Println

	in = bufio.NewScanner(os.Stdin)
	in.Buffer(make([]byte, 1024), int(1e+9))
	in.Split(bufio.ScanWords)
}

func ScanWord() string { in.Scan(); return in.Text() }
func ScanInt() int     { i, _ := strconv.Atoi(ScanWord()); return i }
func ScanStringSlice(n int) []string {
	s := make([]string, n)
	for i := 0; i < n; i++ {
		s[i] = ScanWord()
	}
	return s
}
func ScanIntSlice(n int) []int {
	arr := make([]int, n)
	for i := 0; i < n; i++ {
		arr[i] = ScanInt()
	}
	return arr
}

/*********************** Utils ***********************/

func S(v interface{}) string { return fmt.Sprintf("%v", v) }
func MnMx(args ...int) (int, int) {
	minVal, maxVal := int(math.MaxInt32), int(math.MinInt32)
	for _, v := range args {
		if v < minVal {
			minVal = v
		}
		if v > maxVal {
			maxVal = v
		}
	}
	return minVal, maxVal
}
func Mn(args ...int) int { mn, _ := MnMx(args...); return mn }
func Mx(args ...int) int { _, mx := MnMx(args...); return mx }
func LCM(a, b int) int   { return a / GCD(a, b) * b }
func GCD(a, b int) int {
	if a == 0 {
		return b
	}
	return GCD(b%a, a)
}
func abs(x int) int {
	if x < 0 {
		return -x
	}
	return x
}


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

int main() {
    int N, K, count, pre ,aft;
    cin >> N >> K;

    count = 0;
    while(N > 0) {
        N = N / K;
        // cout << N << endl;
        count++;
    }
    cout << count << endl;
}


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

#define rep(i,a,n) for (int i = a;i<=n;++i)
#define per(i,a,n) for (int i = n;i>=a;--i)
#define all(x) (x).begin(), (x).end()     
#define SZ(x) ((int)x.size())

typedef vector<int> VI;
typedef long long ll;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;
typedef long double ld;

mt19937 mrand(random_device{}());
ll rnd(ll a, ll b) { return a + mrand() % (b - a + 1); }
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }

const int N = 3e5;
int n, deg[N];

int main() {
      ios::sync_with_stdio(false); cin.tie(0);
#ifdef arrias
      freopen("a.txt", "r", stdin);
#endif
      cin >> n;
      rep(i, 2, n) {
            int p;
            cin >> p;
            deg[i]++;
            deg[p]++;
      }
      rep(i, 1, n) {
            cout << (deg[i] - (i != 1)) << "\n";
      }
      return 0;
}

Measured memory_bytes: 4416
#include <iostream> // cin, cout, cerr
#include <algorithm> // minmax, sort, swap
#include <numeric> // iota
#include <cstdio> // printf, scanf
#include <string> // string, stoi, to_string
#include <vector> // vector
#include <queue> // queue, priority_queue
#include <deque> // deque
#include <map> // key-value pairs sorted by keys
#include <set> // set
#include <iomanip> // cout<<setprecision(n)
#include <functional> // function<void(int)>
#include <cmath>

#ifdef DEBUG
#include "debug.hpp"
#else
#define debug(...)
#endif

#define int long long // at least int64 > 9*10^18
#define ENDL '\n'
#define rep(i,n) for(int i = 0; i < (n); i++)
#define print(i) std::cout << (i) << '\n'
#define all(v) (v).begin(), (v).end()
/* libraries */

constexpr int MOD = 1e9+7;
struct mint
{
	int v;
	mint():v(0){}
	mint(int v):v((v+MOD)%MOD){}
	mint operator-()const{ return mint(0) - *this; }
	mint& operator+=(const mint& a){ if((v+=a.v)>=MOD) v-=MOD; return *this; }
	mint& operator-=(const mint& a){ if((v+=MOD-a.v)>=MOD) v-=MOD; return *this; }
	mint& operator*=(const mint& a){ (v*=a.v)%=MOD; return *this; }
	mint& operator/=(const mint& a){ (*this) *= a.inv(); 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 operator/(const mint& a)const{ return mint(*this) /= a; }
	bool operator<(const mint& a)const{ return v < a.v; }
	bool operator==(const mint& a)const{ return v == a.v; }
	mint pow(int k)const{ mint r(1),t(v); while(k){ if(k&1) r*=t; t*=t; k>>=1; } return r; }
	mint inv()const{ return pow(MOD-2); }
	static mint comb(int n, int k) {
		if(n-k<k) k=n-k;
		mint num(1), dom(1);
		for(int i=0;i<k;i++) { num*=n-i; dom*=i+1; }
		return num/dom;
	}
};
std::istream& operator>>(std::istream&i,mint&a){ int t; i>>t; a=mint(t); return i; }
std::ostream& operator<<(std::ostream&o,const mint&a){ o<<a.v; return o; }


std::vector<mint> construct_comb(int n) {
	std::vector<mint> c(n+1);
	mint a = 1;
	c[0] = a;
	for(int i=1;i<=n;i++) {
		a = a*mint(n+1-i)/i;
		c[i] = a;
	}
	return c;
}


signed main() {
	int n,k;
	std::cin >> n >> k;
	// sum of nCk*(n-1)Ck
	auto n0 = construct_comb(n);
	auto n1 = construct_comb(n-1);
	k=std::min(k,n-1);
	mint sum = 0;
	for(int i=0;i<=k;i++) {
		sum+=n0[i]*n1[i];
	}
	print(sum);

	return 0;
}


Measured memory_bytes: 3328
/*
 * Author:  vawait
 * Created Time:  2015/8/22 16:45:15
 * Problem: test.cpp
 */
#include<cstdio>
#include<iostream>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<algorithm>
#include<string>
#include<map>
#include<set>
#include<vector>
#include<queue>
#include<stack>
#include<ctime>
using namespace std;
#define rep(i, a, b) for (int i = (a); i <= (b); ++i)
#define red(i, a, b) for (int i = (a); i >= (b); --i)
#define clr( x , y ) memset(x,y,sizeof(x))
#define mp make_pair
#define pb push_back
#define x first
#define y second
#define sqr(x) ((x) * (x))
typedef long long lint;
const int maxn = 600;
int n , m , f[maxn] , sum[maxn];

int find(int t)
{
    return f[t] == t ? t : f[t] = find( f[t] );
}

void init()
{
    int x , y;
    clr( sum , 0 );
    rep(i,1,n) f[i] = i;
    while ( m -- ) {
        scanf("%d%d",&x,&y);
        sum[x] ++;
        f[find(x)] = find( y );
    }
}

void work()
{
    int ans = 0;
    rep(i,1,n) if ( find( i ) == i ) ans ++;
    rep(i,1,n) ans += sum[i] - 1;
    printf("%d\n",ans);
}

int main()
{
    while ( cin >> n >> m ) {
        init();
        work();
    }
    return 0;
}

Measured memory_bytes: 1236
N, M = map(int, input().split())
L = [[int(j) for j in input().split()] for i in range(N)]
L = sorted(L, key=lambda x: x[0])
ans = 0
t = 0
for a, b in L:
    k = min(M - t, b)
    ans += k * a
    t += k
    if t == M:
        break
print(ans)

Measured memory_bytes: 23528
program main
integer :: n,m,cnt = 0
integer,allocatable :: a(:)

read(*,*)n,m
allocate(a(n))
read(*,*)a(1:n)

do i = 1,n
if (a(i) >= ceiling(sum(a)/real(4*m))) cnt = cnt + 1
end do
if(cnt >= m) then
write(*,*)'Yes'
else
write(*,*)'No'
end if
end program main

Measured memory_bytes: 2860
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define EPS (1e-7)
#define INF (1e9)
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
const double PI = acos(-1);
const ll MOD = 1000000007;
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;
}

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

  ll k;
  if (d == 0) k = n;
  else k = min (2 * d,n);
  double p = double(2*n - k) / double(n*n);
  double ans = (m-1) * p;

  cout << fixed << setprecision(10) << ans <<endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<cmath>
#include<string>
#include<cctype>
#include<algorithm>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<cstring>
//#include<windows.h>
//#include<time.h>
#define pb push_back
#define fi first
#define se second
#define mer make_pair
#define mme memset
using namespace std;

const double pie1=3.1415926;//π1
const double pie2=3.14159265358979;//π2
const double pie3=3.14159265358979323846;//π3
const int vbi=999999999;
const int vli=-vbi;
const long long vbl=999999999999999999;
const long long vll=-vbl;

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<pii,int> piii;
typedef pair<pii,pii> pi4;
typedef pair<pll,ll> plll;
typedef pair<int,pii> ipii;
typedef pair<ll,pll> lpll;
typedef pair<pll,pll> pl4;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<pii> vpi;
typedef vector<pll> vpl;
typedef set<int> sti;
typedef set<ll> stl;
typedef set<pii> spi;
typedef set<pll> spl;
priority_queue<int> pqi;
priority_queue<ll> pql;
queue<int> qi;
queue<ll> ql;

/*void bin_v(){
	char bin[1000];
	gets(bin);
}*/

bool pss(int a){
	for(int i=2;i<=sqrt(a);i++)
		if(a%i==0)
			return false;
	return true;
}
/////////////////////////////////////////////////////////////////////////////////////////
vector<ll> cf;
map<ll,int> mp;

void make_cf(){
	ll sum=1;
	for(int i=1;i<=31;i++){
		sum*=2;
		cf.pb(sum);
	}
}

int main(){
	//my name is Veex
	make_cf();
	ios::sync_with_stdio(false);
	int n;
	cin>>n;
	ll a[n+10];
	for(int i=1;i<=n;i++){
		cin>>a[i];
		mp[a[i]]++;
	}
	sort(a+1,a+n+1);
	reverse(a+1,a+n+1);
	int sum=0;
	for(int i=1;i<=n;i++){
		if(mp[a[i]]<=0)
			continue;
		int x=*upper_bound(cf.begin(),cf.end(),a[i]);
		x=x-a[i];
//		cout<<a[i]<<' '<<x<<endl;
		if((x==a[i]&&mp[x]>=2)||(x!=a[i]&&mp[x]>=1)){
			mp[x]--;
			mp[a[i]]--;
			sum++;
		}
//		else
//			mp[a[i]]--;
	}
	cout<<sum;
	return 0;
}


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

void solve() {
    string s; cin >> s;
    if (s == "RRR") cout << 3;
    else if (s == "RRS" || s == "SRR") cout << 2;
    else if (s == "SSS") cout << 0;
    else cout << 1;
}

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

Measured memory_bytes: 3652
#include <bits/stdc++.h>
using namespace std;
//#define mod 1000000007
int fg(int t)
{
    if(t%2!=0)
    {
        t+=1;
    }
    return t;
}
int main()
{
  int n,m;
  scanf("%d%d",&n,&m);
  if(n%3==0||m%3==0)
  {
      printf("0\n");
  }
  else
  {
      if(n==2&&m==2)
      {
          printf("1\n");
      }
      else
      {
          int p=min(n,m);
          int x=m/3+1;
          int q1=x*n-(m-x)*(n/2);
           x=m/3;
           //int pp=fg(n);
          int q2=(m-x)*(fg(n)/2)-x*n;
          int q=min(q1,q2);
          x=n/3+1;
          int w1=x*m-(n-x)*(m/2);
          x=n/3;
          int w2=(n-x)*(fg(m)/2)-x*m;
          int w=min(w1,w2);
          printf("%d\n",min(min(p,q),w));
      }
  }
    return 0;
}


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

using namespace std;

int n;
vector<int> vec;

void rec(int N, int M){
  if(N == 0){
    int size = vec.size();
    for(int i = 0 ; i < size ; i++){
      cout << vec[i] << (i != size-1 ? ' ' : '\n');
    }
  }else{
    for(int i = 0 ; i < M ; i++){
      if(N - M + i >= 0){
        vec.push_back(M-i);
        rec(N - M + i, M - i);
        vec.pop_back();
      }
    }
  }
}

int main(){

  while(cin >> n, n){
    vec.clear();    
    rec(n, n);
  }

  return 0;
}

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

N = int(input().rstrip())

values = list(map(int, input().rstrip().split()))
keys = list(range(1,N+1))

q_dic = dict(zip(keys, values))
ans = []

M = int(input().rstrip())

drinks = []
for i in range(M):
  a, b = map(int, input().rstrip().split())
  items = {a: b}
  drinks.append(items)

for i in range(len(drinks)):
  key = list(drinks[i].keys())[0]
  val = list(drinks[i].values())[0]
  q_dic[key] = val
  ans.append(sum(q_dic.values()))
  q_dic = dict(zip(keys, values))

for i in range(len(ans)):
  print(ans[i])


Measured memory_bytes: 38768
#include<bits/stdc++.h>
#define INF 2000000001
using namespace std;

typedef struct node{
  node *p,*l,*r;
  int key;
} Node;

typedef Node* Nodepointer;

Nodepointer T;

void insert(int z){
  Nodepointer t=(Node*)malloc(sizeof(Node));
  t->l=NULL;
  t->r=NULL;
  t->key=z;
  if(T->key==INF){
    T->key=z;
    return;
  }
  Nodepointer y=NULL,x=T;
  while(x!=NULL){
    y=x;
    if(t->key<x->key)x=x->l;
    else x=x->r;
  }
  t->p=y;
  if(y==NULL)T=t;
  else if(t->key<y->key)y->l=t;
  else y->r=t;
}

bool find(int key){
  Nodepointer x=T;
  while(x!=NULL){
    if(x->key==key)return true;
    if(key<x->key)x=x->l;
    else x=x->r;
  }
  return false;
}

void print(Nodepointer x,int y){
  if(y)cout<<' '<<x->key;
  if(x->l!=NULL)print(x->l,y);
  if(!y)cout<<' '<<x->key;
  if(x->r!=NULL)print(x->r,y);
}

int main(){
  string s;
  int n,z;
  cin>>n;
  T=(Node*)malloc(sizeof(Node));
  T->p=NULL;
  T->l=NULL;
  T->r=NULL;
  T->key=INF;
  while(n--){
    cin>>s;
    if(s=="insert")cin>>z,insert(z);
    else if(T->key!=INF&&s=="find"){
      cin>>z;
      if(find(z))cout<<"yes"<<endl;
      else cout<<"no"<<endl;
    }
    else if(T->key!=INF){
      print(T,0);
      cout<<endl;
      print(T,1);
      cout<<endl;
    }
  }
  return 0;
}

Measured memory_bytes: 19960
import std.stdio;
import std.string;
import std.conv;

int main()
{
	int MAX = 1000000;
	int[] prime;
	prime.length = MAX;

	prime[0] = prime[1] = 0;
	foreach(int i;2..MAX)
	{
		prime[i] = 1;
	}
	foreach(int i;2..1001)
	{
		if(prime[i])
		{
			for(int j=2*i;j<MAX;j += i)
			{
				prime[j] = 0;
			}
		}
	}
	string s;
	while((s = readln()).length != 0)
	{
		int number = to!(int)(chomp(s));
		int count = 0;
		foreach(int i;2..number+1)
		{
			count += prime[i];
		}
		writeln(count);
	}

	return 0;
}

Measured memory_bytes: 5328
N,Q = map(int,input().split())
S = input()
AC = [0]*N
cnt = 0
for i in range(1,N):
    if S[i-1:i+1] == 'AC':
        cnt += 1
    AC[i] = cnt
        
for i in range(Q):
    l,r = map(int,input().split())
    print(AC[r-1]-AC[l-1])

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

int vmaxn(vector<int> v, int n) {
  sort(v.begin(), v.end());
  return v[v.size()-n];
}

int main() {
  int a, b; cin >> a >> b;
  
  if(a == 0 || b == 0) cout << "Zero" << endl;
  else if(a<0 && b>0) cout << "Zero" << endl;
  else if(a>0 && b>0) cout << "Positive" << endl;
  else if((b-a)%2 == 0) cout << "Negative" << endl;
  else cout << "Positive" << endl;
  
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
     
     
typedef long long ll;
typedef vector <int> vi;
typedef pair <int,int> pi;
typedef tuple <int,int,int> ti;

#define forn(i,a,n) for(int i = a; i < n ; i++)
#define mem(str,a) memset(str, a, sizeof(str));
#define fast_cin() ios_base::sync_with_stdio(false); cin.tie(nullptr)
const int MOD = 1e9+7, N = 1e7 + 10, E = 1e-9;
/*
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
//vector <int> show;
//for (auto x : show)
//   cout << x << " ";
getline(cin,s);


*/

int main() {
    char c;
    cin >> c;
    if(c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u')
        cout << "vowel" << endl;
    else
        cout << "consonant" << endl;
    return 0;
}


Measured memory_bytes: 3632
#include <bits/stdc++.h>
#define REP(i, e) for(int (i) = 0; (i) < (e); ++(i))
#define FOR(i, b, e) for(int (i) = (b); (i) < (e); ++(i))
#define ALL(c) (c).begin(), (c).end()
#define PRINT(x) cout << (x) << "\n"
using namespace std;
using ll = long long; using pint = pair<int, int>; using pll = pair<ll, ll>;
template<typename T> auto compare = [](T x, T y) -> bool{return (x < y);};
const int MOD = 1000000007;

int N, M, Q;
int a[100], b[100], c[100], d[100];
int ans = 0;

int score(vector<int> A){
    int ret = 0;
    REP(i, Q){
        if(A[b[i]] - A[a[i]] == c[i]) ret += d[i];
    }
    return ret;
}

void dfs(vector<int> v){
    if(v.size() == N){
        ans = max(ans, score(v));
        return;
    }
    FOR(i, 1, M + 1){
        if(!v.empty() && i < v.back()) continue;
        vector<int> w(v);
        w.push_back(i);
        dfs(w);
    }
}

signed main(){
    cin >> N >> M >> Q;
    REP(i, Q){
        cin >> a[i] >> b[i] >> c[i] >> d[i];
        a[i]--; b[i]--;
    }
    vector<int> v = {};
    dfs(v);
    PRINT(ans);
    return 0;
}

Measured memory_bytes: 3628
import sys; sys.setrecursionlimit(2147483647); input = sys.stdin.readline
from math import floor, ceil, sqrt, factorial, log
from collections import Counter, defaultdict, deque
from operator import itemgetter
INF = float('inf'); MOD = 10**9+7
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(MI())
def LIR(n): return [LI() for i in range(n)]
def IS(): return input().rstrip()

def main():
    S = IS()
    N = len(S)
    if N%2 == 1:
        a = N//2
        if S[:a] == S[a+1:][::-1]:
            b = (N-1)//4
            if a%2 == 0:
                if S[:b] == S[b:a][::-1]:
                    c = (N+3)//2; d = c+(N-c)//2
                    if (N-c)%2 == 0:
                        if S[c-1:d-1] == S[d:][::-1]:
                            print('Yes')
                            sys.exit()
                        #else: print(7, S, N)
                    else:
                        if S[c-1:d] == S[d:][::-1]:
                            print('Yes')
                            sys.exit()
                        #else: print(6, S, N)
                #else: print(8, S, N)
            else:
                if S[:b] == S[b+1:a][::-1]:
                    c = (N+3)//2; d = c+(N-c)//2
                    if (N-c)%2 == 0:
                        if S[c-1:d-1] == S[d:][::-1]:
                            print('Yes')
                            sys.exit()
                        #else: print(5, S, N)
                    else:
                        if S[c-1:d] == S[d:][::-1]:
                            print('Yes')
                            sys.exit()
                        #else: print(4, S, N)
                #else: print(3, S, N)
        #else: print(2, S, N)
    #else: print(1, S, N)
    print('No')

if __name__ == '__main__':
    main()

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

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

Measured memory_bytes: 256
n=int(input())
a=list(map(int, input().split()))
b=list(map(int, input().split()))

ans=0
tmp=0
for i in range(n-1,-1,-1):
    if(a[i+1] >= b[i]+tmp):
        ans+=b[i]+tmp
        tmp=0
    elif(a[i+1] < tmp):
        ans+=a[i+1]
        tmp=b[i]
    else:
        ans+=a[i+1]
        tmp=b[i]+tmp-a[i+1]
ans+=min(a[0],tmp)
print(ans)

Measured memory_bytes: 18624
#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
using ull = uint64_t;
const ll INF = 9e18;

void print() { cout << endl; }
template <typename Head, typename... Tail>
void print(Head head, Tail... tail) {
    int size = sizeof...(Tail);
    cout << head;
    if (size > 0) {
        cout << " ";
    }
    print(tail...);
}

void print0() {}
template <typename Head, typename... Tail>
void print0(Head head, Tail... tail) {
    cout << head;
    print0(tail...);
}

vector<ll> divisor(ll n) {
    vector<ll> res;
    for (ll i = 1; i * i <= n; i++) {
        if (n % i == 0) {
            res.push_back(i);
            if (i != n / i) {
                res.push_back(n / i);  // n=6, i=2 => 3 を入れる. n=9, i=3 のときは除外.
            }
        }
    }
    return res;
}

ll calc(ll a, ll b) {
    return a * a * a * a * a - b * b * b * b * b;
}

int main() {
    ll X;
    cin >> X;

    vector<ll> dsrs = divisor(X);
    for (auto dr : dsrs) {
        ll a, b;
        b = -70;
        for (b = -70; b < 0; b++) {
            a = b + dr;
            if (a > 70 || a < 0) {
                continue;
            }
            if (calc(a, b) == X) {
                print(a, b);
                return 0;
            }
        }

        b = 0;
        a = dr;
        if (a > 70) {
            continue;
        }
        ll right = 5000;  //TODO
        ll left = 1;
        while (left <= right) {
            ll mid = (left + right) / 2;
            if (mid - dr < 0) {
                left = mid + 1;
                continue;
            }
            ll r = calc(mid, mid - dr);
            if (r == X) {
                print(mid, mid - dr);
                return 0;
            } else if (r < X) {
                left = mid + 1;
            } else {
                right = mid - 1;
            }
        }
    }
}


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

#define ll long long
#define INF 99999999
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()

int main()
{
    string s;
    cin >> s;
    int tmp;
    int last = -1;
    int ans = 0;
    rep(i,s.size())
    {
        tmp = (int)s[i] - 48;
        if(tmp == last)
        {
            ans++;
            if(last==1) last = 0;
            else last = 1;
        }
        else
        {
            last = tmp;
        }
    }
    cout << ans << endl;

}


Measured memory_bytes: 512
s=str(input())
# print(s)
List=list(s)
List.pop(-1)
# print(List)
ans=0
for i in range((len(List)//2)+1):
    R=List[0:i]
    L=List[i:i+len(R)]
    # print("L",L,"R",R)
    if(R==L):
        # print(i,i+1,R,L)
        ans=len(R)*2

print(ans)

Measured memory_bytes: 3060
#include <iostream>
#include <string>
#include <vector>
#include <math.h>
#include <algorithm>
#include <cmath>
#include <ios>
#include <ctype.h>
#include <stack>
#include <istream>
#include <stdio.h>
#include <map>
#include <set>
#include <queue>
#include <unordered_map>
#include <functional>
#include <bitset>
#include <list>
#include <deque>
#include <time.h>
#include <random>
#include <iomanip>
#include <fstream>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define REP(i,a,b) for (int i = a; i < (b); ++i)
#define all(x) (x).begin(),(x).end()
#define pint pair<int,int>
const int INF = 1000000007;
const long double EPS = 1e-15;
const long double PI = acos(-1);
typedef long long ll;
using namespace std;
using Graph = vector<vector<int>>;
using Graph_weighted = vector<vector<pair<int,int>>>;
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
ll lcm(ll a, ll b) { return (a * b) / gcd(a,b); }
ll ceil(const ll a, const ll b) { return (a + b - 1) / b; }
int main(){
  int n,Maxn = -1;
  cin >> n;
  vector<int>v(n);
  rep(i,n){
    cin >> v[i];
    Maxn = max(Maxn,v[i]);
  }
  int tmp,Abs = INF;
  if(Maxn % 2 == 0){
    tmp = Maxn / 2;
    rep(i,n){
      if(v[i] == Maxn)continue;
      Abs = min(Abs,abs(tmp - v[i]));
    }
    cout << Maxn << " ";
    rep(i,n){
      if(v[i] == Maxn)continue;
      if(abs(tmp - v[i]) == Abs){
      cout << v[i] << endl;
      return 0;
    }
    }
  }
  else{
    tmp = Maxn / 2;
    int tmp1 = Maxn / 2 + 1;
    rep(i,n){
      if(v[i] == Maxn)continue;
      Abs = min(Abs,abs(tmp - v[i]));
      Abs = min(Abs,abs(tmp1 - v[i]));
    }
    cout << Maxn << " ";
    rep(i,n){
      if(v[i] == Maxn)continue;
      if(abs(tmp - v[i]) == Abs || abs(tmp1 - v[i]) == Abs){
      cout << v[i] << endl;
      return 0;
    }}
  }
  return 0;
}

Measured memory_bytes: 640