akhauriyash/Code-Regression huggingface dataset:
a, b,c, k = list(map(int, input().split()))

s = [a, a+b, a+b+c]
ans = [a, a, a-c]

if k <= a:
    print(k)
    
elif a + b >= k:
    print(a)

else:
    print(a - (k - (a + b)))

Measured memory_bytes: 9180
# Ýć x^n
def pow(x,n):
    global p
    res=1
    prod=x
    while n>0:
        if n%2==1:
            res=(res*prod)%p
        prod=(prod*prod)%p
        n//=2
    return res

# t x^(-1)
def inv(x):
    global p
    res=1
    prod=x
    e=p-2
    while e>0:
        if e%2==1:
            res=(res*prod)%p
        prod=(prod*prod)%p
        e//=2
    return res

# Kć x!
def fact(x):
    if x<1:
        return 1
    global p
    res=1
    for i in range(2, x+1):
        res=(res*i)%p
    return res
    
# gš nCr
def combi(n,r):
    if r<0 or r>n:
        return 0
    else:
        a=fact(n)
        b=inv(fact(r))
        c=inv(fact(n-r))
        return(((a*b)%p)*c)%p

p=10**9+7
X,Y=map(int,input().split())
if (X+Y)%3!=0 or 2*X<Y or 2*Y<X:
    ans=0
else:
    a=(2*X-Y)//3
    b=(-X+2*Y)//3
    ans=combi(a+b,a)
print(ans)

Measured memory_bytes: 3064
#include <bits/stdc++.h>  // This will work only for g++ compiler.
#define for0(i, n) for (int i = 0; i < (int)(n); ++i) // 0 based indexing
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i) // 1 based indexing
#define forab(i, l, r) for (int i = (int)(l); i <= (int)(r); ++i) // closed interver from l to r r inclusive
#define forr0(i, n) for (int i = (int)(n) - 1; i >= 0; --i) // reverse 0 based.
#define forr1(i, n) for (int i = (int)(n); i >= 1; --i) // reverse 1 based
#define pb push_back
#define fi first
#define se second
#define __builtin_popcount(x) ones(x)
#define __builtin_popcountl(x) onesl(x)
#define __builtin_popcountll(x) onesll(x)// to be used with algorithms that processes a container Eg: find(all(c
#define all(x) (x).begin(), (x).end() //Forward traversal
#define rall(x) (x).rbegin, (x).rend() //reverse traversal
#define tr(c,i) for(__typeof__((c)).begin() i = (c).begin(); i != (c).end(); i++)
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define sz(a) int((a).size())
#define Fast ios_base::sync_with_stdio(false); cin.tie(NULL);
#define InputOuput freopen("input.txt", "r", stdin); freopen("output.txt","w", stdout);
using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;
typedef vector<pii> vpii;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
ll inf = 1e9 +5;
ll recur( vvll &dp, ll i, ll j , vll &value, vll& weight){
    if(i<0) return INT_MIN;
    if(j == 0) return 0;

    if( dp[i][j] == -1){
        dp[i][j] = max( recur(dp, i-weight[j], j-1,value, weight) + value[j] , recur(dp,i, j-1 , value, weight));
    }
    return dp[i][j];
}
int main(){
    //InputOuput;
    Fast;
    int n ,tot; cin >> n >> tot ;
    vll w(n+1,0);
    vll v(n+1, 0); for1(i,n) cin >> w[i] >> v[i];
    vvll dp(tot+1, vll(n+1, -1));
    cout << recur(dp, tot, n, v, w)<<'\n';
    return 0;

}

Measured memory_bytes: 85068
import java.util.*;
public class Main {
	
	public static void main (String[]args) {
		Scanner sc = new Scanner(System.in);
		
		int N =  sc.nextInt();

        List<Integer>inputList = new ArrayList<Integer>();
        // 入力値分入力を求める	
		for (int i = 0; i < N;i++) {
		
			int num = sc.nextInt();
		
			inputList.add(num);
		}

        // 入力値の重複を削除
         List<Integer> listB = new ArrayList<Integer>(new HashSet<>(inputList));
		
        // 要素数を出力
        System.out.println(listB.size());
	}	


}

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

#define MOD_1_000_000_007 (1000000007LL)
#define LINF (1LL<<60)
#define rep(i, n)   for (long long i = 0; i <  (long long)(n); i++)
#define rep1(i, n)  for (long long i = 1; i <  (long long)(n); i++)
#define rep2(i, n)  for (long long i = 2; i <  (long long)(n); i++)
#define rep0c(i, n) for (long long i = 0; i <= (long long)(n); i++)
#define rep1c(i, n) for (long long i = 1; i <= (long long)(n); i++)
#define rep2c(i, n) for (long long i = 2; i <= (long long)(n); i++)
#define repc0(n, i) for (long long i = (long long)(n); i >= 0; i--)
#define repc1(n, i) for (long long i = (long long)(n); i >= 1; i--)
#define repc2(n, i) for (long long i = (long long)(n); i >= 2; i--)

namespace solver {
  using namespace std;
  typedef long long ll;

  ll N, M, A[110], total;

  void init() {
    scanf("%lld %lld", &N, &M);
    rep(i, N) {
      scanf("%lld", &A[i]);
      total += A[i];
    }
  }

  void solve() {
    double lb = ((double)total)/((double)4*M);
    ll count = 0;
    rep(i, N) if(A[i] >= lb) count++;
    if(count >= M) printf("Yes\n");
    else printf("No\n");
  }
}

int main() {
  solver::init();
  solver::solve();
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
#define MOD 1000000007  
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds;   
#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update> 
//find_by_order(k) - k is the kth element of the set
//order_of_key(k) - Number of elements striclty samller than k
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n,m;
    cin>>n>>m;
    vector<ll> bulb[m];
    for(int i=0;i<m;i++)
    {
        ll k;
        cin>>k;
        for(int j=0;j<k;j++)
        {
            ll a;
            cin>>a;
            bulb[i].pb(a);
        }
    }
    ll p[m];
    for(int i=0;i<m;i++)
    {
        cin>>p[i];
    }
    ll a=0,b=pow(2,n)-1;
    ll cnt=0;
   // cout<<a<<" "<<b<<endl;
    for(int i=a;i<=b;i++)
    {
        vector<ll> v;
        int y=i;
        while(y!=0)
        {
            ll c=y%2;
            v.pb(c);
            y/=2;
        }
        int flag=0;
        for(int j=0;j<m;j++)
        {
            int r=0;
            for(int k=0;k<bulb[j].size();k++)
            {
         //       cout<<bulb[j][k]<<endl;
                if(bulb[j][k]>v.size())
                    continue;
                else if(v[bulb[j][k]-1]==1)
                    r++; 
            }
            if(r%2==p[j])
                continue;
            else if(r%2!=p[j])
            {
                flag=1;
                break;
            }
        }
        if(flag==0)
            cnt++;
    }
    cout<<cnt<<endl;
}


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

point = 0
prev = 0
for index, dish in enumerate(dishes):
	if index==0:
		point += b[dish-1]
	else:
		if prev+1 == dish:
			point += (b[dish-1]+c[prev-1])
		else:
		 	point += b[dish-1]
	prev = dish

print(point)

Measured memory_bytes: 3064
// atcoder/sumitrust2019/F/main.cpp
// author: @___Johniel
// github: https://github.com/johniel/

#include <bits/stdc++.h>

#define each(i, c) for (auto& i : c)
#define unless(cond) if (!(cond))

using namespace std;

template<typename P, typename Q> ostream& operator << (ostream& os, pair<P, Q> p) { os << "(" << p.first << "," << p.second << ")"; return os; }
template<typename P, typename Q> istream& operator >> (istream& is, pair<P, Q>& p) { is >> p.first >> p.second; return is; }
template<typename T> ostream& operator << (ostream& os, vector<T> v) { os << "("; for (auto& i: v) os << i << ","; os << ")"; return os; }
template<typename T> istream& operator >> (istream& is, vector<T>& v) { for (auto& i: v) is >> i; return is; }
template<typename T> ostream& operator << (ostream& os, set<T> s) { os << "#{"; for (auto& i: s) os << i << ","; os << "}"; return os; }
template<typename K, typename V> ostream& operator << (ostream& os, map<K, V> m) { os << "{"; for (auto& i: m) os << i << ","; os << "}"; return os; }

template<typename T> inline T setmax(T& a, T b) { return a = std::max(a, b); }
template<typename T> inline T setmin(T& a, T b) { return a = std::min(a, b); }

using lli = long long int;
using ull = unsigned long long;
using point = complex<double>;
using str = string;
template<typename T> using vec = vector<T>;

constexpr array<int, 8> di({0, 1, -1, 0, 1, -1, 1, -1});
constexpr array<int, 8> dj({1, 0, 0, -1, 1, -1, -1, 1});
constexpr lli mod = 1e9 + 7;

int main(int argc, char *argv[])
{
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.setf(ios_base::fixed);
  cout.precision(15);

  lli t1, t2, a1, a2, b1, b2;
  while (cin >> t1 >> t2 >> a1 >> a2 >> b1 >> b2) {
    if (t1 * a1 + t2 * a2 == t1 * b1 + t2 * b2) {
      cout << "infinity" << endl;
      continue;
    }

    lli x = a1 - b1;
    lli y = a2 - b2;
    if ((0 <= x && 0 <= y) || (x <= 0 && y <= 0)) {
      cout << 0 << endl;
      continue;
    }

    // cout << x << ' ' << y << endl;
    x *= t1;
    y *= t2;
    // cout << x << ' ' << y << endl;
    lli z = abs(abs(x) - abs(y));
    // cout << z << endl;
    // cout << abs(x) / z << endl;
    // cout << abs(y) / z << endl;
    if (abs(x) > abs(y)) {
      cout << "0" << endl;
      continue;
    }
    cout << abs(x) / z * 2 + bool(abs(x) % z) << endl;
  }

  return 0;
}


Measured memory_bytes: 3632
#include <stdlib.h>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <numeric>
#include <queue>
#include <vector>

using namespace std;

bool compare_F(pair<int, int> a, pair<int, int> b) {
  if (a.first != b.first) {
    return a.first < b.first;
  } else {
    return a.second > b.second;
  }
}

bool compare_S(pair<int, int> a, pair<int, int> b) {
  if (a.second != b.second) {
    return a.second > b.second;
  } else {
    return a.first > b.first;
  }
}

template <typename T>
void ArrayInput(vector<T> &A) {
  for (auto itr = A.begin(); itr != A.end(); ++itr) {
    cin >> *itr;
  }
}
template <typename T>
void ArrayPut(vector<T> &A) {
  for (auto itr = A.begin(); itr != A.end(); ++itr) {
    cout << *itr << " ";
  }
  cout << endl;
}

using Graph = vector<vector<uint32_t>>;
vector<bool> seen;
vector<uint32_t> dis, A_dis, T_dis;

void dfs(Graph &G, uint32_t v) {
  seen[v] = true;

  for (auto itr = G[v].begin(); itr != G[v].end(); ++itr) {
    if (seen[*itr]) continue;
    dis[*itr] = dis[v] + 1;
    dfs(G, *itr);
  }
}

int main() {
  uint64_t A, B, K;
  cin >> A >> B >> K;
  if (A > K) {
    cout << A - K << " " << B;
  } else {
    K -= A;
    if (B > K) {
      cout << 0 << " " << B - K;
    } else {
      cout << 0 << " " << 0;
    }
  }

  return 0;
}


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

typedef long long ll;

#define REP(i,n) for(ll i=0;i<n;i++)
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define FORR(i,a,b) for(ll i=b-1;i>=a;i--)

#define vl vector<ll>
#define pll pair<ll,ll>

#define DEBUG(x) cout<<#x<<": "<<x<<endl

using namespace std;
/*}}}*/

int main() {
  ll n;
  cin >> n;
  ll ans = 1000 - n%1000;
  if(ans==1000) ans = 0;
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3632
"use strict"
const Main = (input)=>{
  let xs = input.trim().split("\n");
  let a = xs[0];
  let s = xs[1];
  
  if(a >= 3200){
  console.log(s);  
  }else{
    console.log("red");
  }  
}
Main(require("fs").readFileSync("/dev/stdin","utf8"));


Measured memory_bytes: 7372
import java.util.Scanner;

public class Main {

	static Scanner scanner;

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

	    //int n=gi();
	    int k=gi();
	    
        //System.out.println(n-k+1);
        if (k%2==0) {
        	System.out.print(k*k/4);
        }else {
        	System.out.print(((k-1)/2) * ((k+1)/2));
        }


	}

	// 文字列として入力を取得
	public static String gs() {
		return scanner.next();
	}

	// intとして入力を取得
	public static int gi() {
		return Integer.parseInt(scanner.next());
	}

	// longとして入力を取得
	public static long gl() {
		return Long.parseLong(scanner.next());
	}

	// doubleとして入力を取得
	public static double gd() {
		return Double.parseDouble(scanner.next());
	}
}

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

using namespace std;
using ll = long long;
using pii = pair<int, int>;


int N, K;
int V[51];


int main(){

    cin >> N >> K;
    for(int i = 0; i < N; i++) cin >> V[i];
    // l回取る
    // r回取る
    // K - (l + r) 回戻す
    ll ans = -(1LL << 60);
    for(int l = 0; l <= N; l++){
        for(int r = 0; r <= N && (l + r) <= K; r++){
            for(int back = 0; back <= max(0, K - (l + r)); back++){
                deque<int> dq;
                for(int i = 0; i < N; i++) dq.push_back(V[i]);
                // int back = max(0, K - (l + r));
                priority_queue<int, vector<int>, greater<int> > pq;
                for(int i = 0; i < l; i++){
                    if(dq.size()){
                        pq.push(dq.front());
                        // if(l == 1 && r == 4 && back == 0){
                        //     cout << dq.front() << endl;
                        // }
                        dq.pop_front();
                    }
                }
                for(int i = 0; i < r; i++){
                    if(dq.size()){
                        pq.push(dq.back());
                        dq.pop_back();
                    }
                }
            
                for(int i = 0; i < back; i++){
                    if(pq.size()){
                        pq.pop();
                    }
                }
                ll sum = 0;
                while(pq.size()){
                    sum += pq.top();
                    pq.pop();
                }
                // if(sum == 17){
                //     cout << l << " " << r << " " << back << endl;
                    
                // }
                ans = max(ans, sum);
            }
        }
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 384
from collections import Counter

X = int(input())

l = [0]
i = 0
while i**5 - (i-1)**5 <= X:
    i+=1
    l.append(i**5)

for i in l:
    if Counter(l)[X - i]==1:
        print(l.index((X-i)), -l.index(i))
        quit()
    if Counter(l)[X + i]==1:
        print(l.index(X+i), l.index(i))

Measured memory_bytes: 9424
n = input()
a = list(map(int, input().split()))
break_flg = False
total = 0
while True:
  for i, b in enumerate(a):
    if b%2 == 0:
      a[i] = b/2
    else:
      break_flg = True
  if break_flg :
    break
  else:
    total += 1
print(total)


Measured memory_bytes: 2940
#include <bits/stdc++.h>
#define rep(i, a) for(int i = 0; i < a; i++)
#define all(v) v.begin(), v.end()
#define dcout cout << fixed << setprecision(15)
#define arep(i, a) for(auto i : a)
#define F first
#define S second
#define VE vector<int>
#define pb(x) push_back(x)
#define MOD 1000000007
#define INF 10000000000
#define int long long
#define KETA(n) floor(log10(n) + 1)
using namespace std;
signed main() {
    int a, b, n;
    cin >> a >> b >> n;
    int q;
    if(n < b - 1)
        q = n;
    else
        q = b - 1;
    cout << a * q / b << endl;
    return 0;
}

Measured memory_bytes: 3636
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
from collections import deque

def main():
    N, *ab = map(int, read().split())
    E = [[] for _ in range(N + 1)]
    edge_order = []
    
    for a, b in zip(*[iter(ab)] * 2):
        E[a].append(b)
        edge_order.append(b)
    
    # 頂点1から幅優先探索
    queue = deque([1])
    color = [0] * (N+1) 
    while queue:
        V = queue.popleft()
        c = 1
        for i in E[V]:
            if c == color[V]:
                c += 1
            color[i] = c
            c += 1
            queue.append(i)

    print(max(color))
    for i in edge_order:
        print(color[i])


if __name__ == "__main__":
    main()


Measured memory_bytes: 23404
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <queue>
using ll = long long;
using graph = std::vector<std::vector<ll>>;

using namespace std;

int main() {
    ll N;
    cin >> N;
    vector<pair<ll,ll>> A(N);
    for(int i = 0; i < N; i++){
        ll tmp;
        cin >> tmp;
        A[i] = make_pair(tmp,i);
    }
    vector<pair<ll,ll>> B = A;
    sort(B.begin(),B.end());
    pair<ll,ll> m = B[0];
    pair<ll,ll> M = B[N-1];
    if(0 <= m.first){
        cout << N - 1 << endl;
        for(int i = 0; i < N - 1; i++){
            cout << i + 1 << " " << i+2 << endl;
        }
        return 0;
    }
    if(M.first <= 0){
        cout << N - 1 << endl;
        for(int i = 0; i < N - 1; i++){
            cout << N - i << " " << N - i - 1 << endl;
        }
        return 0;
    }
    cout << 2 * N - 2 << endl;
    if(abs(m.first) > abs(M.first)){
        int targetIndex = m.second;
        for(int i = 0; i < N; i++){
            if(i != targetIndex){
                cout << targetIndex + 1 << " " << i + 1 << endl;
            }
        }
        for(int i = 0; i < N - 1; i++){
            cout << N - i << " " << N - i - 1 << endl;
        }
    }else{
        int targetIndex = M.second;
        for(int i = 0; i < N; i++){
            if(i != targetIndex){
                cout << targetIndex + 1 << " " << i + 1 << endl;
            }
        }
        for(int i = 0; i < N - 1; i++){
            cout << i + 1 << " " << i+2 << endl;
        }
    }
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip> // << fixed << setprecision(xxx)
#include <algorithm> // do { } while ( next_permutation(A, A+xxx) ) ;
#include <vector>
#include <string> // to_string(nnn) // substr(m, n) // stoi(nnn)
#include <complex>
#include <tuple> // get<n>(xxx)
#include <queue>
#include <stack>
#include <map> // if (M.find(key) != M.end()) { }
#include <set> // S.insert(M);
// if (S.find(key) != S.end()) { }
// for (auto it=S.begin(); it != S.end(); it++) { }
// auto it = S.lower_bound(M);
#include <random> // random_device rd; mt19937 mt(rd());
#include <cctype>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib> // atoi(xxx)
using namespace std;

#define DEBUG 0 // change 0 -> 1 if we need debug.
// insert #if<tab> by my emacs. #if DEBUG == 1 ... #end

typedef long long ll;

// const int dx[4] = {1, 0, -1, 0};
// const int dy[4] = {0, 1, 0, -1};

// const int C = 1e6+10;
// const ll M = 1000000007;

int main () {
  int N;
  int t[100010], x[100010], y[100010];
  cin >> N;
  t[0] = x[0] = y[0] = 0;
  for (auto i = 1; i <= N; ++i) {
    cin >> t[i] >> x[i] >> y[i];
  }
  for (auto i = 0; i < N; ++i) {
    int T = t[i+1] - t[i];
    int dist = abs(x[i+1] - x[i]) + abs(y[i+1] - y[i]);
    if (T >= dist && (T-dist)%2 == 0) {
      
    } else {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
}


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

namespace ConsoleApp5
{

    class Program
    {
        static void Main(string[] args)
        {
            String S = Console.ReadLine();
            String[] line = S.Split(' ');

            int A = int.Parse(line[0]);
            int P = int.Parse(line[1]);

            P = P + A * 3;

            Console.WriteLine(P / 2);
           
        }
    }
}

Measured memory_bytes: 13140
#include <bits/stdc++.h>
#include <string>
#include <cstring>
#include <algorithm>
#include <math.h>
#include <map>
#include <bitset>
#include <cmath>
#include <set>
#include <utility>

#define INF 1000000000000
#define MOD 1000000007 //10^9+7:合同式の法

using namespace std;
typedef long long ll;

//マクロ
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)


int main(){
    int N,goukei=0;
    cin >> N;
    bool fla = false;

    while(N > 0){
        if(N % 4 == 0 or N % 7 == 0){
            fla = true;
            break;
        }else{
            N -= 7;
        }
    }

    if(fla)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;

}

Measured memory_bytes: 3636
#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    string tenki;
    cin >> tenki;
    if (tenki=="Sunny"){
        cout << "Cloudy";
    }else if(tenki=="Cloudy"){
        cout << "Rainy";
    }else if(tenki=="Rainy"){
        cout << "Sunny";
    }
}

Measured memory_bytes: 256
#include<iostream>
#include<math.h>
#include<string>
#include<iomanip>
#include<bits/stdc++.h>
#include<cstdio>
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL)
#define bll __builtin_popcountll
#define bufclr while((getchar())!='\n')
#define bufcl int ws=cin.get()
#define bl "\n"
#define mp make_pair
#define pb push_back
#define ll long long int
#define UI unsigned int
#define mod  1000000007 /*998244353*/ 
//#define fs first
//#define sc second
#define fora(i,a,x) for(int i=a; i<x; ++i)
#define fors(i,x,a) for(int i=x; i>a; --i)
using namespace std;
void op(){
    #ifndef ONLINE_JUDGE
    freopen("input.txt" , "r" , stdin);
    freopen("output.txt" , "w" , stdout);
    #endif
}
int C(pair<int,int> &a ,pair<int,int> &b){
    return a.first<b.first;
}
void dfs(vector<vector<int> > &vec, int i,int nw, int k,int n){
    //cout<<nw;
    ll res=1;
    if(i==n && nw==k){
        res = (res + 1)%mod;
        return;
    }
    else if(nw>k)
        return;
    else{
    //    vis[i]=1;
        for(auto itr: vec[i]){
         dfs(vec,itr,nw+1,k,n);    
    }
}    

    }
    

long long power(long long x, int y) 
{ 
    long long res = 1;    
   
    while (y > 0) 
    { 
      
        if (y & 1) 
            res = (res*x)%mod; 
   
        y = y>>1; 
        x = (x*x)%mod;  
    } 
    return res%mod; 
}

int main(){
	op();
	string st;
	cin>>st;
	int n = st.length();
	if(st[n-1]=='s')
		cout<<st + "es";
	else
		cout<<st + "s";
}


        





            


Measured memory_bytes: 3600
#include <bits/stdc++.h>
#define repr(i,from,to) for(int (i)=(from);(i)<(to);(i)++)
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
// const bool debug=true;
const bool debug=false;
#define DEBUG if(debug==true)
#define vprint(x) for(auto a:(x)) cout << x << endl;
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const ll MOD = 1000000007;

int main(void) {
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s,t;cin>>s>>t;
    int lens=s.size(),lent=t.size();
    int dp[lens+1][lent+1]={};
    rep(i,lens){
        rep(j,lent){
            if(s[i]==t[j]){
                dp[i+1][j+1]=dp[i][j]+1;
            }
            else if(dp[i+1][j]>dp[i][j+1]){
                dp[i+1][j+1]=dp[i+1][j];
            }else{
                dp[i+1][j+1]=dp[i][j+1];
            }
        }
    }
    string res = "";
    int cnt=dp[lens][lent];
    int curs=lens,curt=lent;
    while(cnt>0){
        if(dp[curs][curt]==dp[curs][curt-1]){
            curt--;
        }else if(dp[curs][curt]==dp[curs-1][curt]){
            curs--;
        }
        else if(dp[curs][curt]==1+dp[curs-1][curt-1]){
            res.insert(res.begin(),s[curs-1]);
            curs--;
            curt--;
            cnt--;
        }
    }
    cout << res << endl;
    return 0;
}


Measured memory_bytes: 35456
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int sz = 4e5+5, mod = 1e9+7;

ll n, dp[sz], cnt[sz], ans[sz];
vector <int> g[sz];

ll fac[sz], finv[sz], inv[sz];

void prec()
{
    inv[0] = inv[1] = 1;
    for(int i=2; i<sz; i++)
        inv[i] = mod - mod / i * inv[mod % i] % mod;
    fac[0] = finv[0] = 1;
    for(int i=1; i<sz; i++) {
        fac[i] = fac[i-1] * i % mod;
        finv[i] = finv[i-1] * inv[i] % mod;
    }
}

ll cmb(int n, int r)
{
    ll d = finv[r] * finv[n-r] % mod;
    return fac[n] * d % mod;
}

ll invmod(ll b)
{
    ll ans = 1, n = mod - 2;
    while(n) {
        if(n&1) ans = (ans * b) % mod;
        n >>= 1;
        b = (b * b) % mod;
    }
    return ans;
}

void get(int u = 1, int p = 0)
{
    dp[u] = 1;
    cnt[u] = 0;
    for(int v : g[u]) if(v - p) {
        get(v, u);

        dp[u] = dp[u] * dp[v] % mod;

        cnt[u] += cnt[v];
        dp[u] *= cmb(cnt[u], cnt[v]);
        dp[u] %= mod;
    }
    cnt[u]++;
}

void dfs(int u = 1, int p = 0, ll upv = 1)
{
    ans[u] = dp[u] * upv % mod;
    ans[u] = ans[u] * cmb(n-1, n-cnt[u]) % mod;
    for(int v : g[u]) if(v - p) {
        ll now = ans[u] * invmod(dp[v]) % mod;
        now = now * invmod(cmb(n-1, n-1-cnt[v])) % mod;
        dfs(v, u, now);
    }
}

int main()
{
    prec();

    cin >> n;
    for(int i=1; i<n; i++) {
        int u, v;
        scanf("%d %d", &u, &v);
        g[u].push_back(v);
        g[v].push_back(u);
    }

    get();

    dfs();

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


Measured memory_bytes: 35828
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define rep(i,a,b) for(i=a;i<b;i++)
ll int large=(ll int)1e13+7;
ll int mod=(ll int)1e9+7;
ll int const N=(ll int)1e6+10;

ll int mod_exp(ll int x,ll int n)
{
    ll int result=1;
    while(n>0)
    {
        if(n%2==1)
            result=(result*x)%mod;
        x=(x*x)%mod;
        n=n/2;
    }
    return result;
}

ll int mod_inverse(ll int a)
{
    return mod_exp(a,mod-2);
}



int main()
{
ios_base::sync_with_stdio(false);
    cin.tie(NULL);
ll int T,i,j,ij;
T=1;
//cin>>T;
while(T--)
{
  ll int n;
  cin>>n;
  ll int a[n];
  rep(i,0,n)
  cin>>a[i];
  ll int sum=0;
  rep(i,0,n)
  sum+=a[i];
  ll int has[100007]={0};
  rep(i,0,n)
  has[a[i]]++;
  ll int q;
  cin>>q;
  while(q--)
  {
      ll int x,y;
      cin>>x>>y;
      sum+=has[x]*(y-x);
      has[y]+=has[x];
      has[x]=0;
      cout<<sum<<endl;
  }


}
return 0;
}
















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

int main() {
  string S;
  cin >> S;
  
  int count = 0;
  if (S.size() % 2 != 0) {
    cout << "No" << endl;
  }
  else {
    for (int i = 0; i < S.size() - 1; i += 2) {
      string T;
      T = S.at(i);
      T = T + S.at(i + 1);
      if (T != "hi") {
        count++;
      }
    }
    
    if (count == 0) {
      cout << "Yes" << endl;
    }
    else {
      cout << "No" << endl;
    }
    
  }
  

}

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

using namespace std;

const int OO = 1e9;
const double EPS = 1e-9;

#define ndl cout << '\n'
#define sz(v) int(v.size())
#define pb push_back
#define mp make_pair
#define fs first
#define sc second
#define present(a, x) (a.find(x) != a.end())
#ifdef LOCAL
#define db(...) ({cout << "> Line " << __LINE__  \
		<< ": "; _db(#__VA_ARGS__, __VA_ARGS__);})
#define RNG() rng()
#else
#define db(...) true
#define RNG() true
#endif

template<class T>
void _db(const char *dbStr, T e) {
	cout << dbStr << " = " << e << endl;
}
template<class T, class... L>
void _db(const char *dbStr, T e, L... r) {
  while(*dbStr != ',') cout << *dbStr++;
  cout << " = " << e << ','; _db(dbStr + 1, r...);
}
template<class S, class T>
ostream& operator<<(ostream& o, const map<S, T>& v) {
	o << "["; int i = 0;
	for (const pair<S, T>& pr : v) o << (!i++ ? "" : ", ") << "{"
	<< pr.fs << " : " << pr.sc << "}"; return o << "]";
}
template<template <class, class...> class S, class T, class... L>
ostream& operator<<(ostream& o, const S<T, L...>& v) {
	o << "["; int i = 0;
	for (const auto& e : v) o << (!i++ ? "" : ", ") << e;
	return o << "]";
}
template<class S, class T>
ostream& operator<<(ostream& o, const pair<S, T>& pr) {
	return o << "(" << pr.fs << ", " << pr.sc << ")";
}
ostream& operator<<(ostream& o, const string& s) {
	for (const char& c : s) o << c;
	return o;
}

template<class T> using V = vector<T>;
template<class T> using VV = V<V<T>>;
template<class T> using VVV = VV<V<T>>;
using ll = long long;
using pii = pair<int, int>;
using vi = V<int>;
using vii = V<pii>;
using vvi = VV<int>;
using mii = map<int, int>;
using umii = unordered_map<int, int>;
using si = set<int>;
using usi = unordered_set<int>;





int main() {
	#ifdef LOCAL
	auto stTime = clock();
//	freopen("in.txt", "r", stdin);
	mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
	#endif
	ios::sync_with_stdio(false);
	cout.precision(10);
	cin.tie(0);

	int A, B;

	cin >> A >> B;

	cout << A * B << '\n';



	#ifdef LOCAL
	cout << "\n\n\nExecution time: " <<
		(clock() - stTime) * 1e3 / CLOCKS_PER_SEC << " ms" << endl;
	#endif
	return 0;
}


Measured memory_bytes: 3608
s=input()
t=input()
n=len(s)



sl=list(s)

sl.sort()
sl=''.join(sl)

a=''
for i in range(n):
    if(sl[i]==a):continue
    a=sl[i]
    b=t[s.index(a)]
    s=s.translate(str.maketrans({a:b,b:a}))
    sl=sl.translate(str.maketrans({a:b,b:a}))
    

if(s==t):print("Yes")
else:print("No")


Measured memory_bytes: 5952
#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <functional>
#include <cstring>
#include <string>
#include <map>
#include <set>
#include <iostream>
#include <ctime>
#include <complex>

#define enp 	printf("**Entry Point**\n")
#define A		first
#define B		second
#define MP		make_pair

using namespace std;

typedef long long ll;

const int INF = 0x6fffffff;
const int MINF = 0x80000000;
const ll mod = 100003;
const int cons = 100001;
const double pi = 3.141592653589793;

int a[101];

int main()
{
	int k, t;
	scanf("%d%d", &k, &t);

	for (int i = 0; i < t; i++)
	{
		scanf("%d", &a[i]);
	}

	sort(a, a + t);

	int sum = 0;

	for (int i = 0; i < t - 1; i++)
	{
		sum += a[i];
	}

	if (a[t - 1] - sum > 1)printf("%d\n", a[t - 1] - sum - 1);
	else puts("0");

	return 0;
}

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

int main()
{
    ios::sync_with_stdio(false);
    
    int ans = 0,n,temp=0;
    cin >> n;
    vector<int> v(n);

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

    for(int i = n-1; i > 0; i--){
        for(int j = i-1; j >= 0; j--){
            if(v[i] >= v[j])
                temp++;
        }
        if(temp == i)
            ans++;
        temp = 0;
    }

    cout<<ans+1<<endl;

    return 0;
}

Measured memory_bytes: 256
/********************************************************
  **░██████╗██╗░░░░░░█████╗░██╗░░░██╗██╗░█████╗░░██████╗░**
  **██╔════╝██║░░░░░██╔══██╗██║░░░██║██║██╔══██╗██╔════╝░**
  **╚█████╗░██║░░░░░███████║╚██╗░██╔╝██║██║░░╚═╝██║░░██╗░**
  **░╚═══██╗██║░░░░░██╔══██║░╚████╔╝░██║██║░░██╗██║░░╚██╗**
  **██████╔╝███████╗██║░░██║░░╚██╔╝░░██║╚█████╔╝╚██████╔╝**
  **╚═════╝░╚══════╝╚═╝░░╚═╝░░░╚═╝░░░╚═╝░╚════╝░░╚═════╝░**
  *********************************************************/
 
#include <bits/stdc++.h>
using namespace std;
 
 
#define ll                          long long
#define ld                          long double
 
#define forn(i,n)                   for(int i=0;i<n;++i)
#define all(v)                      v.begin(), v.end()
#define rall(v)                     v.rbegin(),v.rend()
#define isSubstring(s1,s2)          s1.find(s2) != std::string::npos
	
#define pb                          push_back
#define pf                          push_front
#define mp                          make_pair
#define fr                          first
#define sc                          second
 
#define vpi                         vector<pair<int,int>>
#define vi                          vector<int>
#define sz(a)                       (int)a.size()
 
#define   endl                       "\n"
#define     nl                       cout<<"\n";
#define fastio                       ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
 
#define  MN                           INT_MIN
#define  MX                           INT_MAX

bool isPrime(ll n){if(n<2)return false;for(ll x = 2;x*x <=n;x++){if(n%x == 0)return false;}return true;}
bool isPerfectSquare(long double x){long double sr=sqrt(x);return((sr-floor(sr))==0);}
int gcd(int a, int b){if(a==0)return b;if(b==0) return a;if(a==b)return a;if(a>b)return gcd(a-b,b);return gcd(a,b-a);}

int32_t main()
{
	int n,d;
	cin >> n >> d;
	int x[n][d];
	for(int i=  0;i<n;i++)
	{
		for(int j = 0;j<d;j++)
			cin >> x[i][j];
	}
	int ans = 0;
	for(int i = 0;i<n - 1;i++)
	{
		for(int j = i + 1 ;j < n;j++)
		{
			int dist = 0;
			for(int k = 0 ; k < d;k++)
			{
				dist += (x[i][k] - x[j][k]) *  (x[i][k] - x[j][k]);
			}
			if(isPerfectSquare(dist))ans++;
		}
	}
	cout << ans << endl;
}

Measured memory_bytes: 3628
#include <iostream>

using namespace std;

int main()
{  
    string S;
    cin>>S;
    if(S[2]==S[3]&&S[4]==S[5]){
    cout<<"Yes";}
     else{
        cout<<"No";}
  
   
   
   
   
   
   
   
   
   
   
   
   
    return 0;
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <list>
#include <vector>
#include <queue>
#include <algorithm>
#include <climits>
#include <cstring>
#include <cmath>
#include <stack>
#include <iomanip>
#include <tuple>
#include <functional>
#include <deque>
#include <bitset>

#define int long long
#define CONTAINS(v,n) (find((v).begin(), (v).end(), (n)) != (v).end())
#define SORT(v) sort((v).begin(), (v).end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
#define ARY_SORT(a, size) sort((a), (a)+(size))
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
#define REMOVE(v,a) v.erase(remove(v.begin(), v.end(), a), v.end())
#define REP(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define REPE(i, n) for (int (i) = 0; (i) <= (n); (i)++)
using namespace std;

int N, M;
int P[100001];
vector<int> link[100001];
int flg[100001];


signed main()
{
	cin >> N >> M;
	REP(i, N)
	{
		cin >> P[i + 1];
	}
	REP(i, M)
	{
		int x, y;
		cin >> x >> y;
		link[x].push_back(y);
		link[y].push_back(x);
	}

	int ans = 0;
	int cnt = 1;
	for (int i = 1; i <= N; i++)
	{
		if (flg[i] != 0) continue;

		vector<int> v;
		queue<int> q;
		q.push(i);
		v.push_back(i);
		flg[i] = cnt;
		while (q.size() > 0)
		{
			int n = q.front();
			q.pop();
			for (int l : link[n])
			{
				if (flg[l] == 0)
				{
					flg[l] = cnt;
					v.push_back(l);
					q.push(l);
				}
			}
		}

		for (int a : v)
		{
			if (flg[P[a]] == cnt)
			{
				ans++;
			}
		}

		cnt++;
	}

	cout << ans << endl;
}


Measured memory_bytes: 8824
#include <algorithm>
#include <cmath>
#include <complex>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>
#include <functional>
#include <cstring>
#include <regex>
#include <random>
#include <cassert>
#include <stack>
#include <climits>
using namespace std;

#pragma region

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repr(i, s, n) for (int i = (s); i < (int)(n); i++)
#define revrep(i, n) for (int i = (n) - 1; i >= 0; i--)
#define revrepr(i, s, n) for (int i = (n) - 1; i >= s; i--)
#define debug(x) cerr << #x << ": " << x << "\n"
#define popcnt(x) __builtin_popcount(x)

const double PI = acos(-1.0);

using ll = long long;
using P = pair<int, int>;

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

template<class T>
istream& operator >>(istream &is, vector<T> &v) {
    for (int i = 0; i < (int)v.size(); i++) cin >> v.at(i);
    return is;
}

template<class T, class U>
ostream& operator <<(ostream &os, pair<T, U> p) {
    cout << '(' << p.first << ", " << p.second << ')';
    return os;
}

template<class T>
void print(const vector<T> &v, const string &delimiter = " ") { rep(i, v.size()) cout << (0 < i ? delimiter : "") << v.at(i); cout << endl; }

template<class T>
void print(const vector<vector<T>> &vv, const string &delimiter) { for (const auto &v: vv) print(v, delimiter); }

#pragma endregion

int main() {
    string s;
    cin >> s;
    cout << s.substr(0, 3) << endl;
}

Measured memory_bytes: 3560
from itertools import product
from math import ceil

D,G = map(int,input().split())
p = [0] * D
c = [0] * D

for i in range(D):
  p[i], c[i] = map(int,input().split())

ans=1e9
for x in product([0,1],repeat=D):
  cnt = 0
  pnt = 0
  i = 0
  maxi = 0 # 中途半端に解くiを決める。
  incompflg = False
  for y in x:
    if y == 1:
      # 完全回答するパターン
      cnt += p[i]
      pnt += (i+1)*100*p[i] + c[i]
    else:
      # 完全回答しないパターン
      maxi = i
      incompflg = True
    i += 1
  
  if pnt >= G:
    ans = min(ans, cnt)
  elif incompflg and pnt + (p[maxi]-1) * (maxi+1) * 100 >= G:
    ans = min(ans, cnt+ ceil( (G-pnt) / ( (maxi+1) * 100 ) ))
  #print(x, cnt, pnt, ans)
  
print(ans)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
 
#define ll long long
#define mod 1000000007
#define pb push_back
#define pi pair<ll,ll>
#define vi vector<ll>
#define vpi vector< pi >
#define ff first
#define ss second
const int N=100010;

int main()
{
	ll n,k,res=0,x,y;

	cin>>n>>k;
	res=(n/k)*(n/k)*(n/k);
	if(k%2==0)
	{
		x=n/k;
		k/=2;
		y=n/k-x;
		res+=y*y*y;
	}
	cout<<res;

	return 0;
}

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

int main() {
	
	int p, q, r;
	cin >> p >> q >> r;
	cout << p + q + r - max(p, max(q, r)) << endl;
	
	return 0;
}

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

typedef long long ll;

int main() {
  int n, k;
  cin >> n >> k;
  vector<int> v(n);
  for (int i = 0; i < n; ++i) {
	  cin >> v[i];
  }
  sort(v.rbegin(),v.rend());
  int ans = 0;
  for (int i = 0; i < k; ++i) {
	  ans += v[i];
  }
  cout << ans;
}



















Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define MOD 1000000007
#define PI 3.141592653589793

int main(){
    int n, m, x;
    cin >> n >> m >> x;
    vector<int> v(n+1, 0);
    for(int i = 0; i < m; i++){
        int a;
        cin >> a;
        v[a]++;
    }
    int c1 = accumulate(v.begin(), v.begin()+x, 0);
    int c2 = accumulate(v.begin()+x, v.end(), 0);
    cout << min(c1, c2) << endl;
}


Measured memory_bytes: 256
N = int(input())
a = list(map(int, input().split()))
ball = [0 for c in range(N)]
i = N
ballcount = 0
check = 2
out = 0
while i != 0 and out != N + 1:
    while check * i <= N: 
        ballcount += ball[check * i - 1]
        check += 1
    if ballcount % 2 != a[i - 1]:
        ball[i - 1] = 1
    check = 2
    i -= 1
    ballcount = 0
    out += 1
if out == N + 1:
    i = out
    print(-1)
M = 0
while i < N:
    if ball[i] == 1:
        M += 1
    i += 1
print(M)
i = 0
while i < N:
    if ball[i] == 1:
        print(i + 1)
    i += 1

Measured memory_bytes: 7276
#include<stdio.h>

#define NIL -1

typedef struct{
  int parent,left,right;
}node;

void getdepth(int,int);
void printchildren(int);

node T[100000];
int D[100000];

int main(){
  int i,j,d,v,c,l,r,n;

  scanf("%d",&n);

  for(i=0;i<n;i++){
    T[i].parent = T[i].left = T[i].right = D[i] = NIL;
  }
  
  for(i=0;i<n;i++){
    scanf("%d %d",&v,&d);
    for(j=0;j<d;j++){
      scanf("%d",&c);
      if(j == 0)T[v].left = c;
      else T[l].right = c;
      l = c;
      T[c].parent = v;
    }
  }

  for(i=0;i<n;i++){
    if(T[i].parent == NIL)r = i;
  }
  
  getdepth(r,0);

  for(i=0;i<n;i++)printchildren(i);

  return 0;
}

void getdepth(int u,int p){
  D[u] = p;
  if(T[u].right != NIL)getdepth(T[u].right,p);
  if(T[u].left != NIL)getdepth(T[u].left,p+1);
}

void printchildren(int u){
  int i;
  int c = T[u].left;

  printf("node %d: ",u);
  printf("parent = %d, ",T[u].parent);
  printf("depth = %d, ",D[u]);

  if(T[u].parent == NIL)printf("root, ");
  else if(T[u].left == NIL)printf("leaf, ");
  else printf("internal node, ");
  
  printf("[");
  for(i = 0,c = T[u].left ;c != NIL ;i++){
    if(i)printf(", ");
    printf("%d",c);
    c = T[c].right;
  }
  printf("]\n");
  
}

Measured memory_bytes: 5300
#include<iostream>
#include<algorithm>
#include<vector>
#include<map>
using namespace std;
#define FOR(i, a, n) for(int i=a; i<n; i++)
#define RFOR(i, a, n) for(int i=n-1; i>=a; i--)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) FOR(i, 0, n)
#define LL long long

int getDigit(LL x) {
	int count = 0;
	while (x != 0) {
		x /= 10;
		count++;
	}
	return count;
}

int main()
{
	LL N;
	cin >> N;

	vector<pair<LL, LL>> v;
	for (LL A = 1; A*A <= N; A++) {
		if (N%A == 0) v.push_back(make_pair(A, N / A));
	}
	
	int num_max;
	int num_min = 15;
	REP(i, v.size()) {
		num_max = max(getDigit(v[i].first), getDigit(v[i].second));
		num_min = min(num_min, num_max);
	}

	cout << num_min << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")

#define REP(i, n) for (int i = 0; i < n; i++)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define ALL(v) v.begin(), v.end()

using ll = long long;
using ull = unsigned long long;
using namespace std;

int main() {
  vector<vector<int>> A(3, vector<int>(3));
  vector<vector<int>> C = {
    {0, 0, 0},
    {0, 0, 0},
    {0, 0, 0},
  };
  int N;
  REP(i, 3) {
    REP(j, 3) {
      cin >> A[i][j];
    }
  }
  cin >> N;
  vector<int> b(N);
  REP(i, N) {
    cin >> b[i];
  }
  REP(i, N) {
    REP(j, 3) {
      REP(k, 3) {
        if (b[i] == A[j][k]) {
          C[j][k] = 1;
        }
      }
    }
  }
  REP(i, 3) {
    if (C[i][0] && C[i][1] && C[i][2]) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  REP(i, 3) {
    if (C[0][i] && C[1][i] && C[2][i]) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  if (C[0][0] && C[1][1] && C[2][2]) {
    cout << "Yes" << endl;
    return 0;
  }
  if (C[2][0] && C[1][1] && C[0][2]) {
    cout << "Yes" << endl;
    return 0;
  }
  cout << "No" << endl;
  return 0;
}


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

int main(){
    int N,M;
    std::cin>>N>>M;
    std::vector<std::vector<std::pair<int,int>>> graph(N);
    std::vector<int> in(N);
    for(int i=0;i<M;++i){
        int l,r,d;
        std::cin>>l>>r>>d;
        l--;r--;
        graph[l].push_back(std::make_pair(d,r));
        in[r]++;
    }
    std::queue<int> que;
    std::vector<int> dp(N,-1);
    
    for(int i=0;i<N;++i) if(in[i]==0) que.push(i);
    
        while(!que.empty()){
            int u=que.front();que.pop();
            if(dp[u]==-1) dp[u]=0;
            for(auto e:graph[u]){
                if(dp[e.second]==-1){
                    dp[e.second]=dp[u]+e.first;
                    que.push(e.second);
                }
                else if(dp[e.second]!=dp[u]+e.first){
                    std::cout<<"No\n";
                    return 0;
                }
            }
        }
    for(int i=0;i<N;++i) if(in[i]&&dp[i]==-1){
        std::cout<<"No\n";
        return 0;
    }
    std::cout<<"Yes\n";
}


Measured memory_bytes: 6784
#include <bits/stdc++.h>
using namespace std;
#define rep(i,c) for(int i=0;i<(int)c;i++)
#define print(var) cout<<var<<endl;
#define DEBUG(var) cerr<<var<<endl;
// puts("str");

const int inf = 1000000000;//10^9

int main (){

  string S;
  cin >>S;
  print(S.substr(0,4)+" "+S.substr(4));
  return 0;

}


Measured memory_bytes: 256
n=list(map(int,input()))
d=[0]*2019
d[0]=1
a=0
b=len(n)
for i in reversed(range(b)):
    a+=(n[i]*pow(10,(b-i-1),2019))
    a%=2019
    d[a]+=1

ans=0

for i in range(2019):
    c=d[i]
    ans+=c*(c-1)//2
        
print(ans)

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

#define int long long
#define pb push_back
#define ff first
#define ss second
#define all(a) a.begin(), a.end()

const int mod = 1e9+7;
const int inf = 2e18;

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

	int n,k;
	cin>>n>>k;

	int mp[105]={0};
	for(int i=0;i<k;i++)
	{
		int di;
		cin>>di;
		for(int j=0;j<di;j++)
		{
			int x;
			cin>>x;
			mp[x]++;	
		}
	}

	int cnt =0 ;
	for(int i=1;i<=n;i++)
		if(mp[i]==0)cnt++;

	cout<<cnt<<'\n';

	return 0;
}	

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

#define     bip(a)         __builtin_popcount(a)
#define     ull            unsigned long long
#define     ll             long long
#define     u              unsigned
#define     pb             push_back
#define     pf             push_front ///for list
#define     mp             make_pair
#define     is             insert
#define     ff             first
#define     ss             second
#define     vi             vector<int>
#define     vl             vector<ll>
#define     si             set<int>
#define     sl             set<ll>
#define     li             list<int>
#define     pii            pair<int,int>
#define     pll            pair<ll,ll>
#define     mii            map<int,int>
#define     mll            map<ll,ll>
#define     ma             INT_MAX
#define     mi             INT_MIN
#define     mod            1000000007
#define     pi             3.14159265359
#define     e              2.71828182846
#define     inf            1000000000000000LL
#define     all(x)         x.begin(), x.end()
#define     lb(a,b,c)      lower_bound(a,a+b,c)-a
#define     ub(a,b,c)      upper_bound(a,a+b,c)-a
#define     lbv(a,c)       lower_bound(all(a),c)-a.begin()
#define     ubv(a,c)       upper_bound(all(a),c)-a.begin()
#define     srt1(a,b)      sort(a,a+b)
#define     srt2(a,b)      sort(a,a+b,greater<int>())
#define     gcd(a,b)       __gcd(a,b)
#define     lcm(a,b)       (a*(b/gcd(a,b)))
#define     harmonic(n)    0.57721566490153286l+log(n)
#define     mem(a, b)      memset(a, b, sizeof(a))

///s.lower_bound(a),s.upper_bound(a), for set
///nCr(x, y) = nCr(x-1, y-1) + nCr(x-1, y)
///factorial digit   ((n * log10(n / e) +log10(2 * pi * n) /2.0));


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



Measured memory_bytes: 3536
#include<bits/stdc++.h>
#define sz 100002
#define pb push_back
#define ff first
#define ss second
#define ll long long
#define pi pair<int,int>
#define PQ priority_queue<double, vector<double>, greater<double> >q
#define _sort(v) sort(v.begin(),v.end())
#define MP map<ll int,ll int>mp
#define MEM(x) memset(x,0,sizeof(x))
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define vec() vector<ll int>v1,v2
#define VEC(n) ll int x; vector<ll int>v;for(int i=0;i<n;i++){cin>>x;v.pb(x);}
#define TEST() int test;cin>>test; while(test--)
#define FAST() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
using namespace std;
//Upper_bound   auto x=upper_bound(v[a].begin(),v[a].end(),les);les=*x; if(x==v[a].end())break;
//ll int LCM(ll int a,ll int b) { ll int gcd=__gcd(a,b);ll int lcm=a*b/gcd;return lcm;}
//ll int bigmod(ll int b, ll int p, ll int m){if(p==0)return 1;if(p%2!=0) return b%m*fun(b,p-1,m)%m;if(p%2==0){ ll int res=fun(b,p/2,m);return (res%m*res%m)%m;}}
//ll mod_inverse(ll a, ll mod){return bigmod(a,mod-2,mod);}
//void seive() { prime[np++]=2;for(i=3; i<=sz; i+=2){if(mark[i]==0){ prime[np++]=i;for(j=i*i; j<=sz; j+=i) mark[j]=1; } }}
//string add(string s1,string s2) {string s;int j=s1.size()-1,c=0,m; for(int i=s2.size()-1; i>=0; i--) {if(j>=0)m=s2[i]-'0'+s1[j]-'0'+c;else m=s2[i]-'0'+c; if(m>9) { s+=m%10+'0';c=m/10; } else {  c=0;s+=m+'0'; }j--; } if(c!=0) {s+=c+'0'; }reverse(s.begin(),s.end());return s;}
//int pos;string mul(int n) {string s;for(int i=0; i<pos; i++) { s+="0"; }pos++;int c=0,m; for(int i=s1.size()-1; i>=0; i--) { m=(s1[i]-'0')*n+c;if(m>9) { s+=m%10+'0';c=m/10;} else { c=0; s+=m+'0';} }while(c!=0) { s+=c%10+'0';c=c/10;}    reverse(s.begin(),s.end());return s;}




int main()
{
    ll int n,x,mod,last=0LL,res=0LL,div,total=0LL;
    cin>>n>>x>>mod;
    map<ll int,ll int>mp,mark;
    x%=mod;
    mp[x]=1;
    mark[1]=x;
    for(int i=2;i<=n;i++)
    {
        x=(x*x)%mod;
        mark[i]=x+mark[i-1];
        if(x==0)
        {
            cout<<mark[i]<<endl;
            return 0;
        }
       if(mp[x])
       {
           last=i;
           break;
       }
       mp[x]=i;

    }
    if(last==0)
    {
        cout<<mark[n]<<endl;
        return 0;
    }
    total=(mark[last]-mark[mp[x]]);
    div=last-mp[x];
    n-=mp[x];
    res=mark[mp[x]+n%div];
    res+=n/div*(mark[last]-mark[mp[x]]);
    cout<<res<<endl;
}


Measured memory_bytes: 9708
n = int(input())

U = 55555
is_prime = [1]*(U+1)
is_prime[0] = 0
is_prime[1] = 0
for p in range(2, int(U**.5)+1):
    if is_prime[p]:
        for q in range(2*p, U+1, p):
            is_prime[q] = 0
prime_list = [n for n, bl in enumerate(is_prime)if bl]

A = []
for p, bl in enumerate(is_prime):
    if bl and p % 5 == 1:
        A.append(p)

print(*A[:n])


Measured memory_bytes: 3700