akhauriyash/Code-Regression huggingface dataset:
using System;
    using System.Linq;
    using System.Collections.Generic;
    using System.Text.RegularExpressions;
    using System.Text;
     
    public class Program
    {
        public void Proc() {
            Reader.IsDebug =false;
            int[] inpt = Reader.ReadLine().Split(' ').Select(a=>int.Parse(a)).ToArray();

            bool ans = false;
            if(inpt[0]%inpt[1] == 0) {
                ans = (inpt[2]==0);
            } else {
                for(int i=1; i<=inpt[1]; i++) {
                    if(inpt[0]*i%inpt[1] == inpt[2]) {
                        ans = true;
                        break;
                    }
                }
            }
            Console.WriteLine(ans?"YES":"NO");



        }

        public class Reader {
            public static bool IsDebug = true;
            private static System.IO.StringReader SReader;
            private static string InitText = @"




7 5 1






";
            public static string ReadLine() {
                if(IsDebug) {
                    if(SReader == null) {
                        SReader = new System.IO.StringReader(InitText.Trim());
                    }
                    return SReader.ReadLine();
                } else {
                    return Console.ReadLine();
                }
            }
        }
        public static void Main(string[] args)
        {
            Program prg = new Program();
            prg.Proc();
        }
    }

Measured memory_bytes: 13396
import java.util.*;
public class Main{
	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      int a = sc.nextInt();
      int b = sc.nextInt();
      int c = sc.nextInt();
      int count;
      if(a==b && b==c){
      	count = 1;
      }else if(a==b || b==c || c==a){
		count = 2;
      }else{
      	count=3;
      }
      System.out.println(count);
    }
}

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

int main() {
	int N;
	cin >> N;
	vector<vector<int>> candy(2, vector<int>(N));
	rep(i, 2) {
		rep(j, N) {
			cin >> candy[i][j];
		}
	}
	int ans = 0;
	rep(k, N) {
		int count = 0, i = 0, j = 0;
		rep(j, N) {
			count += candy[i][j];
			if (j == k && i == 0) {
				i++;
				j--;
			}
		}
		ans = max(ans,count);
	}
	cout << ans << endl;
	return 0;
}

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

using ll = long long;
using ull = unsigned long long;
using st = string;
using db = double;
using vll = vector<long long>;
using vdb = vector<db>;
using vvll = vector<vll>;
using vst = vector<st>;
using vchar = vector<char>;
using pll = pair<ll, ll>;
using vpll = vector<pll>;
using vvpll = vector<vpll>;
#define rep(i, m, n) for (ll i = (ll)(m); i < (ll)(n); i++)
#define vrep(i, vec) for(auto& i : vec)
#define vin(vec) for(auto& i : vec) cin >> i
#define all(v) v.begin(), v.end()
template<class T> inline bool chmin(T& a, T b){if(a > b){a = b;return true;} return false;}
template<class T> inline bool chmax(T& a, T b){if(a < b){a = b;return true;} return false;}
const ll mod = 1000000007;
const ll inf = 1LL << 60;


int main(){
  ll n;
  cin >> n;
  vll ans(n - 1);
  rep(i, 0, n - 1){
    ll a;
    cin >> a;
    a--;
    ans.at(a)++;
  }
  vrep(i, ans)cout << i << endl;
  cout << 0 << endl;
}

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

#define foreach(i, v) for(__typeof((v).begin()) i = (v).begin(); i != (v).end(); ++ i)
#define BETWEEN(a, x, b) (a<=x&&x<b)

using namespace std;
typedef long long ll;

int main(int argc, char *argv[]) {
  ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);

  int a,b,k;cin>>a>>b>>k;
  int cnt=0;
  for(int i=min(a,b);i>=1;i--){
    if(a%i==0&&b%i==0){
      cnt++;
      if(cnt==k){
        cout<<i<<endl;
        return 0;
      }
    }
  }

  return 0;
}


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

int main() {
  int n,a,b;
  cin >> n >> a >> b;
  int c=0;
  int d=0;
  int e=0;
  for(int i=0;i<n;i++){
 		int f;
    cin >> f;
    if(f<=a) c++;
    else if (f > a && f <= b) d++;
    else if(f > b)  e++;
    
  }  
  cout << min (c,min(d,e)) << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rep1(i, n) for(ll i = 1; i < (ll)(n); i++)
const ll mo=1000000007;
ll ans=0;
ll dp[0][0];

int main()
{ 
ll a,b;
cin >> a>>b; 
if(a==1&&b==1){
    cout << "1 2" << endl;
    cout << "#." << endl;
return 0;
}
char tab[100][100];

for (int i = 0; i < 100; ++i){
for (int j = 0; j < 100; ++j) {
    tab[i][j]='.';
}}
ll ma=max(a,b);
ll mi=ma-1-min(a,b);
rep(i,ma-1){
    tab[(i/24)*4][4*(i%24)]='#';
    tab[(i/24)*4][4*(i%24)+1]='#';
    tab[(i/24)*4][4*(i%24)+2]='#';
    tab[(i/24)*4+1][4*(i%24)]='#';
    tab[(i/24)*4+1][4*(i%24)+2]='#';
    tab[(i/24)*4+2][4*(i%24)]='#';
    tab[(i/24)*4+2][4*(i%24)+1]='#';
    tab[(i/24)*4+2][4*(i%24)+2]='#';
    if(mi>0){
        if(i%24!=23)tab[(i/24)*4][4*(i%24)+3]='#';
        else tab[(i/24)*4+3][0]='#';
        
        mi--;
    }
}
if(a<b){
for (int i = 0; i < 100; ++i){
for (int j = 0; j < 100; ++j) {
    if(tab[i][j]=='.') tab[i][j]='#';
    else tab[i][j]='.';
}}
}
cout << "100 100" << endl;
if(a==b)tab[99][99]='#';
for (int i = 0; i < 100; ++i){
for (int j = 0; j < 100; ++j) {
    cout << tab[i][j] ;
}cout  << endl;}
return 0;
}


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

int main()
{
    int n;
    cin>>n;
    int v[n],c[n];
    for(int i=0;i<n;i++)
        cin>>v[i];
    for(int i=0;i<n;i++)
        cin>>c[i];

    int ans = 0;
    for(int i=0;i<n;i++)
    {
        ans = max(ans,ans+(v[i]-c[i]));
    }
    cout << ans << "\n";
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
typedef long long ll;
int N_MAX = 200000;
ll p=1e9+7;
int main()
{
  int n,k,i,j,aa,bb,f;
  ll t,res=1;
  vector<ll> a,b;
  cin >> n >> k;
  for(i=0;i<n;i++){
    cin >> t;
    if(t>=0)
      a.push_back(t);
    else
      b.push_back(-t);
  }
  aa=a.size();
  bb=b.size();
  sort(a.begin(),a.end(),greater<ll>());
  sort(b.begin(),b.end(),greater<ll>());
  if(aa>0||k%2==0){
    i=min(aa,k);
    if((k-i)%2==1&&n>k&&i>0)
      i--;
    j=k-i;
    while(i>=2&&j<=bb-2){
      if(a[i-1]*a[i-2]<b[j]*b[j+1]){
        i-=2;
        j+=2;
      }else{
        break;
      }
    }
    f=j%2;
    for(i--;i>=0;i--){
      res*=a[i];
      res%=p;
    }
    for(j--;j>=0;j--){
      res*=b[j];
      res%=p;
    }
  }else{
    f=1;
    for(j=bb-1;j>=bb-k;j--){
      res*=b[j];
      res%=p;
    }
  }
  if(f==1) 
    res=p-res;
  cout << res << endl;
  return 0;
}

Measured memory_bytes: 5624
fn main() {
    let mut line = String::new();
    std::io::stdin().read_line(&mut line).unwrap();
    let mut words = line.split_whitespace();
    let a = words.next().unwrap().parse::<i64>().unwrap();
    let b = words.next().unwrap().parse::<i64>().unwrap();
    let t = words.next().unwrap().parse::<i64>().unwrap();
    let n = ((t as f64 + 0.5) / a as f64).floor() as i64;
    println!("{}", n * b);
}   


Measured memory_bytes: 4352
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line = "";

		int[][] paper = new int[14][14];
		byte x, y, size;
		int whites = 0, blot = 0;

		StringTokenizer st;
		while ((line = br.readLine()) != null) {

			st = new StringTokenizer(line, ",");
			x = Byte.parseByte(st.nextToken());
			y = Byte.parseByte(st.nextToken());
			size = Byte.parseByte(st.nextToken());

			x += 2;
			y += 2;

			if (size == 1) {
				paper[x - 1][y]++;
				paper[x][y - 1]++;
				paper[x][y]++;
				paper[x][y + 1]++;
				paper[x + 1][y]++;
			} else if (size == 2) {
				paper[x - 1][y - 1]++;
				paper[x - 1][y]++;
				paper[x - 1][y + 1]++;
				paper[x][y - 1]++;
				paper[x][y]++;
				paper[x][y + 1]++;
				paper[x + 1][y - 1]++;
				paper[x + 1][y]++;
				paper[x + 1][y + 1]++;
			} else {
				paper[x - 2][y]++;
				paper[x - 1][y - 1]++;
				paper[x - 1][y]++;
				paper[x - 1][y + 1]++;
				paper[x][y - 2]++;
				paper[x][y - 1]++;
				paper[x][y]++;
				paper[x][y + 1]++;
				paper[x][y + 2]++;
				paper[x + 1][y - 1]++;
				paper[x + 1][y]++;
				paper[x + 1][y + 1]++;
				paper[x + 2][y]++;
			}

		}
		for (int i = 2; i < 12; i++) {
			for (int j = 2; j < 12; j++) {
				if (paper[i][j] == 0)
					whites++;
				if (paper[i][j] > blot)
					blot = paper[i][j];
			}
		}
		System.out.println(whites + "\n" + blot);
	}
}

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

#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, n, m) for(int (i) = (n); (i) < (m); ++(i))

constexpr int INF = 1e9;
//constexpr ll INF = 1LL<<61;
// constexpr ll mod = 1e9+7;

int N;
vector<int> A;
map<int, int> mp;

bool isOk(int x, bool same){
  if(same){
    return mp[x] <= 1;
  }
  else{
    return mp[x] <= 0;
  }
}
int main(){
  cin >> N;
  A.resize(N);
  REP(i, N){
    cin >> A[i];
    mp[A[i]]++;
  }
  int cnt = 0;
  REP(i, N){
    bool ans = true;
    for(int j = 1; j * j <= A[i]; j++){
      if(A[i] % j == 0){
        bool same = j == A[i];
        ans = ans && isOk(j, same);
        same = (A[i]/j) == A[i];
        ans = ans && isOk(A[i]/j, same);
      }
    }
    if(ans){
      cnt++;
    }
  }
  cout << cnt << endl;

  return 0;
}

Measured memory_bytes: 32976
/**
 *    author:  otera    
**/
#include<iostream>
#include<string>
#include<cstdio>
#include<cstring>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<deque>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
using namespace std;

typedef long long ll;
typedef unsigned long long ul;
typedef unsigned int ui;
typedef long double ld;
const int inf=1e9+7;
const ll INF=1LL<<60 ;
const ll mod=1e9+7 ;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<int, int> P;
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
#define fr first
#define sc second
#define all(c) c.begin(),c.end()
#define pb push_back
#define debug(x)  cerr << #x << " = " << (x) << endl;
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; }
#define int long long

void solve() {
	int n, d, a; cin >> n >> d >> a;
    vector<int> x(n), h(n);
    vector<P> m(n);
    rep(i, n) {
        cin >> x[i] >> h[i];
        m[i] = make_pair(x[i], (h[i] + a - 1) / a);
    }
    priority_queue<P> pque;
    sort(all(m));
    reverse(all(m));
    int cnt = 0;
    int now = 0;
    rep(i, n) {
        int X = m[i].fr, C = m[i].sc;
        while((int)pque.size() > 0 && X < pque.top().fr) {
            int Z = pque.top().sc;
            now -= Z;
            pque.pop();
        }
        //cerr << X << " " << now << endl;
        C -= now;
        if(C <= 0) continue;
        int co = C;
        cnt += co;
        pque.push(make_pair(X - 2 * d, co));
        //cerr << X - 2 * d << endl;
        now += co;
    }
    cout << cnt << endl;
}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	//cout << fixed << setprecision(10);
	//int t; cin >> t; rep(i, t)solve();
	solve();
    return 0;
}

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

public class Test
{
	public static void Main()
	{
while(true){
		int n=int.Parse(Console.ReadLine());
		if(n==0){break;}
		int ans=0,s=int.Parse(Console.ReadLine());
		for(int i=0;i<s;i++){
			int []k=Console.ReadLine().Split().Select(int.Parse).ToArray();
			int a=k[1]-k[0];
			ans+=a;
		}
		Console.WriteLine(ans>=n?"OK":(n-ans).ToString());
}
		// your code goes here
	}
}

Measured memory_bytes: 9676
#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;

int		main(void)
{
	int a, b, h, m;
	double a_x, a_y, b_x, b_y;
	double ans;

	cin >> a >> b >> h >> m;
	// ans = sqrt(a*a + b*b 
	// - 2*a*b*( sin(M_PI * m / 30) * sin(M_PI * h / 6)
	// 		+ (cos(M_PI * m / 30) * cos(M_PI * h / 6)) ) );
	// ans = sqrt(pow( ( a*sin(M_PI * m / 30) - b*sin(M_PI * h / 6) ), 2.0) + pow((a * cos(M_PI * m / 30) - b * cos(M_PI * h / 6)), 2.0) );
	a_x = a * sin(2 * M_PI * (60 * h + m) / 720);
	a_y = a * cos(2 * M_PI * (60 * h + m) / 720);
	b_x = b * sin(2 * M_PI * m / 60);
	b_y = b * cos(2 * M_PI * m / 60);
	ans = sqrt(pow((a_x - b_x), 2.0) + pow((a_y - b_y), 2.0));
	
	printf("%.10f\n", ans);
	return (0);
}

Measured memory_bytes: 4064
<?php
// C
fscanf(STDIN, '%d', $n);
if ($n < 6) exit(strval($n));
for ($i = 1; $i <= floorFloat(log($n, 6)); $i++) $a6[] = 6 ** $i;
for ($i = 1; $i <= floorFloat(log($n, 9)); $i++) $a9[] = 9 ** $i;
rsort($a6);
rsort($a9);
$ans = PHP_INT_MAX;
for ($i = 0; $i <= $n; $i++) {
    $cnt = 0;
    $t = $i;
    foreach ($a6 as $v) {
        $cnt += intdiv($t, $v);
        $t %= $v;
    }
    $cnt += $t;
    $t = $n - $i;
    foreach ($a9 as $v) {
        $cnt += intdiv($t, $v);
        $t %= $v;
    }
    $cnt += $t;
    $ans = min($ans, $cnt);
}
echo $ans;

function floorFloat($n)
{
    $x = explode('.', strval($n));
    return intval($x[0]);
}

function ceilFloat($n)
{
    $x = explode('.', strval($n));
    return isset($x[1]) && intval($x[1]) > 0 ? intval($x[0]) + 1 : intval($x[0]);
}

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

int main(){
	int n;
	cin>>n;
	int a[n];
	int index=1;
	rep(i,n){
		cin>>a[i];
		if(a[i]==index)index++;
	}
  	if(index>1)
	puts(n-index+1);
  else puts(-1);
}


Measured memory_bytes: 1024
#include <iostream>
#include <string>
#include<vector>

using namespace std;
int main() {
	string t;
	string s;
	string ts = "";
	int a;
	cin >> t>>s;
	a = t.size();
	for (int i = 0; i < a; i++) {
		ts += s[i];
	}
	if (t == ts) {
		cout << "Yes" << endl;

		return 0;
	}

	cout << "No" << endl;

	return 0;
}

Measured memory_bytes: 3620
N, *L,  = [list(map(int, s.split())) for s in open(0)]
N = N[0]
L = L[0]
num_view = 1
for i in range(1, N):
    not_view = 0
    for j in range(0, i):
        if L[i] < L[j]:
            not_view += 1
            
    if not not_view:
        num_view += 1
print(num_view)

Measured memory_bytes: 3060
#include<stdio.h>

int main()
{

  int n,a[200000],max,min,i,j;
  
  scanf("%d",&n);

  for(i=0;i<n;i++){

scanf("%d",&a[i]);

  }
  
    max  = a[1]- a[0];
    min = a[0];

    for(j=1;j<n;j++){

      if(max < (a[j]-min)){

      max = a[j] - min;

    }

    if(min > a[j]){

      min = a[j];

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


    return 0;
}

Measured memory_bytes: 1380
#include <bits/stdc++.h>
#define rep(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define repeq(i,n) for(int (i)=0;(i)<=(int)(n);(i)++)
#define rep1(i,x,n) for(int (i)=(x);(i)<(int)(n);(i)++)
#define rep1eq(i,x,n) for(int (i)=(x);(i)<=(int)(n);(i)++)
#define rrep(i,x) for(int i=((int)(x)-1);i>=0;i--)
using namespace std;
using ll = long long;
using Int = long long;

const int MOD = 1000000007;
const ll INF = numeric_limits<ll>::max();
const int inf = 1e8;
typedef pair<int,int> P;
typedef std::priority_queue<int> IntPrioQueue;
typedef std::priority_queue<int, std::vector<int>, std::greater<int> > IntReversePrioQueue;

//少数点表示
//cout << std::fixed << std::setprecision(14) << 値

int main(){
    cin.tie( 0 ); ios::sync_with_stdio( false );
    int p,q,r;
    cin >> p >> q >> r;
    cout << min({p+q,q+r,r+p})<<endl;
    return 0; 
}

Measured memory_bytes: 256
#include <bitset>
#include <climits>
#include <functional>
#include <iostream>
#include <vector>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < n; i++)
template <typename T, typename E>
struct SegmentTree {
	typedef function<T(T, T)> F;
	typedef function<T(T, E)> G;
	int n;
	F f;
	G g;
	T d1;
	E d0;
	vector<T> dat;
	SegmentTree(){};
	SegmentTree(int n_, F f, G g, T d1, vector<T> v = vector<T>()) : f(f), g(g), d1(d1) {
		init(n_);
		if (n_ == (int)v.size()) build(n_, v);
	}
	void init(int n_) {
		n = 1;
		while (n < n_) n *= 2;
		dat.clear();
		dat.resize(2 * n - 1, d1);
	}
	void build(int n_, vector<T> v) {
		for (int i = 0; i < n_; i++) dat[i + n - 1] = v[i];
		for (int i = n - 2; i >= 0; i--) dat[i] = f(dat[i * 2 + 1], dat[i * 2 + 2]);
	}
	void update(int k, E a) {
		k += n - 1;
		dat[k] = g(dat[k], a);
		while (k > 0) {
			k = (k - 1) / 2;
			dat[k] = f(dat[k * 2 + 1], dat[k * 2 + 2]);
		}
	}
	inline T query(int a, int b) {
		T vl = d1, vr = d1;
		for (int l = a + n, r = b + n; l < r; l >>= 1, r >>= 1) {
			if (l & 1) vl = f(vl, dat[(l++) - 1]);
			if (r & 1) vr = f(dat[(--r) - 1], vr);
		}
		return f(vl, vr);
	}
	T operator[](int i) { return dat[i + n - 1]; }
};
int main() {
	cin.tie(0);
	ios::sync_with_stdio(0);
	int n;
	string s;
	cin >> n >> s;
	vector<int> v(n);
	rep(i, n) v[i] = 1 << (s[i] - 'a');
	SegmentTree<int, int> ssq(
	    n, [](int a, int b) { return a | b; }, [](int a, char b) { return (1 << (b - 'a')); }, 0, v);
	int q;
	cin >> q;
	for (int i = 0; i < q; i++) {
		int k;
		cin >> k;
		if (k == 2) {
			int x, y;
			cin >> x >> y;
			cout << __builtin_popcount(ssq.query(x - 1, y)) << endl;
		} else {
			int x;
			char y;
			cin >> x >> y;
			ssq.update(x - 1, y);
		}
	}
	return 0;
}

Measured memory_bytes: 10780
#include <bits/stdc++.h>
using namespace std;
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
#define all(x) (x).begin(),(x).end()
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
typedef long long ll;
const long long INF = 1LL << 60;
typedef pair<int, int> P;
int main()
{
    int A, B, C, D;
    cin >> A >> B >> C >> D;

    cout << max(A * B, C * D) << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
  using namespace std;
#define ll long long
#define fw(p) for(int w=0;w<(p);w++)
#define fx(p) for(int x=0;x<(p);x++)
#define fy(p) for(int y=0;y<(p);y++)
#define fz(p) for(int z=0;z<(p);z++)
#define fyg(p,g) for(int y=(g);y<(p);y++)
#define fzg(p,g) for(int z=(g);z<(p);z++)
#define ce(d) cout<<d<<endl;
#define vecp(p) int aa;cin>>aa;(p).push_back(aa);
#define vecpl(p) long long aa;cin>>aa;(p).push_back(aa);
#define vecps(p) string aa;cin>>aa;(p).push_back(aa);
#define vecp2(p) cin>>aa;(p).push_back(aa);
#define vecpl2(p) long long a	b;cin>>ab;(p).push_back(ab);
#define vecps2(p) string ab;cin>>ab;(p).push_back(ab);
#define set0(k,n) for(int nn=0;nn<(n);nn++){ (k).push_back(0); }
#define sorts(c) sort((c).begin(),(c).end());
#define reverses(c) reverse((c).begin(),(c).end());
#define vec(b) vector<int> (b);
#define vecl(b) vector<long long> (b);
#define vecs(b) vector<string> (b);
#define vecsize(b,size) vector<int> (b)((size));
#define pb(b,a) (b).push_back((a));
#define doublece(a,b) cout<<(a)<<' '<<(b)<<endl;
#define pairs(s) vector<pair<int,int>> (s);
#define pairsl(s) vector<pair<ll,ll>> (s);
#define pairss(s) vector<pair<string,string>> (s);
#define pairsp(s) int aa,bb;cin>>aa>>bb;(s).push_back(make_pair(aa,bb));
#define pairspl(s) int aa,bb;cin>>aa>>bb;(s).push_back(make_pair(aa,bb));
#define pairsps(s) int aa,bb;cin>>aa>>bb;(s).push_back(make_pair(aa,bb));
#define pairsREV(s) (s).push_back(make_pair(bb,aa));
#define pairslREV(s) (s).push_back(make_pair(bb,aa));
#define pairssREV(s) (s).push_back(make_pair(bb,aa));
#define MOD 1000000007


int main() {
	
	int N,A,B;
	cin>>N>>A>>B;
	doublece(min(A,B),max(0,A+B-N))
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(){
  string s;    
  cin >> s;
  int i;
  for(i=0;i<4;i++){    
    if(s[i]==s[i+1]){   
      cout << "Bad" << "\n";     
      return 0;
    }
  }
  cout << "Good" << "\n";
  return 0;
}

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

# define C continue;
# define R return

# define D double
# define I insert
# define ll long long
# define ld long double
# define ull unsigned long long

# define pb push_back
# define vi vector < int >
# define vc vector < char >
# define vs vector < string >
# define vb vector < bool >
# define vd vector < D >
# define vll vector < ll >
# define vull vector < ull >

# define vvi vector < vector < int > >
# define vvb vector < vector < bool > >
# define vvc vector < vector < char > >
# define vvll vector < vector < ll > >
# define vvd vector < vector < D > >
# define vld vector < ld >

# define all(v) (v).begin() , (v).end()
# define allrev(v) (v).rbegin() , (v).rend()
# define allcomp(v) v.begin() , v.end() , comp
# define allrevcomp(v) v.rbegin() , v.rend() , comp

# define pii pair < int , int >
# define pll pair < long , long >
# define pDD pair < D , D >
# define vpii vector < pii >
# define vpll vector < pll >
# define vpDD vector < pDD >

# define vvpii vector < vector < pii > >
# define F first
# define S second
# define mp make_pair

# define fast ios_base::sync_with_stdio(false) ; cin.tie(0) ; cout.tie(0);
# define dist(a,b,p,q) sqrt((p-a)*(p-a) + (q-b)*(q-b));
# define mod 1000000007

# define pp(n) printf("%.10f",n);
# define line cout<<"\n";

const D pie = acos(-1);
const D hpie = asin(1);
const D qpie = atan2(1,1);
const D tpie = 2*pie;

string vow = "aeiou";

void solve( int test_case )
{
    string s;
    cin >> s;
    
    if ( s[0]==s[1] || s[1]==s[2] || s[2]==s[3] ) cout << "Bad";
    else cout << "Good";
}

int main()
{
    fast
    int t = 1;
    //cin>>t;

    for ( int i=0 ; i<t ; i++ ) solve(i);
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define int long long
#define rep(i,a,b) for(int i=a;i<b;i+=1)
#define reps(i,a,b) for(int i=a;i>=b;i-=1)
#define vi vector<int>
#define pb push_back
#define in(x) int x; cin>>x;
#define inn(x, y) int x, y; cin>>x>>y;
#define mi unordered_map<int,int>
#define mem(x) memset(x, 0, sizeof(x))
#define IOS ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL);
using namespace std;

//bool primes[1000001];
//vi prime;
//void seive(){
//	memset(primes, true, sizeof(primes));
//	primes[0] = primes[1] = false;
//	for(int i = 2; i*i<=1000000;i += 1)
//	{
//		if(primes[i])
//		{
//			for(int j = i*i; j <= 1000000;j += i) primes[j] = false;
//		}
//	}
//	rep(i, 2, 1000001)
//	{
//		if(primes[i]) prime.pb(i);
//	}
//}


int gcd(int a, int b){
	return b==0 ? a : gcd(b, a%b);
}

int32_t main(void){
	IOS;
	
	in(n);
	int ans = 0;
	int x;
	rep(i, 1, n+1)
	{
		rep(j, 1, n+1)
		{
			rep(k, 1, n+1)
			{
				x = gcd(i, j);
				ans += gcd(x, k);
			}
		}
	}
	cout<<ans<<endl;
}

Measured memory_bytes: 3648
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Linq;
using System.Diagnostics;
using System.Globalization;
using static System.Console;
using static System.Math;

namespace abc102_c
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int[] arr = ReadLine().Split().Select(int.Parse).ToArray();

            for(int i=0; i<arr.Length; i++){
                arr[i] -= i+1;
            }

            double sum=0;
            foreach(var item in arr){
                sum += item;
            }
            double mean = arr.Length/2;

            int x = (int)Floor(mean);
            int y = (int)Ceiling(mean);

            double sum1=0;
            double sum2=0;

            var tmp = arr;
            Array.Sort(tmp);

            for(int i=0; i<arr.Length; i++){
                sum1 += Abs(arr[i]-tmp[x]);
                sum2 += Abs(arr[i]-tmp[y]);
            }

            WriteLine(Min(sum1, sum2));
        }
    }
}

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

using namespace std;

void print (string str, int a, int b) {
  cout << str.substr(a, b-a+1) << endl;
  return;
}

string reverse (string str, int a, int b) {
  string s1, s2_b, s2_a="", s3;
  s1 = str.substr(0, a);
  s2_b = str.substr(a, b-a+1);
  for (string::reverse_iterator ritr = s2_b.rbegin();
       ritr != s2_b.rend(); ritr++) {
    s2_a += *ritr;
  }
  s3 = str.substr(b+1);
  return s1+s2_a+s3;
}

string replace (string str, int a, int b, string p) {
  string s1, s2, s3;
  s1 = str.substr(0, a);
  s2 = str.substr(a, b-a+1);
  s3 = str.substr(b+1);
  return s1+p+s3;
}

int main(int argc, char* argv[]) {
  string str; cin >> str;
  int q; cin >> q;

  for (int i = 0; i < q; i++) {
    string cmd; cin >> cmd;
    if (cmd == "replace") {
      int op1, op2;
      string op3;
      cin >> op1 >> op2 >> op3;
      str = replace(str, op1, op2, op3);
    } else if (cmd == "reverse") {
      int op1, op2;
      cin >> op1 >> op2;
      str = reverse(str, op1, op2);
    } else if (cmd == "print") {
      int op1, op2;
      cin >> op1 >> op2;
      print(str, op1, op2);
    }
  }
  return 0;
}

Measured memory_bytes: 1232
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;


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

		Console.WriteLine(((a * b) % 2 == 1) ? "Odd" : "Even");
	}
}





Measured memory_bytes: 13140
// 5/30
// 2-6-1. 線分状の格子点の個数
// 類題
#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int INF = 1e9;

ll gcd(ll a, ll b) {  // bが常にワル役
    if (b == 0) return a;
    return gcd(b, a % b);
}

ll lcm(ll a, ll b) {
    return a / gcd(a, b) * b;  // 先に割ることでオーバーフローを防げる
}

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

    vector<ll> T(N);
    rep(i, N) cin >> T[i];

    ll g = T[0];
    rep(i, N - 1) {
        g = lcm(g, T[i + 1]);
    }

    // cout << lcm(1000000000000000000, 1000000000000000000) << endl;

    cout << g << endl;
}


Measured memory_bytes: 256
def sol(_inp=input):
    n=int(_inp())
    shops=[_inp().split()+[i] for i in range(n)]
    for i in range(n):
        shops[i][1]=-int(shops[i][1])
    shops=sorted(shops)
    nums={i:shops[i][2]+1 for i in range(n)}
    return('\n'.join(str(nums[i]) for i in range(n)))
print(sol())

Measured memory_bytes: 38256
// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define REP(i, n) for (int i = 0; i < n; ++i)
#define range(i,a,b) ((a)<=(i) && (i)<(b))
#define debug(x) cout << #x << ' ' << '=' << ' ' << (x) << endl;
#define fs first
#define sc second
#define pb push_back
typedef long long ll;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> T;
typedef priority_queue<ll> PQI;
typedef priority_queue<P> PQP;
typedef vector<vector<P>> pvec;
typedef vector<vector<ll>> vvec;
typedef vector<ll> vec;
const vector<int> dx = {0, -1, 0, 1, 1, 1, -1, -1};
const vector<int> dy = {1, 0, -1, 0, 1, -1, 1, -1};
const int MOD = (1000000007);
// const int MOD = (998244353);
// const int INF = (1 << 30);
const int INF = (1LL << 60);
const double EPS = (1 >> 30);
template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b; return 1;} return 0;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b; return 1;} return 0;}



signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(15);
    //---------------------------------------------
    
    int n;
    cin>>n;
    vector<int> a(n);
    REP(i,n) cin >> a[i];
    bool flag=false;
    map<int,int> mp;
    rep(i,n){
        mp[a[i]]++;
    }
    for(auto &x : mp){
        if(x.fs==0&&x.sc==n) flag=true;
    }
    ll memo=0;
    for(auto &x : mp){
        if(x.fs==0&&x.sc==n/3) memo++;
        if(x.sc==n*2/3) memo++;
    }
    if(memo==2) flag=true;
    memo=0;
    ll h=0;
    for(auto &x : mp){
        h^=x.fs;
        if(x.sc==n/3) memo++;
    }
    if(memo==3&&h==0) flag=true;

    if(flag){
        cout<<"Yes"<<endl;
    }
    else{
        cout<<"No"<<endl;
    }

    

    
}

Measured memory_bytes: 5760
n=int(input())
l=list(input().split() for i in range(n))
for i in range(n):
    l[i].append(i+1)
for i in range(n):
    l[i][1]=-int(l[i][1])
l.sort()
for i in range(n):
    
    print(l[i][2])



Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define ll long long
#define ld long double
 
using namespace std;
 
const ll MOD = 1000000007;
 
int main()
{
    int n,i,j;
    cin>>n;
    vector<ld>dp(n+1);
    ld p;
    
    dp[0]=1;
    for(i=0;i<n;i++)
    {
    	cin>>p;
    	
    	for(j=i+1;j>=0;j--)
    	{
    		dp[j]=dp[j]*(1-p);
    		if(j>0)
    		dp[j]+=dp[j-1]*p;
		}
	}
	ld ans=0;
	for(i=n/2+1;i<=n;i++)
	ans+=dp[i];
	
	cout<<fixed<<setprecision(20)<<ans;
}

Measured memory_bytes: 384
N, X, Y = map(int, input().split())
X,Y = X-1, Y-1

ans = [0] * N
 
for i in range(N-1):
  for j in range(i+1, N):
    d = min(j-i, abs(i-X) + abs(j-Y) + 1)
    ans[d] += 1

print(*ans[1:], sep='\n')


Measured memory_bytes: 3444
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <map>
#include <stack>
#include <queue>
#include <iomanip>
using namespace std;
using ll = long long;
using P = pair<int, int>;


int main()
{
    int n;
    cin >> n;
    vector<int> s(n);
    int sum = 0;
    for (int i = 0; i < n; ++i)
    {
        cin >> s[i];
        sum += s[i];
    }
    if (sum % 10 != 0)
    {
        cout << sum << endl;
        return 0;
    }

    sort(s.begin(), s.end());
    for (int i = 0; i < n; ++i)
    {
        if (s[i] % 10 != 0)
        {
            cout << sum - s[i] << endl;
            return 0;
        }
    }
    cout << 0 << endl;
    return 0;
}


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

int main()
{
    int x,a,b;
    cin>>x>>a>>b;
    if((b-a)<=0)
    {
        cout<<"delicious"<<endl;
    }
    else if((b-a)<=x)
    {
        cout<<"safe"<<endl;
    }
    else
    {
        cout<<"dangerous"<<endl;
    }
    return 0;
}

Measured memory_bytes: 256
S = input()
MOD = 10**9 + 7
dp = [[0]*4 for _ in range(100005)]
dp[0][0] = 1
for i in range(len(S)):
    for j in range(4):
        if S[i] != '?':
            dp[i+1][j] += dp[i][j]
            dp[i+1][j] %= MOD
        else:
            dp[i+1][j] += 3*dp[i][j] % MOD
            dp[i+1][j] %= MOD
    if S[i] == 'A' or S[i] == '?':
        dp[i+1][1] += dp[i][0]
        dp[i+1][1] %= MOD
    if S[i] == 'B' or S[i] == '?':
        dp[i+1][2] += dp[i][1]
        dp[i+1][2] %= MOD
    if S[i] == 'C' or S[i] == '?':
        dp[i+1][3] += dp[i][2]
        dp[i+1][3] %= MOD
print(dp[len(S)][3])


Measured memory_bytes: 32040
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rep1(i, n) for(int i = 1; i <= (int)(n); i++)
#define showmap(is, js, x) {rep(i, is){rep(j, js){cout << x[i][j] << " ";}cout << endl;}}
#define show(x) {for(auto i: x){cout << i << " ";} cout<<endl;}
#define showm(m) {for(auto i: m){cout << m.x << " ";} cout<<endl;}
typedef long long ll;
typedef pair<int, int> P;
typedef pair<ll, ll> llP;
ll gcd(int x, int y){ return y?gcd(y, x%y):x;}
ll lcm(ll x, ll y){ return (x*y)/gcd(x,y);}


int main()
{
    int n;
    cin >> n;
    vector<ll> a;
    rep(i, n){ ll tmp; cin >> tmp; a.push_back(tmp);}

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

    ll ans = 0;
    rep(i, n){
        if(i==0)continue;
//        cout << a[i/2];
        ans += a[i/2];
    }
    cout << ans << endl;
}



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

using namespace std;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  int n;
  while (cin >> n) {
    int prime_table[1000000] = {};
    for (int i = 2; i <= n; i ++) {
      if (prime_table[i] == 0) {
        for (int j = 2; j <= n / i; j ++) {
          prime_table[i * j] = 1;
        }
      }
    }
    int count = 0;
    for (int i = 2; i <= n; i ++) {
      if (prime_table[i] == 0) {
        count += 1;
      }
    }
    cout << count << endl;
  }
}


Measured memory_bytes: 7040
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define dl double long
const int INF=0x3fffffff;
const ll MOD=1000000007;
const ll MODD=998244353;
#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)
template<typename T> bool chmax(T &m, const T q) { if (m < q) {m = q; return true;} else return false; }
template<typename T> bool chmin(T &m, const T q) { if (m > q) {m = q; return true;} else return false; }

int main()
{
  ll N, R=0, G=0, B=0, mm=0;
  string S;
  cin >> N >> S;

  rep(i, N){
    if(S[i] == 'R') ++R;
    if(S[i] == 'G') ++G;
    if(S[i] == 'B') ++B;
  }

  for(ll i=1; 3+2*(i-1)-1 < N; ++i){
    for(ll j=0; j+2*i < N; ++j){
      if(S[j+0*i] != S[j+1*i] && S[j+0*i] != S[j+2*i] && S[j+1*i] != S[j+2*i]){
            ++mm;
      }
    }
  }

  cout << R*G*B-mm << "\n";
}

Measured memory_bytes: 3624
#include <iostream>
#include <numeric>
#include <vector>
#include <cmath>
#include <string>
#include <algorithm>
#include <set>
#include <map>
using namespace std;
using ll=long long;
#define rep(i,a,b) for(ll i=a;i<b;i++)
int main(){
    int n;
    cin>>n;
    if(n>17|n%4==0|n%7==0|n==11|n==15) {
        cout<<"Yes";
        return 0;
    }
    else cout<<"No";
}

Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int N[100],L,f,i,j,t,F[1000000];
int c(const void *a,const void *b)
{
	return f?*(char*)a-*(char*)b:*(char*)b-*(char*)a;
}
int main()
{
	for(;scanf("%d%d",&N[0],&L),L;)
	{
		memset(F,0,sizeof(F));
		F[N[0]]=1;
		for(i=0;;i++)
		{
			char m[9]={0},M[9]={0};
			for(j=0,t=N[i];j<L;j++,t/=10)m[j]=t%10?t%10+'0':'0';
			strcpy(M,m);
			f=0;qsort(M,L,sizeof(char),c);
			f=1;qsort(m,L,sizeof(char),c);
			N[i+1]=atoi(M)-atoi(m);
			if(F[N[i+1]]==1)break;
			else F[N[i+1]]=1;
		}
		for(j=0;N[j]!=N[i+1];j++);
		printf("%d %d %d\n",j,N[j],i-j+1);
	}
	return 0;
}

Measured memory_bytes: 4524
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<utility>
#include<vector>
#include<queue>
#include<functional>
#include<map>
#include<set>
#include<cstring>
#include<string>
#include<stack>
#include<stdlib.h>
#include<math.h>
using namespace std;
#define int long long
typedef pair<int, int> pii;
typedef pair<int, char> pic;
typedef priority_queue<pii, vector<pii>, greater<pii> > RPQ;
#define mk make_pair
#define INF (1 << 30)
#define INFL (1ll << 60ll)
#define mod 1000000007

int N;
struct node{
    string s;
    int p;
    int id;
};

bool cmp(const node &a, const node &b){
    if(a.s < b.s){
        return true;
    }
    else if(a.p > b.p && a.s == b.s){
        return true;
    }
    return false;
}

node A[110];

signed main(){
    cin >> N;
    for(int i = 0; i < N; i++){
        int a;
        string s;
        cin >> s >> a;
        A[i] = {s, a, i + 1};
    }
    sort(A, A + N, cmp);
    //printf("\n");
    for(int i = 0; i < N; i++){
        cout/* << A[i].s << " " << A[i].p << " " */ << A[i].id << endl;
    }

    return 0;
}
/*


*/

Measured memory_bytes: 256
N = int(input())
a = N/1.08
b = (N+1)/1.08

inta = int(a)
if inta==a:
    print(inta)
elif inta==int(b) or (int(b)==b and inta+1==int(b)):
    print(':(')
else:
    print(inta+1)

Measured memory_bytes: 3064
#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;


long long gcd(long long a, long long b){
  long long x, y;
  x = max(a, b);
  y = min(a, b);

  if(y==0){
    return x;
  }

  return gcd(y, x%y);
}


int T;
long long A, B, C, D;

int main(){
  cin >> T;
  for(int t = 0; t < T; t++){
    cin >> A >> B >> C >> D;
    if(D < B || A < B){
      cout << "No" << endl;
      continue;
    }
    long long E = gcd(B, D);
    long long n = (A-B)/E + 1;
    //printf("gcd = %lld, n = %lld\n", E, n);
    if(A-B < n*E && n*E < A-C){
      cout << "No" << endl;
      continue;
    }
    cout << "Yes" << endl;
  }
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
#define N 100001
int main() {
  int n;
  int* v = new int[N];
  cin >> n;
  for(int i=0;i<n;i++) cin >> v[i];

  int* ki = new int[N];
  for(int i=0;i<N;i++) ki[i] = 0;
  int* gu = new int[N];
  for(int i=0;i<N;i++) gu[i] = 0;

  int n1gu = 0, n2gu = 0, n1ki = 0, n2ki = 0;
  for(int i=0;i<n;i++){
    if(i%2==0) {
      gu[v[i]] += 1;
      if(gu[v[i]] > gu[n1gu]){
        n2gu = n1gu;
        n1gu = v[i];
      } else if(v[i] != n1gu && gu[v[i]] > gu[n2gu]){
        n2gu = v[i];
      }
    }
    else {
      ki[v[i]] += 1;
      if(ki[v[i]] > ki[n1ki]){
        n2ki = n1ki;
        n1ki = v[i];
      } else if(v[i] != n1ki && ki[v[i]] > ki[n2ki]){
        n2ki = v[i];
      }
    }
  }
  int ans = 0;
  if(n1gu != n1ki){
    cout << n - gu[n1gu] - ki[n1ki] << endl;
    return 0;
  } else {
    if(gu[n1gu] + ki[n2ki] > gu[n2gu] + ki[n1ki]){
      cout << n - gu[n1gu] - ki[n2ki] << endl;
      return 0;
    } else {
      cout << n - gu[n2gu] - ki[n1ki] << endl;
      return 0;
    }
  }
}


Measured memory_bytes: 1408
#include<bits/stdc++.h>
#define fo(i,a,b) for(int i=(a);i<(b);i++)
#define qi queue<int>
#define vi vector<int>
#define ll long long
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define pii pair<int,int>
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define fi first
#define se second
#define prq priority_queue
#define foreach(it,c) for(__typeof((c).begin()) it=c.begin();it!=c.end();it++)
//#define KEY_DOWN(VK_NONAME) ((GetAsyncKeyState(VK_NONAME) & 0x8000) ? 1:0)
using namespace std;
inline ll read(){
	ll x=0;
	int f=1;
	char c=getchar();
	for(;!isdigit(c);c=getchar()) if(c=='-')f=-f;
	for(;isdigit(c);c=getchar())x=x*10+(c-'0');
	return x*f;
}
inline void out(int x){
	if(x>=10)out(x/10);
	putchar(x%10+'0');
}
int main(){
	//freopen("a.in","r",stdin);
	//freopen("a.out","w",stdout);
	int n,ans=0;
	string s;
	cin>>n>>s;
	fo(i,0,10) fo(j,0,10) fo(k,0,10)
	fo(x1,0,n) if(s[x1]==i+'0'){
		fo(x2,x1+1,n) if(s[x2]==j+'0'){
			fo(x3,x2+1,n) if(s[x3]==k+'0'){
				ans++;
				break;
			}
			break;
		}
		break;
	}
	cout<<ans<<endl;
	return 0;
}


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

#define PI 3.14159265358979323846

int main()
{
	int		x,n[2];
	double	t,d[2];

	while(cin >> t, t)
	{
		for(int i=1; true; i++)
		{
			n[0] = PI*i;
			n[1] = PI*i +1;

			d[0] = fabs((double)n[0]/i-PI);
			d[1] = fabs((double)n[1]/i-PI);

			x = (d[0]<d[1]?0:1);

			if(d[x] <= t)
			{
				cout << n[x] << "/" << i << endl;
				break;
			}
		}
	}

	return 0;
}

Measured memory_bytes: 0
import java.util.*;
import java.io.*;

public class Main{
    public static void main(String args[]){
        Scanner in = new Scanner(System.in);
        String patt = in.next().toLowerCase();

        int cnt = 0;

        while(true){
            String word = in.next();
            if(word.equals("END_OF_TEXT"))break;

            if(word.toLowerCase().equals(patt))cnt++;
        }   

        System.out.println(cnt);
    }
}


Measured memory_bytes: 26196
package main

import (
  "fmt"
)

func main() {
  var (
    a,b,c,d,e,k int
    )
  fmt.Scan(&a,&b,&c,&d,&e,&k)

  if e - a  <= k  {
    fmt.Println("Yay!")
  } else {
    fmt.Println(":(")
  }
}


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


int main() {
  int N;
  string result;
  cin >> N;
  int a[N];
for (int i=0; i < N; i++) cin >> a[i];

int count_odd=0, count_35=0;
for (int i=0; i < N; i++){
  if (a[i]%2==0){
    count_odd += 1;
    if((a[i]%3==0)||(a[i]%5==0)){
      count_35 += 1;
    }
  }
}

if (count_odd==count_35){
  result = "APPROVED";
}
else{
  result = "DENIED";
}
cout << result << endl;
}



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

int main() {
  int a,b;
  cin>>a>>b;
  if(a==1&&b==2||b==1&&a==2) cout<<3<<endl;
  else if(a==1&&b==3||b==1&&a==3) cout<<2<<endl;
  else cout<<1<<endl;
  return 0;
}



Measured memory_bytes: 256
x, y = map(int, input().split())

h, w = min(x, y), max(x, y)

if h % 3 == 0 or w % 3 == 0:
    print(0)
    exit()

ans1 = h

k = h//2
if h % 2:
    for i in range(1, w):
        l = w - i
        s1 = h * i
        s2 = k * l
        s3 = (k+1)*l
        mn = min(s1, s2)
        mx = max(s1, s3)
        ans1 = min(ans1, mx-mn)

else:
    for i in range(1, w):
        l = w - i
        s1 = h*i
        s2 = k*l
        mn = min(s1, s2)
        mx = max(s1, s2)
        ans1 = min(ans1, mx-mn)

w, h = min(x, y), max(x, y)

ans2 = h

k = h//2
if h % 2:
    for i in range(1, w):
        l = w - i
        s1 = h * i
        s2 = k * l
        s3 = (k+1)*l
        mn = min(s1, s2)
        mx = max(s1, s3)
        ans2 = min(ans2, mx-mn)

else:
    for i in range(1, w):
        l = w - i
        s1 = h*i
        s2 = k*l
        mn = min(s1, s2)
        mx = max(s1, s2)
        ans2 = min(ans2, mx-mn)

print(min(ans1, ans2))


Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define Would
#define you
#define please

//世界は天才だなぁ

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


	int N;
	cin >> N;
	int S[100000];
	rep(i, N) cin >> S[i];

	ll kotae = 0;
	rep1(ab, N / 2 - 1) {
		int n = ab;
		ll kari = 0;
		bool yoyuu = (N - 1) % n;
		while (n < N - 1 - ab && (yoyuu || n * 2 < N - 1)) {
			kari += S[n] + S[N - 1 - n];
			kotae = max(kotae, kari);
			n += ab;
		}
	}
	co(kotae);



	Would you please return 0;
}

Measured memory_bytes: 768
#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>;

// #define N 100010

// int main(){
//     int n, m, h[N], ma[N];
//     cin >> n >> m;
//     rep(i,n){
//         cin >> h[i];
//         ma[i] = 0;
//     }
//     rep(i,m){
//         int a, b;
//         cin >> a >> b;
//         ma[a-1] = max(ma[a-1], h[b-1]);
//         ma[b-1] = max(ma[b-1], h[a-1]);
//     }
//     int ans = 0;
//     rep(i,n) {
//         if(h[i] > ma[i]) ans++;
//     }
//     cout << ans << endl;
//     return 0;
// }

int main(){
    int n, m;
    cin  >> n >> m;
    vector<int> h(n);
    vector<bool> ok(n, true);
    rep(i,n) cin >> h[i];
    rep(i,m) {
        int a,b;
        cin >> a >> b;
        a--;b--;
        if(h[a] <= h[b]) ok[a] = false;
        if(h[b] <= h[a]) ok[b] = false;
    }
    int ans = 0;
    rep(i,n) if(ok[i]) ans++;
    cout << ans << endl;
	return 0;
}

Measured memory_bytes: 3740
#include <stdio.h>

int main() {

	int a, b, c, d;
	
	scanf("%d", &a);
    b = a % 100 % 10;
    c = (a / 10) % 10;
  	d = a / 100;
    printf("%d", b + c + d);
	
	return (0);

}

Measured memory_bytes: 1648
N = int(input())
w_list = [""]*N
is_cor = True
for i in range(N):
  w_list[i] = input()
for i in range(N-1):
  b = w_list.copy()
  b[i] = ""
  if w_list[i][len(w_list[i])-1] != w_list[i+1][0] or w_list[i] in b:
    print("No")
    is_cor = False
    break
if is_cor:
  print("Yes")

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
int h,w;
char s[505][505],out[505][505];
int main(){
	scanf("%d%d",&h,&w);
	for(int i=1;i<=h;++i) scanf("%s",s[i]+1);
	for(int i=1;i<=h;++i,puts("")){
		if(i&1){
			for(int j=1;j<w;++j)
				putchar('#');
			if(s[i][w]=='#')
				putchar('#');
			else putchar('.');
		}
		else{
			putchar('#');
			for(int j=2;j<=w;++j)
				if(s[i][j]=='#')
					putchar('#');
				else putchar('.');
		}
	}
	puts("");
	for(int i=1;i<=h;++i,puts("")){
		if(i&1){
			for(int j=1;j<w;++j)
				if(s[i][j]=='#')
					putchar('#');
				else putchar('.');
			putchar('#');
		}
		else{
			if(s[i][1]=='#')
				putchar('#');
			else putchar('.');
			for(int j=1;j<w;++j)
				putchar('#');
		}
	}
}

Measured memory_bytes: 1024
S = input()
s = [S[_] for _ in range(len(S))]
s.sort()

judge = "abcdefghijklmnopqrstuvwxyz"
for i in range(len(s)):
  judge = judge.lstrip(s[i])

if judge == "":
  print("None")
else:
  print(judge[0])

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

int main(void){
	string day[7]={	"Thursday",
 					"Friday",
 					"Saturday",
					"Sunday",
					"Monday",
 					"Tuesday",
 					"Wednesday"
				};
	int month[13]={0,31,29,31,30,31,30,31,31,30,31,30,31};
	int m,d;
	while(cin >> m >> d,m|d){
		int r=-1;
		for(int i=0;i<m;i++)
			r+=month[i];
		r+=d;
		r%=7;
		cout << day[r] << endl;
	}
	return 0;
}

Measured memory_bytes: 1192
<?php
$n_people = intval(fgets(STDIN));
while ($n_people != 0) {

    $input_line = rtrim(fgets(STDIN));
    $number = preg_split("/[\s,]+/", $input_line);
    // 10 20 30 60 文字列配列
    $income = [];
    for ($i = 0; $i < $n_people; $i++){
        // 配列の作りかた
        $income[] = intval($number[$i]);
        // 10 20 30 60 「数字」列配列
    }
    
    $avg = array_sum($income) / $n_people;
    
    $count = 0;
    for ($i = 0; $i < $n_people; $i++) {
        if ($income[$i] <= $avg) {
            $count += 1;
        }
    }
    print $count;
    print "\n";
    $n_people = intval(fgets(STDIN));
}


Measured memory_bytes: 12632