akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#define pb push_back
#define ii pair<int,int>
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define INF 100000000000000000
#define modulo 1000000007
#define mod 998244353
#define int long long int
using namespace std;

int f(int x){
	return x * x * x * x * x;
}

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

	int X;
	cin >> X;

	for(int a = -1000; a <= 1000; a++){
		for(int b = -1000; b <= 1000; b++){
			if(f(a) - f(b) == X){
				cout << a << " " << b;
				return 0;
			}
		}
	}
	assert(0);
}

Measured memory_bytes: 3556
import java.util.*; 

class Main{
public static void main(String[] args){
	Scanner sc=new Scanner(System.in);
        int h=sc.nextInt();
        int a=sc.nextInt();
  		int ans=0;
		
 	while(h>0){
      h-=a;
      ans++;
    }
    	System.out.println(ans);
    }
}

Measured memory_bytes: 23636
using System;
using System.Linq;

namespace joi2011ho1
{
	class Program
	{
		static void Main(string[] args)
		{
			int[] x = Console.ReadLine().Split().Select(int.Parse).ToArray();
			int n = int.Parse(Console.ReadLine());
			int[,,] sumsum = new int[3, x[0] + 1, x[1] + 1];
			char[] JOI = new char[] { 'J', 'O', 'I', };
			for (int i = 0; i < x[0]; i++)
			{
				string s = Console.ReadLine();
				int[] sum = new int[3];
				for (int j = 0; j < x[1]; j++)
				{
					sum[Array.IndexOf(JOI, s[j])]++;
					for (int k = 0; k < 3; k++)
					{
						sumsum[k, i + 1, j + 1] = sumsum[k, i, j + 1] + sum[k];
					}
				}
			}
			for (int i = 0; i < n; i++)
			{
				int[] a = Console.ReadLine().Split().Select(int.Parse).ToArray();
				a[0]--; a[1]--;
				for (int j = 0; j < 3; j++)
				{
					if (j != 0) Console.Write(" ");
					Console.Write(sumsum[j, a[0], a[1]] - sumsum[j, a[0], a[3]] - sumsum[j, a[2], a[1]] + sumsum[j, a[2], a[3]]);
				}
				Console.WriteLine();
			}
		}
	}
}


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


typedef long long ll;
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef long double ld;

typedef set<int>::iterator sit;
typedef map<int,int>::iterator mit;
typedef vector<int>::iterator vit;

const int INF = 1e9 + 7;
const int MOD = 1e9 + 7;
const int MAXN = 1e6 + 3;

#define _  %  MOD
#define __ %= MOD

#define      each(it,s)        for(auto it = s.begin(); it != s.end(); ++it)
#define      sortA(v)          sort(v.begin(), v.end())
#define      sortD(v)          sort(v.begin(), v.end(), greater<auto>())
#define      fill(a)           memset(a, 0, sizeof (a))

#define      swap(a,b)        {a=a+b;b=a-b;a=a-b;}
#define      rep(i, n)         for(ll i = 0; i < (n); ++i)
#define      repA(i, a, n)     for(ll i = a; i <= (n); ++i)
#define      repD(i, a, n)     for(ll i = a; i >= (n); --i)
#define watch(x) cout << (#x) << " is " << (x) <<endl

#define fi first
#define se second
#define mp make_pair
#define pb push_back

#define fbo find_by_order
#define ook order_of_key

ll gcd(ll a,ll b){if(b==0) return a; else return gcd(b,a%b);}
ll power(ll x,ll y){ll res=1; while(y>0){if(y&1) res=res*x;y=y>>1;x=x*x;}return res;} // modular exponent

int main()
{
    ios_base::sync_with_stdio(false); // don't use printf and scanf
    cin.tie(NULL); // cout<<fixed<<setprecision
    ll n;
    cin>>n;
    string ans="";
    while(n)
    {
      n--;
      ll rem=n%26;
      char ch='a'+(rem+26)%26;
      // watch(ch);
      ans+=ch;
      n/=26;
    }
    reverse(ans.begin(),ans.end());
    cout<<ans<<'\n';
    return 0;
}
// JUST ASK YOURSELF DID YOU GIVE YOUR BEST ? ISSE ZYADA
// KUCH KAR BHI NAHI SAKTE !! ENJOY AND GIVE YOUR BEST!!


Measured memory_bytes: 3640
// J'aime
// Chemise Blanche

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

#define int long long

#define ii pair<int,int>
#define fi first
#define sc second

#define all(x) (x).begin(),(x).end()
#define dbg(x) cerr << __LINE__ << " > " << #x << " = " << (x) << endl

void MAIN() {
  char a; cin >> a;
  if ('a' <= a && a <= 'z') cout << 'a' << '\n';
  else cout << 'A' << '\n';
}

signed main() {
#ifdef _DEBUG
  // freopen("in" , "r", stdin );
  // freopen("out", "w", stdout);
#endif
  ios::sync_with_stdio(0); cin.tie(0);
  int T = 1;
  // cin >> T;
  while (T--) MAIN();
}


Measured memory_bytes: 3560
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){
		
		while(true){
			long D=rl();if(D==0)return;
			int N=ri();
			int M=ri();
			long[] A=new long[3*N];
			A[0]=0;A[1]=D;A[2]=2*D;
			for(int i=1;i<N;i++){
				A[i*3]=rl();
				A[i*3+1]=A[i*3]+D;
				A[i*3+2]=A[i*3]+2*D;
			}
			Array.Sort(A);
			long ans=0;
			for(int i=0;i<M;i++){
				long trgt=rl()+D;
				
				int l=0;
				int r=3*N;
				int c=0;
				while(r-l>1){
					c=(l+r)/2;
					if(A[c]<trgt){
						l=c;
					}else{
						r=c;
					}
				}
				while(A[c]<trgt)c++;
				while(A[c]>=trgt)c--;
				ans+=Math.Min(trgt-A[c],A[c+1]-trgt);
			}
			Console.WriteLine(ans);
		}
		
	}
	public Sol(){
	}




	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(){return Console.ReadLine().Split(' ');}
	static int[] ria(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>int.Parse(e));}
	static long[] rla(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>long.Parse(e));}
	static double[] rda(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>double.Parse(e));}
}

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

using namespace std;
typedef long long ll;
typedef long double ld;
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REPR(i,n) for(int i=n; i>-1; --i)
#define ALL(a) (a).begin(),(a).end()
#define FILL(a,n,x); REP(i,(n)){ (a)[i]=(x); }
#define CINA(a,n); REP(i,(n)){ cin >> (a)[i]; }
#define FILL2(a,n,m,x); REP(i,(n)){ REP(j,(m)){(a)[i][j]=(x);} }
#define CINA2(a,n,m); REP(i,(n)){ REP(j,(m)){cin >> (a)[i][j];} }
#define Liny "Yes\n"
#define Linn "No\n"
#define LINY "YES\n"
#define LINN "NO\n"

#define umap unordered_map
//cout << setfill('0') << right << setw(4) << 12; // "0012"
int keta(ll x){ if(x<10){return 1;} else{return keta(x/10) + 1;}}
int keta_wa(ll x){ if(x<10){return x;} else{return keta_wa(x/10) + x%10;} }
int ctoi(char c){ return ( (c>='0' && c<='9')? c - '0': 0 );}
int __stoi(string s){ return atoi(s.c_str()); }
ll sum(ll a[],ll N){ return accumulate(a,a+N,0LL);}
ll gcd(ll a,ll b){if(a<b)swap(a,b); return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){if(a<b){swap(a,b);} return a/gcd(a,b)*b;}
template<class T> void chmax(T& a, T b){ if(a<b){a=b;} }
template<class T> void chmin(T& a, T b){ if(a>b){a=b;} }

int main(){
  int N,K; cin>>N>>K;
  ld p[N+1];
  ld s[N+1]; s[0] = 0;
  for(int i=1;i<=N;++i){
    cin >> p[i];
    s[i] = s[i-1]+p[i];
  }
  
  ld x = 0;
  int idx = -1;
  for(int i=0;i<=N-K;++i){
    ld t = s[i+K]-s[i];
    if(t>x){ x = t; idx = i+1; }
  }
  ld ans = 0;
  REP(i,K){
    ans += (p[idx+i]+1)/2;
  }
  printf("%.7Lf\n",ans);
}

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

using namespace std;
using LL = long long;

#define FOR(i, a, n) for(int i = (int)(a); i < (int)(n); ++i)
#define REP(i, n) FOR(i, 0, n)

#define pb(a) push_back(a)
#define all(x) (x).begin(),(x).end()

const int INF = (int)1e9;
const LL INFL = (LL)1e19;
const int MOD = (int)1e9 + 7;

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

    int n;
    cin >> n;
    vector<int> a(n), b(n), d(n);
    REP(i, n) cin >> a[i];
    REP(i, n) cin >> b[i];

    LL sum1 = 0, sum2 = 0;
    REP(i, n){
        sum1 += a[i];
        sum2 += b[i];
    }

    if(sum1 < sum2){
        cout << -1 << endl;
        return 0;
    }


    REP(i, n){
        d[i] = a[i] - b[i];
    }

    vector<int> plus, minus;
    REP(i, n){
        if(d[i] < 0) minus.pb(-d[i]);
        else plus.pb(d[i]);
    }

    int minus_sum = 0;
    REP(i, minus.size()){
        minus_sum += minus[i];
    }
    sort(all(plus), greater<int>());
    vector<LL> ruiseki(plus.size()+1);
    REP(i, plus.size()) ruiseki[i+1] += ruiseki[i] + plus[i];

    int ans = minus.size();
    REP(i, ruiseki.size()){
        if(minus_sum > ruiseki[i]) ans++;
    }
    cout << ans << endl;
}

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

using namespace std;

int a[100005];

int main() {
    int n, k, q, x;
    cin >> n >> k >> q;
    for(int i=1;i<=n;i++)
        a[i] = k;
    for(int i=0;i<q;i++) {
        cin >> x;
        a[x] ++;
    }
    for(int i=1;i<=n;i++) {
        if(a[i] > q)
            cout << "Yes\n";
        else
            cout << "No\n";
    }
}


Measured memory_bytes: 1024
#include<iostream>
#include<string>
using namespace std;
int main(){
	int n,m,l,a,b;
	while(true){
	cin>>l;
	if(l==0)
		break;
	a=0;
	b=0;
	for(int i=1;i<=12;i++){
		cin>>m>>n;
		a+=m-n;
		if(a>=l&&b==0)
			b=i;
	}
	if(b==0)
		cout<<"NA"<<endl;
	else
		cout<<b<<endl;
	}
    return 0;
}
 

Measured memory_bytes: 1160
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class Main{
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] array = in.readLine().split(" ");
    int S = Integer.parseInt(array[0]);
    int W = Integer.parseInt(array[1]);
    System.out.println(S>W?"safe":"unsafe");
  }
}



Measured memory_bytes: 32592
n,m,x=map(int,input().split())
a=list(map(int,input().split()))
c=[0 for i in range(n+1)]
for i in a:
      c[i]=1
for i in range(n):
      c[i+1]+=c[i]
print(min(c[x],c[n]-c[x]))

Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll a[200005];
int main()
{
    ll n;
    cin>>n;
    ll sum=0;
    for(ll i=0;i<n;i++)
    {
        cin>>a[i];
        sum+=a[i];
    }
    ll mx=1e18,s=0;
    for(ll i=0;i<n;i++)
    {
        s+=a[i];
        ll x=sum-s;
        mx=min(mx,abs(s-x));
    }
    cout<<mx<<endl;
    return 0;
}


Measured memory_bytes: 1792
#include <iostream>

long long gcd(long long a, long long b){
    long long denom = std::min(a, b), num = std::max(a, b) % denom, buf;
    while(0 != denom){
        buf = denom;
        denom = num % denom;
        num = buf;
    }

    return buf;
}

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

int main(){
    long long a, b, c, d;
    std::cin >> a >> b >> c >> d;
    --a;

    std::cout << b - (b / c + b / d) + b / lcm(c, d) - (a - (a / c + a / d) + a / lcm(c, d)) << std::endl;

    return 0;
}

Measured memory_bytes: 380
#ifdef LOCAL
#define _GLIBCXX_DEBUG
#endif
#include<bits/stdc++.h>
using namespace std;
#define rep(i,s,t) for(ll i = (ll)(s); i < (ll)(t); i++)
#define rrep(i,s,t) for(ll i = (ll)(s-1);(ll)(t) <= i; i--)
#define all(x) (x).begin(), (x).end()
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> Pll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<vvl> vvvl;
constexpr ll INF = numeric_limits<ll>::max()/4;
constexpr ll n_max = 2e5+10;
#define int ll

template <typename A, typename B>
string to_string(pair<A, B> p);
string to_string(const string &s) {return '"' + s + '"';}
string to_string(const char *c) {return to_string((string) c);}
string to_string(bool b) {return (b ? "true" : "false");}
template <size_t N>
string to_string(bitset<N> v){
    string res = "";
    for(size_t i = 0; i < N; i++) res += static_cast<char>('0' + v[i]);
    return res;
}
template <typename A>
string to_string(A v) {
    bool first = true;
    string res = "{";
    for(const auto &x : v) {
        if(!first) res += ", ";
        first = false;
        res += to_string(x);
    }
    res += "}";
    return res;
}
template <typename A, typename B>
string to_string(pair<A, B> p){return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";}

void debug_out() {cerr << endl;}
template<typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
    cerr << " " << to_string(H);
    debug_out(T...);
}

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

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;}

signed main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    ll n; cin >> n;
    vector<ll> a(n);
    for(int i = 0; i < n; i++) cin >> a[i];
    vector<ll> b(n);
    for(int i = 0; i < n; i++) cin >> b[i];

    vector v(51, vector(51, INF));
    vector<ll> ans;
    vector<ll> used(n, 0);
    rrep(k,52,1){
        rep(i,0,51) fill(all(v[i]), INF);
        rep(i,0,51) v[i][i] = 0;

        rep(i,0,51){
            rep(j,1,k){
                chmin(v[i][i % j], (1LL << j));
            }
            for(auto &j : ans){
                chmin(v[i][i % j], (1LL << j));
            }
        }

        rep(l,0,51)rep(i,0,51)rep(j,0,51){
            chmin(v[i][j], v[i][l] + v[l][j]);
        }
        // if(k == 1){
        //     debug(v[19]);
        // }
        // debug(k, ans);
        bool ok = true;
        rep(i,0,n){
            ok &= v[a[i]][b[i]] < INF;
        }
        if(k == 51 && !ok){
            cout << -1 << endl;
            return 0;
        }
        if(!ok){
            ans.emplace_back(k);
        }
        if(accumulate(all(used), 0) == n)break;
    }

    debug(ans);

    ll ret = 0;
    for(auto &i : ans)
        ret |= (1LL << i);

    cout << ret << endl;
}

Measured memory_bytes: 3568
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
#include <stack>
#include <queue>
using namespace std;
typedef long long ll;
int main() {
	ll a, b, c, x, y,count=0;
	cin >> a >> b >> c >> x >> y;
	if ((a + b) / 2 >= c) {
		ll memo1 = min(x, y);
		count += c * memo1*2;
		if (x > y)count += (x - y)*min(a,c*2);
		else if (x < y)count += (y - x)*min(b,c*2);
	}
	else count += x * a + y * b;
	cout << count << endl;
	getchar();
	getchar();
	return 0;
}

Measured memory_bytes: 256
import scala.io.{StdIn => in}

object Main extends App {
  val n = in.readInt
  val x = in.readLine.split(" ").map(_.toInt)
  val sx = x.sorted

  val h = n / 2
  val out = new java.io.PrintWriter(System.out)
  for(i <- 0 until n) {
    val median = if(x(i) < sx(h)) sx(h) else sx(h-1)
    out.println(median)
  }
  out.flush
}

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

int main()
{
    int h,w,a,b;
    cin >> h >> w >> a >> b;

    for(int i=0;i<h;i++){
        for(int j=0;j<w;j++){
            if(i<b && j<a){
                cout << 1;
            }
            if(i<b && j>=a){
                cout << 0;
            }
            if(i>=b && j>=a){
                cout << 1;
            }
            if(i>=b && j<a){
                cout << 0;
            }
        }
        cout << endl;
    }
    return 0;
}


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

int main() {
    int n; cin >> n;
    vector<double> x(n), y(n);
    for(int i = 0; i < n; ++i) {
        cin >> x[i] >> y[i];
    }

    vector<int> ps(n);
    iota(ps.begin(), ps.end(), 0);
    double ans = 0;
    do {
        for(int i = 1; i < n; ++i) {
            ans += hypot(x[ps[i - 1]] - x[ps[i]], y[ps[i - 1]] - y[ps[i]]);
        }
    } while(next_permutation(ps.begin(), ps.end()));
    for(int i = n; i >= 2; --i) {
        ans /= i;
    }
    cout << fixed << setprecision(10) << ans << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
using namespace std;
int main(){
  int n1,n2,flag=0,oc=0;
  string dam;
  vector<string>id;
  cin >> n1;
  for(int i=0;i<n1;i++){
    cin >> dam;
    id.push_back(dam);
  }
  cin >> n2;
  for(int i=0;i<n2;i++){
    cin >> dam;
    flag=0;
    for(int j=0;j<n1;j++){
      if(dam==id[j]){
	flag=1;
	if(oc==0){
	  cout << "Opened by "<< dam<<endl;
	  oc=1;
	  break;
	}
	else {
	  cout << "Closed by "<< dam<<endl;
	  oc=0;
	  break;
	}
      }
    }
    if(flag==0){
      cout << "Unknown "<< dam << endl;
    }
  }
  return 0;
}

Measured memory_bytes: 1220
#include<iostream>
#include<stdio.h>
#include<vector>
#include<ctype.h>
#include<string>
#include<cmath>
#include<string.h>
#include<sstream>
#include<limits.h>
using namespace std;

long long A;
long double B;

int main(){
    cin>>A>>B;
    printf("%lld\n",(long long)floor(A*B));

    //cout<<floor(A*B)<<endl;
    return 0;
}

Measured memory_bytes: 3816
#include <iostream>
#include <vector>
#include <algorithm>
#include <stack>
#include <queue>
#include <list>
#include <string>
#include <numeric>
#include <math.h>
#include <set>
#include <map>
#include <fstream>
#include <sstream>
#include <iterator>
#include <complex>
using namespace std;

int main()
{
	int N,K;
	cin>>N>>K;
	string s;
	cin>>s;

	switch(s[K-1])
	{
		case 'A':
			s[K-1] = 'a';
			break;
		case 'B':
			s[K-1] = 'b';
			break;
		case 'C':
			s[K-1] = 'c';
			break;
	}
	cout<<s<<endl;
	return 0;
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Random;
import java.util.StringTokenizer;

public class Main {

	static long mod=(long)1e9+7;
	
	public static void main(String[] args) {
		FastScanner fs=new FastScanner();
		int a = fs.nextInt();
		int b = fs.nextInt();
		int c = fs.nextInt();
		int d = fs.nextInt();
		
		System.out.println(Math.max(a*1L*c, Math.max( Math.max(a*1L*d, b*1L*c), b*1L*d)));
	}
	
	static long mul(long a, long b) {
		return a*b%mod;
	}
	
	static class Node {
		ArrayList<Node> adj=new ArrayList<>();
		int subtreeSize;
		
		public void dfs(Node par) {
			this.subtreeSize=1;
			for (Node nn:adj) if (nn!=par) {
				nn.dfs(this);
				this.subtreeSize+=nn.subtreeSize;
			}
		}
	}

	static final Random random=new Random();
	
	static void ruffleSort(int[] a) {
		int n=a.length;//shuffle, then sort 
		for (int i=0; i<n; i++) {
			int oi=random.nextInt(n), temp=a[oi];
			a[oi]=a[i]; a[i]=temp;
		}
		Arrays.sort(a);
	}
	
	static void ruffleSort(long[] a) {
		int n=a.length;//shuffle, then sort 
		for (int i=0; i<n; i++) {
			int oi=random.nextInt(n);
			long temp=a[oi];
			a[oi]=a[i]; a[i]=temp;
		}
		Arrays.sort(a);
	}
	
	static class FastScanner {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st=new StringTokenizer("");
		String next() {
			while (!st.hasMoreTokens())
				try {
					st=new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}
		
		int nextInt() {
			return Integer.parseInt(next());
		}
		int[] readArray(int n) {
			int[] a=new int[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
		}
		long nextLong() {
			return Long.parseLong(next());
		}
	}

	
}


Measured memory_bytes: 32800
#include <iostream>
#include <cstdio>
#include <cassert>
#include <algorithm>
#include <vector>
#include <string>
#include <numeric>
#include <cmath>
using namespace std;
typedef long long ll;
typedef long double ld;
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REPR(i,n) for(int i=n; i>-1; --i)
#define ALL(a) (a).begin(),(a).end()
#define FILL(a,n,x); REP(i,n){ (a)[i]=(x); }
#define CINA(a,n); REP(i,(n)){ cin >> (a)[i]; }
#define FILL2(a,n,m,x); REP(i,(n)){ REP(j,(m)){(a)[i][j]=(x);} }
#define CINA2(a,n,m); REP(i,(n)){ REP(j,(m)){cin >> (a)[i][j];} }
#define Liny "Yes\n"
#define Linn "No\n"
#define LINY "YES\n"
#define LINN "NO\n"
#define PI 3.141592653589793

//cout << setfill('0') << right << setw(4) << 12; // "0012"
int keta(ll x){ if(x<10){return 1;} else{return keta(x/10) + 1;}}
int keta_wa(ll x){ if(x<10){return x;} else{return keta_wa(x/10) + x%10;} }
int ctoi(char c){ return ( (c>='0' && c<='9')? c - '0': 0 );}
ll sum(ll a[],ll N){ return accumulate(a,a+N,0LL);}
ll gcd(ll a,ll b){if(a<b)swap(a,b); return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){if(a<b){swap(a,b);} return a/gcd(a,b)*b;}


int main(){
  int N,C; cin>>N>>C;
  int s[1000000],t[1000000],c[1000000];
  int cumu[2000002],r[2000002]={0};
  REP(i,N){
    cin >> s[i] >> t[i] >> c[i];
  }
  // 各チャンネルに関する処理(imos法)
  for(int ch=1;ch<=C;++ch){
    FILL(cumu,2000002,0);
    REP(i,N){
      if(c[i]==ch){
        ++cumu[s[i]*2-1]; // 縁作り
        --cumu[t[i]*2];
      }
    }
    for(int i=1;i<2000002;++i){
      cumu[i] += cumu[i-1]; //値埋め
    }
    REP(i,2000002){
      if(cumu[i]>0){ ++r[i]; } //利用時間帯に1加算
    }
  }
  cout << (int)*max_element(r,r+2000002) <<endl;
}

Measured memory_bytes: 25984
N = int(input())
d = list(map(int, input().split()))

# print(N)
# print(d)

result = 0
for i in range(N):
    for j in range(N):
        if i == j:
            continue
        if i > j:
            continue
        # print('{}, {}'.format(i, j))
        result += d[i] * d[j]
        
print(result)

Measured memory_bytes: 2940
import sys


inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

a, b = inintm()

if a <= 0 and b >= 0:
    print("Zero")
elif a < 0 and b < 0:
    if (abs(a) - abs(b)) % 2 == 0:
        print("Negative")
    else:
        print("Positive")
else:
    print("Positive")

Measured memory_bytes: 61460
#include <bits/stdc++.h>
using namespace std;
 
int main() {
	string s1,s2,s3;
  cin >> s1>> s2>> s3;
  
 string s4="AAA";
  s4[0]=s1[0];
  s4[1]=s2[0];
  s4[2]=s3[0];
  cout << s4 << endl;

}

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

using namespace std;

#define fi first
#define se second
#define pb push_back
#define mp make_pair

#define int long long

typedef pair<int, int> ii;

const int mod = 1e9 + 7;

const int N = 2e5 + 5;
const int inf = 1e15;

int dp[N], n, h, w, pref[N], suff[N];

vector<ii> vec;

int add(int x, int y) {
    return (1ll * x + 1ll * y) % mod;
}

int mul(int x, int y) {
    return (1ll * x * 1ll * y) % mod;
}

int del(int x, int y) {
    return ((1ll * x - 1ll * y) % mod + mod) % mod;
}

int BinPow(int x, int m) {
    if(m == 0)
        return 1;
    else if(m == 1)
        return x % mod;
    else {
        int sum = BinPow(x, m / 2);
        sum = mul(sum, sum);
        if(m % 2)
            sum = mul(sum, x);
        return sum;
    }
}

int ckn(int k, int m) {
    if(k > m) return 0;
    return mul(mul(pref[m], suff[k]), suff[m - k]);
}

signed main() {
    cin.tie(0), ios::sync_with_stdio(0);
    cin >> h >> w >> n;
    for(int i = 1; i <= n; i++) {
        int x, y;
        cin >> x >> y;
        vec.pb({x, y});
    }
    pref[0] = 1;
    for(int i = 1; i <= N - 5; i++)
        pref[i] = mul(pref[i - 1], i);
    for(int i = 0; i <= N - 5; i++)
        suff[i] = BinPow(pref[i], mod - 2);
    vec.pb({h, w});
    sort(vec.begin(), vec.end());
    for(int i = 0; i < vec.size(); i++) {
        int r = vec[i].fi, c = vec[i].se;
        dp[i] = ckn(r - 1, r + c - 2);
        for(int j = 0; j < vec.size(); j++) {
            if(vec[j].fi <= r && vec[j].se <= c && i != j) {
                dp[i] = del(dp[i], mul(dp[j], ckn(r - vec[j].fi, r - vec[j].fi + c - vec[j].se)));
                //cout << mul(dp[j], ckn(r - vec[j].fi, r - vec[j].fi + c - vec[j].se)) << " " <<  r - vec[j].fi + c - vec[j].se << " " << "\n";
            }
        }
        //cout << dp[i] << " " << r << " " << c << "\n";
    }
    cout << dp[vec.size() - 1];
}



Measured memory_bytes: 4480
<?php
$n = trim(fgets(STDIN));

$max   = 0;
$max_i = 0;
for ($i = 1; $i <= $n; $i++) {
    $j     = $i;
    $count = 0;
    while ($j % 2 === 0) {
        $j = $j / 2;
        $count++;
    }
    if ($count >= $max) {
        $max   = $count;
        $max_i = $i;
    }
}

print $max_i;


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

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

vector<vector<int>> data(N, vector<int>(D));
for (int i = 0; i < N; i++) {
    for (int j = 0; j < D; j++) {
        cin >> data.at(i).at(j);
    }
}
int ans = 0;
for (int i1 = 0; i1 < N; i1++) {
    for (int i2 = i1 + 1; i2 < N; i2++) {
        int dis = 0;
        for (int j = 0; j < D; j++) {
           dis += abs(data.at(i1).at(j) - data.at(i2).at(j)) * abs(data.at(i1).at(j) - data.at(i2).at(j));
        }
        for (int n = 0; n <= dis; n++) {
            if (n*n == dis) {
                ans ++;
            }
        }
    }
}
cout << ans << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    int i,l=0,pop=0;
    for(i=1;i<=n;i++)
    {
        int k=i;
        while(k!=0)
        {
            int r=k%10;
            k/=10;
            l++;
        }

        if(l%2!=0)
            pop++;
            l=0;
    }
    cout<<pop;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin >> n;
    long double sum=0;
    for(int i=0;i<n;i++){
        string s;
        long double x,S;
        cin >> x>>s;
        if(s=="JPY"){
            sum+=x;
        }
        else{
            S=380000*x;
            sum+=S;
        }
    }
    cout << sum << endl;
    return 0;
}

Measured memory_bytes: 256
n = int(input())
t, a = map(int, input().split())
h = list(map(int, input().split()))
ans_k = float("inf")
for i in range(n):
    kion = t - (h[i] * 0.006)
    if abs(ans_k - a) > abs(kion - a):
        ans_k = kion
        ans = i
print(ans + 1)

Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
main()
{
	string s;
	cin>>s;
	int c=0,m=0;
	for(int i=0;i<3;i++){
		if(s[i]=='S') {
			m=max(m,c);
			c=0;
		}
		else c++;
	}
	m=max(m,c);
	cout<<m<<'\n';
}

Measured memory_bytes: 3608
import sys
h,w=map(int,input().split())
f=[[] for i in range(h)]
for i in range(h):
  inv=input()
  for j in range(w):
    if inv[j]=="#":
      f[i].append(j)
c=0
for i in f:
  if c!=i[0]:
    print("Impossible");sys.exit()
  if i[-1]-i[0]>=len(i):print("Impossible");sys.exit()
  c=i[-1]
print("Possible")


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

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

    long long ans = 0;
    for (long long i = 1; i * i <= N; i++)
    {
        if (N % i == 0)
        {
            if (i < (N / i) - 1)
            {
                ans += (N / i) - 1;
            }
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>

#define fir first
#define sec second

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

const int maxN = 2e5 + 2;

inline bool Chkmax(int& x, int y)
{ return x < y ? x = y, true : false; }

inline bool Chkmin(int& x, int y)
{ return x > y ? x = y, true : false; }

int n, v, cnt;
int SUC[maxN], ans[maxN];
int x[maxN], f[maxN << 1], g[maxN << 1];
vector<pii> line[20];

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr), cout.tie(nullptr);
    cin >> n >> v;
    for (int i = 1; i <= n; ++i)
        cin >> x[i];
    do
    {
        int l = 1, r = 1; // attenion that l = 0
        for (int j = 2; j <= n; ++j)
        {
            if (x[j] - (v >> cnt) > x[r])
            {
                line[cnt].emplace_back(l, r);
                l = j;
            }
            r = j;
        }
        line[cnt].emplace_back(l, r);
    } while (v >> cnt++);
    // cout << cnt << endl;
    --cnt;
//    for (int i = 0; i < cnt; ++i)
//        for (auto j : line[i])
//            cout << j.fir << ' ' << j.sec << endl;
    fill(f, f + (1 << cnt), -1);
    fill(g, g + (1 << cnt), n + 2);
    f[0] = 0, g[0] = n + 1;
    for (int i = 0; i < cnt; ++i)
        f[1 << i] = line[i + 1].begin()->sec, g[1 << i] = line[i + 1].rbegin()->fir;
    for (int i = 1; i < 1 << cnt; ++i) if (~f[i])
        for (int j = 1; j <= cnt; ++j)
            if (!(i >> (j - 1) & 1))
            {
                auto pos = lower_bound(line[j].begin(), line[j].end(), pii(f[i] + 2, 0)) - 1;
                Chkmax(f[i | 1 << (j - 1)], pos->sec);
            }
    for (int i = 1; i < 1 << cnt; ++i) if (g[i] != n + 2)
        for (int j = 1; j <= cnt; ++j)
            if (!(i >> (j - 1) & 1))
            {
                auto pos = lower_bound(line[j].begin(), line[j].end(), pii(g[i], 0));
                if (pos != line[j].begin())
                    Chkmin(g[i | 1 << (j - 1)], (--pos)->fir);
            }
    fill(SUC, SUC + n + 1, n + 2);
    // cout << f[1] << ' ' << g[1] << endl;
    for (int i = 0, all = (1 << cnt) - 1; i <= all; ++i)
        if (~f[i])
            Chkmin(SUC[f[i]], g[all ^ i]);
    for (int i = n; i; --i)
        Chkmin(SUC[i - 1], SUC[i]);
    //for (int i = 0; i <= n; ++i)
    //    cout << SUC[i] << ' ';
    //cout << endl;
    for (auto i : line[0])
    {
        // cout << i.fir << ' ' << i.sec << endl;
        int flag = SUC[i.fir - 1] <= i.sec + 1;
        for (int j = i.fir; j <= i.sec; ++j)
            cout << (flag ? "Possible" : "Impossible") << endl;
    }
    return 0;
}

Measured memory_bytes: 9840
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<numeric>
#include<utility>

using namespace std;

typedef long long int ll;
const int INF = 1<<30;
const long long LINF = 1LL<<60;

int main(){
    string s, t;
    cin >> s >> t;
    vector<vector<ll>> a(26);
    for(ll i = 0; i < s.size(); i++){
        a[s[i] - 'a'].push_back(i + 1);
    }
    vector<ll> p(t.size());
    vector<ll> cnt(26);
    bool f = true;
    for(int i = 0; i < t.size(); i++){
        ll c = t[i] - 'a';
        if(a[c].size() == 0){
            f = false;
            break;
        }
    }
    if(!f){
        cout << -1 << endl;
        return 0;
    }
    p[0] = a[t[0] - 'a'][0];
    ll ans = p[0];
    for(ll i = 1; i < t.size(); i++){
        ll c = t[i] - 'a';
        ans -= p[i - 1];
        auto itr = upper_bound(begin(a[c]), end(a[c]), p[i - 1]);
        if(itr == end(a[c])){
            ans += s.size();
            p[i] = a[c][0];
        }else{
            p[i] = *itr;
        }
        ans += p[i];
    }
    for(ll i = 0; i < t.size(); i++){
        // else{
        //     p[i] = a[c][cnt[c] % a[c].size()];
        //     cnt[c]++;
        // }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 2304
using System;

class Atcoder97
{
    public static void Main()
    {
        string[] input = Console.ReadLine().Split(' ');
        int a = int.Parse(input[0]);
        int b = int.Parse(input[1]);

        if (a % 2 == 1 && b % 2 == 1)
            Console.WriteLine("Yes");
        else
            Console.WriteLine("No");
    }
}

Measured memory_bytes: 13140
#include<bits/stdc++.h>
#define INF 2147483647
#define inf 1000000007
#define SYOU(x) setprecision(x)
#define abs(x,y) (max(x,y)-min(x,y))
#define mp make_pair
#define fi first
#define se second
using namespace std;
long long i[3000000];
bool o;
bool ans[5];
signed main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long a,b,c,d=0,e=0,f=0,g=0,h=0,j=0;
  cin >>a>>b;
  while(1){
    a=a*2;
    if(a<=b) d++;
    else break;
  }
  cout <<d+1<<'\n';
  return (0);
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int a[21],c[21];
bool b[21];
bool f;
int n,m,q,x,l; 
void dfs(int k){
	if (f) return;
	if (k>=n){
		int tot=0;
		for (int i=0; i<n; i++)
		    tot+=c[i]*a[i];
		if (tot==x){
			f=true; 
			return;
		}
    }
    else{
    	for (int i=0; i<=1; i++){
    		//if (b[i]){
    			b[i]=false; c[k]=i; dfs(k+1); b[i]=true; 
		//	}
		}
	}
}
int main(){
    cin>>n;
    for (int i=0; i<n; i++){
	    cin>>a[i]; c[i]=0;
	} 
        
    cin>>m;
    while (m--){
    	cin>>x; f=false;
    	memset(b,true,sizeof(b));
    	dfs(0);
    	if (f)
    		cout<<"yes"<<endl;
		if (!f)
		   cout<<"no"<<endl;
	}
	return 0;
}


Measured memory_bytes: 3088
#include<bits/stdc++.h>
using namespace std;
#define rep(i,x,y) for(int i=x;i<y;i++)
#define range(a) (a).begin(),(a).end()
#define print(A,n) rep(i,0,n){cout<<(i ? " ":"")<<A[i];}cout<<endl;
#define pprint(A,m,n) rep(j,0,m){print(A[j],n);}
const long mod=1e9+7;
const int size=1e5;
const long inf=1e9;
int main(){
	int N;cin>>N;
	rep(i,1,N+1){
		int temp=(int)(1.0*i*1.08);
		if(temp==N){ cout<<i<<endl; return 0; }
	}cout<<":("<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
typedef long double ld;
int main()
{
  int n,m;
  cin >> n >> m;
  vector<int> x(m);
  REP(i,m){
    cin >> x[i];
  }
  sort(ALL(x));

  if(n>=m){
    cout << 0 << endl;
    return 0;
  }
  
  vector<int> L(m-1);
  REP(i,m-1){
    L[i] = x[i+1] - x[i];
  }
  sort(ALL(L));
  reverse(ALL(L));
  int sum_L = 0;
  REP(i,n-1){
    sum_L += L[i];
  }
  cout << x[m-1]-x[0]-sum_L << endl;
  return 0;
}


Measured memory_bytes: 1024
n,m = map(int,input().split())
count = 0
list = [[int(i) for i in input().split()] for i in range(n)]
#print(list)
for i in range(n):
  list[i].pop(0)
#print(list)
for i in range(1,m+1):
  flag = 1
  for j in range(n):
    if i not in list[j]:
      flag = 0
  if flag == 1:
    count = count + 1
print(count)

Measured memory_bytes: 3064
#include <cstdio>
#include <iostream>
#include <cmath>
#include <cstring>
#include <sstream>
#include <algorithm>
#include <cstdlib>
#include <map>
#include <queue>
#include <utility>
#include <vector>
#include <set>
#include <memory.h>
#include <iomanip>
#include <bitset>
#include <list>
#include <stack>
#include <deque>
#include <numeric>
 
using namespace std;
 
#define mod 1000000007
 
int main(){
  int a, b;
  cin >> a >> b;
  if(a <= 5) cout << 0 << endl;
  else if(a <= 12) cout << b / 2 << endl;
  else cout << b << endl;
}

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

int main() {
  int n, m, k;
  cin >> n >> m >> k;
  vector<ll> a(n);
  vector<ll> b(m);
  ll total = 0;
  ll cnt = m;
  ll now = m - 1;
  rep(i, n) cin >> a[i];
  rep(i, m) {
    cin >> b[i];
    total += b[i];
  }
  ll ma = 0;
  for (int i = -1; i < n; i++) {
    bool ok = true;
    if (i != -1) {
      total += a[i];
      cnt++;
    }
    while (total > k) {
      if (now < 0) {
        ok = false;
        break;
      }
      total -= b[now];
      now--;
      cnt--;
      if (now < 0) {
        if (total > k) ok = false;
        break;
      }
    }
    if (ok) {
      ma = max(cnt, ma);
    } else
      break;
  }
  cout << ma << endl;
}


Measured memory_bytes: 6436
ans = 0
s = input()

s_without_x = [ i for i in s if i != "x" ]
if s_without_x != s_without_x[::-1]:
    ans = -1

else:
    x_list = []
    x = 0
    for i, v in enumerate(s):
        if v != "x":
            x_list.append(x)
            x = 0
        else:
            x += 1
        if i == len(s) - 1:
            x_list.append(x)

    for i in range(len(x_list)//2):
        a, b = max(x_list[i], x_list[-1-i]), min(x_list[i], x_list[-1-i])
        ans += a-b

print(ans)

Measured memory_bytes: 49836
// AOJ 2410: Janken
// 2017.9.27 bal4u@uu
// 2017.12.2

#include <stdio.h>
#include <stdlib.h>

int main()
{
	int n, i, k, me;
	char s[20], *p;

	scanf("%d", &n);
	me = 0;
	for (i = 0; i < n; i++)	{
		scanf("%s", s);
		for (k = 0, p = s; *p; p++) {
			if      (*p == 'o') k += 3;
			else if (*p == '-') k++;
		}
		if (k == 3*n - 2) me = i+1;
	}
	sprintf(s, "%d", me);
	for (i = 0; i < 1000; i++) {
		if (me) puts(s);
		else printf("%d\n", rand() % n + 1);
		fflush(stdout);
		scanf("%d", &k);
	}
	return 0;
}

Measured memory_bytes: 3368
#include<bits/stdc++.h>
using namespace std;
int main(){
  long long  X, Y;
  cin >> X >> Y;
  int ans = -1;
  
  if(X %Y == 0){
   ans = -1;
  }
  else{
    int i=1;
   while(X*i < 10000000000000000){
    if(X*i %Y != 0){
      ans = X*i;
      break;
    }
    i++;
   }
  }
  cout << ans << endl;
}  

Measured memory_bytes: 256
#include<iostream>
#include<cmath>
#include<vector>
#include<bitset>
#include<bitset>
#include<string>
#include<utility>
#include<queue>

using namespace std;

int main(){
    int a,b,c,k;
    cin >> a >> b>> c>> k;
    int num=0;
    while(a>=b){
        b*=2;
        num++;
    }
    while(b>=c){
        c*=2;
        num++;
    }
    if(num <= k){
        cout <<  "Yes" << endl;
    }else{
        cout << "No"  << endl;
    }
    return 0;
}

Measured memory_bytes: 3104
import std.stdio, std.string, std.array, std.conv;

int arrayGCD(int[] x) {
    while (x.length > 1) {
        int a = x[0] < x[1] ? x[1] : x[0];
        int b = x[0] < x[1] ? x[0] : x[1];
        int r;
        while (b > 0) {
            r = a % b;
            a = b;
            b = r;
        }
        x[1] = a;
        x = x[1..$];
    }
    return x[0];
}

void main() {
    int[] a = readln.chomp.split.to!(int[]);
    arrayGCD(a).writeln;
}


Measured memory_bytes: 2484
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n,a,b,anser=0;
  cin>>n>>a>>b;
  for(int i=1;i<=n;i++)
  {
    int sum=0;
    int base=i;
    while(base)
    {
      sum+=base%10;
      base/=10;
    }
   if(sum>=a && sum<=b)
     anser+=i;
  }
  cout<<anser<<endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<stdio.h>
#include<string>
#include<vector>
#include<map>
#include<tuple>
#include<algorithm>
#include<cmath>
#include<limits>
#include<set>
#include<deque>
#include<queue>
using namespace std;
#define int long  long int
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a / gcd(a, b) * b; }
typedef pair<int, int>P;
const int MOD = 1e9 + 7;
const int INF = 1e10;
const long double PI = (acos(-1));


signed main() {
	int a, b, c;
	cin >> a >> b >> c;
	int d = c - a - b;
	int e = 4 * a * b;
	if (d > 0 && e < d * d)cout << "Yes" << endl;
	else cout << "No" << endl;
}

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

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

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

	vector<int> v(N);
	for (int i = 0; i < N; i++) {
		cin >> v.at(i);
	}

	bubbleSort(v, N);
}

void bubbleSort(vector<int> v, int N) {
	int f = 1;
	int cnt = 0;
	while (f) {
		f = 0;
		for (int i = N - 1; i > 0; i--) {
			if (v.at(i) < v.at(i - 1)) {
				int n = v.at(i);
				v.at(i) = v.at(i - 1);
				v.at(i - 1) = n;
				cnt++;
				f = 1;
			}
		}
	}

	for (int i = 0; i < N; i++) {
		cout << v.at(i);
		if (i == N - 1) {
			cout << endl;
			cout << cnt << endl;
		}
		else {
			cout << ' ';
		}
	}
}


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

using namespace std;
using ll = long long;

int main() {
  string s;
  cin >> s;
  int sum = 0;
  rep(i, s.size()) { sum += s[i] - '0'; }
  if (sum % 9 == 0) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}


Measured memory_bytes: 3752
#include<bits/stdc++.h>
using namespace std;
	int a[3][3],n,b[15];
	bool mark[3][3];
int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	for(int i=0;i<3;i++)
		for(int j=0;j<3;j++)
			cin>>a[i][j];
	cin>>n;
	for(int i=0;i<n;i++) cin>>b[i];
	for(int i=0;i<n;i++)
		for(int j=0;j<3;j++)
			for(int k=0;k<3;k++)
				if(b[i]==a[j][k])
					mark[j][k]=1;
	for(int i=0;i<3;i++) {
		bool ok=1;
		for(int j=0;j<3;j++)
			if(mark[i][j]==0)
				ok=0;
		if(ok) {
			cout<<"Yes\n";
			return 0;
		}
	}
	for(int j=0;j<3;j++) {
		bool ok=1;
		for(int i=0;i<3;i++)
			if(mark[i][j]==0)
				ok=0;
		if(ok) {
			cout<<"Yes\n";
			return 0;
		}
	}
	if(mark[0][0]&&mark[1][1]&&mark[2][2]||mark[0][2]&&mark[1][1]&&mark[2][0]) cout<<"Yes\n";
	else cout<<"No\n";
	return 0;
}

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

int isprime(int n){
  int i;
  for(i = 2; i * i <= n; i++){
    if(n % i == 0) return 0;
  }
  return 1;
 }

int	main(){
	int	n,	i,	a,	b,	max,	data[10000];
	while(1){
	  a	=	0;
	  b	=	0;
	  max	=	0;
	  scanf("%d",	&n);
	  if(n	==	0) break;
	  for(i	=	n;	i	>=	1;	i--){
		  if(isprime(i)	==	1){
			  a	=	b;
			  b	=	i;
		  }
		  if(a	-	b	==	2)break;
		}
//		for(i	=	1;	i	<=	cnt;	i++){
//			if(data[i]	-	data[i	-	1]	==	2)max	=	i;
//		}
		printf("%d %d\n",	b,	a);
	}
	return	0;
}

Measured memory_bytes: 1028
#include <stdio.h>
#include <math.h>

int main(void)
{
	double a,b,x,y,answer;

	scanf("%lf %lf %lf %lf",&a,&b,&x,&y);

	answer = sqrt((a-x)*(a-x)+(b-y)*(b-y));

	printf("%f\n",answer);

	return 0;
}

Measured memory_bytes: 652
#include <algorithm>
#include <functional>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <bitset>
#include <climits>

#define all(c) (c).begin(), (c).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define pb(e) push_back(e)
#define mp(a, b) make_pair(a, b)
#define fr first
#define sc second

const int INF=100000000;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
using namespace std;
typedef pair<int ,int > P;
typedef long long ll;

int n;
ll dfs(ll sum,int p,int cnt) {
    if(sum==n) {
        return 1;
    }
    if(cnt==4) {
        return 0;
    }
    ll ret=0;
    for(ll i=p;i<=n;i++) {
        if(sum+i*i>n) break;
        ret+=dfs(sum+i*i,i,cnt+1);
    }

    return ret;
}
void solve() {
    cout<<dfs(0,1,0)<<endl;
}
int main() {
    while(cin>>n) {
        if(n==0) break;
        solve();
    }
    return 0;
}

Measured memory_bytes: 1156
#include <iostream>
#include <string>
#include <cmath>
#include<algorithm>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<iomanip>
#define _USE_MATH_DEFINES
#include <math.h>
#include <functional>
#include<complex>
using namespace std;

#define rep(i,x) for(ll i=0;i<x;i++)
#define repn(i,x) for(ll i=1;i<=x;i++)

typedef long long ll;
const ll INF = 1e17;
const ll MOD = 1000000007;
const ll MAX = 4000001;
const double eps = 1E-18;

ll max(ll a, ll b) {
	if (a > b) { return a; }
	return b;
}

ll min(ll a, ll b) {
	if (a > b) { return b; }
	return a;
}

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

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

struct edge {
	ll ind;
	ll fr;
	ll to;
	ll d;
};

class mint {
	long long x;
public:
	mint(long long x = 0) : x((x% MOD + MOD) % MOD) {}
	mint operator-() const {
		return mint(-x);
	}
	mint& operator+=(const mint& a) {
		if ((x += a.x) >= MOD) x -= MOD;
		return *this;
	}
	mint& operator-=(const mint& a) {
		if ((x += MOD - a.x) >= MOD) x -= MOD;
		return *this;
	}
	mint& operator*=(const  mint& a) {
		(x *= a.x) %= MOD;
		return *this;
	}
	mint operator+(const mint& a) const {
		mint res(*this);
		return res += a;
	}
	mint operator-(const mint& a) const {
		mint res(*this);
		return res -= a;
	}
	mint operator*(const mint& a) const {
		mint res(*this);
		return res *= a;
	}

	mint pow(ll t) const {
		if (!t) return 1;
		mint a = pow(t >> 1);
		a *= a;
		if (t & 1) a *= *this;
		return a;
	}

	// for prime MOD
	mint inv() const {
		return pow(MOD - 2);
	}
	mint& operator/=(const mint& a) {
		return (*this) *= a.inv();
	}
	mint operator/(const mint& a) const {
		mint res(*this);
		return res /= a;
	}

	friend ostream& operator<<(ostream& os, const mint& m) {
		os << m.x;
		return os;
	}
};

mint pw(mint a, ll b) {
	if (b == 0) { return 1; }
	mint ret = pw(a, b>>1);
	ret *= ret;
	if (b & 1) { ret *= a; }
	return ret;
}

typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef vector<vector<vector<ll>>> vvvll;

typedef vector<mint> vmint;
typedef vector<vector<mint>> vvmint;
typedef vector<vector<vector<mint>>> vvvmint;


//////////////////////////

mint T1(ll h, ll w) {
	mint ret = pw(2, h) + pw(2, w) + pw(2, gcd(h, w)) - 3;
	return ret;
}

int main() {
	ll H, W, T;
	cin >> H >> W >> T;

	ll gh = gcd(H, T);
	ll gw = gcd(W, T);

	mint ans = pw(T1(H / gh, W / gw), gh * gw);

	cout << ans << endl;

	
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define R cin>>
#define Z class
#define ll long long
#define ln cout<<'\n'
#define in(a) insert(a)
#define pb(a) push_back(a)
#define pd(a) printf("%.10f\n",a)
#define mem(a) memset(a,0,sizeof(a))
#define all(c) (c).begin(),(c).end()
#define iter(c) __typeof((c).begin())
#define rrep(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rep(i,n) REP(i,0,n)
#define tr(it,c) for(iter(c) it=(c).begin();it!=(c).end();it++)
template<Z A>void pr(A a){cout<<a;ln;}
template<Z A,Z B>void pr(A a,B b){cout<<a<<' ';pr(b);}
template<Z A,Z B,Z C>void pr(A a,B b,C c){cout<<a<<' ';pr(b,c);}
template<Z A,Z B,Z C,Z D>void pr(A a,B b,C c,D d){cout<<a<<' ';pr(b,c,d);}
template<Z A>void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<<a[i];}ln;}
ll check(ll n,ll m,ll x,ll y){return x>=0&&x<n&&y>=0&&y<m;}
const ll MAX=1e9+7,MAXL=1LL<<61,dx[4]={-1,0,1,0},dy[4]={0,1,0,-1};
typedef pair<ll,ll> P;

void Main() {
  ll n,r;
  cin >> n >> r;
  if(n>=10) pr(r);
  else pr(r+100*(10-n));
}

int main(){ios::sync_with_stdio(0);cin.tie(0);Main();return 0;}


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

namespace V1142{
    public class Program{
        public static void Main(string[] args){
            var sr = new StreamReader();
            //---------------------------------
            Func<string, int, string> revStr = (s, i) =>{
                if(i == 0) return s;
                return new string(s.Reverse().ToArray());
            };
            var d1 = new[]{0, 1, 0, 1};
            var d2 = new[]{0, 0, 1, 1};

            var N = sr.Next<int>();
            for(var i = 0; i < N; i++){
                var S = sr.Next<string>();
                var hs = new HashSet<string>();
                for(var j = 0; j < S.Length - 1; j++){
                    var s1 = S.Substring(0, j + 1);
                    var s2 = S.Substring(j + 1);
                    for(var k = 0; k < d1.Length; k++){
                        hs.Add(revStr(s1, d1[k]) + revStr(s2, d2[k]));
                        hs.Add(revStr(s2, d1[k]) + revStr(s1, d2[k]));
                    }
                }
                Console.WriteLine(hs.Count);
            }
            //---------------------------------
        }
    }

    public class StreamReader{
        private readonly char[] _c = {' '};
        private int _index = -1;
        private string[] _input = new string[0];
        private readonly System.IO.StreamReader _sr = new System.IO.StreamReader(Console.OpenStandardInput());

        public T Next<T>(){
            if(_index == _input.Length - 1){
                _index = -1;
                while(true){
                    string rl = _sr.ReadLine();
                    if(rl == null){
                        if(typeof(T).IsClass) return default(T);
                        return (T)typeof(T).GetField("MinValue").GetValue(null);
                    }
                    if(rl != ""){
                        _input = rl.Split(_c, StringSplitOptions.RemoveEmptyEntries);
                        break;
                    }
                }
            }
            return (T)Convert.ChangeType(_input[++_index], typeof(T), System.Globalization.CultureInfo.InvariantCulture);
        }

        public T[] Next<T>(int x){
            var ret = new T[x];
            for(var i = 0; i < x; ++i) ret[i] = Next<T>();
            return ret;
        }

        public T[][] Next<T>(int y, int x){
            var ret = new T[y][];
            for(var i = 0; i < y; ++i) ret[i] = Next<T>(x);
            return ret;
        }
    }
}

Measured memory_bytes: 10504