akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <cstring>
#include <math.h>
#include <bitset>
#include <queue>
#include <set>
#include <iomanip>
#include <math.h>
#include <assert.h>
// #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
constexpr long long int INFLL = 1001001001001001LL;
constexpr long long int infll = 1001001001001001LL;
constexpr int INF = 1000000007;
constexpr int inf = 1000000007;
const int mod = 1000000007;

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

ll gcd(ll a, ll b)
{
    if (a % b == 0)
    {
        return (b);
    }
    else
    {
        return (gcd(b, a % b));
    }
}

ll lcm(ll a, ll b)
{
    return a / gcd(a, b) * b;
}

inline double nCr(const int n, int r)
{
    if (n == 0)
    {
        return 0;
    }
    if (r == 0)
    {
        return 1;
    }
    if (r == 1)
    {
        return n;
    }
    if (n == r)
    {
        return 1;
    }

    if (r > n / 2)
    {
        r = n / 2;
    }

    double result = 1;
    for (double i = 1; i <= r; i++)
    {
        result *= (n - i + 1) / i;
    }

    return (result);
}

template <typename T>
T seinomi(T a)
{
    if (a > 0)
    {
        return a;
    }
    else
    {
        return 0;
    }
}

template <typename T>
map<T, T> soinsuubunkai(T n) //連想配列[素因数f.first][個数f.second]
{
    map<T, T> ret;
    for (T i = 2; i * i <= n; i++)
    {
        while (n % i == 0)
        {
            ret[i]++;
            n /= i;
        }
    }
    if (n != 1)
        ret[n] = 1;
    return ret;
}

template <typename T>
T ketasuu(T num)
{
    return std::to_string(num).length();
}

int kaizyou(int k)
{
    int sum = 1;
    for (int i = 1; i <= k; ++i)
    {
        sum *= i;
    }
    return sum;
}

template <class ForwardIt, class T>
void iota(ForwardIt first, ForwardIt last, T value)
{
    while (first != last)
    {
        *first++ = value;
        ++value;
    }
}

//nの階乗を計算
int factorial(int n)
{
    int answer = 1;
    while (n > 1)
    {
        answer *= n;
        n--;
    }
    return answer;
}
int comb(int n, int r)
{
    return factorial(n) / (factorial(r) * factorial(n - r));
}

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

//小数点以下10桁テンプレート（main関数内の最初に貼付け）
//std::cout << std::fixed << std::setprecision(10);

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


int main(){
ll n;
cin>>n;
if(n<1000){
    cout<<"ABC"<<endl;
}else{
    cout<<"ABD"<<endl;
}
}









Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const ll MOD = 1000000007;
const ld PI = acos(-1);  
const ld EPS = 0.0000000001;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
#define REP(i, n) for(ll i=0; i<(ll)(n); i++)
#define REPD(i, n) for(ll i=n-1; 0<=i; i--)
#define FOR(i, a, b) for(ll i=a; i<(ll)(b); i++)
#define FORD(i, a, b) for(ll i=a; (ll)(b)<=i; i--)
#define ALL(x) x.begin(), x.end()
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};


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

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

    bool same(int a, int b){
        return root(a)==root(b);
    }
    void unite(int a, int b){
        int x=root(a), y=root(b);
        if(same(x, y)) return;
        if(y<x) swap(x, y);
        par[x] += par[y];
        par[y] = x;
    }
    int size(int x){
        return -par[root(x)];
    }

};

vector<bool> seen;
vector<vector<ll>> g;
bool flag;
void dfs(int v=0, int p=-1){
    
    seen[v] = true;
    for(auto x: g[v]){
        if(x==p) continue;
        if(seen[x]) continue;
        dfs(x, v);
    }
}

int main(){
    int n, m;   cin >> n >> m;
    g.resize(n);
    vector<pair<ll, ll>> br(m);
    REP(i, m){
        ll a, b;    cin >> a >> b;
        a--, b--;
        g[a].push_back(b);
        g[b].push_back(a);
        br[i] = {a, b};
    }
    ll res=m;
    REP(i, m){
        seen.assign(n, false);
        ll a=br[i].first, b=br[i].second;
        flag=true;
        dfs(a, b);
        
        REP(j, n) if(!seen[j]) flag = false;
        if(flag) res -= 1;
        
    }
    cout << res << endl;
}

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




int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
#ifdef LOCAL
	std::ifstream in("in");
	std::cin.rdbuf(in.rdbuf());
#endif

	ll A;
	cin >> A;

	string s = to_string(A);
	reverse(s.begin(), s.end());
	int N = s.size();
	vector<int> D(N);
	for(int i = 0; i < N; i++){
		D[i] = s[i] - '0';
	}

	// [digit][less than equal N]
	ll dp[50][2];
	memset(dp, -1, sizeof dp);
	dp[0][1] = 0;
	for(int i = 0; i < N; i++){
		for(int j = 0; j < 2; j++){
			if(dp[i][j] == -1) continue;
			for(int d = 0; d < 10; d++){
				int le = 0;
				if(j == 0 && d < D[i]) le = 1;
				if(j == 1 && d <= D[i]) le = 1;
				dp[i + 1][le] = max(dp[i + 1][le], dp[i][j] + d);
			}
		}
	}

	cout << dp[N][1] << endl;
}


Measured memory_bytes: 764
#include"bits/stdc++.h"

using namespace std; 

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef vector<PII> VPII;
typedef long long LL;
typedef vector<LL> VL;
typedef vector<VL> VVL;
typedef pair<LL, LL> PLL;
typedef vector<PLL> VPLL;
typedef priority_queue<int> PQ_DESC;
typedef priority_queue<int, vector<int>, greater<int>> PQ_ASC;
typedef priority_queue<PII> PQ_DESC_PII;
typedef priority_queue<PII, vector<PII>, greater<PII>> PQ_ASC_PII;
typedef priority_queue<VL> PQ_DESC_VL;
typedef priority_queue<VL, vector<VL>, greater<VL>> PQ_ASC_VL;

#define ALL(c) (c).begin(),(c).end()
#define PB push_back
#define MP make_pair
#define SORT_ASC(c) sort(ALL(c))
//#define SORT_DESC(c) sort(ALL(c), greater<typeof(*((c).begin()))>())
#define SORT_DESC(c) sort((c).rbegin(),(c).rend())
#define REV(c) reverse((c).begin(), (c).end())
#define SIZE(a) int((a).size())

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

const double EPS = 1e-10;
const double PI  = acos(-1.0);
const int LARGE_INT = 1e9+100;
const int INF = 2e9+100;
const LL INF_LL = (LL)INF*(LL)INF;
const int MOD = 1e9+7;

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

LL modpow(LL a, LL n) {
    LL res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % MOD;
        a = a * a % MOD;
        n >>= 1;
    }
    return res;
}

int n,k;
VVI e;

LL dfs(int now, int parent){
    if(k <= SIZE(e[now])){
        return 0;
    }

    LL result = 1;
    LL child_color;
    LL child_num;
    if(parent==-1){
        child_color = k-1;
        child_num = SIZE(e[now]);
    }
    else{
        child_color = k-2;
        child_num = SIZE(e[now])-1;
    }
    REP(i,child_num){
        result *= child_color-i;
        result %= MOD;
    }

    for(auto next : e[now]){
        if(next == parent){
            continue;
        }

        result *= dfs(next, now);
        result %= MOD;
    }

    return result;

}

void Main()
{
    cin>>n>>k;


    e.resize(n);
    REP(i,n-1){
        int a,b;cin>>a>>b;
        a--;b--;
        e[a].PB(b);
        e[b].PB(a);
    }

    LL result = k* dfs(0,-1);
    result %= MOD;

    cout<<result<<endl;

    
	return;
}

int main()
{
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	Main();
    return 0;
}

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

using namespace std;

int main(void){
  string S;
  cin >> S;
  bool v[256] = {0};
  for(auto c : S) v[c] = true;
  if(!(v['N'] ^ v['S']) && !(v['E'] ^ v['W'])) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}


Measured memory_bytes: 256
N,K = map(int,input().split())
A = list(map(int,input().split()))
B = [a%K for a in A]
cs = [0]
for b in B:
    c = (cs[-1] + b-1) % K
    cs.append(c)

from collections import deque
from collections import defaultdict
qs = defaultdict(lambda: deque())

ans = 0
for i,c in enumerate(cs):
    while qs[c] and qs[c][0] + K <= i:
        qs[c].popleft()
    ans += len(qs[c])
    qs[c].append(i)
print(ans)

Measured memory_bytes: 169888
S = list(str(input()))
T = list(str(input()))

cc = 0
for i in range(len(S)):
  if S == T:
    cc += 1
    break
  else:
    S.insert(0,S[-1])
    S.pop()
    
if cc == 1:
  print("Yes")
else:
  print("No")

Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repI(i, d, n) for (int i = (d); i < (n); ++i)
#define reps1(i, n) for (int i = 1; i < (n); ++i)
using namespace std;
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; }

using ll = long long;
using P = pair<int, int>;
using Pl = pair<ll, ll>;
using M = map<int, int>;
using Ml = map<ll, ll>;
ll const INF = 1ll<<61;
double pi = 3.141592653589793238;

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

  vector<ll> a(n);
  rep(i, n) cin >> a[i];

  sort(a.begin(), a.end(), greater<ll>());

  queue<ll> q;
  q.push(a[0]);

  ll ans = 0;

  reps1(i, n) {
    ans += q.front();
    q.pop();
    q.push(a[i]);
    q.push(a[i]);

  }

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


Measured memory_bytes: 6416
a = sorted(list(map(int, input().split())))

s = sum(a)
if s%2==a[2]%2:
  if a[2]%2==a[1]%2:
    print((a[2]-a[1])//2+(a[2]-a[0])//2)
  else:
    a[1] += 1
    a[0] += 1
    print((a[2]-a[1])//2+(a[2]-a[0])//2+1)
else:
  a[2] += 1
  a[1] += 1
  if a[2]%2==a[1]%2:
    print((a[2]-a[1])//2+(a[2]-a[0])//2+1)
  else:
    a[1] += 1
    a[0] += 1
    print((a[2]-a[1])//2+(a[2]-a[0])//2+2)

Measured memory_bytes: 9172
a, b, k = map(int, input().split())

memory = set()
cnt = 0
for n in range(a, b + 1):
    memory.add(n)
    cnt += 1
    if cnt == k:
        break

cnt = 0
for n in reversed(range(a, b + 1)):
    if n not in memory:
        memory.add(n)
    cnt += 1
    if cnt == k:
        break

for n in sorted(list(memory)):
    print(n)


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


#define ll long long int
#define ld long double
#define mod 1000000007
#define big 1e18+100000000
#define small -big
#define pb push_back



template <typename T>

void prarr(T a)
{
     cerr << "[ ";
     
     for(auto i : a){
         cerr << i << " ";
     }
     
     cerr << "]" << endl;
}


#define trace(...) _er(#__VA_ARGS__, __VA_ARGS__)

template <typename Arg1>

void _er(const char* name, Arg1&& arg1){
	cerr << "[" << name << " : " << arg1 << "]" << endl;
}

template <typename Arg1, typename... Args>

void _er(const char* names, Arg1&& arg1, Args&&... args){
    
	const char* comma = strchr(names + 1, ',');
	cerr << "[" ; cerr.write(names, comma - names) << " : " << arg1 << "] ";
	_er(comma+2, args...);
}




void solve() {
            
            ll n;
            cin >> n;
            
            ll A[n + 1];
            ll B[n + 1];
            
            for(ll i = 1; i <= n; i++) {
                    cin >> A[i];
            }
            
            for(ll i = 1; i <= n; i++) {
                    cin >> B[i];
            }
            
            for(ll i = 1; i <= (n / 2); i++) {
                    ll t = B[i];
                    B[i] = B[n - i + 1];
                    B[n - i + 1] = t;
            }
            
            ll l = n + 1;
            ll r = 0;
            
            for(ll i = 1; i <= n; i++) {
                    if(A[i] == B[i]) {
                            l = i;
                            break;
                    }
            }
            
            for(ll i = n; i >= 1; i--) {
                    if(A[i] == B[i]) {
                            r = i;
                            break;
                    }
            }
            
            
            ll l1 = l;
            ll r1 = r;
            
            for(ll i = 1; i < l; i++) {
                    if(l1 <= r1) {
                            if(A[i] != A[l1] && B[i] != B[l1]) {
                                    swap(B[i], B[l1]);
                                    l1++;
                            }
                    }
            }
            
            for(ll i = n; i > r; i--) {
                    if(l1 <= r1) {
                            if(A[i] != A[l1] && B[i] != B[l1]) {
                                    swap(B[i], B[l1]);
                                    l1++;
                            }
                    }
            }
            
            if(l1 <= r1) {
                    cout << "No" << endl;
            } else {
                    cout << "Yes" << endl;
                    for(ll i = 1; i <= n; i++) {
                            cout << B[i] << " ";
                    }
                    cout << endl;
            }
}


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

    int t=1;
    //cin >> t;

    for(int i = 1; i <= t; i++) {  
   
         solve();
    }


    return 0;
        
}


Measured memory_bytes: 6756
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,n) for(ll i=0;i<n;i++)
#define P pair<ll,ll>
#define Graph vector<vector<ll>>
#define INF (1ll<<55)
#define mod 1000000007
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return true;} return false;}
template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return true;} return false;}

int main(){
    ll n,m;cin>>n>>m;
    vector<P> p(n);
    priority_queue<ll> que;
    rep(i,n){
        ll a,b;cin>>a>>b;
        p[i]={a,b};
    }
    sort(p.begin(),p.end());

    ll ans=0,num=0;
    rep(i,m+1){//後ろからi日目の時を考える
        que.push(0);
        while(num<n){
            if(p[num].first<=i){
                que.push(p[num++].second);
            }else{
                break;
            }
        }

        ll mx=que.top();
        ans+=mx;
        que.pop();
    }

    cout<<ans<<endl;

    return 0;
}

Measured memory_bytes: 5876
#include<bits/stdc++.h>
#define ll long long 
#define pb push_back
#define bg begin
#define en end 
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
ll gcd(ll a,ll b){
    if(a==0)
    return b;
    else
    return gcd(b%a,a);
}
using namespace std;
int main()
{
    ll n;
    cin>>n;
    ll a[n];
    ll i;
    for(i=0;i<n;i++){
        cin>>a[i];
    }
    ll st,v,res;
    st=1000/a[0];
    v=1000;
    res=1000%a[0];
    for(i=0;i<n-1;i++){
        if(a[i+1]>a[i]){
            v=st*a[i+1]+res;
        }
        else if(a[i+1]<a[i]){
            st=v/a[i+1];
            res=v%a[i+1];
        }
    }
    cout<<v;
}

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

void bubbleSort(vector<int> A, int N);

int main() {
    int N;
    cin >> N;
    
    vector<int> A(N);
    for (int i=0; i<N; i++) {
        cin >> A.at(i);
    }
    
    bubbleSort(A, N);
}

void bubbleSort(vector<int> A, int N) {
    int flag = 1;
    int i = 0;
    int count = 0;
    while (flag) {
        flag = 0;
        for (int j = N-1; j >= i+1; j--) {
            if (A.at(j-1) > A.at(j)) {
                int tmp = A.at(j);
                A.at(j) = A.at(j-1);
                A.at(j-1) = tmp;
                count ++; // 入れ替え回数を記録
                flag = 1; // 入れ替えが１つでもあったら1
            } // 入れ替えが1つもなかったらソート完了
        }
        i++;
    }
    
    for (int i=0; i<N; i++) {
        cout << A.at(i);
        if (i == N-1) {
            cout << endl;
        } else {
            cout << ' ';
        }
    }
    
    cout << count << endl;
}




Measured memory_bytes: 3160
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <cctype>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <limits>

using namespace std;
typedef long long int ll;
void sayYes() { cout << "Yes" << endl; };
void sayNo() { cout << "No" << endl; };
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }                   // 最大公約数
ll lcm(ll a, ll b) { return a * b / gcd(a, b); };                      // 最小公倍数
ll getDigit(ll num) { return log10(num) + 1; }                         // 桁数
ll digitSum(ll n) { return (n < 10) ? n : digitSum(n / 10) + n % 10; } // 各桁の和
#define rep(i, n) for (ll i = 0; i < n; i++)
#define repn(i, n) for (ll i = 1; i <= n; i++)

void Main()
{
    // int n;
    // cin >> n;
    // vector<int> a(n);
    // rep(i, n)
    // {
    //     cin >> a[i];
    // }
    string str;
    cin >> str;
    if (str == "ABC")
        cout << "ARC" << endl;
    else
        cout << "ABC" << endl;
    return;
}

signed main(void)
{
    std::cin.tie(nullptr);
    std::ios_base::sync_with_stdio(false);
    std::cout << std::fixed << std::setprecision(15);
    Main();
    return 0;
}


Measured memory_bytes: 3628
#include<iostream>
using namespace std;
int main()
{ 
    int a,b,c;
    cin>>a>>b>>c;
    if(a==b&&a!=c||a==c&&a!=b)
    cout<<"Yes";
    else if(b==a&&b!=c||b==c&&b!=a)
    cout<<"Yes";
    
  else
   cout<<"No";
  
    
    
    
    
}




Measured memory_bytes: 256
#include <iostream>
#include <string>
using namespace std;
int main() {

	string s, t;
	cin >> s >> t;
	for (int i = 0; i < s.size(); i++) {
		for (int j = 0; j < s.size(); j++) {
			if (s[j] != t[j]) {
				break;
				//goto out;
			}
			if (j == s.size() - 1) {
				cout << "Yes" << endl;
				goto end;
			}
		}

		char ss = s[s.size() - 1];
		for (int j = s.size() - 1; j >= 0; j--) {
			if (j != 0) {
				s[j] = s[j - 1];
			}
			else {
				s[j] = ss;
			}
		}

	}

	cout << "No" << endl;

	end:

	return 0;
}

Measured memory_bytes: 256
# 75=1*75=3*25=5*15=3*5*5
from math import factorial
from collections import Counter
from itertools import permutations


def prime_factorization(n):
    b = 2
    fct = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            fct.append(b)
        b = b + 1
    if n > 1:
        fct.append(n)
    return fct


n = int(input())
ans1, ans2, ans3 = 0, 0, 0
primes = prime_factorization(factorial(n))
c = Counter(primes)
for key, count in c.items():
    if count >= 74:
        ans1 += 1
for item in permutations(c.items(), 2):
    key1, count1 = item[0]
    key2, count2 = item[1]
    if count1 >= 24 and count2 >= 2:
        ans2 += 1
    if count1 >= 14 and count2 >= 4:
        ans2 += 1
for item in permutations(c.items(), 3):
    key1, count1 = item[0]
    key2, count2 = item[1]
    key3, count3 = item[2]
    if count1 >= 4 and count2 >= 4 and count3 >= 2:
        ans3 += 1
print(ans1 + ans2 + ans3 // 2)


Measured memory_bytes: 3316
#include <bits/stdc++.h>
#define REP(i, n) for (int (i) = 0; (i) < (int)(n); i++) 
#define FOR(i, a, b) for(int (i) = a; (i) < (int)b; i++)
#define RREP(i, n) for(int (i)=((int)(n)-1); (i)>=0; i--)
#define RFOR(i, a, b) for(int (i) =((int)(b)-1); (i)>=(int)a; i--)
#define ALL(v) (v).begin(),(v).end()
#define MOD 1000000007
#define FT first
#define SC second

using namespace std ;
typedef long long ll;
typedef vector<int> vint;
typedef vector<vint> vvint;
typedef pair<int, int> pint;
const int INF = 1e9;
const double EPS = 1e-9;



int main()
{
  int h, w ;
  cin >> h >> w ;
  vector<string> str(h) ;
  REP(i,h){
    cin >> str.at(i) ;
  }
  REP(i,h+2){
    REP(j,w+2){
      if(1<=i && i<=h && 1<=j && j<=w){
        cout << str.at(i-1).at(j-1) ;
      }
      else{
        cout << '#' ;
      }
    }
    cout <<endl ;
  }

  return 0 ;
}




Measured memory_bytes: 256
def c_multiple_gift(X, Y):
    ans = 1  # A_1=Xとなる長さ1の数列が必ず作れる
    while X <= Y:
        X *= 2  # A_{i+1} = 2A_iとする
        ans += 1
    ans -= 1  # whileの最後でYを超える要素を1つ入れたので除く
    return ans 

X,Y = [int(i) for i in input().split()]
print(c_multiple_gift(X, Y))

Measured memory_bytes: 3060
#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <bitset>
#include <utility>
#include <numeric>
#include <iterator>

using namespace std;

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

const ll inf = 1ll << 60;
const ll mod = (ll)1e9 + 7;

#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()

#define print(s) cout << s;
#define println(s) cout << s << endl;
#define printd(s) cout << fixed << setprecision(10) << s << endl;


int main()
{
	vector<ll> a(3);
	for (ll i = 0; i < 3; i++)
	{
		cin >> a[i];
	}

	ll res = 0;
	for (ll i = 0; i < 3; i++)
	{
		ll cnt = 1;
		for (ll j = 0; j < 3; j++)
		{
			if (i != j && a[i] == a[j])
			{
				cnt++;
			}
		}

		res = max(res, cnt);
	}

	if (res == 2)
	{
		println("Yes");
	}
	else
	{
		println("No");
	}
}

Measured memory_bytes: 3628
#pragma region kyomukyomupurin

/**
 *    author  : 𝒌𝒚𝒐𝒎𝒖𝒌𝒚𝒐𝒎𝒖𝒑𝒖𝒓𝒊𝒏
 *    created : 2020-05-28 17:48:01
 **/

#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <chrono>
#include <cmath>
#include <complex>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <vector>

using namespace std;

using int64 = long long;

template <class T>
using binary_heap = std::priority_queue<T, std::vector<T>, std::greater<T>>;

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

template <class Ch, class Tr, class Tuple, std::size_t... Is>
void tuple_out(std::basic_ostream<Ch, Tr>& os, const Tuple& tp, std::index_sequence<Is...>) {
  ((os << (Is ? ", " : "(") << std::get<Is>(tp)), ...) << ")";
}

template <class Ch, class Tr, class... Args>
auto& operator<<(std::basic_ostream<Ch, Tr>& os, const std::tuple<Args...>& tp) {
  tuple_out(os, tp, std::index_sequence_for<Args...>{});
  return os;
}

template <class T>
std::ostream& operator<<(std::ostream& os, const std::vector<T>& vec) {
  int n = 0;
  for (auto e : vec) os << (n++ ? ", " : "{") << e;
  return os << (n ? "}" : "{}");
}

template <class T, class Compare>
std::ostream& operator<<(std::ostream& os, const std::set<T, Compare>& st) {
  int n = 0;
  for (auto e : st) os << (n++ ? ", " : "{") << e;
  return os << (n ? "}" : "{}");
}

template <class T, class U, class Compare>
std::ostream& operator<<(std::ostream& os, const std::map<T, U, Compare>& mp) {
  int n = 0;
  for (auto e : mp) os << (n++ ? ", " : "{") << e;
  return os << (n ? "}" : "{}");
}

template <class T>
std::istream& operator>>(std::istream& is, std::vector<T>& vec) {
  for (T& e : vec) is >> e;
  return is;
}

#define all(_) begin(_), end(_)
#define rall(_) rbegin(_), rend(_)

#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]: ", debug_out(__VA_ARGS__)
#else
#define debug(...)
#endif

void debug_out() { std::cerr << '\n'; }

template <class Head, class... Tail>
void debug_out(Head&& head, Tail&&... tail) {
  std::cerr << head;
  if (sizeof...(Tail) != 0) std::cerr << ", ";
  debug_out(std::forward<Tail>(tail)...);
}

#pragma endregion kyomukyomupurin

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

  string s, t; cin >> s >> t;
  t.pop_back();

  cout << (s == t ? "Yes" : "No") << endl;

  return 0;
}


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

int main() {
  ll A;
  string B;
  cin >> A >> B;
  ll B100 = (ll)(B[0]-'0')*100 + (ll)(B[2]-'0')*10 + (ll)(B[3]-'0');
  cout << (A*B100)/100 << endl;
}


Measured memory_bytes: 3624
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include<stack>
#include <unordered_map>

using namespace std;

int main() {
	int L, R;
	cin >> L >> R;
	int l = L % 2019, r = R % 2019;
	if (R - L > 2019 || r < l) {
		cout << 0;
		return 0;
	}
	int min = 2018;
	for (int i = l; i < r; i++) {
		for (int j = i + 1; j <= r; j++) {
			int a = (i * j) % 2019;
			if (a < min)min = a;
		}
	}
	cout << min;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(){
   string s;
   cin >> s;
   int a=s.size();
   int sum=0;
   for(int i=0;i<a;i++){
       if(s[i]=='0') sum+=0;
       if(s[i]=='1') sum+=1;
       if(s[i]=='2') sum+=2;
       if(s[i]=='3') sum+=3;
       if(s[i]=='4') sum+=4;
       if(s[i]=='5') sum+=5;
       if(s[i]=='6') sum+=6;
       if(s[i]=='7') sum+=7;
       if(s[i]=='8') sum+=8;
       if(s[i]=='9') sum+=9;
   }
   if(sum%9==0) cout << "Yes" << endl;
   else cout << "No" <<endl;
}


Measured memory_bytes: 3712
process.stdin.resume();
process.stdin.setEncoding('utf8');

var lines = []
var reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});

reader.on('line', (line) => {
  lines.push(line);
});

reader.on('close', () => {
 var n = Number(lines[0]);
 var a = lines[1].split(' ');
 a = a.map(function(str) { return Number(str)});
 var max = 0;
 var alice = 0;
 var bob = 0;

 while(true){
   max = Math.max(...a);
   alice += max;
   var index = a.indexOf(max);
   a.splice(index,1);
   n--;
   if(n == 0){
     break;
   }

   max = Math.max(...a);
   bob += max;
   var index = a.indexOf(max);
   a.splice(index,1);
   n--;
   if(n == 0){
     break;
   }
   
 }

 console.log(alice - bob);
});

Measured memory_bytes: 8624
import java.io.FileNotFoundException;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) throws FileNotFoundException {

//    	File file = new File("src/in.txt");

        //コード
//    	Scanner sc = new Scanner(file);
    	Scanner sc = new Scanner(System.in);

    	long N = sc.nextLong();
    	if(N==1) {
    		System.out.println("a");
    	} else {

    		long X = 26;
    		int cnt = 0;
    		while(X<N) {
    			X = 26 * (X+1);
    			cnt++;
    		}
    		X = X/26 -1 ;
        	N = N-X-1;
        	long[] x = new long[11];
        	int keta = 0;
        	while(N>0) {
        		x[keta] = N%26;
        		keta++;
        		N = N/26;
        	}
        	for(int i=cnt;i>=0;i--) {
        		if(i>0) {
        			long y = x[i];
        			long codepoint =  97+y;
        			char c = (char)codepoint;
        			System.out.print(c);
        		} else {
        			long y = x[i];
        			y++;
        			long codepoint =  96+y;
        			char c = (char)codepoint;
        			System.out.println(c);
        		}
        	}
    	}
    }
}

Measured memory_bytes: 27048
#include <iostream>
#include <cstdio>
#include <cstring>

#define MAX_M 100010
#define MOD 1000000007

struct Matrix{
	int a[3][3];
	Matrix(){
		memset(a, 0, sizeof(a));
	}
	int *operator [](int x){
		return a[x];
	}
}m0, m1, w;

Matrix operator *(Matrix x, Matrix y){
	Matrix z;
	for(int i = 0; i < 3; i++)
		for(int j = 0; j < 3; j++)
			for(int k = 0; k < 3; k++)
				z[i][j] = (z[i][j] + 1ll * x[i][k] * y[k][j] % MOD) % MOD;
	return z;
}

Matrix ksm(Matrix x, int y){
	Matrix z;
	z[0][0] = z[1][1] = z[2][2] = 1;
	for(; y; y >>= 1, x = x * x)
		if(y & 1) z = z * x;
	return z;
}

int N, M, x[MAX_M];

int main(){
	m0[0][0] = m0[0][2] = m0[1][1] = m0[1][2] = m0[2][2] = m1[0][2] = m1[1][0] = m1[1][1] = m1[1][2] = m1[2][0] = m1[2][2] = 1, m0[0][1] = m1[0][0] = m1[0][1] = 2;
	scanf("%d%d", &N, &M);
	for(int i = 1; i <= M; i++)
		scanf("%d", &x[i]);
	w[0][0] = 1, w[1][0] = 1, w[2][0] = 1; 
	Matrix ans; ans[0][0] = ans[1][1] = ans[2][2] = 1;
	for(int i = 1; i <= M; i++)
		ans = m0 * ksm(m1, x[i] - x[i - 1] - 1) * ans;
	ans = ksm(m1, N - x[M] - 1) * ans;
	ans = ans * w;
	printf("%d\n", ans[0][0]);
	return 0;
}

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

int main()
{
    ll N,K;
    cin >> N >> K;

    ll ans=0;

    ll sum=(1+N)*N/2;
    for(ll i=K;i<=N;i++){
        ll t1=(0+i-1)*i/2;
        ll t2=(N+N-i+1)*i/2;
        ll max_n=sum-t1;
        ll min_n=sum-t2;
        ans+=(max_n-min_n+1)%MOD;
    }
    cout << (ans+1)%MOD  << endl;
}


Measured memory_bytes: 3604
#include <bits/stdc++.h>
using namespace std;
int main(){
  int K,A,B;
  cin>>K;
  cin>>A>>B;
  for(int i=A;i<B+1;i++){
    if(i%K==0){
      cout<<"OK"<<endl;
      return 0;
    }
  }
  cout<<"NG"<<endl;
}

Measured memory_bytes: 3636
#include<bits/stdc++.h>
#define x real()
#define y imag()
using namespace std;
typedef complex<double> P;
typedef pair<P,P> L;

double dot(P a, P b){ return real(conj(a)*b); }

double cross(P a, P b){ return imag(conj(a)*b); }

int ccw(P a, P b, P c){
  b -= a;
  c -= a;
  if(cross(b,c) > 0) return 1;
  if(cross(b,c) < 0) return -1;
  if(dot(b,c) < 0) return 2;
  if(norm(b) < norm(c)) return -2;
  return 0;
}

bool isIntersect(L s1, L s2){
  return ( ccw(s1.first,s1.second,s2.first) * ccw(s1.first,s1.second,s2.second) <= 0 &&
  ccw(s2.first,s2.second,s1.first) * ccw(s2.first,s2.second,s1.second) <= 0 );
}

double getDistanceSP(L s, P p){
  if(dot(s.second - s.first, p - s.first) < 0) return abs(p - s.first);
  if(dot(s.first - s.second, p - s.second) < 0) return abs(p - s.second);
  return abs(cross(s.second - s.first, p - s.first) / abs(s.second - s.first));  }

double getDistanceSS(L s1, L s2){
  if(isIntersect(s1,s2)) return 0.0;
  return min( min(getDistanceSP(s1, s2.first), getDistanceSP(s1, s2.second)),
              min(getDistanceSP(s2, s1.first), getDistanceSP(s2, s1.second)));
}


double cal(L a,L b,double h){
  double d=getDistanceSS(a,b);
  if(h>d)return d;
  return (h*h+d*d)/2/h;
}

int main(){
  int n;
  while(cin>>n,n){
    double ans=1e9;
    P s,e;
    double minx,maxx,miny,maxy,h;
    cin>>s.x>>s.y>>e.x>>e.y;
    for(int i=0;i<n;i++){
      cin>>minx>>miny>>maxx>>maxy>>h;
      if(minx<=s.x&&s.x<=maxx&&miny<=s.y&&s.y<=maxy)ans=0;
      if(minx<=e.x&&e.x<=maxx&&miny<=e.y&&e.y<=maxy)ans=0;
      ans=min(ans,cal(L(s,e),L(P(minx,miny),P(minx,maxy)),h));
      ans=min(ans,cal(L(s,e),L(P(minx,maxy),P(maxx,maxy)),h));
      ans=min(ans,cal(L(s,e),L(P(maxx,maxy),P(maxx,miny)),h));
      ans=min(ans,cal(L(s,e),L(P(maxx,miny),P(minx,miny)),h));
    }
    printf("%.8lf\n",ans);
  }
  return 0;
}

Measured memory_bytes: 3224
#include<iostream>

using namespace std;

int main()
{
    int h, n;
    cin >> h >> n;
    int total = 0;
    int *a = new int[n];
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        total += a[i];
    }

    if (total >= h) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }


    return 0;
}


Measured memory_bytes: 640
import bisect

S = input()
T = input()

d = [[] for _ in range(27)]
# alpha2num = lambda c: ord(c) - ord("a") + 1
d = {chr(c): [] for c in range(ord("a"), ord("z")+1)}

for i, s in enumerate(S):
    # d[alpha2num(s)].append(i)
    d[s].append(i)

idx = -1
l = 0
ans = 0
for t in T:
    # dl = d[alpha2num(t)]
    dl = d[t]
    if not dl:
        ans = -1
        break
    insert_idx = bisect.bisect_right(dl, idx)
    if insert_idx == len(dl):
        l += 1
        idx = dl[0]
    else:
        idx = dl[insert_idx]
    ans = l * len(S) + idx + 1

print(ans)

Measured memory_bytes: 7540
// E.

#include <iostream>
#include <sstream>
#include <algorithm>
#include <vector>
#include <set>

using namespace std;

typedef long long LL;

int main(int argc, char* argv[]) {
	while (true) {
		LL n = -1;
		cin >> n;
		if (n <= 0) break;
		vector<int> p(n), r(n + 1);
		for (int i = 0; i < n; ++i) {
			cin >> p[i];
			r[p[i]] = i;
		}
		set<LL> s;
		s.insert(-2);
		s.insert(-1);
		s.insert(n);
		s.insert(n + 1);
		LL ans = 0;
		for (LL i = n; i > 0; --i) {
			auto c = s.lower_bound(r[i]);
			auto b = c, d = c;
			--b, ++d;
			auto a = b;
			--a;
			s.insert(r[i]);
//			if (*b >= 0) {
				ans += i * (*b - max(0LL, *a + 1) + 1) * (min(n - 1, *c - 1) - r[i] + 1);
//			}
//			if (*c < n) {
				ans += i * (r[i] - max(0LL, *b + 1) + 1) * (min(n - 1, *d - 1) - *c + 1);
//			}
		}
		cout << ans << endl;
	}
	return 0;
}


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

using namespace std;

pair <int, int> pos[100001];
int cost[100001];
int a[501][501];

 main () {
 	int n, m, d;
 	cin >> n >> m >> d;
 	for (int i = 1;i <= n;i ++) {
 		for (int j = 1;j <= m;j ++) {
 			cin >> a[i][j];
 			pos[a[i][j]] = make_pair (i, j);
 		}
 	}
 	for (int i = 1;i <= n * m;i ++) {
		if (i > d) {
			cost[i] = cost[i - d] + abs (pos[i - d].first - pos[i].first) + abs (pos[i - d].second - pos[i].second);
		}
 	}
 	int q;
 	cin >> q;;
 	while (q --) {
 		int l, r;
 		cin >> l >> r;             
 		cout << cost[r] - cost[l] << endl;
 	}
	return 0; 	 
}

Measured memory_bytes: 2816
package main

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

func max(x, y int) int {
	if x > y {
		return x
	}
	return y
}

func main() {
	defer flush()

	R := readInt()
	C := readInt()
	K := readInt()

	goods := make([][]int, R)
	for i := 0; i < R; i++ {
		goods[i] = make([]int, C)
	}
	for i := 0; i < K; i++ {
		r := readInt() - 1
		c := readInt() - 1
		v := readInt()
		goods[r][c] = v
	}

	n := make([]int, C+1)
	c := make([]int, 4)
	for i := 0; i < R; i++ {
		for k := 0; k < 4; k++ {
			c[k] = 0
		}
		c[0] = n[0]
		for j := 0; j < C; j++ {
			for k := 2; k >= 0; k-- {
				c[k+1] = max(c[k+1], c[k]+goods[i][j])
			}
			for k := 0; k < 4; k++ {
				n[j] = max(n[j], c[k])
			}
			c[0] = max(c[0], n[j+1])
		}
	}

	result := -1
	for k := 0; k < 4; k++ {
		result = max(result, c[k])
	}

	println(result)
}

const (
	ioBufferSize = 1 * 1024 * 1024 // 1 MB
)

var stdinScanner = func() *bufio.Scanner {
	result := bufio.NewScanner(os.Stdin)
	result.Buffer(make([]byte, ioBufferSize), ioBufferSize)
	result.Split(bufio.ScanWords)
	return result
}()

func readString() string {
	stdinScanner.Scan()
	return stdinScanner.Text()
}

func readInt() int {
	result, err := strconv.Atoi(readString())
	if err != nil {
		panic(err)
	}
	return result
}

var stdoutWriter = bufio.NewWriter(os.Stdout)

func flush() {
	stdoutWriter.Flush()
}

func println(args ...interface{}) (int, error) {
	return fmt.Fprintln(stdoutWriter, args...)
}


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

int main() {
    int N;cin>>N;
    vector<int > v;
    while(N--){
        int a;cin>>a;
        if(a==0){
            int b;cin>>b;
            v.push_back(b);
        }
        else if(a==1){
             int b;cin>>b;
             cout<<v[b]<<endl;
        }
        else if(a==2){
            v.pop_back();
        }
    }
    return 0;
}



Measured memory_bytes: 3840
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
#define rrep(i,n) for(int i=n-1;i>=0;--i)
#define yesno(flg) if(flg){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;}
#define MAX_N 1002
#define i197 1000000007

using namespace std;

typedef long long ll;
typedef pair<ll,ll> P1;
typedef pair<int,int> Pi;
typedef pair<double,Pi> Pdi;
typedef pair<ll,int>Pli;
typedef pair<P1,ll> P2;
const ll INF=1000000000000000001;
struct edge{int to,cost;};
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};
struct Road{double cost;int a,b;};

int main() {

	string s;
	string t="CODEFESTIVAL2016";
	cin>>s;

	int total=0;
	rep(i,17){
		if(s[i]!=t[i])total++;
	}
	cout<<total<<endl;
	return 0;

}


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

using namespace std;

const int maxn = 1e6 + 5;
int N;
string s[maxn];
int g[maxn][26], cnt;
int en[maxn];
vector<int> path[maxn];

int32_t main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    cin >> N;
    for(int i = 1; i <= N; ++i){
        cin >> s[i];
        int root = 0;
        reverse(begin(s[i]), end(s[i]));
        for(auto &v : s[i]) {
            path[i].emplace_back(root);
            if(g[root][v - 'a'] == 0) g[root][v - 'a'] = ++cnt;
            root = g[root][v - 'a'];
        }
        en[root] = 1;
    }
    int64_t ans = 0;
    for(int i = 1; i <= N; ++i) {
        set<char> suf;
        for(int j = s[i].size() - 1; ~j; --j) {
            suf.insert(s[i][j]);
            int now = path[i][j];
            for(auto &v : suf) {
                ans += 1ll * en[g[now][v - 'a']];
            }
        }
    }
    cout << ans - N << '\n';
}


Measured memory_bytes: 169424
use std::io::*;
use std::str::*;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let s = stdin
        .bytes()
        .map(|c| c.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect::<String>();
    s.parse::<T>().ok().unwrap()
}

fn string() -> String {
    read()
}

fn main() {
    let a: Vec<char> = string().chars().collect();
    let b: Vec<char> = string().chars().collect();

    if a.len() == b.len() {
        for i in 0..a.len() {
            if a[i] > b[i] {
                println!("{}", "GREATER");
                return;
            } else if a[i] < b[i] {
                println!("{}", "LESS");
                return;
            }
        }
        println!("{}", "EQUAL");
    } else if a.len() > b.len() {
        println!("{}", "GREATER");
    } else if a.len() < b.len() {
        println!("{}", "LESS");
    }
}


Measured memory_bytes: 4352
#include <iostream>
#include <cstdio>
#include <algorithm>

using namespace std;

int main(){
	
	string str;
	
	int ans, num;
	
	ans = 0;
	num = 0;
	
	while(true){
		num = 0;
		cin >> str;
		if(cin.eof()){
			break;
		}
		for(int i = 0; i < str.size(); i++){
			if(str[i] >= '0' && str[i] <= '9'){
				num *= 10;
				num += (str[i] - '0');
			}else{
				ans += num;
				num = 0;
			}
		}
		ans += num;
	}
	
	printf("%d\n", ans);
	
	return 0;
}

Measured memory_bytes: 1180
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define debug(a) cout<<#a<<":"<<a<<endl;
const ll INF=0x3f3f3f3f;
const ll N=1e6+7;
const ll mod=1e9+7;
ll maxn,minn;
ll T,n,m;
vector<ll>mp[N];
ll dp[N][2];

void dfs(ll a,ll p){
	ll len=mp[a].size();
	if(len==1&&a!=1){
		dp[a][0]=1;
		dp[a][1]=1;
		return ;
	}
	for(ll i=0;i<len;i++){
		if(mp[a][i]!=p){
			dfs(mp[a][i],a);
			ll ans1=(dp[mp[a][i]][0]+dp[mp[a][i]][1])%mod;
			ll ans2=dp[mp[a][i]][0];
			dp[a][0]=(dp[a][0]*ans1)%mod;
			dp[a][1]=(dp[a][1]*ans2)%mod;
		}
	}
	
}


int main(){
	ll u,v;
	cin>>n;
	for(ll i=1;i<n;i++){
		dp[i][0]=dp[i][1]=1;
		scanf("%lld%lld",&u,&v);
		mp[u].push_back(v);
		mp[v].push_back(u);
	}
	dp[n][0]=dp[n][1]=1;
	dfs(1,0);
	cout<<((dp[1][0]+dp[1][1])%mod)<<endl;
	


	return 0;
}





Measured memory_bytes: 36608
#include<iostream>
#define rep(i,n) for(ll i = 0; i < (n); i++)
using ll = long long;
using namespace std;

int main()
{
    double d, t, s;
    cin >> d >> t >> s;
    if(d / s <= t) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 3732
#include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <functional>
using namespace std;

long s[100010];
long t[100010];

bool isOK_s(int i, long k){
    return s[i] >= k;
}
bool isOK_t(int i, long k){
    return t[i] >= k;
}

int bss(long k, int a){
    int left = -1, right = a;
    while(right - left > 1){
        int mid = left + (right - left) / 2;
        if(isOK_s(mid, k)){
            right = mid;
        }else{
            left = mid;
        }
    }
    return right;
}
int bst(long k, int b){
    int left = -1, right = b;
    while(right - left > 1){
        int mid = left + (right - left) / 2;
        if(isOK_t(mid, k)){
            right = mid;
        }else{
            left = mid;
        }
    }
    return right;
}

int main(){
    int a, b, q;
    cin >> a >> b >> q;
    for(int i = 0; i < a; i++){
        cin >> s[i];
    }
    for(int i = 0; i < b; i++){
        cin >> t[i];
    }
    for(int i = 0; i < q; i++){
        long x;
        cin >> x;
        int si = bss(x, a);
        int ti = bst(x, b);
//        cout << si << " " << ti << endl;
        long s1 = s[si]-x;
        long s2 = x-s[si-1];

        long t1 = t[ti]-x;
        long t2 = x-t[ti-1];

        long max1 = max(s1, t1);
        long max2 = max(s2, t2);
        if(si==0 || ti==0){
            max2 = 1l << 62;
        }
        if(si==a || ti==b){
            max1 = 1l << 62;
        }
        if(si == 0){
            s2 = s1;
        }
        if(si == a){
            s1 = s2;
        }
        if(ti == 0){
            t2 = t1;
        }
        if(ti == b){
            t1 = t2;
        }
        cout << min(min(min(max1, max2), min(s1*2+t2, s2*2+t1)), min(t1*2+s2, t2*2+s1)) << endl;
//        cout << max1 << " " << max2 << " " << (s1*2+t2) << " " << (s2*2+t1) << " " << (t1*2+s2) << " " << (t2*2+s1) << endl;
    }
    
    return 0;
}


Measured memory_bytes: 2944
#include<bits/stdc++.h>
#define ll long long
#define pii pair<int,int>
using namespace std;

const int N = 1e5+10;
int a[N];
int main(){
    ll a,b,c;
    cin >> a >> b >> c;
    c = c - a - b;
    if(c<=0){
        cout << "No\n";
    }else{
        c = c*c;
        if(c > 4*a*b){
            cout <<"Yes\n";
        }else{
            cout <<"No\n";
        }
    }
    return 0;
}

Measured memory_bytes: 256
using System;

namespace ABC059A
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] bufs = Console.ReadLine().Split(' ');

            Console.Write((char)('A' + (bufs[0][0] - 'a')));
            Console.Write((char)('A' + (bufs[1][0] - 'a')));
            Console.Write((char)('A' + (bufs[2][0] - 'a')));

            Console.WriteLine();
        }
    }
}


Measured memory_bytes: 13140
W,H,x,y,r=map(int,input().split())
xp=x+r
xm=x-r
yp=y+r
ym=y-r
if(x+r>W or x-r<0):
    print("No")
elif(y+r>H or y-r<0):
    print("No")
else:
    print("Yes")



Measured memory_bytes: 5596
N,M,L=map(int,input().split())
A=[[] for i in range(N)]
for i in range(M):
    a,b,c=map(int,input().split())
    A[a-1].append((b-1,c))
    A[b-1].append((a-1,c))
d=[[100000000001]*N for i in range(N)]
for i in range(N):
    d[i][i]=0
for i in range(N):
    for to,cost in A[i]:
        d[i][to] = cost
for k in range(N):
    for i in range(N):
        for j in range(N):
            if d[i][k] != 100000000001 and d[k][j] != 100000000001:
                d[i][j] = min(d[i][j], d[i][k] + d[k][j])
B=[[] for i in range(N)]
for i in range(N):
    for j in range(N):
        if d[i][j]<=L:
            B[i].append((j,1))
times=[[100000000001]*N for i in range(N)]
for i in range(N):
    times[i][i]=0
for i in range(N):
    for to,cost in B[i]:
        times[i][to] = cost
for k in range(N):
    for i in range(N):
        for j in range(N):
            if times[i][k] != 100000000001 and times[k][j] != 100000000001:
                times[i][j] = min(times[i][j], times[i][k] + times[k][j])
Q=int(input())
for i in range(Q):
    s,t=map(int,input().split())
    if times[s-1][t-1]!=100000000001:
    	print(times[s-1][t-1]-1)
    else:
      	print(-1)

Measured memory_bytes: 84676
#pragma region template
#include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const long long MOD = 1e9 + 7, MAX = 1e18, larg = 1e5, INF = -1e18;
long long A, B, C, D, E, F, G, H, I, J, K, L, N, M, O, P, Q, R, S, T, U, V, W, x, y, z;
long long max_value = INF, max_index = -1;
long long min_value = MAX, min_index = -1;
typedef long long ll;
typedef pair<ll, bool> Pa;

vector<Pa> say[15];
int main() {
	cin >> N;
	rep(i, N){
		cin >> A;
		rep(j, A){
			cin >> B >> C; B--;
			if(C == 1) say[i].push_back(Pa(B, true));
			else say[i].push_back(Pa(B, false));
		}
	}
	ll ans = 0;
	rep(i, 1<<N){
		ll curr = i, cnt = 0;
		bool now[15];
		rep(j, N){
			if((curr>>j)%2 == 1){
				now[j] = true;
				cnt++;
			}else{
				now[j] = false;
			}
		}
		bool flag = true;
		rep(k, N){
			if(now[k]){
				rep(j, say[k].size()){
					if(say[k][j].second != now[say[k][j].first]){
						flag = false;
					}
				}
			}
		}
		if(flag) ans = max(ans, cnt);
	}
	cout << ans;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
#define MAX 300003
#define MOD 1000000007
#define INF 1000000000000000000
using Graph=vector<vector<int>>;

long long modpow(long long a,long long n,long long mod){
  long long res=1;
  while(n>0){
    if(n&1){       //nのbitと...00001を比較  nが2で割り切れるならtrue
      res=(res*a)%mod;
    }
    a=(a*a)%mod;
    n>>=1;
  }
  return res;
}

long long modinv(long long a,long long mod){
  return modpow(a,mod-2,mod);
}


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

  ll com=1;
  for(ll i=0;i<K-2;i++){
    com*=(N*M-2-i);
    com%=MOD;
    com*=modinv(i+1,MOD);
    com%=MOD;
  }

  ll sum=0;
  for(ll i=0;i<N;i++){
    for(ll j=0;j<M;j++){
      sum+=i+j;
    }
  }

  ll ans=0;


  for(ll i=0;i<N;i++){
    for(ll j=0;j<M;j++){
      if(j==0){
        ans+=(sum%MOD)*com%MOD;
        ans%=MOD;
        continue;
      }
      sum+=N*(2*j-M);
      ans+=(sum%MOD)*com%MOD;
      ans%=MOD;
    }
    sum+=M*(2*(i+1)-N);
  }
  ans*=modinv(2,MOD);
  ans%=MOD;

  cout<<ans<<endl;
}


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

namespace test
{
    class MainClass
    {
        public static void Main(string[] args)
        {

            //問題156


            string[] line = Console.ReadLine().Split(' ');

            int n = int.Parse(line[0]);
            int r = int.Parse(line[1]);

            if (n >= 10)
            {
                Console.WriteLine(r);
            }
            else
            {
                Console.WriteLine(r + 100 * (10 - n));
            }

        }

    }





    
}


Measured memory_bytes: 27440
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		if (a < b) {
			System.out.println("a < b");
		} else if (a == b) {
			System.out.println("a == b");
		} else if (a > b) {
			System.out.println("a > b");
		}
	}
}

Measured memory_bytes: 17160
N = int (input())
A = list(map(int,input().split()))
b = 0
ans = 0

while True:
    for i in range(N):
        a = abs(A[b] - A[i])
        if a > ans:
            ans = a
    b = b + 1
    if b == N - 1:
        break
    else :
        continue
    break      
print(ans)

Measured memory_bytes: 3060
#include<iostream>
#include<cstdio>
#include<cstdlib>
using namespace std;

bool c[5002][5002];

int main()
{
	int i,j,n,w,h;
	long long max,s;
	int a[3001],b[3001];
	
	while(1)
	{
		scanf("%d",&n);
		if(n==0) break;
		for(i=0;i<=5000;i++)
		{
			for(j=0;j<=5000;j++)
			{
				c[i][j]=false;
			}
		}
		for(i=0;i<=n-1;i++)
		{
			scanf("%d%d",&a[i],&b[i]);
			c[a[i]][b[i]]=true;
		}
		max=0;
		for(i=0;i<=n-1;i++)
		{
			for(j=i+1;j<=n-1;j++)
			{
				w=abs(a[j]-a[i]);
				if(a[j]>a[i]) h=b[j]-b[i];
				else h=b[i]-b[j];
				if(a[i]-h>=0 && a[i]-h<=5000 && a[j]-h>=0 && a[j]-h<=5000 && b[i]+w<=5000 && b[j]+w<=5000)
				{
				   if(c[a[i]-h][b[i]+w]==true && c[a[j]-h][b[j]+w]==true)
				   {
					   s=w*w+h*h;
					   if(max<s) max=s;
				   }
				}
			}
		}
		printf("%lld\n",max);
	}
	return 0;
}

Measured memory_bytes: 27596
#include <map>
#include <set>
#include <ctime>
#include <cmath>
#include <stack>
#include <queue>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <cstring> 
#include <iostream>
#include <algorithm>
using namespace std;

int N;
int a[200];
int ans;

int main()
{
	scanf("%d", &N);
	for(int i = 1;i <= N;++i)
	{
		scanf("%d", &a[i]);
		if(i & 1)
		{

			if(a[i] & 1)
				++ans;
		}
	}

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

Measured memory_bytes: 3824