akhauriyash/Code-Regression huggingface dataset:
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<long long, long long>;
constexpr char ln =  '\n';
constexpr long long MOD = 1000000007LL;
constexpr long long INF = 1001001001LL;
constexpr long long LINF = 1001001001001001001;
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define rept(i, j, n) for(int i=(j); i<(n); i++)
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; }


int main(){ 
    string s; cin >> s;
    int n = s.size(), res = 0;

    for(int i=n-2; i>0; i -=2){
        string a = s.substr(0, i/2);
        string b = s.substr(i/2, i/2);
        if(a == b){
            res = i;
            break;
        }
    }
    cout << res << ln;
}



Measured memory_bytes: 3632
#include<bits/stdc++.h>
using namespace std;
#define int long long
struct node{
  int key;
  node *left,*right,*p;
  node(){}
  node(int key):key(key){left=right=p=NULL;};
};
node *root;
void insert(node z){
  node *y=NULL;
  node *x=root;
  while(x!=NULL){
    y=x;
    if(z.key<x->key) x=x->left;
    else x=x->right;
  }
  z.p=y;
  if(y==NULL) root=new node(z);
  else if(z.key<y->key) y->left=new node(z);
  else y->right=new node(z);
}
bool find(int z){
  node *x=root;
  while(x!=NULL){
    if(z==x->key) return true;
    if(z<x->key) x=x->left;
    else x=x->right;
  }
  return false;
}
void inorderTreeWalk(node *v){
  if(v==NULL) return;
  inorderTreeWalk(v->left);
  cout<<" "<<v->key;
  inorderTreeWalk(v->right);
}
void preorderTreeWalk(node *v){
  if(v==NULL) return;
  cout<<" "<<v->key;
  preorderTreeWalk(v->left);
  preorderTreeWalk(v->right);
}
signed main(){
  int n;
  cin>>n;
  root=NULL;
  for(int i=0;i<n;i++){
    string s;
    cin>>s;
    //cout<<(root==NULL?-1:root->key)<<endl;
    if(s=="print"){
      inorderTreeWalk(root);
      cout<<endl;
      preorderTreeWalk(root);
      cout<<endl;
      continue;
    }
    int x;
    cin>>x;
    if(s=="insert"){
      insert(node(x));
    }
    if(s=="find"){
      cout<<(find(x)?"yes":"no")<<endl;
    }
  }
  return 0;
}


Measured memory_bytes: 21936
#include<iostream>
#include<vector>
#include<queue>
#include<stack>
#include<algorithm>
#include<math.h>
using namespace std;
#define vel vector<long long>
#define vvel vector<vel>
#define int long long
#define ll long long
#define D double
#define veb vector<bool>
#define vveb vector<veb>
#define V vector
#define pin pair<int,int>
#define sor(a) sort(a.begin(),a.end())
#define mp make_pair 
#define rep(i,n) for(int i=0;i<n;i++)
#define mmin(x,y) x=min(x,y)
#define mmax(x,y) x=max(x,y)
#define upperbound(v,val) upper_bound(v.begin(),v.end(),val)
#define lowerbound(v,val) lower_bound(v.begin(),v.end(),val)
int gcd(int a,int b){
	a = abs(a); b = abs(b);
	if (a < b) { swap(a, b); }
	if (b == 0) { return a; }
	else { return gcd(b, a%b); }
}
bool ret(int p, vel &a) {
	vel ans(p,0);
	if (a[0]%p != 0) { return false; }
	for(int i=1;i<a.size();i++) {
		int pl = i % (p - 1);
		if (pl == 0) { pl += p-1; }
		ans[pl] += a[i];
	}
	bool xx = true;
	rep(i, p) { xx = xx & (ans[i]%p == 0); }
	return xx;
}
bool is_prime(int x) {
	for (int i = 2; i*i <= x; i++) {
		if (x%i == 0 and x != i) { return false; }
	}
	return true;
}
int ord(int n, int p) {
	if (n%p != 0) { return 0; }
	return ord(n / p,p) + 1;
}
int rui(int n, int ru) {
	if (ru == 0) { return 1; }
	return rui(n, ru - 1)*n;
}
signed main() {
	int n; cin >> n;
	vel a(n+1);
	rep(i, n+1) { cin >> a[n - i]; }
	int gd = abs(a[n]);
	rep(i, n) { gd = gcd(gd, a[i + 1]); }
	vel all_list(0);
	veb can_div(n + 1, false);
	for (int i = 2; i <= n; i++) {
		if (is_prime(i)) {
			can_div[i] = ret(i, a);
			if (can_div[i]) {
				all_list.push_back(i);
			}
		}
	}
	int qgd = gd;
	for (int i = 2; i*i <= qgd; i++) {
		int ord1 = ord(gd, i);
		if (ord1 > 0) { 
			gd = gd / rui(i,ord1); 
			if (i > n) { all_list.push_back(i); }
		}
	}
	if (gd>n and gd>1) { all_list.push_back(gd); }
	sor(all_list);
	rep(i, all_list.size()) { cout << all_list[i] << endl; }
	return 0;
}

Measured memory_bytes: 384
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (InputReader in = new InputReader(); PrintWriter out = new PrintWriter(System.out)) {
            new Main().solve(in, out);
            out.flush();
        }
    }

    void solve(InputReader in, PrintWriter out) {
        int[] times = new int[3];
        times[0] = in.nextInt();
        times[1] = in.nextInt();
        times[2] = in.nextInt();
        Arrays.sort(times);

        out.println(times[0] + times[1]);
    }
}

class InputReader implements AutoCloseable {
    private final Scanner sc = new Scanner(System.in);

    String next() {
        return this.sc.next();
    }

    int nextInt() {
        return Integer.parseInt(this.sc.next());
    }

    long nextLong() {
        return Long.parseLong(this.sc.next());
    }

    double nextDouble() {
        return Double.parseDouble(this.sc.next());
    }

    @Override
    public void close() {
        this.sc.close();
    }
}


Measured memory_bytes: 23380
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
typedef long long ll;
namespace mp = boost::multiprecision;
using Mint = mp::cpp_int;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repi(i,a,b) for(int i = int(a); i < int(b); i++)
#define all(v) v.begin(), v.end()
#define uni(v) v.erase(unique(all(v)), v.end())
#define sort_g(v) sort(all(v), greater<int>())
#define dump(x) cerr << #x << ' ' << '=' << ' ' << x << endl

const ll D = pow(10, 18);

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

    vector<ll> A(N);
    rep(i, N) cin >> A.at(i);
	sort(all(A));

	if(A.at(0) == 0) {
		cout << 0 << endl;
		return 0;
	}

	sort_g(A);
    Mint M = 1;
    rep(i, N) {
        M *= A.at(i);
		if(M > D) {
			cout << -1 << endl;
			return 0;
		}
    }

    cout << M << endl;
}

Measured memory_bytes: 4096
#include <iostream>

using namespace std;

int main ()
{
	long n,l;

	cin >> n >> l;

	long co = 0;
	for (long i = 0; i < 10000; i++)
	{
		if (l * i == n)
		{
			co = i;
			break;
		}
		else if (l * i > n)
		{
			co += i - 1;
			co += n - (l * (i - 1));
			break;
		}
	}

	cout << co << endl;
}


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

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

  vector<int> vec(n);
  rep(i,n){
    cin >> vec[i];
  }

  int ans =0;

  for(int i =1; i < n-1; i++){
    priority_queue<int> que;
    que.push(vec[i-1]);
    que.push(vec[i]);
    que.push(vec[i+1]);

    que.pop();
    if(que.top() == vec[i]){
      ans++;
    }
  }

  cout << ans << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include<cmath>
#include"stdio.h"
using namespace std;
long long XOR(long long x) {
	int n;
	if (x <= 0){
      return 0;
    }
	for (int i = 0; true; i++) {
		if (pow(2, i) > x) {
			n = i;
			break;
		}
	}
	long long sum = 0;
  if(x%4==1||x%4==2){
    sum++;
  }
  x++;
  
	for (int i = 2; i <= n; i++) {
		long long temp;
		temp = x % (long long)(pow(2, i));
 //     cout<< temp<<',';
		if (temp - pow(2, i - 1) > 0) {
          temp=temp - pow(2, i - 1);
 //         cout<<temp<<endl;
			if (temp % 2 == 1) {
    
				sum += (long long)pow(2, i - 1);
			}
		}
	}
  
	return sum;
}


int main() {
	long long A, B;
	cin >> A >> B;
	if (A != B) {
		cout <<( XOR(A - 1) ^ XOR(B));
	}
	else {
		cout << A;
	}
	return 0;
}

Measured memory_bytes: 512
x1, y1, x2, y2 = map(int, input().split())
x3 = x2 - y2 + y1
y3 = x2 - x1 + y2
x4 = x1 - y2 + y1
y4 = y1 + x2 - x1
print(x3, y3, x4, y4)

Measured memory_bytes: 2940
import sys
import datetime

w = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']
while True:
    m, d = map(int, raw_input().split())
    if m == 0 and d == 0:
        break
    print w[datetime.date(2004,m,d).weekday()]

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

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

const int INF = 1e9;
const int MAX = 1e5;

// 4近傍、8近傍
int dx[] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[] = {0, 1, 0, -1, 1, 1, -1, -1};

int main() {
  int a, b, c;
  cin >> a >> b >> c;

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

  return 0;
}


Measured memory_bytes: 256
#include<stdio.h>

int jump(int,int,int,int,int);

int main(void){
    int N;

    scanf("%d",&N);

    int i;

    int h[N+1];
    int cost[N+1];
    for(i=1;i<=N;i++){
        scanf("%d",&h[i]);
    }
    h[0]=0;

    int sa;
    if(h[2]-h[1]>0){
        sa=h[2]-h[1];
    }else{
        sa=h[1]-h[2];
    }

    if(N==2){
        printf("%d",sa);
        return 0;
    }

    cost[1]=0;
    cost[2]=sa;

    for(i=3;i<N+1;i++){
        cost[i]=jump(h[i],h[i-1],h[i-2],cost[i-2],cost[i-1]);
    }

    printf("%d",cost[N]);

    return 0;

}

int jump(int hc,int hb,int ha,int costa,int costb){
    int sac_b,sac_a;

    if(hc-hb>0){
        sac_b=hc-hb;
    }else{
        sac_b=hb-hc;
    }

    costb+=sac_b;

    if(hc-ha>0){
        sac_a=hc-ha;
    }else{
        sac_a=ha-hc;
    }

    costa+=sac_a;

    if(costa>costb){
        return costb;
    }else{
        return costa;
    }
}

Measured memory_bytes: 896
#include<stdio.h>
#include<iostream>
#include<algorithm> 
using namespace std;
typedef long long ll;

int main(){
	ll s1[10];
	for(int i=1;i<=4;i++)	cin>>s1[i];
	ll s=s1[1]*s1[3];
	for(int i=1;i<=2;i++){
		for(int j=3;j<=4;j++){
			s=max(s,s1[i]*s1[j]);
		} 
	}
	cout<<s<<endl;
	return 0;
} 

Measured memory_bytes: 3180
#include<bits/stdc++.h>
using namespace std;
 
#define int long long
#define ll long long 
#define f(i,l,n) for(int i=l;i<n;i++)
#define E "\n"
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define MAX 1e18
#define float long double
 
const int N=1e5+3;
int sol()
{
	int n;
	cin >> n;
	while(n!=0)
	{
		if(n%10==7)
		{
			cout<<"Yes\n",0;
			return 0;
		}
		n/=10;
	}
	cout<<"No\n";
	return 0;
}
 
 
 
 
int32_t main()
{
 
 
 int t=sol();
}

Measured memory_bytes: 3596
#include <algorithm>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits.h>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <string>
#include <string.h>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<=n;i++)
#define eps LDBL_EPSILON
#define moder 1000000007
#define int long long
#define ll long long
#define double long double
#define INF LLONG_MAX/3
#define P pair<int,int>
#define prique priority_queue<int,vector<int>,greater<int>>
using namespace std;
int n, a[100010], b[100010], c[100010];
int gcd(int x, int y) {
	if (!y)return x;
	return gcd(y, x % y);
}
signed main() {
	cin >> n;
	rep(i, n)cin >> a[i];
	b[0] = a[0];
	for (int i = 1; i < n; i++) {
		b[i] = gcd(b[i - 1], a[i]);
	}
	c[n - 1] = a[n - 1];
	for (int i = n - 1; i >= 0; i--) {
		c[i] = gcd(c[i + 1], a[i]);
	}
	int ans = c[1];
	for (int i = 1; i < n - 1; i++) {
		ans = max(ans, gcd(b[i - 1], c[i + 1]));
	}
	ans = max(ans, b[n - 2]);
	cout << ans << endl;
}

Measured memory_bytes: 2560
import  java.util.*;
class Main{

public static void  main(String[]  args){

 long sum = 1;int[] arr = new int[1000];
for(int i = 1;i <= 999 ;i++)
arr[i] = i+arr[i-1];

Scanner  s = new Scanner(System.in);
int a = s.nextInt() , b = s.nextInt();

int diff1 = 0 , diff2 = 0;
for(int i = 1;i < 999;i++){
if(arr[i] >= a){
diff1 = (arr[i] - a);
diff2 = (arr[i+1] - b);
if(diff1 == diff2)
break;
}
}
System.out.println(diff1);
}
}

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

#define ll 				long long
#define vi 				vector<ll>
#define vvi				vector<vector<ll>>
#define mii 			map<ll,ll>
#define rev(a); 		reverse(a.begin(), a.end());
#define sortv(a); 		sort(a.begin(), a.end());
#define sortd(a); 		sort(a.begin(), a.end(), greater<int>());
#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 pb 				push_back
#define mp 				make_pair
#define printv(a);		FOR(_Q,0,(int)(a).size()) cout<<(a)[_Q]<<" "; cout<<'\n';

ll MOD = 1000000007;
ll INF = LLONG_MAX;

/*****************************************************************************/


void solve() {
	
}

signed main() {
	ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	int n; cin>>n;
	int k;
	mii mp;
	FOR(i,1,n) {
		cin>>k;
		mp[k]++;
	}
	FOR(i,1,n+1) {
		cout<<mp[i]<<'\n';
	}
}

Measured memory_bytes: 16132
#include<cstdio>
#include<cstring>
#include<string>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<queue>
#include<map>
#include<ctime>

using namespace std;

template <typename T>

inline T read()
{
	T x=0,f=1;char c=getchar();
	while(!isdigit(c))
	{if(c=='-') f=-f;c=getchar();}
	while(isdigit(c))
	{x=(x<<3)+(x<<1)+(c-48);c=getchar();}
	return x*f;
}

#define lint long long int
#define ulint unsigned lint

const int inf=1e9+1e7;

int dp[20][20];

int n,ans=0;

int main(void)
{

	// freopen("testdata.in","r",stdin);
	// freopen("testdata.out","w",stdout);

	scanf("%d",&n);

	for(int i=1,x;i<=n;i++)
	{
		x=i;
		if(x%10==0) continue;
		int s=x%10;
		while(x>=10) x/=10;
		++dp[x][s];
		ans+=dp[s][x]*2;
		if(x==s) --ans;

	}

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

	return 0;

}


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

#define int long long

template <class Monoid> struct SegmentTree{
    using Func = function<Monoid(Monoid, Monoid)>;

    int size;
    vector<Monoid> seg;
    const Func merge;
    const Monoid def;

    SegmentTree(int n, Monoid d, const Func f): merge(f), def(d){
        for(size = 1; size <= n; size <<= 1);
        seg.assign(size*2, def);
    }

    Monoid& operator[] (int i) { return seg[i+size]; };
    void build(){ for(int i = size-1;i >= 0;i--) seg[i] = merge(seg[i*2], seg[i*2+1]); }

    void update(int i, Monoid val){
        seg[i += size] = val;
        while(i >>= 1) seg[i] = merge(seg[i*2], seg[i*2+1]);
    }

    void add(int i, Monoid val){ update(i, val+seg[i+size]); }

    Monoid get(int a, int b){
        Monoid l = def, r = def;
        for(a += size, b += size; a < b; a >>= 1, b >>= 1){
            if(a & 1) l = merge(l, seg[a++]);
            if(b & 1) r = merge(r, seg[--b]);
        }
        return merge(l, r);
    }
};

int n;
int a[100010];

bool isOK(int num){
    int b[100010] = {};
    unordered_map<int, int> mp;
    vector<int> vec;
    vec.push_back(0);
    for(int i = 0;i < n;i++){
        b[i+1] += b[i];
        if(a[i] >= num){
            b[i+1]++;
            vec.push_back(b[i+1]);
        }else{
            b[i+1]--;
            vec.push_back(b[i+1]);
        }
    }
    sort(vec.begin(), vec.end());
    vec.erase(unique(vec.begin(), vec.end()), vec.end());

    for(int i = 0;i < vec.size();i++){
        mp[vec[i]] = i;
    }

    long long ans = 0;
    SegmentTree<int> seg(n, 0, [](int a, int b){ return a + b;});
    seg.update(mp[0], 1);

    for(int i = 1;i <= n;i++){
        ans += seg.get(0, mp[b[i]]+1);
        seg.add(mp[b[i]], 1);
    }

    return ans >= ((((long long)n * (long long)(n+1)) / 2)+1) / 2;
}

signed main(){
    cin >> n;

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

    int l = 1, r = 1000000001;

    while(r-l > 1){
        int mid = (r+l)/2;

        if(isOK(mid)){
            l = mid;
        }else{
            r = mid;
        }
    }

    cout << l << endl;
    return 0;
}


Measured memory_bytes: 8964
#include <cstdio>
#include <vector>
#include <algorithm>

using namespace std;

int n[101],mx;
vector<int> ms;

int main(){
  int m;
  while(~scanf("%d",&m)){
    if(++n[m]==mx){
      ms.push_back(m);
    }else if(n[m]>mx){
      mx++;
      ms.clear();
      ms.push_back(m);
    }
  }
  sort(ms.begin(),ms.end());
  for(int i=0; i<ms.size(); i++)
    printf("%d\n",ms[i]);
}

Measured memory_bytes: 1048
#include <bits/stdc++.h>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<string> vs;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<ll,pll> pip;
typedef vector<pip> vip;
const int inf=1<<30;
const ll INF=1ll<<60;
const double pi=acos(-1);
const double eps=1e-11;
const ll mod=1e9+7;
const int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};

const int NPrime=1000000;
bool prime[NPrime+1];
vi EnumeratePrime(){
	fill(prime+2,prime+NPrime+1,true);
	vi a;
	for(int i=2;i<=NPrime;i++) if(prime[i]){
		a.emplace_back(i);
		for(int j=2*i;j<=NPrime;j+=i) prime[j]=0;
	}
	return a;
}

int a,b,c;

int main(){
	EnumeratePrime();
	while(1){
		cin>>a>>b>>c;
		if(a==0) break;
		for(int i=a;;i+=b){
			if(prime[i]){
				c--;
				if(c==0){
					cout<<i<<endl;
					break;
				}
			}
		}
	}
}


Measured memory_bytes: 4232
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rrep(i, n) for(int i = (int)(n); i >= 0; i--)
#define SORT(c) sort((c).begin(),(c).end())
#define REVERSE(c) reverse((c).begin(),(c).end())
#define REVSORT(c) SORT(c);REVERSE(c)
#define ALL(x) (x).begin(),(x).end()
const long long MOD = 1000000007;
typedef long long ll;

int main(){
	ll N;
	cin >> N;
	ll ans = N * (N - 1) / 2;
	cout << ans << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
using namespace std;
typedef long long ll;
const ll mod = 1000000007;

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

    int n;
    cin >> n;
    string s, t;
    cin >> s >> t;
    if(n == 1){
        cout << 3 << endl;
        return 0;
    }

    vector<int> mode; // 0: vertical, 1: horizontal
    for(int i = 0; i < s.size()-1; ++i){
        if(s[i] == s[i+1]){
            mode.push_back(1);
            ++i;
            if(i == s.size()-2) mode.push_back(0);
        }
        else{
            mode.push_back(0);
            if(i == s.size()-2) mode.push_back(0);
        }
    }

    ll res = (mode[0]==0)? 3: 6;
    ll prev = mode[0];
    for(int i = 1; i < mode.size(); ++i){
        ll curr = mode[i];
        
        if(prev==0 && curr==0) res = res*2 % mod;
        if(prev==0 && curr==1) res = res*2 % mod;
        if(prev==1 && curr==0) res = res*1 % mod;
        if(prev==1 && curr==1) res = res*3 % mod;
        
        prev = curr;
    }

    cout << res << endl;

    return 0;
}

Measured memory_bytes: 3620
#include <stdio.h>
int main(void){
    int A, B, i, res = 0;
    scanf("%d %d", &A, &B);
    for(i=A;i<=B;i++)if( (i%10==(i/10000)) && ((i/10)%10==(i/1000)%10) )res++;
    printf("%d", res);
    return 0;
}


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

int main() {
  int N,a,b,c,d;
  cin >> N;
  
  a=N/1000;
  b=(N%1000)/100;
  c=(N%100)/10;
  d=N%10;
  
  if (a==b && b==c && c==d)
    cout << "Yes" << endl;
  else if ((a==b && b==c) || (b==c && c==d))
    cout << "Yes" << endl;
  else
    cout <<"No"<< endl;
}

Measured memory_bytes: 256
package main

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

func main() {
	x := ReadInt()

	ke := (x + 10) / 11
	ne := 2 * ke

	ko := (x + 4) / 11
	no := 2*ko + 1

	fmt.Println(Min(ne, no))
}

func Min(xs ...int) int {
	min := xs[0]
	for _, x := range xs[1:] {
		if min > x {
			min = x
		}
	}
	return min
}

var reader = bufio.NewReader(os.Stdin)

func Scan(a ...interface{}) {
	if _, err := fmt.Fscan(reader, a...); err != nil {
		panic(err)
	}
}
func ReadInt() (i int)       { Scan(&i); return }
func ReadString() (s string) { Scan(&s); return }
func ReadInts(n int) []int {
	v := make([]int, n)
	for i := 0; i < n; i++ {
		Scan(&v[i])
	}
	return v
}


Measured memory_bytes: 1840
#include <iostream>
#include <string>

using namespace std;

int main()
{
    string upper, lower;
    cin >> upper;
    cin >> lower;

    bool match = true;
    for (int i = 0; i < 3; i++) {
        match &= upper[i] == lower[2 - i];
    }

    string ans = match ? "YES" : "NO";
    cout << ans << "\n";
}

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

#define REP(i,n) for(ll i=0; i<(ll)(n); i++)
#define FOR(i,n,m) for (ll i=n; i<(ll)(m); i++)
#define pb push_back
#define INF 1000000007LL
#define all(a) (a).begin(),(a).end()
#define chmin(a,b) a=min(a,b)
#define chmax(a,b) a=max(a,b)

typedef long long ll;
typedef pair<int,int> p;

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

#define MAX_N 100000
int dp[12][MAX_N];

int N, M, Q;
vector<p> edge;
int v[MAX_N],d[MAX_N],c[MAX_N+1];
int main(){
    ios::sync_with_stdio(false);
    cin >> N >> M;
    REP(i, M) {
        int a, b;
        cin >> a >> b;
        a--;b--;
        edge.pb(p(a,b));
    }
    cin >> Q;
    REP(i, Q) {
        cin >> v[i] >> d[i] >> c[i+1];
        v[i]--;
        dp[d[i]][v[i]] = i+1;
    }
    
    for(int i = 10; i > 0; i--) {
        for(auto x: edge) {
            int u = x.first;
            int v = x.second;
            dp[i-1][u] = max(dp[i-1][u], dp[i][v]);
            dp[i-1][v] = max(dp[i-1][v], dp[i][u]);
            
        }
    }
    
    REP(i,N) {
        int m = 0;
        REP(j, 11) {
            m = max(m, dp[j][i]);
        }
        cout << c[m] << endl;
    }
    
    return 0;
}

Measured memory_bytes: 7028
require 'pp'

n, m = gets.split.map(&:to_i)
a_n = gets.split.map(&:to_i)

lcm = a_n.inject(1) {|ans, n| ans = ans.lcm(n / 2) }

judge = true
a_n.each do |a|
    x = lcm / (a / 2)
    if x % 2 == 0
        judge = false
    end
end

if judge
    puts m / lcm - m / (lcm * 2)
else
    puts 0
end


Measured memory_bytes: 13044
#include <iostream>
#include <cmath>

using namespace std;

int kum[100003];
int arr[100003];
string s;

int main () {
	int n,q;
	cin>>n>>q;
	cin>>s;
	for(int i=1;i<s.length();i++){
		if(s[i-1]=='A' and s[i]=='C') arr[i]++;
	}
	for(int i=1;i<n;i++){
		kum[i]=arr[i]+kum[i-1];
	}
	for(int i=0;i<q;i++){
		int l,r;
		cin>>l>>r;
		cout<<kum[r-1]-kum[l-1]<<endl;
	}



return 0;
}



Measured memory_bytes: 1792
import bisect,sys
input = sys.stdin.readline
a,b,q = map(int,input().split())
inf = 10**18
s = [-inf]+[int(input()) for i in range(a)]+[inf]
t = [-inf]+[int(input()) for i in range(b)]+[inf]
for i in range(q):
  x = int(input())
  i = bisect.bisect_right(s,x)
  j = bisect.bisect_right(t,x)
  print(min(max(s[i],t[j])-x,x-min(s[i-1],t[j-1]),min(s[i]-x,x-t[j-1])+s[i]-t[j-1],min(t[j]-x,x-s[i-1])+t[j]-s[i-1]))

Measured memory_bytes: 131036
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<bitset>
#include<cctype>
#include<climits>
#include<cmath>
#include<cstdio>
#include<deque>
#include<list>
#include<map>
#include<set>
#include<stack>
#include<string>
#include<sstream>
#include<queue>
#include<vector>
using namespace std;

int cnt = 0, m = 0;
vector<int> G;

void insertionSort(int A[], int n, int g) {
	for (int i = g; i < n; i++) {
		int v = A[i],
			j = i - g;
		while (j >= 0 && A[j] > v) {
			A[j + g] = A[j];
			j = j - g;
			cnt++;
		}
		A[j + g] = v;
	}
}

void shellSort(int A[], int n) {
	for (int j = 1; j <= n; m++, j = j * 3 + 1) {
		G.push_back(j);
	}
	reverse(G.begin(), G.end());
	for (int i = 0; i < m; i++) {
		insertionSort(A, n, G[i]);
	}
}


int main() {
	int n; cin >> n;
	static int A[1000000];
	for (int i = 0; i < n; i++) {
		scanf("%d", &A[i]);
	}
	shellSort(A, n);

	cout << m << endl;
	for (int i = 0; i < m; i++) {
		printf("%d", G[i]);
		if (i != m - 1)printf(" ");
		else cout << endl;
	}
	cout << cnt << endl;
	for (int i = 0; i < n; i++) {
		printf("%d\n", A[i]);
	}

	return 0;
}

Measured memory_bytes: 5204
#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <map>
#include <unordered_map>

using namespace std;

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

void getZarr(string& str, int Z[]) {
  int n = str.length();
  int L, R, k;

  L = R = 0;
  for (int i = 1; i < n; ++i) {
    if (i > R) {
      L = R = i;
      while (R < n && str[R - L] == str[R]) {
        R++;
      }
      Z[i] = R - L;
      R--;
    } else {
      k = i - L;

      if (Z[k] < R - i + 1) {
        Z[i] = Z[k];
      } else {
        L = i;
        while (R < n && str[R - L] == str[R]) {
          R++;
        }
        Z[i] = R - L;
        R--;
      }
    }
  }
}


void search(string& text, string& pattern, vector<int> *result) {
  string s = pattern + "$" + text;
  int l = s.length();

  int Z[l];
  getZarr(s, Z);

  int p = pattern.length();

  vector<int> res;
  for (int i = 0; i < l; ++i) {
    if (Z[i] == p) {
      result->push_back(i - p - 1);
    }
  }
}

int sch(int i, int stop, const string& s, const string& t, vector<int>& vm) {
  // Early check of vm[i]. If vm[i] is larger than 0, its value is alreday
  // caluculated.
  if (vm[i] > 0) { return vm[i]; }

  int j = (i + t.size()) % s.size();  // The dst of next hop.
  if (j == stop) { return -1; }  // Loop exists

  if (vm[j] < 0) { // s[j..?] matches with t
    if (sch(j, stop, s, t, vm) < 0) {
      return -1;
    }
  }
  // By calling sch, now, the positive value is set to vm[j].

  vm[i] = vm[j] + 1;
  return vm[i];
}

int main(int argc, char** argv) {
  string s, t;
  cin >> s;
  cin >> t;

  int l = s.size();

  // repeat count
  int r = 1 + ((s.size() - 1 + t.size()) / s.size());
  string reps;
  reps.reserve(r * s.size());
  rep(i, r) {
    reps += s;
  }

  // For Debug
  // cout << reps << endl;

  vector<int> matches;
  search(reps, t, &matches);

  vector<int> vm(s.size());

  for (auto i : matches) {
    if (i >= s.size()) { break; }  // Treat only i <= s.size() - 1
    vm[i] = - 1;
  }

  int loopExists = false;
  int maxSize = 0;
  for (auto i : matches) {
    if (i >= s.size()) { break; }  // Treat only i <= s.size() - 1
    int x = sch(i, i, s, t, vm);
    if (x == -1) { // There is loop
      loopExists = true;
      break;
    }
    maxSize = max(maxSize, x);
  }

  if (loopExists) {
    cout << -1 << endl;
  } else {
    cout << maxSize << endl;
  }
}


Measured memory_bytes: 24172
import math
def f(a,b):
    c = (a[0]-b[0])**2 + (a[1]-b[1])**2
    return math.sqrt(c)
n = int(input())
l = []
x = 0
for _ in range(n):
    l.append(list(map(int,input().split())))
for i in range(0,n-1):
    for j in range(i+1,n):
        x = x + f(l[i],l[j])
print((2*x)/n)

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

namespace ProconTemplate
{
    //https://atcoder.jp/contests/abc141/tasks/abc141_c
    class abc169_b
    {
        //private static int[] m_aiPrimes;
        //private static int m_iCurPrimeIdx;
        public static void Main(string[] args)
        {
            //string s = Console.ReadLine();
            //int[] xi = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();

            //string[] asInput = Console.ReadLine().Split(' ');
            //long A = long.Parse(asInput[0]);
            //decimal B = decimal.Parse(asInput[1]);
            //Console.WriteLine(A * (long)(100 * B) / 100);

            string[] asInput = Console.ReadLine().Split(' ');
            int X = int.Parse(asInput[0]);
            int Y = int.Parse(asInput[1]);

            bool bExists = (Y % 2 == 0 && Y >= X * 2 && Y <= X * 4);
            Console.WriteLine(bExists ? "Yes" : "No");

            Console.ReadLine();

        }

    }
}


Measured memory_bytes: 27464
import java.util.*;
public class Main {
	public static void main(String[] args){
    	Scanner scanner = new Scanner(System.in);
      
      	int A = scanner.nextInt();
      	int B = scanner.nextInt();
      
      	if(A / 10 == 0 && B / 10 == 0) {
        	System.out.println(A * B);
         	return;
        }
      	System.out.println("-1");
	}
}
 

 



Measured memory_bytes: 23764
import java.util.Scanner;
public class Main{
 public static void main(String[] args){
   Scanner sc = new Scanner(System.in);
   String N = sc.next();
   if ("Sunny".equals(N)) System.out.println("Cloudy");   
   else if ("Cloudy".equals(N)) System.out.println("Rainy");   
   else if ("Rainy".equals(N)) System.out.println("Sunny");   
   
   
   
 }
}

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

using namespace std;

int main()
{
    long long n;
    cin >> n;
    string s;
    int ac=0,tle=0,wa=0,re=0;
    for(int i=0;i<n;i++)
    {
        cin >> s;
        if(s=="AC")
            ac++;
        else if(s=="TLE")
            tle++;
        else if(s=="WA")
            wa++;
        else
            re++;
    }
    cout << "AC x " << ac << endl;
    cout << "WA x " << wa << endl;
    cout << "TLE x " << tle << endl;
    cout << "RE x " << re << endl;
    return 0;
}


Measured memory_bytes: 3628
n, m, q = map(int, input().split())
query = [tuple(map(int, input().split())) for _ in range(q)]

def score(A):
    ret = 0
    for a, b, c, d in query:
        if A[b-1] - A[a-1] == c:
            ret += d
    return ret

def dfs(pre, _min):
    if len(pre) == n:
        return score(pre)
    ret = 0
    for i in range(_min, m+1):
        new = pre + [i]
        ret = max(ret, dfs(new, i))
    return ret

print(dfs([], 1))

Measured memory_bytes: 9216
#include<iostream>
#include<algorithm>
#include<string>
#include<cstdlib>
#include<map>
#include<iomanip>
#include<sstream>
#include<vector>
#include<stack>
#include<math.h>
#include<queue>
#include<complex>
#include<random>
#include<ctime>
using namespace std;



const long long int mod=1000000007;
const long long int INF=99999999999999999;
long long int n,k,a[200005],sum[200005]={},res=0;
pair<long long int,long long int>pa[200005];
string str;
int main() {
	cout << fixed << setprecision(18);
    cin>>n>>k;
    for(int i=1;i<=n;i++){
        cin>>a[i];
        a[i]--;
    }
    for(int i=1;i<=n;i++){
        sum[i]=sum[i-1]+a[i];
        sum[i]%=k;
        //cout<<sum[i]<<" ";
    }
    for(int i=0;i<=n;i++){
        pa[i]={sum[i],i};
    }
    sort(pa,pa+n+1);
    pa[n+1]={99999999999999,9999999999999};
    long long int l,mode=0,kazu=0,kaburi=0;
    for(int i=0;i<=n+1;i++){
        if(mode==0){
            l=pa[i].second;
            kazu=1;
            mode=1;
        }else if(mode==1){
            if(pa[i].first!=pa[i-1].first){
                res-=kaburi*(kaburi-1)/2;
                res+=kazu*(kazu-1)/2;
                kazu=1;
                kaburi=0;
                l=pa[i].second;
            }else if(pa[i].second-l>=k){
                res-=kaburi*(kaburi-1)/2;
                res+=kazu*(kazu-1)/2;
                while(pa[i].second-pa[i-kazu].second>=k){
                    l=pa[i-kazu].second;
                    kazu--;
                }
                kaburi=kazu;
                kazu++;
            }else{
                kazu++;
            }
        }
    }

    cout<<res<<endl;



} 


Measured memory_bytes: 6528
#include<iostream>
#include<iomanip>
#include<cmath>
#include<string>
#include<cstring>
#include<vector>
#include<list>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<stack>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define mp make_pair
#define rep(i, n) for(int i=0;i<n;++i)
#define rrep(i, n) for(int i=n;i>=0;--i)
const int inf=1e9+7;
const ll mod=1e9+7;
const ll mod1=998244353;
const ll big=1e18;
const double PI=2*asin(1);

int main() {
  int N;
  cin>>N;
  ll A, B;
  vector<ll> arr;
  map<ll, ll> amap;
  for(int i=0;i<N;++i) {
    cin>>A>>B;
    arr.push_back(A);
    amap[A] = B;
  }
  sort(arr.begin(), arr.end(), greater<ll>());
  cout<<arr[0]+amap[arr[0]]<<endl;
}



Measured memory_bytes: 10392
#include <iostream>

using namespace std;

int main (){
  int W, H, x, y, r;
  cin >> W >> H >> x >> y >> r;

  if((x >= r)&&(x + r <= W)&&(y >= r)&&(y + r<= H)) cout << "Yes" << endl;
  else cout << "No" << endl;
}




Measured memory_bytes: 3116
import sys,random
try: sys.stdin = open('in.in','r')
except: pass

R,G,B,N = map(int,input().split())

ans = 0
for r in range(0,N+1,R):
	for b in range(0,N+1-r,B):
		if (N-b-r)%G != 0: continue
		ans += 1
print(ans)


Measured memory_bytes: 40812
/*Author - Shubham Gupta (@shubham107)*/
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef vector<ll> vl;		typedef vector<int> vi;
typedef vector<vl> vvl;	  	typedef vector<vi> vvi;
typedef pair<ll, ll> pll;	typedef pair<int, int> pii;
#define forn(i,n) for(int i=0;i<n;i++)
#define rforn(i,n) for(int i=n-1;i>=0;i--)
#define forne(i,n) for(int i=1;i<=n;i++)
#define forse(i,s,e) for(int i=s;i<e;i++)
#define rforse(i,s,e) for(int i=e-1;i>=s;i--)
#define all(x) x.begin(),x.end()
#define sz(x) (int)x.size()
#define MOD 1000000007
#define F first
#define S second
#define pb push_back
#define fill(a,x) memset(a,x,sizeof a);
#define trav(a,x) for(auto &a:x)
#define INF	ll(1e18)
#ifdef SHUBHAM107
#include "../code-pieces/trace.h"
#else
#define trace(args...)
#endif

ll modpow(ll a, ll b, ll m = MOD) {
	a %= m; ll res = 1; while (b) {if (b & 1)res = res * a % m; a = a * a % m; b >>= 1;}
	return res;
}
ll bpow(ll a, ll b) {ll res = 1; while (b) {if (b & 1)res = res * a; a = a * a; b >>= 1;} return res;}
ll modinv(ll a) {return modpow(a, MOD - 2, MOD);}
void graph(vvi &adj, int m) {int x, y; forn(i, m) {cin >> x >> y; adj[x - 1].pb(y - 1); adj[y - 1].pb(x - 1);}}

const int mxN = 2e5 + 5;
void solve() {
	int n, m;
	cin >> n >> m;
	vi heights(n);
	forn(i, n) cin >> heights[i];
	vvi adj(n);
	graph(adj, m);
	int ans = 0;
	forn(i, n){
		bool good = true;
		trav(k, adj[i]){
			if(heights[i] <= heights[k]) good = false;
		}
		if(good) ans++;
	}
	cout << ans;
}
int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
#ifdef SHUBHAM107
	freopen("inp.txt", "r", stdin);
	freopen("out.txt", "w", stdout);
	freopen("err.txt", "w", stderr);
#endif
	int t = 1;
	// cin >> t;
	while (t--) {
		solve();
	}
}


Measured memory_bytes: 8748
import std.algorithm, std.container, std.conv, std.math, std.range, std.typecons, std.stdio, std.string;

auto rdsp(){return readln.splitter;}
void pick(R,T)(ref R r,ref T t){t=r.front.to!T;r.popFront;}
void readV(T...)(ref T t){auto r=rdsp;foreach(ref v;t)pick(r,v);}

void main()
{
  int n, m; readV(n, m);

  auto g = GraphW!(int, long, 10L^^18)(n);
  foreach (_; 0..m) {
    int a, b; long c; readV(a, b, c); --a; --b;
    g.addEdge(a, b, -c);
  }

  auto d = g.bellmanFord(0);

  if (d[n-1] == -g.inf)
    writeln("inf");
  else
    writeln(-d[n-1]);
}

struct GraphW(N = int, W = int, W i = 10^^9)
{
  alias Node = N, Wt = W, inf = i;
  struct Edge { Node src, dst; Wt wt; alias cap = wt; }
  Node n;
  Edge[][] g;
  alias g this;
  this(Node n) { this.n = n; g = new Edge[][](n); }
  void addEdge(Node u, Node v, Wt w) { g[u] ~= Edge(u, v, w); }
  void addEdgeB(Node u, Node v, Wt w) { g[u] ~= Edge(u, v, w); g[v] ~= Edge(v, u, w); }
}

template BellmanFord(Graph)
{
  import std.traits;
  alias Node = TemplateArgsOf!Graph[0], Wt = TemplateArgsOf!Graph[1];

  void bellmanFord(ref Graph g, Node s, out Wt[] dist, out Node[] prev)
  {
    auto n = g.n, sent = n;

    dist = new Wt[](n);
    dist[] = g.inf + g.inf;
    dist[s] = 0;

    prev = new Node[](n);
    prev[] = sent;

    foreach (k; 0..n)
      foreach (i; 0..n)
        foreach (e; g[i])
          if (dist[e.dst] > dist[e.src] + e.wt) {
            dist[e.dst] = dist[e.src] + e.wt;
            prev[e.dst] = e.src;
            if (k == n-1) dist[e.dst] = -g.inf;
          }
  }

  Wt[] bellmanFord(ref Graph g, Node s)
  {
    Wt[] dist;
    Node[] prev;
    bellmanFord(g, s, dist, prev);
    return dist;
  }
}
auto bellmanFord(G, N)(G g, N s) { return BellmanFord!G.bellmanFord(g, s); }


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

#pragma region Macros
using ll = long long;
#define int ll
using pii = pair<int, int>;
using tiii = tuple<int, int, int>;
template<class T = ll> using V = vector<T>;
template<class T = ll> using VV = V<V<T>>;
#define IOS\
    ios::sync_with_stdio(false);\
    cin.tie(0);\
    cout.tie(0);
#define FOR(i,l,r) for(ll i=(l);i<(r);++i)
#define REP(i,n) FOR(i,0,n)
#define REPS(i,n) FOR(i,1,n+1)
#define RFOR(i,l,r) for(ll i=(l);i>=(r);--i)
#define RREP(i,n) RFOR(i,n-1,0)
#define RREPS(i,n) RFOR(i,n,1)
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define eb emplace_back
#define all(x) (x).begin(),(x).end()
#define SORT(name) sort(name.begin(), name.end())
#define RSORT(name)\
    SORT(name);\
    reverse(all(name));
#define ZERO(p) memset(p, 0, sizeof(p))
#define MINUS(p) memset(p, -1, sizeof(p))
inline void Yes(bool b = true) {cout << (b ? "Yes" : "No") << '\n';}
inline void YES(bool b = true) {cout << (b ? "YES" : "NO") << '\n';}
template <class T> inline void print(T x){ cout << x << '\n';}
template<typename T1,typename T2> inline void chmin(T1 &a, T2 b){ if(a > b) a = b; }
template<typename T1,typename T2> inline void chmax(T1 &a, T2 b){ if(a < b) a = b; }

const ll LLINF = (1LL<<60);
const int INF = (1LL<<30);
const double DINF = std::numeric_limits<double>::infinity();
#pragma endregion

#if 1
#  define DBG(fmt, ...) printf(fmt, ##__VA_ARGS__)
#else
#  define DBG(fmt, ...)
#endif

const int MOD = 1000000007;
const int MAX_N = 100010;

signed main() {
    IOS;

    int a;
    cin >> a;
    print(a + a * a + a * a * a);

    return 0;
}


Measured memory_bytes: 3448
#include <iostream>
#include <iomanip>
typedef long long ll;
using namespace std;
const ll INF = 1e9;
const ll MOD = 1e9 + 7;
#define repi(i, n, init) for (ll i = init; i < (n); i++)

int main()
{
    int n, d;
    cin >> n >> d;
    cout << (n + d * 2) / (d * 2 + 1) << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
 
using namespace __gnu_pbds;
using namespace std;
 
typedef long long int ll;
typedef unsigned long long int sll;
typedef long double ld;
#define A 1000000007
#define D 100000000000000ll
#define B 998244353ll
#define C 1000000000000000000ll
#define M 4000
#define FAST ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define oset tree<pair<ll,ll>, null_type,less_equal<pair<ll,ll>>, rb_tree_tag,tree_order_statistics_node_update> 
#define pb push_back
#define pf push_front
#define pob pop_back
#define pof pop_front
#define mxe(v) *max_element(v.begin(),v.end())
#define mne(v) *min_element(v.begin(),v.end())
#define bs binary_search
#define lb lower_bound
#define ub upper_bound
#define ve vector
#define br break
#define PI acos(-1)
#define subt cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n" 

int main() 
{
    FAST;
    ll n,m,k;
    cin>>n>>m>>k;
    ll a[n],b[m];
    for(int i=0;i<n;i++)
        cin>>a[i];
    for(int i=0;i<m;i++)
        cin>>b[i];
    ll in1=0,in2=0,ans=0,ti1=0,ti2=0;
    while(ti1<=k && in1<n)
    {
        ti1+=a[in1];
        in1++;
    }
    if(ti1>k)
    {
        ti1-=a[in1-1];
        in1--;
    }
    while(in1>=0)
    {
        while(ti1+ti2<=k && in2<m)
        {
            ti2+=b[in2];
            in2++;
        }
        if(ti1+ti2>k)
        {
            in2--;
            ti2-=b[in2];
        }
        ans=max(ans,in1+in2);
        in1--;
        ti1-=a[in1];
    }
    cout<<ans;
    subt;
    return 0;
}

Measured memory_bytes: 6936
#define lp(i,n) for(int i=0;i<n;i++)
#define pau system("pause")
#define ll long long
#include<bits/stdc++.h>

using namespace std;
int main(){
    string s;
    cin>>s;
    if(s=="AAA"||s=="BBB")
        cout<<"No"<<endl;
    else
        cout<<"Yes"<<endl;
}


Measured memory_bytes: 256
s = 0
n,k =  map(int, input().split())
x = list(map(int, input().split()))
for i in range(1,n):
    if x[i-1]> k:
        s+=x[i-1]-k
        s+=x[i]
        x[i] = 0
    elif x[i-1]+x[i]>k:
        s+=x[i]+x[i-1]-k
        x[i] -=x[i]+x[i-1]-k
        #print(i,s)
print(s)

Measured memory_bytes: 14540
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <stack>
#include <numeric>
#include <algorithm>
#include <tuple>
#include <stdio.h>
#include <bitset>
#include <limits.h>
#include <complex>
#include <deque>
#include <iomanip>
#include <list>
#include <cstring>
using namespace std;
#define pi pair<int,int>
#define pl pair<long long,long long>
#define chmax(a,b) (a<b ? a=b:0)
#define chmin(a,b) (a>b ? a=b:0)
#define en cout << endl //セミコロンつけろ
//#define MM 1000000000
//#define MOD MM+7
typedef long long ll;
const int MM = 1e9;
const int MOD = MM+7;
const long double PI = acos(-1);
const long long INF = 1e15;
int dx[8] = {-1,0,1,0,-1,-1,1,1};
int dy[8] = {0,-1,0,1,-1,1,1,-1};
// 'A' = 65, 'Z' = 90, 'a' = 97, 'z' = 122
template<typename T>
T GCD(T u,T v){
    return v ? GCD(v,u%v) : u;
}
template<typename T>
T LCM(T x,T y){
    T gc = GCD(x,y);
    return x*y/gc;
}
struct edge {
    ll to,cost;
};

int main(){
    int N; cin >> N;
    vector<ll> a(N),ch(N);

    for (int i = 0; i < N; i++){
        cin >> a[i];
        ch[i] = a[i]-i-1;
    }
    sort(ch.begin(),ch.end());
    ll tmp1 = MM,tmp2 = MM;
    tmp1 = ch[N/2];
    ll mn = INF;
    ll sum = 0;
    for (int i = 0; i < N; i++){
        sum += abs(ch[i]-tmp1);
    }
    mn = min(mn,sum);
    cout << mn << endl;
}

Measured memory_bytes: 3328
#include <bits/stdc++.h>
using namespace std;
#define  rep(i, n) for(int i = 0; i < n; i++) 
#define  all(x) (x).begin(),(x).end()     // 昇順ソート
#define  rall(v) (v).rbegin(), (v).rend() // 降順ソート
#define  INF 1LL << 60
typedef long long int LL;
typedef long long int ll;
#define pll pair<ll, ll>
#define F first
#define S second
const int MOD = 1000000007;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return true; } return false; }
//sort(all(x))とするとソートできるよ
// 10^x は pow(10,(x)) 
// 任意のlogは　対数の底の変換を使う    log(N) / log(任意の底)

int main(){
    int N;cin >> N;
    vector<LL> a(N);
    LL x;cin >> x;
    rep(i,N)cin >> a[i];
    LL ans = 0;
    rep(i,N){
        if(i == 0)continue;
        if(a[i-1] >= x){
            ans += a[i-1] - x;
            a[i-1] = x;
            ans += a[i];
            a[i] = 0;
        }
        else{
            if(a[i]+a[i-1] > x){
                LL tmp = a[i]+a[i-1]-x;
                ans += tmp;
                a[i] -= tmp;
            }
            else continue;
        }
    }
    cout << ans << endl;
    
}



Measured memory_bytes: 1024
#include<stdio.h>
#include<string.h>

int i;
char s[1000];

int main(){
	while(scanf("%s",s)!=EOF){
		for(i=0;i<strlen(s);i++){
			if(s[i]=='@'){
				while(s[i+1]!='0'){
					printf("%c",s[i+2]);
					s[i+1]--;
				}
				i+=2;
			}else{
				printf("%c",s[i]);
			}
		}
		printf("\n");
	}
	
	return 0;
}

Measured memory_bytes: 0
#include<bits/stdc++.h>
using namespace std;
string s,t;
int main()
{
   while(cin>>s>>t)
   {
      if(s==t)
         {
            cout<<"EQUAL"<<endl;
            continue;
         }
      int n=s.size();
      int m=t.size();
      if(n>m)
         cout<<"GREATER"<<endl;
      if(m>n)
         cout<<"LESS"<<endl;
      if(n==m)
      {
         if(s>t)
            cout<<"GREATER"<<endl;
         else
            cout<<"LESS"<<endl;
      }
   }
   return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
const int mod=1e9+7;
typedef long long ll;
int X[7],Y[7];
ll f[2000005],inv[2000005],ans;
ll C(int n,int m){
	return f[n+m]*inv[n]%mod*inv[m]%mod;
}
ll calc0(int x,int y){
	ll ans=0;
	ans+=C(x-X[2],y-Y[2]);
	ans+=C(x-X[1]+1,y-Y[1]+1);
	ans-=C(x-X[1]+1,y-Y[2]);
	ans-=C(x-X[2],y-Y[1]+1);
	return (ans%mod+mod)%mod;
}
ll calc1(int x,int y){
	ll ans=0;
	ans+=C(X[5]-x,Y[5]-y);
	ans+=C(X[6]-x+1,Y[6]-y+1);
	ans-=C(X[5]-x,Y[6]-y+1);
	ans-=C(X[6]-x+1,Y[5]-y);
	return (ans%mod+mod)%mod;
}
int main(){
	f[0]=f[1]=inv[0]=inv[1]=1;
	for(int i=2;i<=2000002;i++) f[i]=f[i-1]*i%mod,inv[i]=inv[mod%i]*(mod-mod/i)%mod;
	for(int i=2;i<=2000002;i++) inv[i]=inv[i]*inv[i-1]%mod;
	for(int i=1;i<=6;i++) scanf("%d",&X[i]);
	for(int i=1;i<=6;i++) scanf("%d",&Y[i]);
	for(int i=X[3];i<=X[4];i++){
		ans=(ans+1LL*(mod-(i+Y[3]))*calc0(i,Y[3]-1)%mod*calc1(i,Y[3]))%mod;
		ans=(ans+1LL*(i+Y[4]+1)*calc0(i,Y[4])%mod*calc1(i,Y[4]+1));
	}
	for(int i=Y[3];i<=Y[4];i++){
		ans=(ans+1LL*(mod-(i+X[3]))*calc0(X[3]-1,i)%mod*calc1(X[3],i))%mod;
		ans=(ans+1LL*(X[4]+i+1)*calc0(X[4],i)%mod*calc1(X[4]+1,i))%mod;
	}
	printf("%lld",ans);
	return 0;
}

Measured memory_bytes: 31488
#include <bits/stdc++.h>
#define maxN 5000002
using namespace std;
int n, a, b, c, d;
int main()
{
    scanf("%d %d %d %d %d", &n, &a, &b, &c, &d);
    if (a > b)
        swap(a, b);
    if (a == b)
    {
        if (c == 0 || (n & 1))
            printf("YES\n");
        else
            printf("NO\n");
        return 0;
    }
    /*for (int i = 1; i <= n; ++ i)
        if ((i & 1) == (n & 1))
        {
            if ((1LL * i * c <= b - a) && (1LL * i * d >= b - a))
            {
                printf("YES\n");
                return 0;
            }
        }*/
    for (int i = 0; i < n; ++ i)
    {
        long long e = 1LL * b - a - 1LL * (n - 2 * i - 1) * c;
        if ((e <= 1LL * (n - i - 1) * (d - c) && e >= 0) || (e <= 0 && e >= 1LL * i * (c - d)))
        {
            printf("YES\n");
            return 0;
        }
    }
    printf("NO\n");
    return 0;
}


Measured memory_bytes: 256
import sys

p, q, r = map(int, input().split())
if p <= q <= r:
    print(p + q)
elif p <= r <= q:
    print(p + r)
elif q <= p <= r:
    print(p + q)
elif q <= r <= p:
    print(r + q)
elif r <= p <= q:
    print(p + r)
elif r <= q <= p:
    print(r + q)

Measured memory_bytes: 3060
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<string>
#include<vector>
#include<cmath>
#include<queue>
#include<deque>
#include<stack>
#include<set>
#include<map>
#define PI acos(-1.0)
#define LL long long
#define MAX 0x3fffffff
using namespace std;

int n, k, a[200005];

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	cin >> n >> k;
	for (int i = 0; i < n; i++)cin >> a[i];
	sort(a, a + n);
	LL ans = 0;
	for (int i = 0; i < n - k; i++)ans += a[i];
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 1024
#pragma region Header
#ifdef DEBUG
#include "debug.hpp"
#else
#define NDEBUG
#define debug(...)
#define IFD(...)
#endif
#include <utility>
#include <cstdint>
#include <cmath>
#include <cassert>
#include <vector>
#include <array>
#include <deque>
#include <queue>
#include <stack>
#include <tuple>
#include <set>
#include <map>
#include <unordered_map>
#include <bitset>
#include <string>
#include <functional>
#include <algorithm>
#include <numeric>
#include <stdexcept>
#include <iostream>
#include <iomanip>
using namespace std;
using i32 = int32_t;
using i64 = int64_t;
using u32 = uint32_t;
using u64 = uint64_t;
#define rep(i, n) for (int i = 0; i < static_cast<int>(n); ++i)
#define repd(i, n) for (int i = static_cast<int>(n) - 1; i >= 0; --i)
#define FOR(i, a, b) for (int i = static_cast<int>(a); i <= static_cast<int>(b); ++i)
#define FORD(i, b, a) for (int i = static_cast<int>(b); i >= static_cast<int>(a); --i)
template <typename T>
int SZ(T const &x)
{
    return static_cast<int>(x.size());
}
template <class T>
bool chmax(T &a, T const &b)
{
    if (a < b)
    {
        a = b;
        return true;
    }
    return false;
}
template <class T>
bool chmin(T &a, T const &b)
{
    if (b < a)
    {
        a = b;
        return true;
    }
    return false;
}
#pragma endregion

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

    int n;
    cin >> n;
    vector<int> h_s(n);
    rep(i, n)
    {
        cin >> h_s[i];
    }

    // 0からiまでのぼるコスト
    vector<int> dp(n, 0);
    dp[1] = abs(h_s[1] - h_s[0]);
    FOR(i, 2, n - 1)
    {
        dp[i] = min(dp[i - 1] + abs(h_s[i] - h_s[i - 1]), dp[i - 2] + abs(h_s[i] - h_s[i - 2]));
    }
    cout << dp[n - 1];

    return 0;
}


Measured memory_bytes: 3952