akhauriyash/Code-Regression huggingface dataset:
# -*- coding: utf-8 -*-

N = int(input())
V = list(map(int, input().split()))

V1, V2 = {}, {}
for i in range(N // 2):
    v1, v2 = V[i * 2], V[i * 2 + 1]
    if v1 in V1:
        V1[v1] += 1
    else:
        V1[v1] = 1
    if v2 in V2:
        V2[v2] += 1
    else:
        V2[v2] = 1

VS1, VS2 = sorted(V1.values()), sorted(V2.values())

if max(V1, key=V1.get) == max(V2, key=V2.get):
    if len(V1) == 1:
        if len(V2) == 1:
            print(N // 2)
        else:
            print(N - VS1[-1] - VS2[-2])
    else:
        if len(V2) == 1:
            print(N - VS1[-2] - VS2[-1])
        else:
            if VS1[-2] < VS2[-2]:
                print(N - VS1[-1] - VS2[-2])
            else:
                print(N - VS1[-2] - VS2[-1])
else:
    print(N - VS1[-1] - VS2[-1])


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

int main() {
  char c;
  cin >> c;
  bool A = c == 'a';
  bool B = c == 'e';
  bool C = c == 'i';
  bool D = c == 'o';
  bool E = c == 'u';
  if(A||B||C||D||E){
    cout << "vowel" << endl;
  }
  else{
    cout << "consonant" << endl;
  }	
}



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

/*
<四則演算の式> ::= <乗算除算の式> (+ or -) <乗算除算の式> (+ or -) ...
<乗算除算の式> ::= <括弧か数> (* or /) <括弧か数> (* or /) ...
<括弧か数>     ::= '(' <四則演算の式> ')' or <数>
<数>           ::= ...
*/

// 構文解析
using State = string::const_iterator;
class ParseError{};

int number(State &begin);
int term(State &begin);
int factor(State &begin);
int expression(State &begin);

// 数字の列をパースして，その数を返す
int number(State &begin) {
    int ret = 0;

    while (isdigit(*begin)) {
        ret *= 10;
        ret += *begin - '0';
        begin++;
    }

    return ret;
}


// 乗算除算の式をパースして，その評価結果を返す
int term(State &begin) {
    int ret = factor(begin);

    for (;;) {
        if (*begin == '*') {
            begin++;
            ret *= factor(begin);
        }
        else if (*begin == '/') {
            begin++;
            ret /= factor(begin);
        }
        else {
            break;
        }
    }

    return ret;
}

int factor(State &begin) {
    if (*begin == '(') {
        begin++; // '('を飛ばす
        int ret = expression(begin);
        begin++;
        return ret;
    }
    else {
        return number(begin);
    }
}


// 四則演算の式をパースして，その評価結果を返す
int expression(State &begin) {
    int ret = term(begin);

    for (;;) {
        if (*begin == '+') {
            begin++;
            ret += term(begin);
        }
        else if (*begin == '-') {
            begin++;
            ret -= term(begin);
        }
        else {
            break;
        }
    }

    return ret;
}

void consume(State &begin, char expected) {
    if (*begin == expected) {
        begin++;
    }
    else {
        cerr << "Expected " << expected << " but got " << *begin << endl;
        cerr << "Rest string is ";
        while (*begin) {
            cerr << *begin++;
        }
        cerr << endl;
        throw ParseError();
    }
}

int main() {
    int N;
    cin >> N;
    cin.ignore();
    rep(i, N) {
        string s;
        getline(cin, s);

        State begin = s.begin();
        int ans = expression(begin);
        //consume(begin, '=');
        cout << ans << endl;
    }
    return 0;
}



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

int main() {
    ll N, L;
    cin >> N >> L;
    ll sum = 0;
    rep(i, N) sum += L + i;
    ll ans;
    if (L < 0 && L + N - 1 < 0)
        ans = sum - (L + N - 1);
    else if (L > 0 && L + N - 1 > 0)
        ans = sum - (L);
    else
        ans = sum;
    cout << ans << endl;

    return 0;
}


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

#define rep(i,n) for(ll i=0;i<(n);++i)
using ll = int_fast64_t;
using pll = pair<ll,ll>;
constexpr ll INF = 1LL<<60;
constexpr ll MOD = 1e9+7;
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(a>b){a=b;return 1;}return 0;}
#if loc||local
void dump(){cerr<<endl;}
template<class T,class... Ts> void dump(T&& h, Ts&&... t){cerr<<h<<", ";dump(forward<Ts>(t)...);}
#else
void dump(){}
template<class T,class... Ts> void dump(T&& h, Ts&&... t){}
#endif
template<class T> istream &operator>>(istream&is,vector<T>&v){for(auto &elemnt:v)is>>elemnt;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> ostream &operator<<(ostream& os,vector<T>const& v){for(auto const& vi:v)os<<vi<<" ";return os;}
template<class T,class U> ostream &operator<<(ostream& os,pair<T,U>const& p){os<<p.first<<","<<p.second;return os;}
template<class T>vector<T> vec(size_t a){return vector<T>(a);}
template<class T, class... Ts>auto vec(size_t a, Ts... ts){return vector<decltype(vec<T>(ts...))>(a, vec<T>(ts...));}

signed main(){

  ll n,m,v,p;
  cin>>n>>m>>v>>p;
  vector<ll> a(n);
  cin>>a;

  sort(rbegin(a),rend(a));
  dump(a);

  auto check = [&](ll idx)->ll{
    auto b = a;
    ll key = a[idx]+m;
    rep(i,n){
      if(b[i]<=key)b[i]=min(b[i]+m,key);
      else if(b[i]>key)b[i]+=m;
    }
    vector<ll>d(n);
    rep(i,n)if(b[i]-a[i]<m)d[i]=m-(b[i]-a[i]);
    sort(rbegin(d),rend(d));
    ll cnt = 0;
    rep(i,n)cnt+=b[i]-a[i];
    sort(rbegin(b),rend(b));
    auto itr = lower_bound(b.begin(),b.end(),key,greater<>());
    int id = itr-begin(b);
    dump(cnt,id);
    for(int i=0;i+id+1<p;++i){
      cnt += d[i];
      dump(d[i]);
    }
    dump(b);dump(d);
    dump(a[idx],cnt,id);
    return id+1<=p && cnt>=m*v;
  };

  ll loweq = 0;
  ll high = n;
  while(high-loweq>1){
    ll mid = high+loweq>>1;
    if(check(mid))loweq=mid;
    else high=mid;
  }

  cout<<(high)<<endl;

}

Measured memory_bytes: 2704
#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;
int main()
{
  int N, K;
  cin >> N >> K;
  int ans = 0;
  for (int i = 0; i < N; i++) {
    int x;
    cin >> x;
    ans += min(abs(x)*2, abs(x-K)*2);
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3636
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef long double ld;
ll a1, a2, a3;
//ld ;
//string s;
 
int main() {
  cin >> a1 >> a2 >> a3;
  string ans = (a1+a2+a3 <= 21) ? "win" : "bust";
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
// We only fail when we stop trying
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define endl '\n'
#define D(x) cerr << #x << " = " << (x) << '\n'
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()

const int N = 3005;

string s, t;
int dp[N][N];

int main()
{
  cin >> s >> t;
  for(int i = 1 ; i <= sz(s) ; i++) {
    for(int j = 1 ; j <= sz(t); j++) {
      dp[i][j] = max(dp[i - 1][j], dp[i][j - 1]);
      if(s[i - 1] == t[j - 1])
        dp[i][j] = max(dp[i - 1][j - 1] + 1, dp[i][j]);
    }
  }
  int i = sz(s), j = sz(t);
  string r;
  while(i > 0 && j > 0) {
    if(s[i - 1] == t[j - 1]) {
      r += s[i - 1];
      i--, j--;
    } else if(dp[i][j] == dp[i - 1][j]) {
      i--;
    } else {
      j--;
    }
  }
  reverse(all(r));
  cout << r << endl;
  return 0;
}


Measured memory_bytes: 35456
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll,ll>;
using vl = vector<ll>;
using Map = map<ll,ll>;
using Tup = tuple<ll,ll,ll>;
using vvl = vector<vector<ll>>;
#define all(v) v.begin(), v.end()
#define prt(v) cout<<(v)<<"\n";
#define fl cout<<flush;
#define fi(v) get<0>(v)
#define se(v) get<1>(v)
#define th(v) get<2>(v)
#define endl "\n"
template <typename T> bool chmax(T &a, const T &b){if (a<b){a=b;return 1;}return 0;}
template <typename T> bool chmin(T &a, const T &b){if (a>b){a=b;return 1;}return 0;}
const ll INF=1LL<<60;
const ll MOD=1000000007;
const ll MOD2=998244353;
const ld pi=3.141592653589793238;

signed main(void){
    cin.tie(0);cout.tie(0);ios::sync_with_stdio(false);
    ll N;
    cin >> N;
    vector<ll> h(N,0);
    for(ll i=0;i<N;++i)cin>>h[i];
    vector<ll> dp(N,INF);
    dp[0]=0;
    for(ll i=0;i<N;++i){
        if(i>=1)chmin(dp[i],dp[i-1]+llabs(h[i]-h[i-1]));
        if(i>=2)chmin(dp[i],dp[i-2]+llabs(h[i]-h[i-2]));
    }
    prt(dp[N-1])

    return 0;
}


Measured memory_bytes: 1792
#include <iostream>
#include <string>
#include <vector>
#include <cstdio>
#include <algorithm>
#include <stack>
#include <climits>
#include <tuple>
#include <unordered_map>

using namespace std;

typedef long long ll;

int main(void) {
  ll N, M, C;
  cin >> N >> M >> C;
  vector<ll> B(M);
  for (int i = 0; i < M; i++) { cin >> B[i]; }

  int count = 0;
  for (int i = 0; i < N; i++) {
    int sum = 0;
    for (int j = 0; j < M; j++) {
      int tmp; cin >> tmp;
      sum += tmp * B[j];
    }
    if (sum + C > 0) { count++; }
  }
  cout << count << endl;
}


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

main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    char c; cin >> c;
    int x = c;
    if(97 <= x && x <= 122)
        cout << 'a';
    else
        cout << 'A';
}

Measured memory_bytes: 3608
#include <iostream>
#include <algorithm>
#include <cctype>
#include <cstdio>
#include <math.h>
using namespace std;

int main() {
	
	int a,b,c,d,e,x;
	
	while(cin>>a>>b>>c>>d>>e){
		for(int i=0;i<5;i++){
			if(a<b){x=a;a=b;b=x;}
			if(b<c){x=b;b=c;c=x;}
			if(c<d){x=c;c=d;d=x;}
			if(d<e){x=d;d=e;e=x;}
		}
		cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;
		}
	return 0;
}

Measured memory_bytes: 0
fun main(args: Array<String>) {
    val (A, B) = listOfLong()
    val G = gcd(A, B)
    val C = factorize(G)
    println(C.count() + 1)
}
fun next() = readLine()!!
fun listOfString() = next().split(" ")
fun listOfLong(delta: Long = 0L) = listOfString().map { java.lang.Long.parseLong(it) + delta }
tailrec fun gcd(a: Long, b: Long): Long = if (a % b == 0L) b else gcd(b, a % b)
fun factorize(N: Long): MutableList<Pair<Long, Int>> {
    val res = mutableListOf<Pair<Long, Int>>()
    var n = N
    var i = 2L
    while (i * i <= n) {
        if (n % i == 0L) {
            var m = 0
            while (n % i == 0L) {
                n /= i
                m += 1
            }
            if (m > 0) res.add(Pair(i, m))
        }
        i += 1L
    }
    if (n != 1L) res.add(Pair(n, 1))
    return res
}

Measured memory_bytes: 37872
#include <bits/stdc++.h>
using namespace std;
 
using ll = long long;
 
int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
 
	//ifstream cin("input.txt");
 
    ll x;
    cin>>x;
    
    ll cur=100LL;
    
    int ans=0;
    
    while(cur<x)
    {
        cur += ll(cur/100LL);
        ans++;
    }
    
    cout << ans << endl;
}

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

int main(){
  int n, d, ans;
  cin >> n >> d;
  
  if(n % (2*d+1) == 0) ans = n / (2*d+1);
  else ans = n / (2*d+1) + 1;
  
  cout << ans << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define L long long
map<L,L>mp;
int main()
{
    L n,q,m,d,vl,mx;
    while(scanf("%lld %lld",&n,&q)){
        if(n==0&&q==0)return 0;
        mp.clear();mx=-2;
        for(L i=0;i<n;i++){
            scanf("%lld",&m);
            for(L i=0;i<m;i++){
                scanf("%lld",&d);
                mp[d]++;
                if(mp[d]>mx){
                    mx=mp[d];vl=d;
                }
                else if(mp[d]==mx){
                    if(d<vl){
                        vl=d;
                    }
                }
            }
        }
        if(mx<q){
            printf("0\n");
        }
        else{
            printf("%lld\n",vl);
        }
    }
    return 0;
}



Measured memory_bytes: 3128
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

from heapq import heappop,heappush,heapify

N,*V = map(int,read().split())

heapify(V)

while len(V) >= 2:
    x = heappop(V); y = heappop(V)
    heappush(V,(x+y)/2)

answer = V[0]
print(answer)

Measured memory_bytes: 3064
v, e = map(int, input().split())

inf = float("inf")

#edgesをdp的に用いる
edges = [[inf]*v for _ in range(v)]
for _ in range(e):
    s, t, d = map(int, input().split())
    edges[s][t] = d

for w in range(v):
    edges[w][w] = 0

for k in range(v):
    for i in range(v):
        for j in range(v):
            edges[i][j] = min(edges[i][j], edges[i][k]+edges[k][j])


if any(edges[i][i] < 0 for i in range(v)):
    print("NEGATIVE CYCLE")
else:
    for x in edges:
        x = ["INF" if y == inf else str(y) for y in x]
        print(" ".join(x))




Measured memory_bytes: 6016
// E - Divisible Substring

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

// const int INF = 2147483647;
// const ll INF = 9223372036854775807;
// const ll MOD = 1e9 + 7;

int ctoi(char c) {
	return c - '0';
}

map<int, int> rem_list;

int main() {
	int N, P;
	string S;
	cin >> N >> P >> S;

	ll ans;

	if (P == 2) {
		ans = 0;
		for (int i=0; i<N; i++) {
			if (ctoi(S[i]) % 2 == 0) {
				ans += i+1;
			}
		}

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

	if (P == 5) {
		ans = 0;
		for (int i=0; i<N; i++) {
			if (ctoi(S[i]) % 5 == 0) {
				ans += i+1;
			}
		}

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

	int mod_k = 0; // 部分文字列kのMOD P
	int d = 1;
	for (int i=N-1; i>=0; i--) {
		mod_k = (ctoi(S[i]) * d + mod_k) % P;
		rem_list[mod_k]++;

		d = (d * 10) % P; // 10^i も MOD P にしておく
	}

	ans = rem_list[0]; // 最後の桁まで使う場合

	for (auto itr : rem_list) {
		ll cnt = itr.second;
		ans += cnt * (cnt - 1) / 2;
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 900
#include <bits/stdc++.h>
using namespace std;
#define ll long long 
#define endl "\n"
#define pb push_back
#define f(i,n) for(i=0;i<n;i++)
#define F(i,a,b) for(i=a;a<=b;i++)
#define arr(a,n) for( i=0;i<n;i++)cin>>a[i];
#define fi first
#define se second
#define mp make_pair
#define mod 1000000007
#define YES cout<<"YES"<<endl;
#define Yes cout<<"Yes"<<endl;
#define NO cout<<"NO"<<endl;
#define No cout<<"No"<<endl;
#define yes cout<<"yes"<<endl;
#define no cout<<"no"<<endl;
#define vi vector<ll>
#define ed end()
#define bg begin()
#define sz size()
#define ln length()
#define s() sort(a,a+n);
#define sr() sort(a,a+n,greater<ll>());
#define v()  sort(v.begin(),v.end());
#define vr() sort(v.begin(),v.end(),greater<ll>());
#define mod 1000000007
#define fast() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
ll gcd(ll a, ll b){if(!b)return a;return gcd(b, a % b);}
ll power(ll x,ll y,ll p){ll res=1;x%=p;while(y>0){if(y&1)res=(res*x)%p;y=y>>1;x=(x*x)%p;}return res;}
int main() {
   /* #ifndef ONLINE_JUDGE
        // for getting input from input.txt
        freopen("input.txt", "r", stdin);
        // for writing output to output.txt
        freopen("output.txt", "w", stdout);
    #endif*/
        /* 
        Ofcourse it's Hard.
        It's supposed to be Hard.
        If it's easy everyone would do it.
        HARD IS WHAT MAKES IT GREAT

        YESTERDAY U SAID TOMORROW

        SLOWLY BECOMING THE PERSON I 
        SHOULD HAVE BEEN A LONG TIME AGO

        SAME TASK CAN'T BE FOUND DIFFICULT TWICE

        BTBHWSITW

        SPRH TU KAB P

        CP IS ALL ABOUT THINKING 
        YOU HAVE MUCH MORE POTENTIAL THAN U THINK

        AJIT SHIDDAT 10

        UR DAILY ROUTINE 


        */

fast();
//ll t;cin>>t;while(t--)
{
    ll n,size=0;
    cin>>n;
    map<ll,ll>m;
    for(int i=0;i<n;i++)
    {
      ll x;
      cin>>x;
      if(m[x]>0)
      {
        m[x]=0;
      }
      else
      {
        m[x]=1;
      }
    }
    for(auto t:m)
      {
        if(t.se>0)
          size++;
}
    cout<<size<<endl;
}
return 0;
}

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

using namespace std;
typedef long long ll;

#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, a, b) for (int i = (a); i < (b); ++i)
#define all(a) (a).begin(), (a).end()

int main()
{
    int n;
    cin >> n;
    set<char> se;

    rep(i, n)
    {
        char s;
        cin >> s;
        se.insert(s);
    }

    cout << ((se.size() == 4) ? "Four" : "Three") << '\n';

    return 0;
}


Measured memory_bytes: 3572
#include <stdio.h>

#define N     100
#define WHITE 0
#define GRAY  1
#define BLACK 2

static int n;
static int M[N][N];
static int color[N];
static int start[N];
static int end[N];
static int t;

static void dfs_visit(int u)
{
    color[u] = GRAY;
    start[u] = ++t;
    for (int v = 0; v < n; v++) {
        if (M[u][v] == 0)
            continue;
        if (color[v] == WHITE)
            dfs_visit(v);
    }
    color[u] = BLACK;
    end[u] = ++t;
}

static void dfs()
{
    for (int i = 0; i < n; i++) {
        color[i] = WHITE;
    }

    t = 0;

    for (int i = 0; i < n; i++) {
        if (color[i] == WHITE) {
            dfs_visit(i);
        }
    }

    for (int i = 0; i < n; i++) {
        printf("%d %d %d\n", i + 1, start[i], end[i]);
    }
}

int main()
{
    int u, v, k;

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

    for (int i = 0; i < n; i++) {
        scanf("%d %d", &u, &k);
        for (int j = 0; j < k; j++) {
            scanf("%d", &v);
            M[u - 1][v - 1] = 1;
        }
    }

    dfs();

    return 0;
}


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

int main(){
  int a, b;
  cin >> a >> b;
  string s;
  cin >> s;
  bool ans = true;
  
  for(int i = 0; i < a+b+1; i++){
  	if(i == a){
    	continue;
    }
  
  	if(s.at(i) == '0'){
    	continue;
    }
  	else if(s.at(i) == '1'){
    	continue;
    }
  	else if(s.at(i) == '2'){
    	continue;
    }
  	else if(s.at(i) == '3'){
    	continue;
    }
  	else if(s.at(i) == '4'){
    	continue;
    }
  	else if(s.at(i) == '5'){
    	continue;
    }
  	else if(s.at(i) == '6'){
    	continue;
    }
  	else if(s.at(i) == '7'){
    	continue;
    }
  	else if(s.at(i) == '8'){
    	continue;
    }
  	else if(s.at(i) == '9'){
    	continue;
    }
    else{
    	ans = false;
    }
  }
  if(s.at(a) != '-'){
  	ans = false;
  }
  if(ans){
  	cout << "Yes" << endl;
  }
  else{
  	cout << "No" << endl;
  }
}

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

int max2(int a, int b){
  if(a>=b) return a;
  else return b;
}
int max3(int a, int b, int c){
  if(a>=b && a>=c) return a;
  else if(b>=a && b>=c) return b;
  else if(c>=a && c>=b) return c;
  else return -1;
}

int main(){
  int N;
  scanf("%d",&N);
  int *a,*b,*c;
  a=(int*)malloc((N+1)*sizeof(int));
  b=(int*)malloc((N+1)*sizeof(int));
  c=(int*)malloc((N+1)*sizeof(int));
  for(int i=1;i<=N;i++){
    scanf("%d%d%d",&a[i],&b[i],&c[i]);
  }

  int **dp;
  dp=(int**)malloc((N+1)*sizeof(int*));
  for(int i=1;i<=N;i++){
    dp[i]=(int*)malloc(3*sizeof(int));
  }
  dp[1][0]=a[1];
  dp[1][1]=b[1];
  dp[1][2]=c[1];
  for(int i=2;i<=N;i++){
    dp[i][0]=a[i]+max2(dp[i-1][1],dp[i-1][2]);
    dp[i][1]=b[i]+max2(dp[i-1][0],dp[i-1][2]);
    dp[i][2]=c[i]+max2(dp[i-1][0],dp[i-1][1]);
  }
  printf("%d\n",max3(dp[N][0],dp[N][1],dp[N][2]));
  return 0;
}


Measured memory_bytes: 5248
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define N 10000002
bool prime[N];

//check prime
bool isPrime(ll n)
{
	if(n<=1)return false;
	for(ll i=2;i*i<=n;i++)
	{
		if(n%i==0)return false;
	}
    return true;
}
//gcd
ll gcd(ll x,ll y)
{
	if(x==0)return y;
	else return gcd(y%x,x);
}
//lcm;
ll lcm(ll x,ll y)
{
	return x*y/gcd(x,y);
}

// sieve of eratosthenes
void sieve(vector<ll> &v)
{
	memset(prime,true,N);
	prime[0]=prime[1]=false;
	for(ll i=2;i*i<N;i++)
	{
		if(prime[i]==true)
		{
			for(ll j=i+i;j<N;j+=i)
			{
				prime[j]=false;
			}
		}
	}
	for(ll i=0;i<N;i++)
	{
		if(prime[i]==true)
		{
			v.push_back(i);
		}
	}
}

//count sum & divisor

ll countDivisor(vector<ll> &v,ll n)
{
	
	for(ll i=1;i*i<=n;i++)
	{
		if(i*i==n)
		{
			v.push_back(i);
		}
		else if(n%i==0)
		{
			v.push_back(i);
			v.push_back(n/i);
		}
	}
}

//primeFactorization

ll primeFactorization(vector<ll> &v,ll n)
{
	while(n%2==0)
	{
		v.push_back(2);
		n/=2;
	}
	for(ll i=3;i*i<=n;i=i+2)  
    {  
        while(n%i==0)  
        {  
			v.push_back(i); 
            n = n/i;  
        }  
    } 
	if(n>2)
    {
    	v.push_back(n);	
	}
}

//Palindrome check string
bool isPalindrome(string s)
{
	int l=0;
	int h=s.size()-1;
	while(l<h)
	{
		if(s[l++]!=s[h--])
		{
			return false;
		}
	}
	return true;
	
}

void solve()
{
	int k;
	cin>>k;
	for(int i=0;i<k;i++)
	{
		cout<<"ACL";
	}
	cout<<endl;
}

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


Measured memory_bytes: 3640
import itertools
import math

N = int(input())

dis = 0
a = 0


x = [0] * N
y = [0] * N
for i in range(N):
  x[i], y[i] = map(int, input().split())
for i in itertools.permutations(range(N)):
  for j in range(1,len(i)):
    dis += math.sqrt((x[i[j]] -x[i[j-1]])**2 + (y[i[j]] - y[i[j-1]])**2)
a = itertools.permutations(range(N))
print(dis/len(list(a)))


Measured memory_bytes: 7972
from collections import defaultdict

N, W = map(int, input().split())

dp = defaultdict(lambda: 1e9)
dp[0] = 0
ans = 0
for _ in range(N):
    w, v = map(int, input().split())
    keys = sorted(dp.keys(), reverse=True)
    for k in keys:
        dp[k + v] = min(dp[k + v], dp[k] + w)
        if dp[k + v] <= W:
            ans = max(ans, k + v)


print(ans)


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

int dp[3001][3001];

int main(){
    string s,t;
    cin >> s >> t;
    for (int i = 0; i < 3001; i++) {
        dp[0][i] = 0;
    }
    for (int i = 1; i <= s.length(); i++) {
        dp[i][0] = 0;
        for (int j = 1; j <= t.length(); j++)
        {
            if (s[i-1] == t[j-1])
                dp[i][j] = max(dp[i - 1][j - 1] + 1, max(dp[i][j - 1], dp[i - 1][j]));
            else
                dp[i][j] = max(dp[i][j - 1], dp[i - 1][j]);
        }
    }
    int i = s.length();
    int j = t.length();
    string str = "";
    while (dp[i][j] != 0)
    {
        while(dp[i][j] == dp[i-1][j])
            i--;
        while(dp[i][j] == dp[i][j-1])
            j--;
        i--;
        j--;
        str.push_back(s[i]);
    }
    reverse(str.begin(), str.end());
    cout << str << endl;
}

Measured memory_bytes: 38824
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

struct Node {
    int key;
    struct Node *right, *left, *parent;
};
typedef struct Node Node;

Node *root, *NIL;

void insert(int k) {
    Node *y = NIL;
    Node *x = root;
    Node *z;
    
    z = (Node *)malloc(sizeof(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) return;
    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(void) {
    int n, i, x;
    char com[16];
    scanf("%d",&n);
    
    for(i=0;i<n;i++) {
        scanf("%s",com);
        if(!strcmp(com,"insert")) {
            scanf("%d",&x);
            insert(x);
        } else if(!strcmp(com,"print")) {
            inorder(root);
            printf("\n");
            preorder(root);
            printf("\n");
        }
    }

    return 0;
}


Measured memory_bytes: 25212
import java.io.*;
import java.math.*;
import java.util.*;
import java.util.regex.*;


public class Main {

	final static long MOD = 1000000007;
	public static String[] Ws = null;
	public static int wsIndx = 0;
	public static BufferedReader in = null;
	public static long cnt=0;
	public static PrintWriter pw = new PrintWriter(System.out);
	public static void main(String[] args) throws Exception {
		solutionC(args);
		if(in!=null){
			in.close();
		}
		pw.flush();
		pw.close();
	}

	public static void solutionA(String[] args) throws Exception{

		pw.println(nextInt()*nextInt());
	}
	public static void solutionB(String[] args) throws Exception{
		int N = nextInt();
		long[] a = nextLongs();
		Arrays.sort(a);
		long ans = a[0];
		for(int i=1;i<N;i++) {
			long x = 0;
			try{
				x= Math.multiplyExact(ans, a[i]);
			}catch(Exception e) {
				pw.println(-1);
				return;
			}
			if(x>=1000000000000000001L) {
				pw.println(-1);
				return;
			}
			ans=x;
		}
		pw.println(ans);
	}
	public static void solutionC(String[] args) throws Exception{
		String A = nextString();
		String B = nextString();
		BigDecimal bA = new BigDecimal(A);
		BigDecimal bB = new BigDecimal(B);



		pw.println(bA.multiply(bB).longValue());
	}
	public static void solutionD(String[] args) throws Exception{

	}



	public static void check() throws Exception{
		if(in == null){
			in = new BufferedReader(new InputStreamReader(System.in));
		}
		if(Ws==null || Ws.length<=wsIndx){
			Ws = in.readLine().split(" ");
			wsIndx=0;
		}
	}
	public static int nextInt()throws Exception{
		check();
		return Integer.parseInt(Ws[wsIndx++]);
	}

	public static long nextLong()throws Exception{
		check();
		return Long.parseLong(Ws[wsIndx++]);
	}

	public static String nextString()throws Exception{
		check();
		return Ws[wsIndx++];
	}

	public static int[] nextInts()throws Exception{
		check();
		int[] tmp = new int[Ws.length];
		for(int i=0;i<tmp.length;i++){
			tmp[i]=Integer.parseInt(Ws[i]);
		}
		wsIndx=Ws.length;
		return tmp;
	}

	public static long[] nextLongs()throws Exception{
		check();
		long[] tmp = new long[Ws.length];
		for(int i=0;i<tmp.length;i++){
			tmp[i]=Long.parseLong(Ws[i]);
		}
		wsIndx=Ws.length;
		return tmp;
	}

	public static String[] nextStrings()throws Exception{
		check();
		wsIndx=Ws.length;
		return Ws;
	}

}



Measured memory_bytes: 25688
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

#define dump(x)  cerr << #x << " = " << (x) << endl;
#define PB push_back
#define MP make_pair
#define ll long long

inline int toInt(string s){int v;istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x){ostringstream sout;sout<<x;return sout.str();}

bool predication(const pair<int,int> &a, const pair<int,int> &b){
    return a.first > b.first;
}

int main(){
    std::ios::sync_with_stdio(false);
    ll n, tmp = 0;
    cin >> n;
    vector<pair<ll,ll>> a;
    for(int i=0;i<n;++i)
    {
        cin >> tmp;
        a.push_back(MP(tmp, i));
    }
    sort(a.begin(), a.end(), predication);

    ll dp[n+1][n+1] = {};
    // dp[i-th][right]
    for(int i=0;i<n;++i)
    {
        for(int j=0;j<=i;++j)
        {

            // put to the left : i-j
            dp[i+1][j] = max(dp[i+1][j], dp[i][j] + a[i].first * abs(a[i].second - (i-j)));
            dp[i+1][j+1] = max(dp[i+1][j+1], dp[i][j] + a[i].first * abs(n-1-j - a[i].second));
        }
    }

    ll ret = -1;
    for(int i=0;i<=n;++i)
    {
        ret = max(ret, dp[n][i]);
    }
    cout << ret << endl;
}

Measured memory_bytes: 35012
from numba import njit
from sys import maxsize


@njit
def solve(n, k, p, c):
    used = [0] * n
    ss = []
    for i in range(n):
        if used[i]:
            continue
        now = i
        s = []
        while not used[now]:
            used[now] = 1
            s.append(c[now])
            now = p[now]
        ss.append(s)

    res = -maxsize
    for s in ss:
        s_len = len(s)
        cumsum = [0]
        # 2周分の累積和
        for i in range(2*s_len):
            cumsum.append(cumsum[-1] + s[i%s_len])

        max_sum = [-maxsize] * s_len
        for i in range(s_len):
            for j in range(s_len):
                max_sum[j] = max(max_sum[j], cumsum[i+j] - cumsum[i])

        for i in range(s_len):
            if i > k:
                continue
            v = (k - i) // s_len
            if i == 0 and v == 0:
                continue
            if cumsum[s_len] > 0:
                res = max(res, max_sum[i] + cumsum[s_len] * v)
            elif i > 0:
                res = max(res, max_sum[i])
    print(res)


if __name__ == '__main__':
    n, k = map(int, input().split())
    p = list(map(lambda x: int(x)-1, input().split()))
    c = list(map(int, input().split()))
    solve(n, k, p, c)


Measured memory_bytes: 118684
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <numeric>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <functional>
#define _USE_MATH_DEFINES
#include <cmath>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cfloat>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <cassert>
using namespace std;

#define EPS 1e-12
#define ull unsigned long long
#define ll long long
#define VI vector<ll>
#define PII pair<ll, ll> 
#define VVI vector<vector<ll> >
#define REP(i,n) for(int i=0,_n=(n);(i)<(int)_n;++i)
#define RANGE(i,a,b) for(int i=(int)a,_b=(int)(b);(i)<_b;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
#define ALLR(c) (c).rbegin(), (c).rend()
#define PB push_back
#define MP(a, b) make_pair(a, b)
#define POPCOUNT __builtin_popcount
#define POPCOUNTLL __builtin_popcountll
#define CLEAR(table, v) memset(table, v, sizeof(table));
#define PRINT1(table, D0) REP(d0, D0) cout<<table[d0]<<" "; cout<<"\n";
#define PRINT2(table, D0, D1) REP(d0, D0) { REP(d1, D1) cout<<table[d0][d1]<<" "; cout<<"\n"; }
#define PRINT3(table, D0, D1, D2) REP(d0, D0) { REP(d1, D1) { REP(d2, D2) cout<<table[d0][d1][d2]<<" "; cout<<"\n"; } cout<<"\n"; }
#define UNIFORM_DOUBLE(a, b) (((b-a)*(double)rand()/RAND_MAX)+a) // [a, b) 
#define UNIFORM_LL(a, b) (ll)UNIFORM_DOUBLE(a, b) // [a, b) 
#define IN(v, lo, hi) ((lo)<=(v) && (v)<(hi))
#define DD(v) cout<<#v<<": "<<v<<endl
template <typename T0, typename T1> std::ostream& operator<<(std::ostream& os, const map<T0, T1>& v) { for( typename map<T0, T1>::const_iterator p = v.begin(); p!=v.end(); p++ ){os << p->first << ": " << p->second << " ";} return os; }
template <typename T0, typename T1> std::ostream& operator<<(std::ostream& os, const pair<T0, T1>& v) { os << v.first << ": " << v.second << " "; return os; }
template <typename T> std::ostream& operator<<(std::ostream& os, const vector<T>& v) { for( int i = 0; i < (int)v.size(); i++ ) { os << v[i] << " "; } return os; }
template <typename T> std::ostream& operator<<(std::ostream& os, const vector<vector<T> >& v) { for( int i = 0; i < (int)v.size(); i++ ) { os << v[i] << endl; } return os; }
template <typename T> std::ostream& operator<<(std::ostream& os, const set<T>& v) { vector<T> tmp(v.begin(), v.end()); os << tmp; return os; }
template <typename T> std::ostream& operator<<(std::ostream& os, const deque<T>& v) { vector<T> tmp(v.begin(), v.end()); os << tmp; return os; }

#define MOD 1000000007LL
#define INF (1LL<<60)

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	ll X,Y;
	while(cin>>X>>Y) {
		cout<<X+Y/2<<endl;
	}
	
	return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

#define MAX 2000000
#define INFTY (1<<30)

int H, A[MAX+1];

void maxHeapify(int);
int extract(void);
void increseKey(int, int);
void insert(int);
void swap(int *, int *);

int main() {

  int key;
  char s[10];

  while(1) {
    scanf("%s", s);
    if( s[0] == 'e' && s[1] == 'n' ) {
      break;
    }
    if( s[0] == 'i' ) {
      scanf("%d", &key);
      insert(key);
    } else {
      printf("%d\n", extract());
    }
   
  }
  return 0;
}

void maxHeapify(int i) {
  
  int l;
  int r;
  int largest;
  int tmp;
  
  l = 2 * i;
  r = 2 * i + 1;

  if( l<=H && A[l]>A[i] ) {
    largest = l;
  } else {
    largest = i;
  }
  
  if( r <= H && A[r]>A[largest] ) {
    largest = r;
  }
  
  if( largest != i ) {
    tmp = A[i];
    A[i] = A[largest];
    A[largest] = tmp;
    maxHeapify(largest);
  }
  
  return ;
}

int extract(void){
  int maxv;
  
  if(H < 1)return -INFTY;
  
  maxv = A[1];
  A[1] = A[H--];
  maxHeapify(1);
  
  return maxv;
}

void increaseKey(int i,int key){
 
  if(key < A[i])return;
 
  A[i] = key;
  while(i > 1 && A[i/2] < A[i]){
    swap(&A[i],&A[i/2]);
    i = i/2;
  }

  return ;
}

void insert(int key){
 
  H++;
  A[H] = -INFTY;
  increaseKey(H,key);

  return ;
}

void swap(int *a,int *b){
  int tmp;
 
  tmp = *a;
  *a = *b;
  *b = tmp;

  return ;
}

Measured memory_bytes: 4696
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <cmath>
#include <numeric>
#include <string>
#include <queue>
#include <iomanip>
#include <iterator>

// #define MOD 1000000007
// #define INF 1000000001

using namespace std;
// typedef unsigned long long ull;
typedef long long ll;


template <class T>
ostream &operator<<(ostream &o, const vector<T>&obj) {
    o << "["; for (int i = 0; i < (int)obj.size(); ++i) o << (i > 0 ? ", " : "") << obj[i]; o << "]"; return o;
}
template <class T, class U>
ostream &operator<<(ostream &o, const pair<T, U>&obj) {
    o << "(" << obj.first << ", " << obj.second << ")"; return o;
}
template <class T, class U>
ostream &operator<<(ostream &o, const map<T, U>&obj) {
    o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr) o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;
}
template <class T>
ostream &operator<<(ostream &o, const set<T>&obj) {
    o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr) o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;
}

void print() {
    cout << "\n";
}
template<class Head, class... Body>
void print(Head head, Body... body) {
    cout << head << " ";
    print(body...);
}

int main(int argc, char const *argv[]) {
    string s;
    cin >> s;
    cout << s.front() << s.length()-2 << s.back() << endl;
    return 0;
}


Measured memory_bytes: 256
def isCLKWISE(ph) : return not ((ph[-1][0] - ph[-3][0])*(- ph[-3][1] + ph[-2][1]) - (ph[-2][0] - ph[-3][0])*(- ph[-3][1] + ph[-1][1] ) < 0)
      
def ConvexHullScan(P):
    P = sorted(P)
    phU = [P[0],P[1]]
    for p in P[2:]:
        phU.append(p)
        if isCLKWISE(phU) : continue
        while(True):
            del phU[-2]
            if len(phU) == 2 : break
            else :
                if isCLKWISE(phU) : break

    phL = [P[-1],P[-2]]
    for p in P[-3::-1]:
        phL.append(p)
        if isCLKWISE(phL) : continue
        while(True):
            del phL[-2]
            if len(phL) == 2 : break
            else :
                if isCLKWISE(phL) : break

                
                
    ph = phU + phL[1:-1]
    return ph
  
n = range(int(input()))
P = [[int(x) for x in input().split()] for _ in n]
Q = ConvexHullScan(P)
Q.reverse()
print(len(Q))
idx = min([[x[1][1],x[1][0],x[0]] for x in enumerate(Q)])[2]
R = Q[idx:] + Q[:idx]
for r in R : print(r[0],r[1])

Measured memory_bytes: 33768
#include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
/*
//#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
*/

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
/*
//#if __cplusplus >= 201103L
#include <array>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
*/
using namespace std;
#define fi first
#define se second
#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define each(itr,v) for(auto itr:v)
#define pb(s) push_back(s)
#define mmax(x,y) (x>y?x:y)
#define mmin(x,y) (x<y?x:y)
#define maxch(x,y) x=mmax(x,y)
#define minch(x,y) x=mmin(x,y)
#define mp(a,b) make_pair(a,b)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl

#define uni(x) x.erase(unique(all(x)),x.end())
template<class T,class U>inline void chmin(T &t,U f){if(t>f)t=f;}
template<class T,class U>inline void chmax(T &t,U f){if(t<f)t=f;}
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) > (b) ? (b) : (a))

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
typedef pair<P, int> PPI;

#define INF INT_MAX/3
#define MAX_N 1000
#define M_INF 1000000000
int n,m,v,i;
void solve(){
   cin.tie(0);
  ios::sync_with_stdio(false);
  cin>>n;
  ll p = n/1000 *10 + (n/100)%10;
  ll s = (n/10) % 10 *10+ n%10;
  // cout<<(n/100)%10<<endl;
  // cout<<p<<s<<endl;
  if((p>0 and p < 13) and (s>0 and s < 13)) cout<<"AMBIGUOUS"<<endl;
  else if((s>0 and s < 13)) cout<<"YYMM"<<endl;
  else if((p>0 and p < 13)) cout<<"MMYY"<<endl;
  else cout<<"NA"<<endl;

}

int main(){
  solve();
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define MOD 100000007
#define PI 3.141592653589793238
#define pb push_back
#define ALL(V) (V).begin(), (V).end()
#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long long int lint;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef vector<int> VI;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;
ll gcd(ll a, ll b) { return (a % b == 0 ? b : gcd(b, a % b)); }
ll lcm(ll a, ll b) { return a * b / gcd(a, b); }
ll char_to_ll(char c) { return (int)(c - '0'); }
ll string_to_ll(string s) { return char_to_ll(atoi(s.c_str())); }
bool is_prime(ll x){ if(x <= 1) return false; for(ll i = 2; sqrt(i) <= x; i++) if(x % i == 0) return false; return true; }


int main(){
    ll H, A;
    cin >> H >> A;

    ll count = 0;
    while (H > 0){
        count++;
        H -= A;
    }

    cout << count << endl;

    return 0;
}


Measured memory_bytes: 256
import java.util.*;
import java.io.*;
public class Main
{
    public static void main(String []args) throws IOException {
    	FastScanner in  = new FastScanner(System.in);
    	PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)), false);
    	solve(in, out);
    	in.close();
    	out.close();
    }
    static long gcd(long a, long b){ return (b==0) ? a : gcd(b, a%b); }
    static int gcd(int a, int b){ return (b==0) ? a : gcd(b, a%b); }
    static class FastScanner{
	BufferedReader reader;
	StringTokenizer st;
	FastScanner(InputStream stream){reader=new BufferedReader(new InputStreamReader(stream));st=null;}
	String next(){while(st == null || !st.hasMoreTokens()){try{String line = reader.readLine();if(line == null){return null;}
	     st = new StringTokenizer(line);}catch (Exception e){throw new RuntimeException();}}return st.nextToken();}
	String nextLine()  {String s=null;try{s=reader.readLine();}catch(IOException e){e.printStackTrace();}return s;}
	int    nextInt()   {return Integer.parseInt(next());}
	long   nextLong()  {return Long.parseLong(next());}
	double nextDouble(){return Double.parseDouble(next());}
	char   nextChar()  {return next().charAt(0);}
	int[]  nextIntArray(int n)         {int[] arr= new int[n];   int i=0;while(i<n){arr[i++]=nextInt();}  return arr;}
	long[] nextLongArray(int n)        {long[]arr= new long[n];  int i=0;while(i<n){arr[i++]=nextLong();} return arr;}
	int[]  nextIntArrayOneBased(int n) {int[] arr= new int[n+1]; int i=1;while(i<=n){arr[i++]=nextInt();} return arr;}
	long[] nextLongArrayOneBased(int n){long[]arr= new long[n+1];int i=1;while(i<=n){arr[i++]=nextLong();}return arr;}
	void   close(){try{reader.close();}catch(IOException e){e.printStackTrace();}}
    }
    
    /********* SOLUTION STARTS HERE ************/
    
    private static void solve(FastScanner in, PrintWriter out){
        String s = in.next();
        int n = s.length(),f=0;
        for(int i=0;i<n;i++){
            if(i%2==1){
                if(s.charAt(i)=='L' || s.charAt(i)=='U' || s.charAt(i)=='D'){}
                else f=1;
            }else{
                if(s.charAt(i)=='R' || s.charAt(i)=='U' || s.charAt(i)=='D'){}
                else f=1;
            }
        }
        out.println(f==0?"Yes":"No");
    }
    
    /************* SOLUTION ENDS HERE **********/
}

Measured memory_bytes: 22612
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<utility>
#include<set>
#include<stack>
#include<list>
#include<deque>
#include<bitset>
#include<iomanip>
#include<cstring>
#include<sstream>
#include<cstdio>
#include<cstdlib>
#include<climits>
#include<cmath>
#include<cctype>


#define pb push_back
#define mp make_pair
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define ren(i,a,b) for(int i=a;i>=b;i--)
#define ff first
#define ss second
#define pll pair<long long int,long long int>
#define pii pair<int,int>
#define vll vector<long long int>
#define vii vector<int>
#define gi(n) scanf("%d",&n)
#define gll(n) scanf("%lld",&n)
#define gstr(n) scanf("%s",n)
#define gl(n) cin >> n
#define oi(n) printf("%d",n)
#define oll(n) printf("%lld",n)
#define ostr(n) printf("%s",n)
#define ol(n) cout << n
#define os cout<<" "
#define on cout<<"\n"
#define o2(a,b) cout<<a<<" "<<b
#define all(n) n.begin(),n.end()
#define present(s,x) (s.find(x) != s.end())
#define cpresent(s,x) (find(all(s),x) != s.end())
#define tr(container, it) for(__typeof(container.begin()) it = container.begin(); it != container.end(); it++)
using namespace std;

typedef unsigned long long int ull;
typedef long long int ll;
typedef vector<vector<ll> > mat;

ll f[505][505],m=1e9+7,dp[505][505];

ll p(ll a,ll b)
{
	ll r=1;
	while(b)
	{
		if(b%2)
		r=(r*a)%m;
		a=(a*a)%m;
		b/=2;
	}
	return r;
}

int main()
{ios_base::sync_with_stdio(false);
rep(i,0,504)
{
	rep(j,1,504)
	{
		f[i][j]=(f[i][j-1]+p(j,i))%m;
	}
}
int n,a[505],b[505],c;
cin>>n>>c;
rep(i,0,n-1)
cin>>a[i];
rep(i,0,n-1)
cin>>b[i];

rep(j,0,c)
dp[0][j]=(f[j][b[0]]-f[j][a[0]-1])%m;

rep(i,1,n-1)
{
	rep(j,0,c)
	{
		rep(k,0,c)
		{
			if(j+k<=c)
			{
				dp[i][j+k]+=(dp[i-1][j]*(f[k][b[i]]-f[k][a[i]-1]))%m;
				dp[i][j+k]%=m;
			}
		}
	}
}
ll ans=dp[n-1][c]%m;
ans=(ans+m)%m;
ol(ans);
return 0;
}


Measured memory_bytes: 3968
package main

import (
	"fmt"
	"strings"
)

func main() {
	var A, B string
	fmt.Scan(&A)
	fmt.Scan(&B)
	if len(A) > len(B) {
		fmt.Println("GREATER")
		return
	} else if len(A) < len(B) {
		fmt.Println("LESS")
		return
	} else {
		ADigits := strings.Split(A, "")
		BDigits := strings.Split(B, "")
		for i := 0; i < len(ADigits); i++ {
			if ADigits[i] > BDigits[i] {
				fmt.Println("GREATER")
				return
			} else if ADigits[i] < BDigits[i] {
				fmt.Println("LESS")
				return
			}
		}
		fmt.Println("EQUAL")
	}
}

Measured memory_bytes: 640
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<cmath>
long long n,m,ans;
char a[110][110];
using namespace std;
int main()
{
	cin>>n>>m;
	for(int i=1;i<=n;i++)
		for(int j=1;j<=m;j++)
		cin>>a[i][j];
	for(int i=1;i<=n;i++)
		for(int j=1;j<=m;j++)
		{
			ans=0;
			if(a[i][j]!='#')
			{
				if(a[i-1][j-1]=='#') ans++;
				if(a[i-1][j]=='#') ans++;
				if(a[i-1][j+1]=='#') ans++;
				if(a[i][j-1]=='#') ans++;
				if(a[i][j+1]=='#') ans++;
				if(a[i+1][j-1]=='#') ans++;
				if(a[i+1][j]=='#') ans++;
				if(a[i+1][j+1]=='#') ans++;
				a[i][j]=char (ans+'0');
			}
		}
	for(int i=1;i<=n;i++)
	{
		for(int j=1;j<=m;j++) 
		cout<<a[i][j];
		cout<<endl;
	}
}

Measured memory_bytes: 256
n=int(input())
li=[]
for i in range(0,n):
    n=input()
    li.append(n)
flag=0
chck=1
temp=li[0]
for j in li:
    t=li.count(j)
    if(t>1):
        flag=1
        break
    if(chck!=1):
        p=len(temp)
        ch=temp[p-1]
        
        ch1=j[0]
        if(ch==ch1):
            flag=0
            temp=j
        else:
            flag=1
            break
    chck=chck+1
if(flag==1):
    print('No')
else:
    print('Yes')

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
const int N=2003;
int main()
{

int n,m,ans,f1[N][N],f2[N][N],f3[N][N],f4[N][N];
	cin >>n>>m;
	char mp[2003][2003];
	for(int i=1;i<=n;i++)scanf("%s",mp[i]+1);
	for(int i=1;i<=n;i++)
	for(int j=1;j<=m;j++)
	if(mp[i][j]=='.')f1[i][j]=f1[i-1][j]+1,f2[i][j]=f2[i][j-1]+1;
	for(int i=n;i;i--)
	for(int j=m;j;j--)
	if(mp[i][j]=='.')f3[i][j]=f3[i+1][j]+1,f4[i][j]=f4[i][j+1]+1;
	for(int i=1;i<=n;i++)
	for(int j=1;j<=m;j++)
	if(mp[i][j]=='.')ans=max(ans,f1[i][j]+f2[i][j]+f3[i][j]+f4[i][j]-3);
	cout <<ans<<endl;
	return 0;
}


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

int main() {
  string n, m;
  cin >> n >> m;
  int c = 0;
  for(int i = 0;i < n.size();++i) {
    if(n.at(i) != m.at(i)) {
      ++c;
      m.at(i) = n.at(i);
    }
  }
  cout << c << endl;
}

Measured memory_bytes: 3844
s = list(map(int,input().split()))
l = [0]*s[1]
r = [0]*s[1]
for i in range(s[1]):
    l[i], r[i] = list(map(int,input().split()))
    
lmax=0
rmin=s[0]
for i in range(s[1]):
    if l[i] > lmax:
        lmax = l[i]
    if r[i] < rmin:
        rmin = r[i]
if lmax > rmin:
    print(0)
else:
    print(-lmax+rmin+1)

Measured memory_bytes: 10996
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			char[] s = scanner.next().toCharArray();
			char[] t = scanner.next().toCharArray();
			boolean result = false;
			for (int i = 0; i < s.length; i++) {
				int count = 0;
				while ((count < s.length) && (s[(i + count) % s.length] == t[count])) {
					count++;
				}
				if (s.length == count) {
					result = true;
					break;
				}
			}
			System.out.println(result ? "Yes" : "No");
		}
	}
}


Measured memory_bytes: 35664
N, M = (int(x) for x in input().split())
A = [int(x) for x in input().split()]
list = []
for j in range(M):
    list.append([int(x) for x in input().split()])
A.sort()
list.sort(key = lambda x:x[1])

i, j = 0, M-1
while -1 < j:
    while i < N and list[j][0] > 0:
        if A[i] < list[j][1]:
            A[i] = list[j][1]
            list[j][0] -= 1
            i += 1
        else:
            print(sum(A))
            exit()
    else:
        j -= 1

print(sum(A))


Measured memory_bytes: 26948
#include<bits/stdc++.h>
using namespace std;
namespace whatever{
	int readu(){
		char ch=getchar();
		while(!isdigit(ch))
			ch=getchar();
		int value=ch-'0';
		ch=getchar();
		while(isdigit(ch)){
			value=value*10+ch-'0';
			ch=getchar();
		}
		return value;
	}
	long long readull(){
		char ch=getchar();
		while(!isdigit(ch))
			ch=getchar();
		long long value=ch-'0';
		ch=getchar();
		while(isdigit(ch)){
			value=value*10+ch-'0';
			ch=getchar();
		}
		return value;
	}
	long long gcd(long long a, long long b){
		return b==0? a: gcd(b, a%b);
	}
	void run(){
		int t=readu();
		while(--t!=-1){
			long long a=readull();
			long long b=readull();
			long long c=readull();
			long long d=readull();
			bool result;
			int type;
			if(d<b||a<b||c<a%b){
				result=false;
				type=0;
			}
			else if(d==b){
				result=true;
				type=1;
			}
			else{
				long long g=gcd(b, d);
				a%=g;
				long long min_value=(c-a+g)/g*g+a-b;
				result=(min_value>=0);
				type=2;
			}
			puts(result?"Yes":"No");
			cerr<<"type: "<<type<<endl;
		}
	}
}
int main(){
	whatever::run();
}

Measured memory_bytes: 256