akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define FOR(i,l,r) for(long long i=(l);i<(r);++i)
#define REP(i,n) FOR(i,0,n)
#define REPS(i,n) FOR(i,1,n+1)
#define RFOR(i,l,r) for(long long i=(l);i>=(r);--i)
#define RREP(i,n) RFOR(i,n-1,0)
#define RREPS(i,n) RFOR(i,n,1)
#define int long long
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define SZ(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

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

signed main(){
    int h,m,h2,m2,k;cin>>h>>m>>h2>>m2>>k;
    int x=h2*60+m2;
    int y=h*60+m;
    cout<<x-y-k<<endl;
}

Measured memory_bytes: 3632
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair

using ll = long long;
using namespace std;

void solve()
{
    ll x, k, d;
    cin >> x >> k >> d;
    x = abs(x);
    ll n = x;
    ll i = 0; //move
    ll m = LONG_LONG_MAX;
    i = n / d;
    n = n % d;

  

    if (i > k)
    {
        n = n + (i - k) * d;
        i = k;
        
    }

    if (min(n, abs(n - d)) < n && i < k)
    {
        i++;
        n = abs(n - d);
    }

    if ((k - i) % 2 == 0) //remaining moves
    {
        cout << n << '\n';
    }
    else
    {
        cout << abs(n - d) << '\n';
    }
}

int main()
{
    std::ios::sync_with_stdio(false);
    std::cin.tie(NULL);
    int test;
    test = 1;
    while (test--)
    {
        solve();
    }
    return 0;
}

Measured memory_bytes: 3648
n = int(input())
a = [int(a) for a in input().split()]
aans =0
ans =0
for i in range(n-1):
  if a[i] >= a[i+1]:
    ans +=1
  else :
    if ans >aans:
      aans =ans
      ans = 0
    else :
      ans =0
if ans >aans:
  aans =ans
print(aans)
    

Measured memory_bytes: 14252
#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[])
{
	int w , a , a1 , b , b1;
	scanf("%d%d%d" , &w , &a , &b);
	a1 = a + w;
	b1 = b + w;
	if(a <= b && b <= a1 || (a <= b1 && b1 <= a1))
		puts("0");
	else
	{
		if(b > a1)
		{
			printf("%d\n" , b - a1);
		}
		else
		{
			printf("%d\n" , a - b1);
		}
	}
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <set>
#include <map>
#include <queue>
#include<limits.h>
#include<iomanip>
#define rep(i, n) for(int i = 0; i < n; i++)
#define REP(i, m, n) for(int i = m; i < n; i++)
#define ALL(v) v.begin(),v.end()
#define RALL(v) v.rbegin(),v.rend()
#define check(v) rep(i,v.size()) cout << v[i] << " ";\
cout << endl
#define INF 1e8
typedef long long ll;
using namespace std;
//オーバーフローに気をつけろよおおおおおお
//確認忘れるなよおおおおおお

int main() {
    ll a, b; cin >> a >> b;
    ll ans = 1;
    while(a*2<=b){
        a*=2;
        ans++;
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
#define FAST ios_base::sync_with_stdio(0); cin.tie(); cout.tie();
 
#define MAXX 10005
 
#define PI   3.14159265358979323846264338327950
 
#define F first
#define S second
 
#define ll 	 long long int
 
#define mod  1000000007



int main()
{
	FAST;
	ll a, b;
	cin >> a >> b;
	ll x =  b - a;
	x = (1 + x) * x / 2;
	
	cout << x - b;
	return 0;
}

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

typedef long long int   ll;
#define cases           int t;cin>>t;while(t--)
#define FIO             ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define endl            "\n"
#define scan(n)         scanf("%d",&n)
#define PI              3.1415926535897932384626433832795
#define int             ll
#define loop0           for(int i=0;i<n;i++)
#define loop1           for(int i=1;i<=n;i++)
#define inpar0(ar)      for(int i=0;i<n;i++)cin>>ar[i];
#define inpar1(ar)      for(int i=1;i<=n;i++)cin>>ar[i];
#define showar0(ar)     for(int i=0;i<n;i++)cout<<ar[i]<<" ";
#define showar1(ar)     for(int i=1;i<=n;i++)cout<<ar[i]<<" ";
#define manu            cout<<(checkerCounter++)<<endl;
int checkerCounter = 1;
int mod=1000000007;
int maxn=200001;
int binpow(int a,int b,int mod){int res=1;while(b>0){if(b%2){res=(res*a)%mod;b--;}a=(a*a)%mod;b/=2;}return res%mod;}
bool isPrime(int n){if(n==1)return false;for(int i=2;i*i<=n;i++){if(n%i==0)return false;}return true;}

signed main(){
    int a,b;cin>>a>>b;
    cout<<a*b;
}


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

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

    if(s=="SUN")
        cout<<"7"<<endl;
    else if(s=="MON")
        cout<<"6"<<endl;
    else if(s=="TUE")
        cout<<"5"<<endl;
    else if(s=="WED")
        cout<<"4"<<endl;
    else if(s=="THU")
        cout<<"3"<<endl;
    else if(s=="FRI")
        cout<<"2"<<endl;
    else if(s=="SAT")
        cout<<"1"<<endl;


    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,a,b) for(ll i=ll(a);i<ll(b);i++)
#define irep(i,a,b) for(ll i=ll(a);i>=ll(b);i--)
#define pb push_back
#define mp make_pair
#define pll pair<ll,ll>
#define endl "\n"
using ll=long long;
using ld=long double;
using namespace std;
const ll mod= 1e9+7;
const ll INF = 1LL<<40;
ll GCD(ll a, ll b) { return b ? GCD(b, a%b) : a; }


ll n,k,ans=0;
const ll MAX=220000;
ll fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % mod;
        inv[i] = mod - inv[mod%i] * (mod / i) % mod;
        finv[i] = finv[i - 1] * inv[i] % mod;
    }
}

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % mod) % mod;
}


int main(){
  cin>>n>>k;
  COMinit();
  if(k>1)ans++;
  rep(i,1,min(n-1,k)+1)ans=(ans+COM(n,i)*COM(n-1,n-i-1))%mod;
  cout<<ans%mod;
}

Measured memory_bytes: 5376
N,M,X = map(int,input().split())
C = []
A = []
for n in range(N):
    l = list(map(int,input().split()))
    C.append(l[0])
    A.append(l[1:len(l)])
l = [0] * (N + 1)
Mx = 10 ** 7
Mn = Mx
while True:
    i = 0
    while True:
        l[i] = l[i] ^ 1
        if l[i] == 1:
            break
        i += 1
    if i >= N:
        break
    lA = [0] * M
    c = 0
    for n in range(N):
        if l[n] == 0:
            continue
        c += C[n]
        for m in range(M):
            lA[m] += A[n][m]
    flg = True
    for m in range(M):
        if lA[m] < X:
            flg = False
            break
    if not flg:
        continue
    if c < Mn:
        Mn = c
if Mn == Mx:
    print(-1)
else:
    print(Mn)

Measured memory_bytes: 74300
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;

public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner cin = new  Scanner(System.in);
		label:while(true){
			char[] s = (cin.next()).toCharArray();
			if(s[0]=='0'){
				break;
			}
			if(all(s)){
				System.out.println(0);
				continue;
			}
			HashSet<String> map = new HashSet<String>();
			Queue<char[]> q = new LinkedList<char[]>();
			Queue<Integer> depth = new LinkedList<Integer>();
			q.add(s);
			depth.add(0);
			label2:while(!q.isEmpty()){
				char[] ss = q.poll();
				int dep = depth.poll();
				for(int i = 0; i < s.length-1;i++){
					if(ss[i]!=ss[i+1]){
						char[] next = change(ss,i);
						if(map.contains(String.valueOf(next))){
							//System.out.println("onaji");
							continue;
						}
						if(all(next)){
							System.out.println(dep+1);
							continue label;
						}
						map.add(String.valueOf(next));
						q.add(next);
						depth.add(dep+1);
					}
				}
			}
			System.out.println("NA");
		}
	}
	static boolean all(char[] s){
		for(int i = 0;i<s.length-1;i++){
			if(s[i]!=s[i+1]){
				return false;
			}
		}
		return true;
	}
	static char[] change(char[] s,int x){
		char[] re = s.clone();

		if(re[x]!='r'&&re[x+1]!='r'){
			re[x]='r';
			re[x+1]='r';
		}
		else if(re[x]!='g'&&re[x+1]!='g'){
			re[x]='g';
			re[x+1]='g';
		} 
		else{
			re[x]='b';
			re[x+1]='b';
		}
		return re;
	}
}

Measured memory_bytes: 17000
comp='MARCH'
cnt=[0,0,0,0,0]

n=int(input())
for i in range(n):
  word=input()
  for j in range(len(comp)):
    if word[0]==comp[j]: cnt[j]+=1

ans = 0
for i in range(len(cnt)):
  for j in range(i+1, len(cnt)):
      for k in range(j+1, len(cnt)):
        ans += cnt[i]*cnt[j]*cnt[k]
        
print(ans)

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

using ll = long long;
using ull = unsigned long long;
using ld = long double;

#define MOD 1000000007

#define rep(i, n) for(ll (i) = 0LL;(i) < (ll)(n);(i)++)
#define rep2(i, s, e) for(ll (i) = (ll)(s);(i) < (ll)(e);(i)++)
#define repi(i, n) for(ll (i) = 0LL;(i) <= (ll)(n);(i)++)
#define repi2(i, s, e) for(ll (i) = (ll)(s);(i) <= (ll)(e);(i)++)
#define per(i, n) for(ll (i) = (ll)(n) - 1LL;(i) >= 0LL;(i)--)
#define per2(i, s, e) for(ll (i) = (ll)(s) - 1LL;(i) >= (ll)(e);(i)--)
#define peri(i, n) for(ll (i) = (ll)(n);(i) >= 0LL;(i)--)
#define peri2(i, s, e) for(ll (i) = (ll)(s);(i) >= (ll)(e);(i)--)
#define iter(i, it) for(auto &(i): (it))

template<typename T, typename U> ostream& operator<<(ostream &s, const pair<T, U> m) {
    cout << "(" << m.first << ", " << m.second << ")";
    return s;
}
template<typename T, typename U> ostream& operator<<(ostream &s, const map<T, U> m) {
    ll c = 0;
    cout << "{ ";
    iter(i, m) cout << i << (c++ == m.size() - 1 ? " " : ", ");
    cout << "}";
    return s;
}
template<typename T> ostream& operator<<(ostream &s, const vector<T> &v) {
    cout << "{ ";
    rep(i, v.size()) cout << v[i] << (i == v.size() - 1 ? " " : ", ");
    cout << "}";
    return s;
}
template<typename T> ostream& operator<<(ostream &s, const list<T> &v) {
    ll c = 0;
    cout << "{ ";
    iter(i, v) cout << i << (c++ == v.size() - 1 ? " " : ", ");
    cout << "}";
    return s;
}

int main(void) {
    string S;
    ll K;
    cin >> S;
    cin >> K;
    rep(i, K) {
        if(S[i] != '1') {
            cout << S[i] << endl;
            return 0;
        }
    }
    cout << 1 << endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <algorithm>
#include <fstream>
#include <iomanip>

typedef long long ll;
const ll INF = (ll)1e18 + 1;
const ll MOD = 1e9 + 7;

void print(){ std::cout << std::endl; }
template<typename H> void print(H head) { std::cout << head << std::endl; }
template<typename H, typename... T> void print(H head, T... tail){ std::cout << head << " ", print(tail...); }
template<typename V> void printVec(V v) {ll i=0;for(auto x : v){std::cout << " [" << i++ << "] " << x;} print();}



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

  ll N;
  std::cin >> N;

  std::vector< ll > va(N, 0LL);
  std::map< ll, ll > mc;
  for (ll i = 0; i < N; i++) {
    std::cin >> va[i];
    mc[va[i]]++;
  }

  if ((N % 2 == 1 && mc[0] != 1) || (N % 2 == 0 && mc[0] != 0)) {
    print(0);
    return 0;
  }

  bool judge = true;
  if ((N % 2 == 1 && mc[0] == 1)) {
    for (ll i = 1; i < N; i++) {
      if (i % 2 == 1 && mc[i] != 0) {
	judge = false;
      }
      if (i % 2 == 0 && mc[i] != 2) {
	judge = false;
      }
    }
    if (judge == false) {
      print(0);
      return 0;
    }
  }

  if ((N % 2 == 0 && mc[0] == 0)) {
    for (ll i = 1; i < N; i++) {
      if (i % 2 == 1 && mc[i] != 2) {
	judge = false;
      }
      if (i % 2 == 0 && mc[i] != 0) {
	judge = false;
      }
    }
    if (judge == false) {
      print(0);
      return 0;
    }
  }

  ll cnt = N / 2;
  ll ans = 1;
  for (ll i = 0; i < cnt; i++) {
    ans = (ans * 2) % MOD;
  }

  print(ans);
  return 0;
}


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

int main()
{
	int k;
	string s;
	cin >> k >> s;

	if (s.size() <= k) {
		cout << s << endl;
	} else {
		for (int i = 0; i < k; i++) {
			cout << s[i];
		}
		cout << "..." << endl;
	}
}


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

#define F first
#define S second
#define prev azaza
#define MP make_pair
#define PB push_back

using namespace std;
typedef long long ll;
typedef long double ld;

const int max_n = 1111, inf = 1000111222;

vector<int> v;

int main()
{
    //freopen("input.txt", "r", stdin);
    int n, x;
    cin >> n >> x;
    int cur = 0;
    int ans = 1;
    for (int i = 0; i < n; ++i) {
        int d;
        cin >> d;
        cur += d;
        if (cur <= x) {
            ++ans;
        }
    }
    cout << ans << endl;

    return 0;
}




Measured memory_bytes: 256
-- i18n.hs --- i18n

-- author: Seong Yong-ju <sei40kr@gmail.com>

solve :: String -> String
solve [] = ""
solve (c:s) = [c] ++ show (length s - 1) ++ [last s]

main :: IO ()
main = do
  s <- getLine
  putStrLn $ solve s


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

#define int long long
#define vvi vector<vector<int>>
#define vec vector
#define pq priority_queue
#define all(v) (v).begin(), (v).end()
#define uniqueV(x) sort(x.begin(), x.end()); x.erase(unique(x.begin(), x.end()), x.end());
#define rep(i, n) for (int (i) = (0); (i) < (n); ++(i))
#define repp(i, m, n) for (int (i) = (m); (i) < (n); ++(i))
#define dbg(x) cerr << #x << ": " << x << endl;
#define dbg2(x, y) cerr<<"("<<#x<<", "<<#y<<") = "<<"("<<x<<", "<<y<<")"<<endl;
#define dbg3(x, y, z) cerr<<"("<<#x<<", "<<#y<<", "<<#z<<") = "<<"("<<x<<", "<<y<<", "<<z<<")"<<endl;
#define dbgB(value, size) cerr<<#value<<": "<<bitset<size>(value) << endl;
#define line() cerr << "---------------" << endl;

const int dx[] = {1, -1, 0, 0};
const int dy[] = {0, 0, -1, 1};
const double PI = 3.14159265358979323846;

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }

template<typename T, typename U>
void print1(T Array, U size) {
  for (int i = 0; i < size; i++) {
    cout << Array[i] << " ";
  }
  cout << endl;
}

template<typename T>
void print(T Array, int height, int width) {
  for (int i = 0; i < height; i++) {
    for (int j = 0; j < width; j++) {
      cout << " " << Array[i][j];
    }
    cout << endl;
  }
}

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

signed main() {
  string s; cin >> s; cout << count(all(s), '+') - count(all(s) , '-') << endl;

  return 0;
}

Measured memory_bytes: 764
#include<vector>
#include<iostream>
#include<algorithm>
#include<chrono>
#include<set>
#include<cstdio>
#include<string>
#include<unordered_map>

using namespace std;


int main()
{
    int n, q;
    long long ans = 0;
    scanf("%d",&n);
    unordered_map<int, int> mp;
    vector<int> a(n);
    for(int i = 0; i < n; i++){
        scanf("%d", &a[i]);
        mp[a[i]]++;
        ans += a[i];
    }
    scanf("%d",&q);
    for(int i = 0; i < q; i++){
        int b, c;
        scanf("%d%d", &b, &c);
        mp[c] += mp[b];
        ans += (mp[b]*c - mp[b]*b);
        mp[b] = 0;
        cout << ans << endl;
    }
}

Measured memory_bytes: 7224
package main

import (
	"fmt"
)

func main() {
	x := make([]int, 4)
	y := make([]int, 4)
	fmt.Scan(&x[0], &y[0], &x[1], &y[1]) 

	vector := make([]int, 2)
	vector[0] = x[1] - x[0]
	vector[1] = y[1] - y[0]

	x[2] = x[1] - vector[1]
	y[2] = y[1] + vector[0]

	vector[0] = x[2] - x[1]
	vector[1] = y[2] - y[1]

	x[3] = x[2] - vector[1]
	y[3] = y[2] + vector[0]

	fmt.Println(x[2],y[2],x[3],y[3])
}



Measured memory_bytes: 512
#include <iostream>

using namespace std;

int main(){
  string S, T;
  int count=0;
  cin >> S >> T;
  int size = S.size();
  for(int x=0;x<size;x++){
    if(S.at(x)!=T.at(x)){
      count++;
    }
  }
  cout << count;
}

Measured memory_bytes: 3864
// B.

#include <iostream>
#include <sstream>
#include <algorithm>

using namespace std;

int main(int argc, char *argv[]) {
	string s;
	cin >> s;
	int len = s.length();
	int sum = 0;
	for (char c : s) {
		sum += c - '0';
	}
	bool ans = stoi(s) % sum == 0;
	cout << (ans ? "Yes" : "No") << endl;
	return 0;
}


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

struct node{
  struct node *right;
  struct node *left;
  struct node *parent;
  int key;
};
typedef struct node * Node;
#define NIL NULL

Node root=NIL;
Node treeMinimum(Node x){
  if(x->left == NIL) return x;
  else treeMinimum(x->left);
}

Node treeMaximum(Node x){
  if(x->right == NIL) return x;
  else treeMaximum(x->right);
}

Node treeSearch(Node u, int k){
  if(u == NIL || k == u->key) return u;
  else if(k < u->key) return treeSearch(u->left,k);
  else return treeSearch(u->right,k);
}

Node treeSuccessor(Node x){
  Node y;
  if(x->right != NIL) return treeMinimum(x->right);

  y = x->parent;
  while(y != NIL && x->key == y->right->key){
    x = y;
    y = y->parent;
  }
  return y;
}

void treeDelete(Node z){
  Node y; // node to be deleted
  Node x; // child of y
  if(z->left == NIL || z->right == NIL) y = z;
  else y = treeSuccessor(z);

  if(y->left!=NIL) x = y->left;
  else x = y->right;

  if(x!=NIL) x->parent = y->parent;

  if(y->parent == NIL) root = x;
  else if(y == y->parent->left) y->parent->left = x;
  else y->parent->right = x;

  if(y!=z) z->key = y->key;
}

void insert(int k){
  Node y = NIL;
  Node x = root;
  Node z;

  z = malloc(sizeof(struct node));
  z->key = k;
  z->left = NIL;
  z->right = NIL;
  
  while(x != NIL){
    y = x;
    if(z->key < x->key){
      x = x->left;
    }
    else x = x->right;
    
  }
  z->parent = y;
  if(y == NIL) root = z;
  else if(z->key < y->key) y->left = z;
  else y->right = z;
}

void inorder(Node u){
  if(u!=NIL){
    inorder(u->left);
    printf(" %d",u->key);
    inorder(u->right);
  }
}
void preorder(Node u){
  if(u==NIL) return ;
  printf(" %d",u->key);
  preorder(u->left);
  preorder(u->right);
}


int main(){
  int n, i, x;
  char com[20];
  scanf("%d", &n);

  for ( i = 0; i < n; i++ ){
    scanf("%s", com);
    if ( com[0] == 'f' ){
      scanf("%d", &x);
      Node t = treeSearch(root, x);
      if ( t != NIL ) printf("yes\n");
      else printf("no\n");
    } else if ( com[0] == 'i' ){
      scanf("%d", &x);
      insert(x);
    } else if ( com[0] == 'p' ){
      inorder(root);
      printf("\n");
      preorder(root);
      printf("\n");
    } else if ( com[0] == 'd' ){
      scanf("%d", &x);
      treeDelete(treeSearch(root, x));
    }
  }

  return 0;
}



Measured memory_bytes: 20484
#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
#include<bitset>
#include<vector>
#include<deque>
#include<list>
#include<queue>
#include<map>
#include<set>
#include<stack>
#include<cmath>
#include<iomanip>
#include <functional>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int mod = 1000000007;
const int INF = 1 << 28;
const double EPS = 1e-10;
//cout << fixed << std::setprecision(9)
//memset(a, 0, sizeof(a));
//--------------------------

ll k, a, b;

int main()
{
	cin >> k >> a >> b;
	ll ans = 0;

	if (b - a > 2) {
		if (k < a + 1) {
			ans = k + 1;
		}
		else {
			k -= (a + 1);
			ans = b;
			ans += (b - a) * (k / 2);
			if (k % 2) ans++;
		}
	}
	else {
		ans = k + 1;
	}

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


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

#include <fstream>
using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout << setprecision(20) << fixed;
  /*
  ifstream in("input.txt");
  cin.rdbuf(in.rdbuf());
  //*/
  int n;
  cin >> n;

  switch(n % 10){
    case 2:
    case 4:
    case 5:
    case 7:
    case 9:
      cout << "hon" <<endl;
      break;
    case 0:
    case 1:
    case 6:
    case 8:
      cout << "pon" <<endl;
      break;
    case 3:
      cout << "bon" <<endl;
      break;
  }
}


Measured memory_bytes: 3632
import bisect
N,M=map(int,input().split())
A=list(map(int,input().split()))
A=[(1,a) for a in A]
DO=[tuple(map(int,input().split())) for i in range(M)]
DO+=A
DO.sort(key=lambda x:x[1])
cnt=0
ans=0
while True:
    check=DO.pop()
    if cnt+check[0]<=N:
        ans+=check[0]*check[1]
        cnt+=check[0]
    else:
        ans+=check[1]*(N-cnt)
        break
print(ans)

Measured memory_bytes: 32012
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <string>

using namespace std;

#define INF (100000000)

typedef pair<int, int> P;

int main() {
    int N,M;
    cin >> N >> M;

    vector<int> D;
    vector<P> DPAIR(M);
    for(int i=0; i<M; ++i) DPAIR[i]=P(i,0);
    for(int i=0; i<N; ++i) {
        int temp;
        cin >> temp;
        D.push_back(temp-1);
        ++DPAIR[temp-1].second;
    }

    vector<int> DD[M];

    for(int i=0; i<M; ++i) {
        DD[i].resize(N);
        DD[i][0]=(D[0]==i?1:0);
        for(int j=1; j<N; ++j) {
            DD[i][j]=DD[i][j-1]+(D[j]==i?1:0);
        }
    }

    string ALPHA="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
    string istr=ALPHA.substr(0,M);
    vector<int> indx(M+1);
    map<string,P> mp;

    for(int c=1; c<=M; ++c) {
        string str=istr.substr(0,c);
        indx[c]=M;
        for(int i=0; i<c; ++i) indx[i]=i;
        --indx[c-1];
        while(indx[0]<M-c || c==M) {
            int now=c-1;
            while(indx[0]!=M-c || c==M) {
                if(indx[now+1]-indx[now]>1) {
                    ++indx[now];
                    str[now]=istr[indx[now]];
                    break;
                } else if(indx[now]-indx[now-1]>1) {
                    ++indx[now-1];
                    str[now-1]=istr[indx[now-1]];
                    for(int i=now; i<c; ++i) {
                        indx[i]=indx[i-1]+1;
                        str[i]=istr[indx[i]];
                    }
                    break;
                } else {
                    --now;
                }
            }

            // main
            int cnt=INF;
            int len;
            for(int i=0; i<c; ++i) { // most back position's index
                string s=str;
                s.erase(s.begin()+i);
                if(s=="") {
                    cnt=min(cnt,DPAIR[indx[i]].second-DD[indx[i]][DPAIR[indx[i]].second-1]);
                    len=DPAIR[indx[i]].second;
                } else {
                    int fst=mp[s].first;
                    int snd=mp[s].second;
                    cnt=min(cnt,fst+DPAIR[indx[i]].second-DD[indx[i]][snd+DPAIR[indx[i]].second-1]+DD[indx[i]][snd-1]);
                    len=snd+DPAIR[indx[i]].second;
                }
            }
            
            mp[str]=make_pair(cnt,len);
            if(c==M) break;
        }
    }

    cout << mp[istr].first << endl;
    return 0;
}


Measured memory_bytes: 125852
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
typedef long long ll;
const ll MOD = 1000000007;
#define SortAsc(c) std::sort(c.begin(), c.end())
#define SortDesc(c) std::sort(c.rbegin(), c.rend())
int dx[8] = {0, 1, 0, -1, 1, 1, -1, -1};
int dy[8] = {1, 0, -1, 0, 1, -1, 1, -1};

int main()
{
    int a, b;
    cin >> a >> b;
    cout << a * b << endl;
}

Measured memory_bytes: 3572
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//cout << fixed << setprecision(17) << res << endl;


vector<pair<ll, ll> > prime_factorize(ll n) {
    vector<pair<ll, ll> > res;
    for (ll p = 2; p * p <= n; ++p) {
        if (n % p != 0) continue;
        ll num = 0;
        while (n % p == 0) { ++num; n /= p; }
        res.push_back(make_pair(p, num));
    }
    if (n != 1) res.push_back(make_pair(n, 1));
    return res;
}

int main() {
    ll n;
    cin >> n;
    auto V = prime_factorize(n);
    ll res = 0;
    for (auto p : V) {
        //cerr << p.first << "," << p.second << endl;
        ll m = p.second;
        ll u = (ll)(sqrt(double(m*2)));
        //cerr << m << " vs " << u << endl;
        if (u * (u+1) <= 2*m && 2*m < (u +1) * (u+2)) {
            res += u;
        } else if ((u-1) * (u) <= 2*m && 2*m < (u) * (u+1)) {
            res += u-1;
        } else if ((u+1) * (u+2) <= 2*m && 2*m < (u +2) * (u+3)) {
            res += u+1;
        }
    }
    cout << res << endl;
}


Measured memory_bytes: 3724
class Node:
    def __init__(self):
        self.parent_id = -1
        self.depth = 0
        self.children = []

global nodes

def calc_depth(node_id,arg_depth):
    nodes[node_id].depth = arg_depth
    for child in nodes[node_id].children:
        calc_depth(child, arg_depth+1)

V = int(input())

nodes = []
# V個のノードを用意
for loop in range(V):
    node = Node()
    nodes.append(node)

# 親子関係取得
for loop in range(V):
    table = list(map(int,input().split()))
    node_id = table[0]
    num = table[1]

    for i in range(num):
        child_id = table[2+i]
        nodes[node_id].children.append(child_id)
        nodes[child_id].parent_id = node_id

# 値を探して深さを計算する
for i in range(V):
    if nodes[i].parent_id == -1:
        calc_depth(i,0)
        break

for i in range(V):
    print("node %d: parent = %d, depth = %d, "%(i,nodes[i].parent_id,nodes[i].depth),end = "")

    if nodes[i].parent_id == -1:
        print("root,",end ="") #根
    else:
        if len(nodes[i].children) == 0: #葉
            print("leaf,",end ="")
        else: #節
            print("internal node,",end ="")
    print(" [",end = "")
    print(", ".join(map(str,nodes[i].children)),end = "")
    print("]")


Measured memory_bytes: 40700
#include <bits/stdc++.h>
using namespace std;
#define int long long
using ll=long long;
using vi=vector<int>;
using pii=pair<int,int>;
#define ALL(c) begin(c),end(c)
#define RALL(c) rbegin(c),rend(c)
#define ITR(i,b,e) for(auto i=(b);i!=(e);++i)
#define FORE(x,c) for(auto &x:c)
#define REPF(i,a,n) for(int i=a,i##len=(int)(n);i<i##len;++i)
#define REP(i,n) REPF(i,0,n)
#define REPR(i,n) for(int i=(int)(n);i>=0;--i)
#define SZ(c) ((int)c.size())
#define CONTAIN(c,x) (c.find(x)!=end(c))
#define OUTOFRANGE(y,x,h,w) ((y)<0||(x)<0||(y)>=(h)||(x)>=(w))
#define dump(...)
#define pb push_back
const signed INF_=1001001001; const long long INF=1001001001001001001LL;
const int DX[9]={0,1,0,-1,1,1,-1,-1,0},DY[9]={-1,0,1,0,-1,1,1,-1,0};
template<class T> ostream& operator<<(ostream &os,const vector<T> &v) {
    ITR(i,begin(v),end(v))os<<*i<<(i==end(v)-1?"":" ");return os;}
template<class T> istream& operator>>(istream &is,vector<T> &v) {
    ITR(i,begin(v),end(v)) is>>*i;return is;}
template<class T,class U> istream& operator>>(istream &is, pair<T,U> &p) {
    is>>p.first>>p.second;return is;}
template<class T, class U> bool chmax(T &a,const U &b){return a<b?a=b,1:0;}
template<class T, class U> bool chmin(T &a,const U &b){return a>b?a=b,1:0;}
template<class T> using heap=priority_queue<T,vector<T>,greater<T>>;
struct before_main_function {
    before_main_function() {
        cin.tie(0); ios::sync_with_stdio(false);
        cout << setprecision(15) << fixed;
        #define endl "\n"
    }
} before_main_function;
//------------------8<------------------------------------8<--------------------

signed main() {
    string s;
    cin >> s;
    int c = 0;
    REPF(i, 2, SZ(s) - 1) {
        if (s[i] == 'C') c++;
        else if ('A' <= s[i] && s[i] <= 'Z') {
            cout << "WA" << endl;
            return 0;
        }
    }
    if (c == 1 && s[0] == 'A' && 'a' <= s[1] && s[1] <= 'z' && 'a' <= s[SZ(s) - 1] && s[SZ(s) - 1] <= 'z') {
        cout << "AC" << endl;
    } else {
        cout << "WA" << endl;
    }
    return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define mp make_pair
#define pb(x) push_back(x)
#define vi vector<int>
#define vs vector<string>
#define vll vector<long long>
#define vc vector<char>
#define vs vector<string>
#define pii pair<int, int>
#define pll pair<long long, long long>
#define pil pair<int, long long>
#define pli pair<long long, int>
#define pcc pair<char, char>
#define pdd pair<double, double>
#define mll map<long long, long long>
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(), (v).end()
#define flsh fflush(stdout)
#define gcd __gcd
#define clr(x) memset(x, 0, sizeof(x))
#define mod 1000000007LL
#define mod2 998244353LL
#define INF 1000000000007
 

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> o_tree;


void solve()
{
   ll n,k;
   cin>>n>>k;
   string s;
   cin>>s;
   char cc = tolower(s[k-1]);
   s[k-1]=cc;
   cout<<s<<"\n";
}


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


if (fopen("input.txt","r" ))
  {
     freopen("input.txt", "r", stdin);
     freopen("output.txt", "w", stdout);
  }
cout<<setprecision(20);


ll t=1;


// cin>>t;


while(t--)
{
solve();
} 


return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <queue>
#include <cmath>
#include <algorithm>
#include <utility>

using namespace std;

int search_xyz(int e);

int main()
{
    int num;
    int n, k;
    cin >> num;
    for (int i = 0; i < num; i++)
    {
        cin >> n >> k;
        int x[n];
        pair<int, int> y[n - 1];

        for (int j = 0; j < n; j++)
        {
            cin >> x[j];
            if (j > 0)
                y[j - 1] = make_pair(x[j] - x[j - 1], j - 1);
        }
        int full = x[n - 1] - x[0];

        sort(y, y + n - 1);
        reverse(y, y + n - 1);

        int setsuyaku = 0;
        for (int j = 0; j < min(n - 1, k - 1); j++)
        {
            full -= y[j].first;
        }
        cout << full << endl;
    }
    return 0;
}



Measured memory_bytes: 4260
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <iomanip>
#include <queue>
#include <deque>
#include <unordered_map>
#define rep(i,n) for(int i=0;i<n;i++)
#define repn(i,n) for(int i=1;i<=n;i++)
using namespace std;
typedef long long ll;

double R;

int main(){
    cin>>R;

    cout<<2.0*3.14*R<<endl;
}

Measured memory_bytes: 3744
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using static System.Console;
using static System.Math;

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            var ab = ReadInts();
            var list = new List<int>();
            list.Add(ab[0] + ab[1]);
            list.Add(ab[0] - ab[1]);
            list.Add(ab[0] * ab[1]);
            WriteLine(list.Max());
        }

        private static string Read() { return ReadLine(); }
        private static string[] Reads() { return (Read().Split()); }
        private static int ReadInt() { return int.Parse(Read()); }
        private static long ReadLong() { return long.Parse(Read()); }
        private static double ReadDouble() { return double.Parse(Read()); }
        private static int[] ReadInts() { return Array.ConvertAll(Read().Split(), int.Parse); }
        private static long[] ReadLongs() { return Array.ConvertAll(Read().Split(), long.Parse); }
        private static double[] ReadDoubles() { return Array.ConvertAll(Read().Split(), double.Parse); }

        //最大公約数

        public static int Gcd(int a, int b)
        {
            if (a < b)
            {
                return Gcd(b, a);
            }
            while (b != 0)
            {
                var reminder = a % b;
                a = b;
                b = reminder;
            }
            return a;
        }

        //最小公倍数
        public static int Lcm(int a, int b)
        {
            return a * b / Gcd(a, b);
        }

        //文字数を数える
        public static int CountChar(string s, char c)
        {
            return s.Length - s.Replace(c.ToString(), "").Length;
        }
    }
}


Measured memory_bytes: 13268
#include <bits/stdc++.h>
#include <algorithm>
#include <math.h>
#include <string>
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)
#define INF 999999999
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );

using llong = long long;
using namespace std;

int main(){
    char n[201000];
    llong ans=0;
    cin >> n;
    int len = strlen(n);
    
    for(int i=0;i<len;i++){
        ans += n[i]-'0';
    }
    
    if(ans%9 == 0) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 3716
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct{
  int id;
  int left;
  int right;
  int parent;
  int sibling;
}tree;
tree *T;
int d = 0;
int degree(int i){
  int degree = 0;
  if(T[i].left != -1) degree++;
  if(T[i].right != -1) degree++;
  return degree;
}

int depth(int i){
  if(T[i].parent == -1) return d;
  else{
    d++;
    return depth(T[i].parent);
  }
}

int height(int i){
  int hl=0, hr=0;
  if(T[i].left != -1){
    hl++;
    hl += height(T[i].left);
  }
  if(T[i].right != -1){
    hr++;
    hr += height(T[i].right);
  }
  if(hr >= hl) return hr;
  else return hl;
}

int main(){
  int i, n, id;
  char s[20];

  scanf("%d",&n);
  T = malloc(sizeof(tree)*n);
  for(i = 0; i < n; i++){
    T[i].parent = -1;
    T[i].sibling = -1;
  }
  for(i = 0; i < n; i++){
    scanf("%d",&id);
    T[id].id = id;
    scanf("%d%d",&T[id].left, &T[id].right);
    T[T[id].left].parent = id;
    T[T[id].right].parent = id;
    T[T[id].left].sibling = T[id].right;
    T[T[id].right].sibling = T[id].left;
  }
  //print
  for(i = 0; i < n; i++){
    if(T[i].parent == -1) strcpy(s,"root");
    else if(T[i].left == -1 && T[i].right == -1) strcpy(s,"leaf");
    else strcpy(s,"internal node");
    printf("node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, %s\n", i, T[i].parent, T[i].sibling, degree(i), depth(i), height(i), s);
    d = 0;
  }
  return 0;
}

Measured memory_bytes: 600
// Author : Sarthak Kapoor
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#define rep(i,n) for(int i=0;i<n;++i)
#define repa(i,a,n) for(int i=a;i<n;++i)
#define repr(i,n) for(int i=n-1;i>=0;--i)
#define repba(i,b,a) for(int i=b;i>=a;--i)
#define repab(i,a,b) for(int i=a;i<b;++i)
#define ll long long
#define ull unsigned long long
#define vi vector<int>
#define msi map<string,int>
#define mii map<int,int>
#define viip vector<pair<int,pair<int,int> > > 
#define mp make_pair
#define vip vector<pair<int,int> >
#define pb push_back 
#define po pop_back
#define fi first
#define sec second
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define s(v) v.size()
ll mod = 1000000007;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());//use rng()%n for numbers in range [0,n-1]
ll gcd(ll a,ll b){
	if(b==0)return a;
	return gcd(b,a%b);
}
int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

	int n;
	cin>>n;
	vi v(n);
	rep(i,n){
		cin>>v[i];
	}	
	v[0]--;
	repa(i,1,n){
		if(v[i] > v[i-1])v[i]--;
		else if(v[i] == v[i-1])continue;
		else{
			cout<<"No";
			return 0;
		}
	}
	cout<<"Yes";
	return 0;
}

Measured memory_bytes: 640
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>

#define rep(i, n) for(int i=0; i<(int)(n); i++)
#define REP(i, n) for(int i=1; i<=(int)(n); i++)

using namespace std;


int main(){
    int N;
    int count = 0;
    cin >> N;
    vector<int> p(N);
    vector<int> q(N);
    rep(i, N){
        cin >> p[i];
        q[i] = i+1;
    }   

    for (int i=0; i<N; i++){
        if (abs(q[i] - p[i]) == 0){
            continue;
        }else{
            count++;
        }
    }

    if ((count == 0) || (count == 2)){
        cout << "YES" << endl;
    }else{
        cout << "NO" << endl;
    }

    return 0;
}



Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstring>
#include <cstdlib>  
#include <math.h>
#include <cmath>
#include<cctype>
#include<string>
#include<set>
#include<iomanip>
#include <map>
#include<algorithm>
#include <functional>
#include<vector>
#include<climits>
#include<stack>
#include<queue>
#include<bitset>
#include <deque>
#include <climits>
#include <typeinfo>
#include <utility> 
using namespace std;
using ll = long long;
template<typename T>using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;
const ll inf = 1LL << 60;
#define all(x) (x).begin(),(x).end()
#define puts(x) cout << x << endl
#define rep(i,m,n) for(ll i = m;i < n;++i)
#define pb push_back
#define fore(i,a) for(auto &i:a)
#define rrep(i,m,n) for(ll i = m;i >= n;--i)



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

	int A, B;
	cin >> A >> B;
	if (A <= 9 && B <= 9)puts(A*B);
	else puts(-1);
	return 0;
}


Measured memory_bytes: 256
#include <string>
#include <iostream>
using namespace std;
#define LL long long
string s;
LL k;
int main(){
	ios::sync_with_stdio(false);
	cin >> s >> k;
	int cnt = 0;
	int st = 0,len = s.length();
	while(st < len && s[st] == '1')cnt++,st++;
	if(cnt == len || cnt >= k)putchar('1');
	else putchar(s[st]);
	return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
#include "ext/pb_ds/assoc_container.hpp"
#include "ext/pb_ds/tree_policy.hpp"
#include "ext/rope"
using namespace std;
using namespace chrono;
using namespace __gnu_pbds;
using namespace __gnu_cxx;
mt19937 rng(high_resolution_clock::now().time_since_epoch().count());
mt19937_64 rngll(high_resolution_clock::now().time_since_epoch().count());
#define lambdify(x) [&](auto &&...args){ return x(forward<decltype(args)>(args)...); }
template<typename T, typename U> T &ctmax(T &x, const U &y){ return x = max<T>(x, y); }
template<typename T, typename U> T &ctmin(T &x, const U &y){ return x = min<T>(x, y); }
template<typename T> using Tree = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;



int SOLVE(){
	long long n, a, b, c, d;
	cin >> n >> a >> b >> c >> d;
	vector<long long> price(10);
	price[2] = a, price[3] = b, price[5] = c;
	map<long long, long long> cost;
	cost[0] = 0, cost[1] = d;
	static const vector<long long> qu{2, 3, 5};
	function<long long(long long)> solve = [&](long long n){
		if(cost.count(n)) return cost[n];
		long long res = __builtin_mul_overflow_p(n, d, 0LL) ? numeric_limits<long long>::max() : n * d;
		for(auto p: qu){
			int rem = n % p;
			if(rem){
				ctmin(res, min(solve((n - rem) / p) + rem * d, solve((n + p - rem) / p) + (p - rem) * d) + price[p]);
			}
			else{
				ctmin(res, solve(n / p) + price[p]);
			}
		}
		return cost[n] = res;
	};
	cout << solve(n) << "\n";
	return 0;
}

int main(){
	cin.tie(0)->sync_with_stdio(0);
	int ttt;
	cin >> ttt;
	while(ttt --){
		SOLVE();
	}
	return 0;
}

/*

*/

////////////////////////////////////////////////////////////////////////////////////////
//                                                                                    //
//                                   Coded by Aeren                                   //
//                                                                                    //
////////////////////////////////////////////////////////////////////////////////////////

Measured memory_bytes: 4492
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <unordered_map>

using namespace std;
using ll = long long;

void _cin(){} template <class Head, class... Tail> void _cin(Head&& head, Tail&&... tail){ cin >> head; _cin(forward<Tail>(tail)...); }
void _cout(){ cout << "\n"; } template <class Head, class... Tail> void _cout(Head&& head, Tail&&... tail){ cout << head; _cout(forward<Tail>(tail)...); }
int gcd(int a, int b){ return (b == 0) ? a : gcd(b, a % b); }
template<typename S, typename T> ostream& operator<<(ostream &os, const pair<S, T> &p){ cout << "[" << p.first << ", " << p.second << "]"; return os; }

#define Sq(x) (x)*(x)
#define For(i, n) for(int i = 0; i < (n); i ++)
#define Rep(n) For(_, n)
#define Range(c) c.begin(), c.end()
#define RevRange(c) c.rbegin(), c.rend()
#define Contains(c, x) (find(Range(c), x) != c.end())
#define Search(rb, re, x) distance(rb, find(rb, re, x))
#define Sort(a) sort(Range(a))
#define DeSort(a) sort(RevRange(a))
#define Reverse(c) reverse(Range(c))
#define Unique(a) a.erase(unique(Range(a)), a.end())
#define Cusum(T, xs, sxs) vector<T> sxs(xs.size()+1); For(i, (int)xs.size()) sxs[i+1] = sxs[i] + xs[i]
#define Cin(T, ...) T __VA_ARGS__; _cin(__VA_ARGS__)
#define Cins(T, n, xs) vector<T> xs(n); For(i, n) cin >> xs[i]
#define Cins2(T, n, xs, ys) vector<T> xs(n), ys(n); For(i, n) cin >> xs[i] >> ys[i]
#define Cins3(T, n, xs, ys, zs) vector<T> xs(n), ys(n), zs(n); For(i, n) cin >> xs[i] >> ys[i] >> zs[i]
#define Cinss(T, n, m, xs) Vec2(T, n, m, xs); For(i, n) For(j, m) cin >> xs[i][j]
#define Cinm(T, n, map) unordered_map<T, int> map; Rep(n){ Cin(T, x); map[x] ++; }
#define Cout(...) _cout(__VA_ARGS__)
#define Couts(xs) { for(const auto &e : xs) cout << e << " "; cout << "\n"; }
#define Coutyn(cond) Cout((cond) ? "yes" : "no")
#define CoutYn(cond) Cout((cond) ? "Yes" : "No")
#define CoutYN(cond) Cout((cond) ? "YES" : "NO")
#define Return(expr) { Cout(expr); return 0; }
#define vc vector
#define Mini(a, x) a = min(a, x)
#define Maxi(a, x) a = max(a, x)

// constexpr int MOD = 1e9+7;

int main(void){
    Cin(int, n);
    ll ans = 0;
    for(int i = 1; i <= n; i ++){
        if(i % 3 == 0 || i % 5 == 0) continue;
        ans += i;
    }
    Cout(ans);
}


Measured memory_bytes: 3636
#include<bits/stdc++.h>
using namespace std;
const int N = 2e5 + 9;
int n, v, l[N][20], r[N][20], x[N], p, f[1 << 20], g[1 << 20], dp[N];

void Max (int &x, int y) { if (x < y) x = y; }
void Min (int &x, int y) { if (x > y) x = y; }

bool Judge (int x) {
	return dp[l[x][0] - 1] <= r[x][0] + 1;
}

int main () {
	scanf("%d%d", &n, &v);
	for (int i = 1; i <= n; ++i) scanf("%d", &x[i]);
	for (p = 0; v; v >>= 1, ++p) {
		l[0][p] = l[1][p] = 1; for (int j = 2; j <= n; ++j) l[j][p] = x[j] - x[j - 1] <= v ? l[j - 1][p] : j;
		r[n + 1][p] = r[n][p] = n; for (int j = n - 1; j; --j) r[j][p] = x[j + 1] - x[j] <= v ? r[j + 1][p] : j;
	}
	for (int i = 1; i <= n; ++i) l[i][p] = r[i][p] = i;
	g[0] = n + 1;
	for (int i = 1; i < (1 << p); ++i) {
		g[i] = 0x3f3f3f3f;
		for (int j = 0; j < p; ++j) if (i >> j & 1) {
			Max(f[i], r[f[i ^ (1 << j)] + 1][j + 1]);
			Min(g[i], l[g[i ^ (1 << j)] - 1][j + 1]);
		}
	}
	for (int i = 0; i <= n; ++i) dp[i] = 0x3f3f3f3f;
	for (int i = 0; i < (1 << p); ++i) Min(dp[f[i]], g[((1 << p) - 1) ^ i]);
	for (int i = n - 1; i; --i) Min(dp[i], dp[i + 1]);
	for (int i = 1; i <= n; ++i) puts(Judge(i) ? "Possible" : "Impossible");
	return 0;
}

Measured memory_bytes: 39040
import numpy as np

S = np.array([int(x) for x in input()])

n, m = divmod(len(S), 2)

c1 = np.array([0, 1] * n + ([] if m ==0 else [0]))
c2 = np.array([1, 0] * n + ([] if m ==0 else [1]))

a1 = sum(abs(S - c1))
a2 = sum(abs(S - c2))

print(min(a1, a2))

Measured memory_bytes: 18636
#include <iostream>
#include <stdio.h>
#include <string>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <math.h>
#include <vector>
#include <algorithm>
#include <queue>
#include <stack>
#include <climits>
#include <bitset>
#include <list>

using namespace std;

typedef unsigned long long ull;
typedef long long ll;

#define mod ((ull)(1e9)+7)
#define MAX ((ull)(1e9)+1)

int main(){
	int y, m, d;
	scanf("%d/%d/%d", &y, &m, &d);
	if(m>=5) cout << "TBD" << endl;
	else cout << "Heisei" << endl;
	return 0;
}

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

typedef long long ll;
typedef long double ld;

#define MOD 1000000007
#define all(x) (x).begin(),(x).end()
#define rep(i, n) for(int i = 0; i < (int)(n); i++)

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

int main(){

    ll M;

    cin >> M;

    cout << 48 - M << endl;

    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>

using namespace std;
typedef pair<char, int> P;

string s;

int main() {
	cin >> s;
	vector<P> v;
	char c = s[0];
	int length = 1;
	for (int i = 1; i < s.size(); i++) {
		if (s[i] == c)length++;
		else {
			v.push_back(P(c, length));
			c = s[i], length = 1;
		}
	}

	v.push_back(P(c, length));
	
	int ans = 0;

	if (v.size() < 3) {
		cout << 0 << endl;
		return 0;
	}

	for (int i = 0; i < v.size() - 2; i++) {
		if (v[i].first == 'J' && v[i + 1].first == 'O' && v[i + 2].first == 'I') {
			if (v[i].second >= v[i + 1].second && v[i + 1].second <= v[i + 2].second) {
				ans = max(ans, v[i + 1].second);
			}
		}
	}
	
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 12520
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define sz(x) (int)(x).size()
#define uni(x) x.erase(unique(rng(x)),x.end())
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
#define EPS (1e-10)
#define equals(a, b) (fabs((a)-(b)) < EPS)
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
typedef set<int> S;
typedef queue<int> Q;
typedef queue<P> QP;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
typedef vector<double> vd;
typedef pair<double,double> PD;
typedef pair<int,P> ed;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
const int MOD = 1000000007;
  
int main() {
  ll N;
  cin >> N;
  ll ans = (N-1)*N/2;
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int NMAX = 50 + 10, AMAX = 50 + 10;

int N, A;
vector<int> X;
ll dp[NMAX][NMAX][NMAX * AMAX];

void abc044c() {

  for (int j = 1; j < NMAX; j++) {
    for (int k = 0; k < NMAX * AMAX; k++) {
      dp[0][j][k] = 0;
    }
  }
  dp[0][0][0] = 1;
  for (int i = 0; i < N; i++) {
    for (int j = 0; j <= N; j++) {
      for (int k = 0; k <= N * A; k++) {
        if (k >= X[i] && j >= 1) {
          dp[i + 1][j][k] = dp[i][j][k] + dp[i][j - 1][k - X[i]];
        }
        else {
          dp[i + 1][j][k] = dp[i][j][k];
        }
      }
    }
  }
  ll ans = 0;
  for (int j = 1; j <= N; j++) {
    ans += dp[N][j][j * A];
  }
  cout << ans << '\n';
  return;
}

int main() {
  cin >> N >> A;
  X.resize(N);
  for (int i = 0; i < N; i++) {
    cin >> X[i];
  }
  abc044c();
  return 0;
}

Measured memory_bytes: 86144
#include<iostream>
#include<string>
#include<vector>
using namespace std;
int main(){
	int a, b, c;
	cin >> a >> b >> c;

	if (a > b){
		if (a > c){
			if (c > b){
				cout << "Yes" << endl;
			}
			else{
				cout << "No" << endl;
			}
		}
		else{
			cout << "No" << endl;
		}
	}

	else if (a < b){
		if (a < c){
			if (c < b){
				cout << "Yes" << endl;
			}
			else{
				cout << "No" << endl;
			}
		}
		else{
			cout << "No" << endl;
		}
	}


	return 0;
}

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

namespace ABC143C_Slimes
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            string s = Console.ReadLine();

            bool flag = false;
            int count = 0;
            for (int i = 0; i < s.Length - 1; i++) 
            {
                if (s[i] == s[i + 1])
                {
                    flag = true;
                }
                else
                {
                    flag = false;
                }
                if (!flag)
                {
                    count++;
                }
            }

            Console.WriteLine(count + 1);
        }
    }
}


Measured memory_bytes: 11360
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
        long sum = 0;
        List<Integer> s_array = new ArrayList<>();
        for(int i= 0; i < N; i++) {
            int s = scan.nextInt();
            sum += s;
            s_array.add(s);
        }
        if(sum % 10 != 0) {
            System.out.println(sum);
            return;
        }
        s_array.sort(Integer::compareTo);
        Optional<Integer> first = s_array.stream().filter(data -> data % 10 != 0).findFirst();
        if (first.isPresent()) {
            System.out.println(sum - first.get());
        }
        else {
            System.out.println(0);
        }
    }
}


Measured memory_bytes: 26580