akhauriyash/Code-Regression huggingface dataset:
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        MyScanner in = new MyScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        A solver = new A();
        solver.solve(1, in, out);
        out.close();
    }

    static class A {
        public void solve(int testNumber, MyScanner in, PrintWriter out) {
            String S = in.next();
            if ("ABC".equals(S)) {
                out.println("ARC");
            } else {
                out.println("ABC");
            }
        }

    }

    static class MyScanner {
        private BufferedReader in;
        private StringTokenizer st;

        public MyScanner(InputStream stream) {
            in = new BufferedReader(new InputStreamReader(stream));
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    String rl = in.readLine();
                    if (rl == null) {
                        return null;
                    }
                    st = new StringTokenizer(rl);
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return st.nextToken();
        }

    }
}



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

typedef long long ll;
const int MOD = 1e9 + 7;
const int INF = 1e9;

int main() {
  int n;
  cin >> n;
  vector<int> a(n+1);
  for(int i = 0; i < n; i++) cin >> a[i+1];
  vector<int> b(n+1);
  for (int i = n; i >= 1; --i) {
    int sum = 0;
    for (int j = i+i; j <= n; j += i) {
      sum ^= b[j];
    }
    b[i] = sum^a[i];
  }
  vector<int> ans;
  for (int i = 1; i <= n; i++) {
    if (b[i]) ans.push_back(i);
  }
  cout << ans.size() << endl;
  for(int i = 0; i < ans.size(); i++) {
    printf("%d%c", ans[i], i+1==ans.size()?'\n':' ');
  }
  return 0;
}


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

int main() {
    ll K,S;
    cin >> K >>S;
    ll ans =0;
    for(int x=0;x<=K;x++)for(int y=0;y<=K;y++){
        ll z = S-x-y;
        if(z>=0&&z<=K){
            ans++;
        }
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#define MAX 10000
#define NIL -1
struct Node{int parent,left,right;
};
Node T[MAX];
int n,D[MAX],H[MAX];
void setDepth(int u,int d)
{
	if(u==NIL)return;
	D[u]=d;
	setDepth(T[u].left,d+1);
	setDepth(T[u].right,d+1);
}
int setHeight(int u)
{
	int h1=0,h2=0;
	if(T[u].left!=NIL)
	h1=setHeight(T[u].left)+1;
	if(T[u].right!=NIL)
	h2=setHeight(T[u].right)+1; 
	return H[u]=(h1>h2?h1:h2);
}
int getSibling(int u)
{
	if(T[u].parent==NIL)return NIL;
	if(T[T[u].parent].left!=u&&T[T[u].parent].left!=NIL)
	return T[T[u].parent].left;
	if(T[T[u].parent].right!=u&&T[T[u].parent].right!=NIL)
	return T[T[u].parent].right;
	return NIL;
}
void printf(int u)
{
	printf("node %d: ",u);
	printf("parent = %d, ", T[u].parent);
	printf("sibling = %d, ",getSibling(u));
	int deg=0;
	if(T[u].left!=NIL)deg++;
	if(T[u].right!=NIL)deg++;
	printf("degree = %d, ",deg);
	printf("depth = %d, ",D[u]);
	printf("height = %d, ",H[u]);
	if(T[u].parent==NIL)
	{
		printf("root\n");
	}
	else if(T[u].left==NIL&&T[u].right==NIL)
	{
		printf("leaf\n");
	}
	else 
	{
		printf("internal node\n");
	}
}
int main()
{
	int v,l,r,root=0;
	scanf("%d",&n);
	for(int i=0;i<n;i++)
	T[i].parent=NIL;
	for(int i=0;i<n;i++)
{
	scanf("%d %d %d",&v,&l,&r);
	T[v].left=l;
	T[v].right=r;
	if(l!=NIL)T[l].parent=v;
	if(r!=NIL)T[r].parent=v;
}
for(int i=0;i<n;i++)
if(T[i].parent==NIL)
root=i;
setDepth(root,0);
setHeight(root);
for(int i=0;i<n;i++)
printf(i);
return 0;
}

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

using namespace std;

int main() {
    int n;
    cin >> n;
    if (n % 10 == 7 || n % 100 / 10 == 7 || n / 100 == 7) {
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }
    return 0;
}

Measured memory_bytes: 3632
#include <iostream>

using namespace std;

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

    for (long long i = 1; i <= 3500; i++) {
        for (long long j = 1; j <= 3500; j++) {
            if (4 * i * j - n * i - n * j > 0 && n * i * j % (4 * i * j - n * i - n * j) == 0) {
                cout << i << " " << j << " " << n * i * j / (4 * i * j - n * i - n * j) << endl;
                goto out;
            }
        }
    }
out:
    ;
}


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

typedef long long ll;
typedef unsigned long long ull;
template<typename T>T gcd(T a,T b){if(b==0)return a;else return gcd(b,a%b);}
template<typename T>T lcm(T a,T b){return a/gcd(a,b)*b;}
template<typename T>T maxx(T a,T b){if(a>=b) return a;else return b;}
template<typename T>T minn(T a,T b){if(a<=b) return a;else return b;}
ll power(ll x,ll y,ll p){ll res=1;x%=p;while(y>0){if(y&1)res=((res%p)*(x%p))%p;y>>=1;x=(x*x)%p;}return res;}
ll powerfew(ll x,ll y){ll res=1;while(y>0){if(y&1)res*=x;y>>=1;x*=x;}return res;}
#define IO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define loop(i,n) for(int i=1;i<=n;++i)
#define mem(x,y) memset(x,y,sizeof(x))
#define PI  3.141592653589
#define INF 0x3f3f3f3f//(1061109567)
const ll MAX=2e5+10;
ll a[1000000],b[1000000],c[1000000];
int main()
{
	ll n;
	cin >>n;
	for(ll i=1;i<=n;i++)
	{
		cin >>a[i];
	}
	for(ll i=1;i<=n;i++)
	{
		if((i+a[i])<=n)//sadasdasd
		{
			b[i+a[i]]++;
		}
	}
	for(ll i=1;i<=n;i++)
	{
		if((i-a[i])>0)
		{
			c[i-a[i]]++;
		}
	}
	ll ans=0;
	for(ll i=1;i<=n;i++)
	{
		ans+=c[i]*b[i];
	}
	cout <<ans<<endl;
	return 0;
}

Measured memory_bytes: 8320
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		
		try (Scanner sc = new Scanner(System.in);) {
			int labels[] = new int[6];
			
			for(int i = 0; i < 6; i++) {
				labels[i] = sc.nextInt();
			}
			
			String orders = sc.next();
			
			Dice dice = new Dice(labels);
			
			for(int i = 0; i < orders.length(); i++) {
				dice.move(String.valueOf(orders.charAt(i)));
			}
			
			System.out.println(dice.getTop());
		}
	}
}

class Dice {
	
	private int position[];
	
	Dice(int labels[]){
		this.position = labels;
	}
	
	void move(String order) {
		if(order.equals("N")) {
			position = new int[]{position[1], position[5], position[2], position[3], position[0], position[4]};
			return;
		}
		if(order.equals("E")) {
			position = new int[]{position[3], position[1], position[0], position[5], position[4], position[2]};
			return;
		}
		if(order.equals("S")) {
			position = new int[]{position[4], position[0], position[2], position[3], position[5], position[1]};
			return;
		}
		if(order.equals("W")) {
			position = new int[]{position[2], position[1], position[5], position[0], position[4], position[3]};
			return;
		}
	}
	
	int getTop() {
		return position[0];
	}
}


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

using namespace std;

typedef pair<int, int> p;
typedef long long ll;
const int inf = 1000000007;

int main() {
  ll a, b, c, d;
  cin >> a >> b >> c >> d;
  if (b < 0 && d < 0) {
    cout << a * c << endl;
    return 0;
  }
  if (a < 0 && c < 0) {
    if (b >= 0 && d >= 0) {
      if (a * c >= b * d)
        cout << a * c << endl;
      else
        cout << b * d << endl;
    } else {
      cout << a * c << endl;
    }
    return 0;
  }
  if (b < 0) {
    cout << b * c << endl;
    return 0;
  }
  if (d < 0) {
    cout << d * a << endl;
    return 0;
  }
  cout << b * d << endl;
  return 0;
}

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

using namespace std;

const int maxn = 1e5+100;

int n, h[4][maxn], dp[maxn][4];

int solve(int x, int last){
    if(dp[x][last]!=-1)return dp[x][last];
    if(x==n+1)return 0;
    for(int i=1; i<=3; i++){
        if(i!=last){
            dp[x][last]=max(dp[x][last], h[i][x] + solve(x+1, i));
        }
    }
    return dp[x][last];
}

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

    cin >> n;

    for(int i=1; i<=n; i++)cin >> h[1][i] >> h[2][i] >> h[3][i];

    memset(dp, -1, sizeof dp);

    cout << solve(1,0) << endl;
}


Measured memory_bytes: 10752
#include<bits/stdc++.h>
 
#define rep(i,n) for(ll i = 0;i < n;++i)
#define all(v) v.begin(),v.end()
using namespace std;
using ll = long long;
typedef pair<int,int> P;
 
const int INF = 1001001001;
const long double PI = (acos(-1));
const int mod = 1e9+7;
const int vx[6] = {0,1,0,-1,1,-1};
const int vy[6] = {1,0,-1,0,1,1};



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

    ll a,v,b,w,t;
    cin >> a >> v >> b >> w >> t;
    bool flag;
    if(a<b) flag = true;
    else flag = false;
    if(flag){
        a += v*t;
        b += w*t;
        if(a >= b) cout << "YES" << endl;
        else cout << "NO" << endl;
    }else{
        a -= v*t;
        b -= w*t;
        if(a <= b) cout << "YES" << endl;
        else cout << "NO" << endl;        
    }

    cout << endl;
    return 0;
}


Measured memory_bytes: 3648
#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<string>
#include<cmath>
#include<vector>
#include<stack>
#include<queue>
#include<time.h>
#include<set>
#include<map>
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define REP(i,a,b) for(int i=a;i>b;i--)
#define vint vector<int> 
#define vvint vector<vint>
#define ct(a) cout<<a<<endl
using namespace std;
typedef long long ll;
const ll INF = 1e9+7;
const int MOD = 1e9 + 7;

string N;

ll cul(ll n,ll cur,ll cur2) {
	if (n == N.length()-1) {
		return cur + N[n] - '0'+cur2;
	}


	cur += N[n]-'0';
	ll ret1 = cul(n + 1,0,cur2+cur);
	ll ret2 = cul(n + 1, cur * 10,cur2);
	return ret1 + ret2;

}


int main(void) {
	cin >> N;

	cout<<cul(0, 0,0)<<endl;



	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdlib>
#include <cstring>
#include <cstdio>
#include <iostream>
using namespace std;
struct Node{
	int key;
	Node *next, *prev;
};

Node *nil;

Node* listsearch(int key){
	Node *cur = nil->next;
	while (cur != nil && cur->key != key){
		cur = cur->next;
	}
	return cur;
}

void init(){
	nil = (Node *)malloc(sizeof(Node));
	nil->next = nil;
	nil->prev = nil;
}

void printList(){
	Node *cur = nil->next;
	int isf = 0;
	while(1){
		if(cur == nil) break;
		if(isf++ > 0) printf(" ");
		printf("%d", cur->key);
		cur = cur->next;
	}
	printf("\n");
}

void deleteNode(Node *t){
	if (t == nil) return;
	t->prev->next = t->next;
	t->next->prev = t->prev;
	free(t);
}

void deleteFirst(){
	deleteNode(nil->next);
}

void deleteLast(){
	deleteNode(nil->prev);
}

void deleteKey(int key){
	deleteNode(listsearch(key));
}

void insert(int key){
	Node *x = (Node *)malloc(sizeof(Node));
	x->key = key;

	x->next = nil->next;
	nil->next->prev = x;
	nil->next = x;
	x->prev = nil;
}

int main(){
	int key, n, i;
	int size = 0;
	char com[20];
	int np = 0, nd = 0;
	scanf("%d", &n);
	init();
	for (int i=0; i<n; i++){
		scanf("%s%d", com, &key);
		if (com[0] == 'i') {insert(key); np++; size++;}
		else if (com[0] == 'd'){
			if (strlen(com) > 6){
				if (com[6] == 'F') deleteFirst();
				else if (com[6] == 'L') deleteLast();
			} else {
				deleteKey(key); nd++;
			}
			size--;
		}
	}

	printList();

	return 0;
}

Measured memory_bytes: 32364
#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 REP(i,a,b) for(int i=a;i<b;i++)
#define yesno(flg) if(flg){cout<<'YES'<<endl;}else{cout<<'NO'<<endl;}
#define vi vector<int>
#define pb push_back
#define i197 1000000007
#define MAX_N 200002
using namespace std;

typedef long long ll;
typedef pair<int,int> Pii;
typedef pair<Pii,int> Piii;
typedef pair<int,ll> Pil;
typedef pair<ll,ll> Pll;
typedef pair<string,int> Psi;
typedef pair<Psi,int> Psii;

const int inf=1000000000;
struct edge{
	int myc,to,c,cost;
};
struct pos{
	int to,cost,color;
};
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};

ll d[13][100001]={};
int r[100000]={};
int l[100000]={};
int t[100000]={};
int main() {
	string s;
	cin>>s;
	int n=s.size();
	l[n-1]=n-1;
	r[0]=0;

	rep(i,n-1){
		if(s[i+1]=='L'){
			r[i+1]=r[i];
		}else{
			r[i+1]=i+1;
		}
	}
	for(int i=n-2;i>=0;--i){
		if(s[i]=='R'){
			l[i]=l[i+1];
		}else{
			l[i]=i;
		}
	}
	rep(i,n){
		if(s[i]=='R'){
			if((l[i]-i)%2>0){
				t[l[i]-1]++;
			}else{
				t[l[i]]++;
			}
		}else {
			if((i-r[i])%2>0){
				t[r[i]+1]++;
			}else{
				t[r[i]]++;
			}
		}
	}
	cout<<t[0];
	rep(i,n-1)cout<<" "<<t[i+1];
	cout<<endl;
	return 0;
}


Measured memory_bytes: 1792
#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;
    ll res = 0; int cnt = 0;
    for(char c: s){
        if(c=='B')cnt++;
        else res += cnt;
    }
    cout << res << ln;
}



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

using namespace std;
using ll = long long;
constexpr int mod = 1e9+7;
constexpr int md = mod;
int main(){
    int a,p;
    cin>>a>>p;
    cout << ((3*a)+p)/2 << endl;
    return 0;
}



Measured memory_bytes: 256
#ifdef _MSC_VER
#include <__msvc_all_public_headers.hpp>
#undef min
#undef max
#else
#define NDEBUG
#include <bits/stdc++.h>
#endif

using namespace std;
using large = long long;

int main()
{
    string s;
    cin >> s;
    int n = 0;
    int most = 0;
    for (auto c : s) {
        if (c == 'R') {
            ++n;
            most = max(most, n);
        } else {
            n = 0;
        }
    }

    cout << most << endl;
    return 0;
}


Measured memory_bytes: 3620
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#define int long long
using namespace std;
inline void rd(int &x)
{
	x=0;register char k=getchar();int s=1;
	while(k>'9'|k<'0'){if(k=='-')s=-1;k=getchar();}
	while(k>='0'&&k<='9')x=x*10+k-48,k=getchar();x*=s;
}
int n,m,ans;
main()
{
	cin>>n;//cout<<sqrt(n)<<endl;
	if(n==2)
	{
		cout<<0;
	}else
	{
		for(int i=2;i<=sqrt(n);i++)
	{//cout<<i<<endl;
		if(n%i==0)
		{
			int j=n/i;
			m=i-1;//cout<<i<<endl;cout<<(n/m)*i<<endl;cout<<i<<endl;
			if((n/m)*i==n){ans+=m;}//,
			if(j!=i)
			{
				m=j-1;
			if((n/m)*j==n)ans+=m;
			}
		}
	}cout<<ans+n-1;
	}
	
}

Measured memory_bytes: 384
#include <iostream>
using namespace std;
#define REP(i,n) for(int i=0;i<n;i++)
#define REP2(i,m,n) for(int i=m;i<n;i++)
int main(){
	int N;
	cin >> N;
	int H[N];
	REP(i,N){
		cin >> H[i];
	}
	int max = H[0];
	int ans = 1;
	REP2(i,1,N){
		if(H[i] >= max){
			++ans;
			max = H[i];
			//cout << i << ' ' << H[i] << endl;
		}
	}
	cout << ans << endl;
	return 0;
}

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

int main()
{
	string a, b, c;
	cin >> a >> b;
	c = a + b;
	int n = stoi(c);
	cout << ((pow((int)(sqrt(n)),2) == n) ? "Yes" : "No") << endl;
	return 0;
}

Measured memory_bytes: 256
n, m=map(int, input().split())
ab=[list(map(int, input().split())) for _ in range(n)]
ab.sort()
ans=0
for i in range(n):
  if ab[i][1]<=m:
    ans+=ab[i][0]*ab[i][1]
    m-=ab[i][1]
  else:
    ans+=ab[i][0]*m
    break
print(ans)

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

vector<vector<ll>> dp;
vector<int> a;

ll solve(int s, int g, int N){
    if(dp[s][g] != 1e18) return dp[s][g];

    if((N-(g-s+1))%2==0){
        // 太郎君の手
        dp[s][g] = max(solve(s+1,g,N) + a[s], solve(s, g-1, N) + a[g]);
    }else{
        dp[s][g] = min(solve(s+1,g,N) - a[s], solve(s, g-1, N) - a[g]);
    }
    return dp[s][g];
}

int main(){
    int N;  cin >> N;
    a.resize(N,0);
    for(int i=0; i<N; i++) cin >> a[i];

    dp.resize(N, vector<ll>(N, 1e18));
    for(int i=0; i<N; i++){
        if((N-1)%2==0)
            dp[i][i] = a[i];
        else
            dp[i][i] = -a[i];
    }

    cout << solve(0, N-1, N) << endl;
}


Measured memory_bytes: 70912
#include <bits/stdc++.h>
#define rep(i, n) for(int i= 0; i < (n); i++)
using ll= long long int;
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; }
ll mod= 1e9 + 7;


int main(){
  int x,y,a,b,c;
  cin >> x >> y >> a >> b >> c;
  priority_queue<ll> aa,bb,cc;
  rep(i,a){ll g;cin >> g;aa.push(g);}
  rep(i,b){ll g;cin >> g;bb.push(g);}
  rep(i,c){ll g;cin >> g;cc.push(g);}
  ll ans=0;

  rep(i,x){cc.push(aa.top()); aa.pop();}
  rep(i,y){cc.push(bb.top()); bb.pop();}
  rep(i,x+y){
    ans+=cc.top();
    cc.pop();
  }
  cout << ans << endl;
}


Measured memory_bytes: 8972
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
    ll X;
    cin>>X;
    ll now=100;
    for(int i=0;i<=50000;i++){
        if(now>=X){
            cout<<i;
            break;
        }
        now=now+now/100;
    }
}

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

using namespace std;

int main(){
  string s;

  int insertions = 0;
  getline(cin, s);
  int end = s.size()-1;
  int start = 0;
  
  while (start < end){
    if (s[start] == s[end]){
      ++start;
      --end;
      continue;
    }

    if ('x' == s[end]){
      ++insertions;
      --end;
    }
    else if ('x' == s[start]){
      ++insertions;
      ++start;
    }
    else {
      cout<<-1;
      return 0;
    }
  }
  cout<<insertions;
  return 0;
  
}


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

int main() {
  vector<char> C1(3);
  vector<char> C2(3);
  
  for (int i = 0; i < 3; i++) {
    cin >> C1.at(i);
  }
  for (int i = 0; i < 3; i++) {
    cin >> C2.at(i);
  }
  
  reverse(C2.begin(), C2.end());
  
  if (C1 == C2) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  
}

Measured memory_bytes: 256
N, K=map(int, input().split())
A=list(sorted(list(map(int, input().split())), reverse=True))

def gcd(a,b):
	while b:
		a,b=b,a%b
	return a

g=A[0]
for i in range(1,len(A)):
	g=gcd(g,A[i])

print("POSSIBLE" if K%g==0 and K<=max(A) else "IMPOSSIBLE")

Measured memory_bytes: 14224
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
#define endl "\n"

int main()
{
  i64 N, D;
  cin >> N >> D;
  i64 ans = 0;
  for (i64 i = 0; i < N; i++)
  {
    i64 X, Y;
    cin >> X >> Y;
    if (X * X + Y * Y <= D * D)
      ans++;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3616
using System;

class AtCoder
{

    public static string Solve(string strs)
    {
        int count = 0;

        for (int i = 0; i < strs.Length; ++i)
        {
            char s = strs[i];
            
            for (int j = 0; j < strs.Length; ++j)
            {
                if (s == strs[j])
                {
                    ++count;
                }                     
            }

            if (count % 2 != 0)
            {
                return "No";
            }
            count = 0;
        }
        return "Yes";
    }

    static void Main()
    {
        string strs = Console.ReadLine();

        string answer = Solve(strs);
        Console.WriteLine(answer);
    }
}

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

using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef pair<int, int> Pii;
typedef pair<int, ll> Pil;
typedef pair<ll, ll> Pll;
typedef pair<ll, int> Pli;
typedef vector < vector<ll> > Mat;

#define fi first
#define se second

const ll MOD = 1e9 + 7;
const ll MOD2 = 998244353;
const ll MOD3 = 1812447359;
const ll INF = 1ll << 62;
const double PI = 2 * asin(1);

void yes() {printf("yes\n");}
void no() {printf("no\n");}
void Yes() {printf("Yes\n");}
void No() {printf("No\n");}
void YES() {printf("YES\n");}
void NO() {printf("NO\n");}

int main(){
  ll N; cin >> N;
  ll ans = 0;
  for (ll i = 1; i * i <= N; i++){
    if (N % i != 0) continue;
    ll A = i, m = N / i - 1;
    if (m > A) ans += m;
  }
  cout << ans << endl;

  return 0;
}



Measured memory_bytes: 3604
#include<cstdio>
using namespace std;
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};
char s[400][401];
int par[160000];
int c1[160000];
int c2[160000];
int find(int x) {
    if (par[x] == x) return x;
    return par[x] = find(par[x]);
}
void unite(int x, int y) {
    x = find(x);
    y = find(y);
    if (x == y) return;
    par[x] = y;
}
int main() {
    int h, w, i, j, k;
    long long ans = 0;
    scanf("%d %d", &h, &w);
    for (i = 0; i < h; i++) scanf("%s", s[i]);
    for (i = 0; i < h * w; i++) par[i] = i;
    for (i = 0; i < h; i++) {
        for (j = 0; j < w; j++) {
            for (k = 0; k < 4; k++) {
                int x = i + dx[k];
                int y = j + dy[k];
                if (x < 0 || x >= h || y < 0 || y >= w) continue;
                if (s[i][j] != s[x][y]) unite(i * w + j, x * w + y);
            }
        }
    }
    for (i = 0; i < h; i++) {
        for (j = 0; j < w; j++) {
            if (s[i][j] == '.') {
                c1[find(i * w + j)]++;
            } else {
                c2[find(i * w + j)]++;
            }
        }
    }
    for (i = 0; i < h * w; i++) ans += (long long)c1[i] * c2[i];
    printf("%lld\n", ans);
    return 0;
}


Measured memory_bytes: 2176
n, k = map(int, input().split())
alist = list(map(int, input().split()))

al, bl = [0], [0]
for a in alist:
  al.append(al[-1] + a)
  bl.append(bl[-1] + max(0, a))

al.append(al[-1])
bl.append(bl[-1])

ans = 0
for i in range(0, n - k + 2):
  bsum = bl[-1] - bl[i + k] + bl[i]
  bb = bsum + al[i + k] - al[i]
  ans = max(ans, bb, bsum)
print(ans)


Measured memory_bytes: 17660
n,k=map(int,input().split())
s=input()
s='01'+s+'10'
S=[]
E=[]
ans=[]
for i in range(n+3):
  if s[i:i+2]=='01':
    S.append(i+1)
  if s[i:i+2]=='10':
    E.append(i)
if S==[] and E==[]:
  print(n)
else:
  for j in range(len(E)-k):
    ans.append(abs(S[j]-E[j+k]))
  if ans!=[]:
    ans[0]-=1
    ans[len(ans)-1]-=1
    print(max(ans)+1)
  else:
    print(n)

Measured memory_bytes: 8884
import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner stdIn = new Scanner(System.in);
		int x = stdIn.nextInt();
		int y = stdIn.nextInt();
		int[] ans = new int[1000];
		int index = 0;
		
		while( x != 0 || y != 0 ){
			int n = stdIn.nextInt();
		
			int[][] result = new int[x][y];
			result[0][0] = 1;
		
			for(int i = 0; i < n; i++){
				int aX = stdIn.nextInt();
				int aY = stdIn.nextInt();
				result[aX-1][aY-1] = -1;
			}
			for(int i = 1; i < x; i++){
				if( result[i][0] == -1 ){
					result[i][0] = 0;					
				} else {
					result[i][0] = result[i-1][0];
				}
			}
			for(int i = 1; i < y; i++){
				if( result[0][i] == -1 ){
					result[0][i] = 0;					
				} else {
					result[0][i] = result[0][i-1];
				}
			}
			for(int i = 1; i < x; i++){
				for(int j = 1; j < y; j++){
					if( result[i][j] == -1 ){
						result[i][j] = 0;
					} else {
						result[i][j] = result[i-1][j] + result[i][j-1];
					}
				}
			}
			ans[index] = result[x-1][y-1];
			index++;
			
			x = stdIn.nextInt();
			y = stdIn.nextInt();
		}
		for(int i = 0; i < index; i++){
			System.out.println(ans[i]);
		}
	}
}

Measured memory_bytes: 11000
m,n = list(map(int, input().split()))
MOD=10**9+7
if abs(m-n) > 1:
    print(0)
    exit()

def fact(x):
    ans=1
    for i in range(2, x+1):
        ans=ans%MOD*i
    return ans

if m>n:
    n,m = m,n
    
f = fact(m)
if m==n:
    print(f * f * 2 % MOD)
else:
    print(f * f * n % MOD)

Measured memory_bytes: 3064
#include<iostream>
#include<math.h>
using namespace std;
int maxn=1000;
int main(){
    int A[maxn];
    double a,b=0,c=0,d=0,e=0,f=0,g=0,w=0,x=0,y=0,z=0;
    for(int i=0;i!=6;i++){
        cin>>a;
        A[i]=a;
    }
    for(int i=4;i!=0;i--){
        b=abs(A[0]-A[i]);
        if(b>A[5]){cout<<":("; return 0;}
        b=0;
    }

    for(int i=4;i!=1;i--){
        b=abs(A[1]-A[i]);
        if(b>A[5]){cout<<":("; return 0;}
        b=0;
    }

    for(int i=4;i!=2;i--){
        b=abs(A[2]-A[i]);
        if(b>A[5]){cout<<":("; return 0;}
        b=0;
    }

    for(int i=4;i!=3;i--){
        b=abs(A[3]-A[i]);
        if(b>A[5]){cout<<":("; return 0;}
        b=0;
    }
    cout<<"Yay!";
    return 0;
}


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

int main() {
  double w,h,x,y;
  cin >> w >> h >> x >> y;
  double ans = w*h / 2;
  int flag = 0;
  if (x*2 == w && y*2 == h) flag = 1;
  else flag = 0;
  cout << ans << " " << flag << endl;
  return 0;
}


Measured memory_bytes: 3744
#include <map>
#include <set>
#include <vector>
#include <algorithm>
#include <iostream>
#include <bitset>
#include <cassert>
#include <queue>
#include <random>
#include <stack>
#include <iomanip>

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

typedef unsigned int uint;
typedef long long llong;
typedef unsigned long long ullong;
typedef long double ldouble;

typedef vector<llong> vecllong;
typedef vector<vecllong> vvecllong;

const llong MOD = 1e9 + 7;
const llong INF = 1e17;

#define FOR(i, n) for (llong i = 0; i < n; i++)
#define FORS(i, a, b) for (llong i = a; i < b; i++)
#define FORR(i, n) for (llong i = n; i > 0; i++)

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

    llong N;
    cin >> N;
    string S;
    cin >> S;

    vecllong nextNum(N + 1, 0);
    vecllong nowNum(N + 1, 1);
    nowNum[0] = 0;

    FORS(index, 2, N + 1) {
        if(S[index - 2] == '<') {
            llong sum = 0;
            FORS(j, 1, N - index + 2) {
                sum = (sum + nowNum[j]) % MOD;
                nextNum[j] = sum;
            }
        } else {
            llong sum = 0;
            for(llong j = N - index + 1; j >= 1; j--) {
                sum = (sum + nowNum[j + 1]) % MOD;
                nextNum[j] = sum;
            }
        }
        swap(nowNum, nextNum);
    }

    cout << nowNum[1] << endl;

    return 0;
}

Measured memory_bytes: 384
import numpy as np

s = list(input())
Ans1 = 0
Ans2 = 0
for i in range(len(s)):
    C = int(s[i])
    if C == i%2:
        Ans1 += 1
    else:
        Ans2 += 1

print(min(Ans1,Ans2))


Measured memory_bytes: 21380
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=2e6+20;
const ll mod=1e9+7;
char s[N],t[N];
int fail[N],suf[N];
void getfail(int *fail,char *s)
{
	fail[0]=-1;
	int i=0,j=-1;
	while(s[i])
	{
		if(j==-1||s[i]==s[j])
		{
			fail[i+1]=j+1;
			i++,j++;
		}
		else
			j=fail[j];
	}
}
int main()
{
	while(scanf("%s",s)!=EOF)
	{
		ll ans=0;
		int len=strlen(s);
		for(int i=0;s[i];i++)
			t[i]=s[len-i-1];
		t[len]='\0';
		getfail(fail,s);
		getfail(suf,t);
		int m;
	//	cout<<fail[len]<<endl;
		if(fail[len]==0||len%(len-fail[len]))
			m=1;
		else
			m=2;
		bool flag=true;
		for(int i=1;s[i];i++)
		{
			if(s[i]!=s[i-1])
				flag=false;
		}	
		if(flag)
			m=len;
		if(m==1||flag)
			ans=1;
		else
		{
			for(int i=0;i<len-1;i++)
			{
				int k=len-i-1;
			//	cout<<i<<' '<<k<<endl;
				if((fail[i+1]==0||(i+1)%((i+1)-fail[i+1])) &&(suf[k]==0||(k)%(k-suf[k])))
					ans++;
			}
		}	
		cout<<m<<endl<<ans<<endl;
	}
	return 0;
}


Measured memory_bytes: 10368
#文字列入力・置換BC→X
s = str(input())

k = 0

tmp1 = ""
f = True

for i,si in enumerate(s):
    if (f):
        if (si != tmp1): # 1文字hit
            k += 1
            tmp1 = si
            f = True
        else: # 2
            tmp1 = ""
            f = False
    else:
        k += 1
        tmp1 = ""
        f = True


print(k)

Measured memory_bytes: 3500
#include <stdio.h>

int Adj[101][101];
int d[101], f[101], color[101];
int n, time;

void DFS(void){

  int i;

  for(i = 1; i <= n ;i++){
    color[i] = 0;
  }
  time = 0;

  for(i = 1; i <= n; i++){
    if(color[i] == 0){
      DFS_Visit(i);
    }
  }

}

void DFS_Visit(int u){

  int i;

  color[u] = 1;
  time++;
  d[u] = time;

  for(i = 1; i <= n; i++){
    if( (Adj[u][i] == 1) && (color[i] == 0) ){
      DFS_Visit(i);
    }
  }

  color[u] = 2;

  f[u] = ++time;

}

main(){
 
  int i, j, m, l;
 
  scanf("%d", &n);
 
  for(i = 1; i <= n; i++){
    scanf("%d %d", &Adj[i][0], &m);
 
    for(j = 1; j <= n; j++){
      Adj[i][j] = 0;
    }
     
    for(j = 1; j <= m; j++){
      scanf("%d", &l);
      Adj[i][l] = 1;
    }
 
  }
 
  DFS();

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

Measured memory_bytes: 636
a, b, x = gets.chomp.split.map(&:to_f)

if x > a**2 * b / 2
  puts (Math.atan((2 * (a**2 * b - x))/(a**3)) * 180)/Math::PI
else
  puts (Math.atan((a * b**2)/(2 * x)) * 180)/Math::PI 
end


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

int main()
{
    int N;
    cin >> N;
    double p[N+1];
    double dp[N+1][N+1];
    for(int i = 1;i <= N;i++){
        cin >> p[i];
    }
    for(int i = 0;i <= N;i++){
        for(int j = 0;j <= N;j++){
            dp[i][j] = 0.0;
        }
    }
    
    dp[0][0] = 1.0;
    // dp[i][j] コインi枚使い表がj枚のときの確率 
    for(int i = 1;i <= N;i++){
        for(int j = 0;j <= i;j++){
            if(j-1 >= 0){
                dp[i][j] = dp[i-1][j-1]*p[i] + dp[i-1][j]*(1.0-p[i]);
            }else{
                dp[i][j] = dp[i-1][j]*(1.0-p[i]);
            }
        }
    }
    double ans = 0.0;
    for(int i = N/2 + 1;i <= N;i++){
        ans += dp[N][i];
    }
cout << fixed << setprecision(11) << ans << endl;


}


Measured memory_bytes: 70528
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int i=0; i<(n); i++)
const long long INF = numeric_limits<long long>::max();
int main()
{
    int a,b,c,ans,youki1,youki2;
    cin>>a>>b>>c;
    youki1 = a-b;
    youki2 = min(c,youki1);
    ans=c-youki2;
    cout << ans;
    return 0;
}

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

namespace AtCoder
{

    class Program
    {
        static void Main(string[] args)
        {
            var rck = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
            var r = rck[0];
            var c = rck[1];
            var k = rck[2];
            var dp = new long[r+1, c+1, 4];
            var vDictionary = new Dictionary<(int, int), long>();
            for (int i = 0; i < k; i++)
            {
                var yxv = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
                vDictionary.Add((yxv[0], yxv[1]), yxv[2]);
            }

            for (int y = 1; y <= r; y++)
            {
                for (int x = 1; x <= c; x++)
                {
                    var prevMax = 0L;
                    for (int i = 0; i < 4; i++)
                        if (prevMax < dp[y - 1, x, i])
                            prevMax = dp[y - 1, x, i];
                    dp[y, x, 0] = Math.Max(prevMax, dp[y, x - 1, 0]);
                    if (vDictionary.TryGetValue((y, x), out long v))
                    {
                        dp[y, x, 1] = Math.Max(prevMax + v, Math.Max(dp[y, x - 1, 0] + v, dp[y, x - 1, 1]));
                        dp[y, x, 2] = Math.Max(dp[y, x - 1, 1] + v, dp[y, x - 1, 2]);
                        dp[y, x, 3] = Math.Max(dp[y, x - 1, 2] + v, dp[y, x - 1, 3]);
                    }
                    else
                    {
                        for (int i = 1; i < 4; i++)
                            dp[y, x, i] = dp[y, x - 1, i];
                    }
                }
            }
            long ans = 0;
            for (int i = 0; i < 4; i++)
                if (ans < dp[r, c, i])
                    ans = dp[r, c, i];
            Console.WriteLine(ans);
        }
    }
}


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

int main() {
  ll A, B, K;
  cin >> A >> B >> K;

  ll take = min(A, K);
  A -= take;
  K -= take;

  if (K > 0) B -= K;
  if (B < 0) B = 0;

  cout << A << " " << B << endl;

  return 0;
}


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

// ----------- define --------------
#define int long long
#define vi vector<int>
#define vc vector<char>
#define ii pair<int,int>
#define fi first
#define sc second
#define all(x) (x).begin(),(x).end()
#define get_bit(x, k) ((x >> k) & 1)
// ---------------------------------

void MAIN() {
  int n, c, k;
  cin >> n >> c >> k;
  vector<int> a(n);
  for (auto &i : a) cin >> i;
  sort(all(a));
  int i = 0, ans = 0;
  while (i < n) {
    i = upper_bound(a.begin() + i, a.begin() + min(i + c, n), a[i] + k) - a.begin();
    ans++;
  }
  cout << ans << '\n';
}

signed main() {
  ios::sync_with_stdio(0); cin.tie(0);
  int T = 1;
  // cin >> T;
  while (T--) MAIN();
}


Measured memory_bytes: 3944
// ybmj
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int INF = 0x3f3f3f3f;
const int NINF = 0xc0c0c0c0;

int main() {
    /*
    #ifndef ONLINE_JUDGE
    freopen("1.in","r",stdin);
    freopen("1.out","w",stdout);
    #endif
    */
    std::ios::sync_with_stdio(false);
    int x, y, z;
    while (cin >> x >> y >> z) {
        x -= z;
        cout << x / (y + z) << endl;
    }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int i=0; i<(n); i++)
#define rep_1(i,n) for(int (i)=0;(i)<=(n);(i)++)
#define rep_2(i,a,b) for(int (i)=(a);(i)<(b);(i)++)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

int main()
{

    int L;
    double ans;
    cin >> L ;
    ans =(double)(L / 3.0)* (double)(L/3.0)* (double)(L/3.0);
    printf("%.12f\n",ans);
    return 0;
}

Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<vector>
#include<functional>
#include<algorithm>
#include<stdlib.h>
#include<string>
#include<string.h>
#define _USE_MATH_DEFINES
#include<math.h>
#include<deque>
#include<set>
#include<map>
#include<queue>
#include<list>
#include<iostream>
using namespace std;
typedef long long ll;
#define rep(i,a,b) for(auto i=a;i<b;i++)
#define all(_x) _x.begin(), _x.end()
#define r_sort(_x) sort(_x.begin(), _x.end(), std::greater<int>())
#define vec_cnt(_a, _n) (upper_bound(all(_a), _n) - lower_bound(all(_a), _n))
ll gcd(ll a, ll b) { return a % b == 0 ? b : gcd(b, a % b); }
ll lcm(ll a, ll b) { return (a / gcd(a, b)) * b; }
#define INF 1 << 30
const ll mod = 1000000007;
int c[10][10];
int main() {
	int H, W, v;
	ll cost = 0;
	scanf("%d%d", &H, &W);
	rep(i, 0, 10)rep(i2, 0, 10)scanf("%d", &c[i][i2]);
	rep(k, 0, 10) {
		rep(s, 0, 10) {
			rep(e, 0, 10) {
				c[s][e] = min(c[s][e], c[s][k] + c[k][e]);
			}
		}
	}
	rep(y, 0, H) {
		rep(x, 0, W) {
			scanf("%d", &v);
			if (v != -1)cost += (ll)c[v][1];
		}
	}
	printf("%lld\n", cost);
	return 0;
}


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

namespace Competitive
{
    internal class Solution
    {
        public int NX, NY;
        public long[] X, Y, XS, YS;
        public long MOD = 1000000007;
        public void Run()
        {
            {
                var line = Input.ReadIntArray();
                NX = line[0];
                NY = line[1];
            }
            X = Input.ReadLongArray();
            Y = Input.ReadLongArray();

            XS = new long[NX];
            YS = new long[NY];
            for (int i = 0; i < NX; i++)
            {
                XS[i] = X[i] + (i == 0 ? 0 : XS[i - 1]);
            }
            for (int i = 0; i < NY; i++)
            {
                YS[i] = Y[i] + (i == 0 ? 0 : YS[i - 1]);
            }

            long XX = 0;
            long YY = 0;
            for (int i = 0; i < NX; i++)
            {
                XX += (X[i] * (1 + i) - XS[i]);
                XX %= MOD;
            }
            for (int i = 0; i < NY; i++)
            {
                YY += (Y[i] * (1 + i) - YS[i]);
                YY %= MOD;
            }

            Console.WriteLine((XX * YY) % MOD);
        }
    }

    // libs ----------
    

    // common ----------

    internal static class Input
    {
        public static string ReadString()
        {
            string line = Console.ReadLine();
            return line;
        }

        public static int ReadInt()
        {
            string line = Console.ReadLine();
            return int.Parse(line);
        }

        public static int[] ReadIntArray()
        {
            string line = Console.ReadLine();
            return line.Split(' ').Select(int.Parse).ToArray();            
        }

        public static long ReadLong()
        {
            string line = Console.ReadLine();
            return long.Parse(line);
        }

        public static long[] ReadLongArray()
        {
            string line = Console.ReadLine();
            return line.Split(' ').Select(long.Parse).ToArray();
        }

        public static double[] ReadDoubleArray()
        {
            string line = Console.ReadLine();
            return line.Split(' ').Select(double.Parse).ToArray();
        }
    }
    
    internal class Program
    {
        public static void Main(string[] args)
        {
            var s = new Solution();
            s.Run();
        }
    }
}

Measured memory_bytes: 38324
#include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define ll long long
#define ld long double
#define pb push_back
#define mp make_pair
#define endl '\n'
#define pii pair<int,int>
#define min3(a,b,c) min(a,min(b,c))
#define max3(a,b,c) max(a,max(b,c))
#define all(x) x.begin(),x.end()
#define fill(a,b) memset(a,b,sizeof(a))
#define sz(x) (int)x.size()
#define sp(x) setprecision(x)
#define ff first
#define ss second
#define lb lower_bound
#define ub upper_bound
#define bs binary_search

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    int n; cin>>n;
    set<int> s;
    bool flag=1;
    for(int i=0;i<n;i++){
        int x; cin>>x;
        if(s.find(x)==s.end()) s.insert(x);
        else flag=0;
    }
    if(flag) cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
}

Measured memory_bytes: 9600
#include <iostream>
#include <vector>


using namespace std;

int main()
{
    int n, k;
    cin >> n >> k;
    vector<int> vec = vector<int>(n+1);
    for(int i = 0; i < vec.size(); i++) {
        vec[i] = 0;
    }
    int d, t;
    for(int i = 0; i < k; i++) {
        cin >> d;
        for(int j = 0; j < d; j++) {
            cin >> t;
            vec[t]++;
        }
    }
    int cnt = 0;
    for(int i = 1; i < vec.size(); i++) {
        if(vec[i] > 0) {
            continue;
        }
        cnt++;
    }
    cout << cnt << endl;
    return 0;
}

Measured memory_bytes: 3600
N = int(input())
I = []
for i in range(N):
  X, L = map(int, input().split())
  I.append((X - L, X + L))

I.sort(key=lambda a: (a[1], a[0]))

x = -10**100
ans = 0
for l, r in I:
  if l >= x:
    ans += 1
    x = r

print(ans)



Measured memory_bytes: 58200
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define rep( i, n, m ) for(int i = ( n ); i < ( m ); i++)
#define rep_d( i, n, m ) for(int i = ( n ) - 1; i >= ( m ); i--)
#define sort_asc( X ) sort(( X ).begin(), ( X ).end())
#define sort_desc( X ) sort(( X ).begin(), ( X ).end(), greater <>())

template <class T> bool chmax( T& a, T b );
template <class T> bool chmin( T& a, T b );
int* eratosthenes( int N );
bool bit_search( int pattern, int N );
template <class T> void cumulative_sum( T array, size_t N );

const ll INF = 1LL << 60;
const int k_mod = 1e9 + 7;

int main( void ){
	string str;
	cin >> str;
	map<char, int> mp;
	rep( i, 0, 4 ){
		mp[str[i]]++;
	}
	for(auto m:mp){
		if (m.second != 2){
			cout << "No\n";
			return 0;
		}
	}
	cout << "Yes\n";
}

int* eratosthenes( int N ){
	int* prime_array = new int[ N + 1 ];
	int lim = N;
	prime_array[ 0 ] = 0;
	prime_array[ 1 ] = 0;
	rep( i, 2, N + 1 ){
		prime_array[ i ] = 1;
	}
	rep( i, 2, lim ){
		if (prime_array[ i ] == 0)
			continue;
		lim = N / i;
		for(int j = i * 2; j < N + 1; j += i){
			prime_array[ j ] = 0;
		}
	}
	return prime_array;
}
template <class T> void cumulative_sum( T array, size_t N ) {
	rep( i, 1, N + 1 ){
		array[ i ] += array[ i - 1 ];
	}
}
template <class T> bool chmax( T& a, T b ) {
	if (a < b){
		a = b; return true;
	}
	return false;
}
template <class T> bool chmin( T& a, T b ) {
	if (a > b){
		a = b; return true;
	}
	return false;
}
bool bit_search( int pattern, int N ){
	int cnt = 0;
	rep( bit, 0, N ){
		if (pattern & ( 1 << bit )){
			cnt++;
		}
	}
	return true;
}


Measured memory_bytes: 256
//by Top1
#include <bits/stdc++.h>
          
#define f first
#define s second
#define int long long
#define ld long double
#define ull unsigned long long
#define pii pair <int, int>
#define pll pair <long, long>
#define mp make_pair
#define pb push_back
#define pf push_front
#define pp pop_back
#define cerr cout
#define rev reverse
#define all(s) s.begin(), s.end()
#define sz(s) (int)s.size()
#define forn(i, a, b) for (int i = a; i <= b; i++)
#define boost ios_base::sync_with_stdio(false); cin.tie(0),cout.tie(0);
#define nxtp next_permutation
#define pvtp prev_permutation
#define KZ return 
#define x1 x21212121
#define y1 y21212121
#define sqr(x) x * x 
      
const int inf = (1e9) + 1;
const int mod = 479001599;
const int maxn = 3e6 + 111;
        
using namespace std;          

double r;

void solve(){
	cin >> r;

   	cout << fixed << setprecision(9) << 2 * 3.14159265359 * r;
}                              
      
main(){
	//freopen(".in", "r", stdin);
	//freopen(".out", "w", stdout);

    boost;
    
    int q = 1;
 
    //cin >> q;
    
    while (q--){
        solve();
    }
}

Measured memory_bytes: 3808
N = input()[::-1]
iv = 1
MOD = 10**9+7
dp = [0]*13
dp[0]=1
ls = [0]*13
for i in range(len(N)):
  x = N[i]
  
  if x=='?':
    for j in range(13):
      for h in range(10):
        ls[(h*iv+j)%13] += dp[j]
        
  else:
    x = int(x)
    for j in range(13):
      ls[(j+x*iv)%13]+=dp[j]
      
  for j in range(13):
    dp[j] = (ls[j]%MOD)
    ls[j]=0
  iv *= 10
  iv %= 13
print(dp[5])

Measured memory_bytes: 43200
#include<iostream>
#include<vector>
#include<set>
#include<algorithm>
#include<queue>
#include<utility>
#define LL long long
using namespace std;



int main() {
	int h, a, b;
	cin >> h >> a >> b;
	int ans = 0;
	for (int i = a; i <= b; i++)
		if (h%i == 0)ans++;
	cout << ans << endl;
	return 0;
}





Measured memory_bytes: 3084
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<stack>
#include<string>
#include<map>
#include<tuple>
#include<cmath>


#define MOD 1000000007
#define rep(i,k,N) for(int i=k;i<N;i++)
#define MP make_pair
#define MT make_tuple //tie,make_tuple は別物
#define PB push_back

typedef long long ll;

using namespace std;

void YN(bool ans){
    if(ans)cout<<"Yes"<<endl;
    else cout <<"No"<<endl;
    return;
}

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

int main(){
    string S;
    cin>>S;
    bool ans=true;
    if(S.size()%2==1)ans=false;
    rep(i,0,S.size()/2){
        if(S[2*i] != 'h' || S[2*i+1] != 'i'){
            ans=false;
        }
    }
    YN(ans);
    return 0;
}

Measured memory_bytes: 256
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    N = int(readline())
    for h in range(1, 3501):
        for n in range(1, 3501):
            if (4 * h * n - N * n - N * h) != 0:
                w = (N * h * n) / (4 * h * n - N * n - N * h)
                if w == int(w) and w != 0 and (h * n * w) != 0 and w > 0:
                    if 4 / N == (n * w + h * w + h * n) / (h * n * w):
                        print(h, n, int(w))
                        exit()


if __name__ == '__main__':
    solve()


Measured memory_bytes: 39152
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repf(i, j, n) for (int i = (j); i < (n); i++)
#define repr(i, n) for (int i = (n)-1; i >= 0; i--)

signed main() {
  int a, b, c;
  cin >> a >> b >> c;
  cout << a + b + c - max({a, b, c}) << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define all(vec) vec.begin(), vec.end()
#define END return 0
typedef int64_t ll;
const int mod7 = 1e9 + 7;
const int mod9 = 1e9 + 9;
const int inf = 1 << 30;
const ll INF = 1LL << 60;
template<typename T> T gcd(T a, T b) {return b ? gcd(b, a % b) : abs(a);}
template<typename T> T lcm(T a, T b) {return a / gcd(a, b) * b;}
template<typename T> bool chmax(T &a, T b) {if (a < b) {a = b; return true;} return false;}
template<typename T> bool chmin(T &a, T b) {if (a > b) {a = b; return true;} return false;}
template<typename A, size_t N, typename T> void Fill(A (&array)[N], const T &val) {fill((T*)array, (T*)(array+N), val);}

int n, X;

int main() {
    cin >> n >> X;
    int x;
    cin >> x;
    int ans = abs(x - X);
    rep(i, n - 1) {
        cin >> x;
        ans = gcd(ans, abs(x - X));
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const long long INF = 1LL << 60;
const int mod = 1e9 + 7;

const int m = 2019;

int main()
{
    while (1)
    {
        long long h, w;
        cin >> h >> w;
        if (h == 0 && w == 0)
        {
            break;
        }
        for (int i = 0; i < h; i++)
        {
            for (int j = 0; j < w; j++)
            {
                cout << '#';
            }
            cout << endl;
        }
        cout << endl;
    }

    return 0;
}


Measured memory_bytes: 3092
n, k = map(int, input().split())
H = list(map(int, input().split()))

dp = [10 ** 12] * (n)
dp[0] = 0
dp[1] = abs(H[1] - H[0])

for i in range(1, n-1):
  dp[i+1] = min([dp[i-j] + abs(H[i+1] - H[i-j]) for j in range(min(k, i+1))])
  
ans = dp[n-1]

print(ans)

Measured memory_bytes: 52448
#include<iostream>
#include<algorithm>
using namespace std;
static const int MAX = 200000;
 
int main()
{
	int R[MAX],n;
	
	cin >> n;
	for(int i = 0; i < n; i++) cin >> R[i];
	
	int maxv = -2000000000;
	int minv = R[0];
	
	for(int i = 1; i < n; i++ ) {
		maxv = max(maxv, R[i]-minv);
		minv = min(minv, R[i]);
	}
	
	cout << maxv << endl;
	
	return 0;
}

Measured memory_bytes: 3884