akhauriyash/Code-Regression huggingface dataset:
// When you are hungry for something and you're determined and you're focused 
// and you're committed to something it's hard to surrender, isn't it?

#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
#define endl "\n"
#define ll long long 
#define int ll
#define mod 1000000007
#define mod1 1000000006
#define modi 998244353
#define setbit(x) __builtin_popcount(x)
#define fff(i,n) for(int i=0;i<n;i++)
#define fab(i,a,b) for(int i=(a);i<(b);i++)
#define ff first
#define ss second
#define pb push_back
vector<ll> vi[300005];
int color[100005];
ll pa[500005];
ll si[500005];
#define pb push_back
bool visi[1000005]={false};
bool is[100005];
ll fac[10000001];
ll prime[400005];
ll bit[100005];
const long double eps = 1.0e-14;      // allowable error
#define fio ios_base::sync_with_stdio(false); cin.tie(NULL);
 
 
void fact(){
    fac[0]=1;
    for(int i=1;i<=10000000;i++){
        fac[i]=(fac[i-1]*i)%mod;
    }
    return ;
}
void sieve(){
    prime[0]=0;
    prime[1]=0;
    for(int i=2;i<400005;i++){
        prime[i]=1;
    }
    for(int i=2;i*i<400005;i++){
        if(prime[i]==1){
            for(int j=i*i;j<400005;j+=i){
                prime[j]=0;
            }
        }
    }
    
}
 
ll power(ll n , ll p ){
    if(p==0)
        return 1;
    
    ll res = power((n*n)%mod,p/2);
    if(p%2==1)
        res = (n*res)%mod;
    
    return res;
}
 
 
void upd(ll i,ll val,ll n) {
    for(;i<=n;i+=i&(-i))
        bit[i]+=val;
}
 
ll qry(ll i) {
    ll sum=0;
    for(;i>0;i-=i&(-i))
        sum+=bit[i];
    return sum;
}
 
 
ll fin(ll u) {
    if(pa[u]==u)
        return u;
    return fin(pa[u]);
}
 
void uni(ll u,ll v) {
    ll p1=fin(u);
    ll p2=fin(v);
    if(p1==p2)
        return;
    if(si[p1]<si[p2])
        swap(p1,p2);
    si[p1]+=si[p2];
    pa[p2]=p1;
    return;
}

int log(int x) {
    int i;
    for(i=0;(1<<i)<=x;i++);
    return i;
}

vector<int> osci(vector<int> v) {
	vector<int> v1;
	int n=v.size();
	int i=0,j=n-1;
	for(int k=0;k<n;k++) {
		if(k%2==0)
			v1.pb(v[i++]);
		else
			v1.pb(v[j--]);
	}
	reverse(all(v1));
	return v1;
} 
 
int32_t main() {
    fio
	cout << fixed << setprecision(15);
    
    int a,b,c,x;
    cin >> a >> b >> c >> x;
    
    int ans=0;
    fff(i,a+1) {
        fff(j,b+1) {
            fff(k,c+1) {
              if(((i*500)+(j*100)+(k*50))==x)
              ans++;
            }
        }
    }
    
    cout << ans;

	return 0;
    
}

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

int main(){
  long int n ; cin >> n ;
  if(n%2==1){
    cout << 0 << endl ;
    return 0 ;
  }
  n /= 2 ;
  long int ans = 0 ;
  while(n>0){
    ans += n/5 ;
    n /= 5 ;
  }
  cout << ans << endl ;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main()
{
    ll a, b, c;
    cin >> a >> b >> c;
    ll l = min(a, min(b, c));
    ll h = max(a, max(b, c));
    ll m = a + b + c - l - h;
    
    if(h % 2 == 0)
    {
        cout << 0 << endl;
    }
    else
    {
        cout << l * m << endl;
    }
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define mk make_pair
#define rint register int
#define int long long 
using namespace std;
inline int read(){int w=1,s=0;char ch=getchar();while(!isdigit(ch)){if(ch=='-')w=-1;ch=getchar();}while(isdigit(ch)){s=s*10+ch-'0';ch=getchar();}return w*s;}
int q[1000010],val[1000010];
ll ans[1000010];
char s[1000010];
int n,Q;
inline ll getans(int k){
	int head=1,tail=0;ll curans=0,tag=0;ll ans=0;
	for(rint i=1;i<=n;++i){
		while(head<=tail&&i-q[head]>=k) curans-=val[head]+tag,head++;
		if(s[i]=='D'){
			q[++tail]=i;
			val[tail]=-tag;
		}
		if(s[i]=='M') tag++,curans+=(tail-head+1);
		if(s[i]=='C'){
			ans+=curans;
		}
	}return ans;
}
signed main()
{
	n=read();scanf("%s",s+1);
	Q=read();
	for(rint i=1;i<=Q;++i){
		int k=read();
		cout<<getans(k)<<"\n";
	}
	return 0;
}


Measured memory_bytes: 17408
/******************************************
 * Author : sinon.su96@gmail.com
 * Or : ahafid96@gmail.com
 * Username : SINON
 * Date : April 2020
 * Civil and Structural engineering student
 * at Ecole des Ponts ParisTech
 * ***************************************/

//Import usefull library :
#include <iostream>
#include <fstream>
#include <vector>
#include <set>
#include <map>
#include <cstring>
#include <string>
#include <cmath>
#include <cassert>
#include <ctime>
#include <algorithm>
#include <sstream>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <cstdlib>
#include <cstdio>
#include <iterator>
#include <functional>
#include <bitset>
using namespace std;

//usefull abreviation
#define fi first
#define se second
#define pb push_back
#define sqr(x) (x)*(x)
typedef long long LL;
typedef unsigned long long uLL;
typedef pair<int, int> pii;
typedef pair<LL, LL> pll;
typedef vector<int> vi;


int main()
{
  long long n, k;
  long long x;
  cin >> n >> k;
  x = n%k;
  while (abs(x-k)<x){
    x = abs(x-k);
  }
  cout << x << "\n";
  return 0;
}



Measured memory_bytes: 256
open System
open System.Collections.Generic

let c5 number = 
    if number = 5 then 1
    else 0

let c7 number =
    if number = 7 then 1
    else 0

let last (abc : int list) = 
    if abc.[0] = 2 && abc.[1] = 1 then "YES"
    else "NO"


let rec check (check5, check7, index, abc : int[]) : int list= 
    if index = abc.Length then [check5 ; check7]
    else check (check5 + (c5 abc.[index]), check7 + (c7 abc.[index]) ,(index + 1) ,abc)
[<EntryPoint>]
let main argv =
    
    let abcString = Console.ReadLine().Split(' ')
    let abc = Array.map (fun numberString -> int numberString) abcString

    let temp :string = (last (check (0,0,0,abc)))

    printfn "%s" temp
    
    0

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

int solve(int n)
{
  int t = 0;
  while(n > 0){
    n /= 10;
    t++;
  }
  return t;
}
int main()
{
  int n, ans = 0;
  cin >> n;
  for(int i = 1; i <= n; i++){
    if(solve(i) % 2 != 0){
      ans++;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
import Control.Applicative
import Data.List
main :: IO()
main = do
    n <- read <$> getLine
    [d, x] <- map read . words <$> getLine
    list <- sequence (replicate n (read <$> getLine))
    print $ solve list d x

solve :: [Int] -> Int -> Int -> Int
solve list d x = sum (map (num d) list) + x

num :: Int -> Int -> Int
num d a = 1 + div (d-1) a




Measured memory_bytes: 892
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        eprintln!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

use std::ascii::AsciiExt;
use std::cmp;
use std::iter::Iterator;

fn main() {
    input! {
        n:usize,
        y:usize,
    }

    for i in 0..n + 1 {
        for j in 0..n + 1 {
            if i + j > n {
                continue;
            }
            let k = n - i - j;
            if 10000 * i + 5000 * j + 1000 * k == y && k >= 0 {
                println!("{} {} {}", i, j, k);
                return;
            }
        }
    }

    println!("-1 -1 -1");
}


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

ll mod = 1e9 + 7;

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

  if (abs(N - M) > 1) {
    cout << 0 << endl;
    return 0;
  }

  ll n = 1;
  rep(i, N) {
    n *= N - i;
    n %= mod;
  }

  ll m = 1;
  rep(i, M) {
    m *= M - i;
    m %= mod;
  }

  if (N == M)
    n *= 2;

  ll ans = n * m;
  ans %= mod;
  cout << ans << endl;
}

Measured memory_bytes: 256
#include<map>
#include<set>
#include<cmath>
#include<stack>
#include<deque>
#include<queue>
#include<cstdio>
#include<string>
#include<vector>
#include<cstring>
#include<cstdlib>
#include<iostream>
#include<algorithm>
const int mod=1e9+7;
const double eps=1e-6;
const double pi=acos(-1);
const int inf=0x7fffffff;
typedef long long int ll;
typedef unsigned long long ull;
using namespace std;

int main()
{
    int a,b,c;
    scanf("%d%d%d",&a,&b,&c);
    int maxx=max(max(a,b),c);
    printf("%d\n",a+b+c-maxx);
    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
int main(){
  int a,b;
  scanf("%d %d",&a,&b);
  if(a<b){
    printf("a < b\n");
  }
  if(a>b){
    printf("a > b\n");
  }
  if(a==b){
    printf("a == b\n");
  }


  return 0;
}

Measured memory_bytes: 580
def lcm(a, b):
    if b > a:
        a, b = b, a

    x = a * b
    r = a % b
    while r != 0:
        a = b
        b = r
        r = a % b

    return x // b


A, B, C, D = map(int, input().split())
CD = lcm(D, C)
A -= 1

n = (B // C) + (B // D) - (B // CD)
n -= (A // C) + (A // D) - (A // CD)
print(B - A - n)

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define ll long long
#define f first 
#define s second
#define FIO ios_base::sync_with_stdio(false);cin.tie(NULL);
#define MAX 1000005
#define pb push_back
int flag[1000006];
ll gcd(ll a, ll b)
{
  if(a == 0)
    return b;
  return gcd(b%a,a);
}

int main(){
  FIO;
  int t,l,r,a,b;
  cin >> a >> b;
  if( a >= 13)
    cout << b;
  else if(a >= 6)
    cout << b/2;
  else 
    cout << "0";
  return 0;
}

Measured memory_bytes: 256
(defvar N (read))
(defvar infty (expt 10 10))

(loop repeat (1- N) with a = infty and b = 0
      and ha and hb = 0 and hc = (read) do
      (shiftf ha hb hc (read))
      (shiftf a b (min (+ a (abs (- ha hc)))
                       (+ b (abs (- hb hc)))))
      finally (princ b))


Measured memory_bytes: 57704
#include <iostream>
#include <algorithm>

using namespace std;

typedef long long ll;

int N, A, B, C, D;

int main() {
    cin >> N >> A >> B >> C >> D;

    B = abs(A-B);

    ll lo = 0, hi = N;
    while (hi-lo > 1) {
        ll mid = (hi+lo)/2;
        ll pos = mid * C - (N-1-mid) * D;
        if (pos <= B) lo = mid;
        else hi = mid;
    }

    ll pos_l = lo * C - (N-1-lo) * D;
    ll pos_h = lo * D - (N-1-lo) * C;
    cout << ((B >= pos_l && B <= pos_h) ? "YES" : "NO") << endl;
}

Measured memory_bytes: 256
#include <stdio.h>
int main()
{
    int A,B,C;
    scanf("%d%d%d",&A,&B,&C);
    if((B+C)>=A)
    {
        printf("%d\n",(B+C)-A);
    }
    else
        {
            printf("0\n");
        }
    return 0;
}


Measured memory_bytes: 128
#include<algorithm>
#include<bitset>
#include<cmath>
#include<complex>
#include<deque>
#include<functional>
#include<iomanip>
#include<iostream>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<stack>
#include<string>
#include<unordered_map>
#include<unordered_set>
#include<utility>
#include<vector>

using namespace std;
typedef long long ll;

#define REP(i, n) for(ll i=0;i<(ll)(n);i++)
#define RREP(i, n) for(ll i=(ll)(n-1);i>=0;i--)
#define FOR(i, a, b) for(ll i=(ll)(a); i<=(ll)(b); i++)
#define RFOR(i, a, b) for(ll i=(ll)(a);i>=(ll)(b); i--)
#define ALL(x) (x).begin(),(x).end()
#define SIZE(x) ((ll)(x).size())
#define INF 1000000000000
#define MOD 10000007
#define PB push_back
#define MP make_pair
#define F first
#define S second

signed main()
{
	ll N, D;
  	cin >> N >> D;
	int count=0;
	REP(i, N){
		ll X, Y;
		cin >> X >> Y;
		if(X*X+Y*Y<=D*D)count++;
	}
	cout << count << endl;
}


Measured memory_bytes: 3632
#include<stdio.h>
void f(int,int,int);
int ans;
int x,y;
void f(int n,int kai,int sum){
    if(n>9){
        if(sum==y&&kai==x){
            ans++;
        }
        return;
    }
    f(n+1,kai+1,sum+n);
    f(n+1,kai,sum);
}





int main(void){

    while(1){
        scanf("%d %d",&x,&y);
        ans=0;
        if(x==0&&y==0)break;
        f(0,0,0);
        printf("%d\n",ans);
    }
    return 0;
}

Measured memory_bytes: 596
#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS

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

using namespace std;

using ll = long long;
using ull = unsigned long long;

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

int main()
{
	int n;
	while (cin >> n)
	{
		if (n == 0)
		{
			break;
		}

		n = 1000 - n;

		int ans = 0;
		int x[] = {500, 100, 50, 10, 5, 1};
		for (int i = 0; i < 6; i++)
		{
			int add = n / x[i];
			ans += add;

			n -= add * x[i];
			if (n <= 0)
			{
				break;
			}
		}

		cout << ans << endl;
	}
}



Measured memory_bytes: 3076
/*input
6 5
-790013317 -192321079 95834122 418379342 586260100 802780784
-253230108 193944314 363756450 712662868 735867677
*/
#include <bits/stdc++.h>
#define fastIo ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define fi first
#define se second
#define sz size
#define pb push_back
#define mp make_pair
using namespace std;

//#define LOCAL
#ifdef LOCAL
	#define DEBUG(x) do { cout << #x << ": " << x << '\n'; } while (0)
#else
	#define DEBUG(x) 
#endif

const double EPS = 1e-9;
const double PI = 3.141592653589793238462;

const int dr[] = {1, 1, 0, -1, -1, -1, 0, 1};
const int dc[] = {0, 1, 1, 1, 0, -1, -1, -1};

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

const int MOD = 1000000007;

int main(){
	fastIo;

	int n, m;
	cin >> n >> m;

	long long ans1 = 0, ans2 = 0;
	long long x, y;
	for(int i = 0; i < n; i++){
		cin >> x;
		ans1 += (2 * i - n + 1) * x;
		ans2 %= MOD;
	}
	for(int i = 0; i < m; i++){
		cin >> y;
		ans2 += (2 * i - m + 1) * y;
		ans2 %= MOD;
	}

	cout << ((ans1 % MOD) * (ans2 % MOD)) % MOD << '\n';

	return 0;
}

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

int main() {
    int N;
    int t;
    cin >> N;
    t = N;
    int r = 0;
    for(int i = 8; i >= 0; i--){
        r += N / int(pow(10, i));
        N %= int(pow(10, i));
    }
    if(t % r == 0){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
  // ここにプログラムを追記
}



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

int main(){
    char s[6];
    for(int i = 0; i < 6; i++){
        cin >> s[i];
    }
    if(s[2] == s[3] && s[4] == s[5]) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;



}

Measured memory_bytes: 256
# coding: utf-8
# Your code here!
x=int(input())
import fractions
def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n /= i
      table.append(i)
    i += 1
  if n > 1:
    table.append(n)
  return table
while True:
  d=list((prime_decomposition(x)))
  if len(d)==1:
      break
  x+=1
print(x)


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

#define PI 3.1415926535897932
#define MOD 1000000007
#define INF 1e9

#define REP(i, n) for(int i = 0; i < (n); i++)
#define REP1(i, n) for(int i = 1; i <= (n); i++)
#define ALL(v) (v).begin(), (v).end()
#define YES cout << "YES" << endl
#define Yes cout << "Yes" << endl
#define NO  cout << "NO"  << endl
#define No  cout << "No"  << endl

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef vector<bool> vb;


void solve()
{
    int N; cin >> N;
    vi A(N), B(N), C(N-1);
    REP(i, N) cin >> A[i];
    REP(i, N) cin >> B[i];
    REP(i, N-1) cin >> C[i];

    int ans = 0;
    REP(i, N)
    {
        ans += B[A[i]-1];
        if(i == N) continue;
        if(A[i+1] == A[i]+1) ans += C[A[i]-1];
    }
    cout << ans << endl;
} 
    
int main() 
{
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(20);

    solve();

    return 0;
}

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

//#define int long long
//using ll = boost::multiprecision::cpp_int;
using ll = long long;
//constexpr int INF = 1e9;//INT_MAX=(1<<31)-1=2147483647
constexpr ll INF = (ll)1e18;//(1LL<<63)-1=9223372036854775807
constexpr ll MOD = (ll)1e9 + 7;
constexpr double EPS = 1e-9;
constexpr int dx[4]={1,0,-1,0};
constexpr int dy[4]={0,1,0,-1};
#ifdef LOCAL_ENV
	#define debug(var) std::cout<<#var" = "<<var<<std::endl
#else
	#define debug(var)
#endif
#define p(var) std::cout<<var<<std::endl
#define rep(i, n)   for(ll i=0, i##_length=(n); i< i##_length; ++i)
#define repeq(i, n) for(ll i=1, i##_length=(n); i<=i##_length; ++i)
#define all(a) (a).begin(), (a).end()
#define PI (acos(-1))
template<typename T> inline T power(T x, T n){ return n ? power(x*x%MOD,n/2)*(n%2?x:1)%MOD : 1; }
template<typename T> inline T gcd(T a, T b) { return b ? gcd(b,a%b) : a; }
template<typename T> inline T lcm(T a, T b) { return a / gcd(a,  b) * b; }
template<typename T1, typename T2>inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template<typename T1, typename T2>inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }
template<typename T1, typename T2> ostream& operator<<(ostream& s, const pair<T1, T2>& p) {return s << "(" << p.first << ", " << p.second << ")";}
template<typename T> ostream& operator<<(ostream& s, const vector<T>& v) {
	for (int i = 0, len = v.size(); i < len; ++i){
		s << v[i]; if (i < len - 1) s << "\t";
	}
	return s;
}
template<typename T> ostream& operator<<(ostream& s, const vector< vector<T> >& vv) {
	for (int i = 0, len = vv.size(); i < len; ++i){
		s << vv[i] << endl;
	}
	return s;
}
template<typename T1, typename T2> ostream& operator<<(ostream& s, const map<T1, T2>& m) {
	s << "{" << endl;
	for (typeof(m.begin()) itr = m.begin(); itr != m.end(); ++itr){
		s << "\t" << (*itr).first << " : " << (*itr).second << endl;
	}
	s << "}" << endl;
	return s;
}

/*-----8<-----8<-----*/

constexpr ll C_MAX = 100;

ll H, W, N;

void input() {
	scanf("%lld%lld%lld", &H, &W, &N);
	if(N==0){
		printf("%lld\n", (H-2)*(W-2));
		rep(i,9)printf("0\n");
		return;
	}
	vector<pair<ll,ll>> a;
	rep(i,N){
		ll s,t;
		scanf("%lld%lld", &s, &t);
		rep(j,3)rep(k,3){
			pair<ll,ll> p;
			ll h=s-2+j,w=t-2+k;
			if(h<1||w<1||H-2<h||W-2<w)continue;
			p.first=h;
			p.second=w;
			a.push_back(p);
		}

	}

	sort(a.begin(), a.end(), [](const pair<ll,ll> &x, const pair<ll,ll> &y) {
		if(x.first!=y.first)return x.first < y.first;
		return x.second < y.second;
	});

	vector<ll> ans(10,0);
	pair<ll,ll> t=a[0];
	ll c=1;
	repeq(i,a.size()-1){
		if(a[i]==t){
			c++;
		}else{
			ans[c]++;
			c=1;
			t=a[i];
		}
	}
	ans[c]++;

	ans[0]=(H-2)*(W-2);
	repeq(i,9)ans[0]-=ans[i];
	rep(i,10)printf("%lld\n", ans[i]);
}

signed main() {
	input();
	return 0;
}


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

int main(){
  int a,b,c;
  cin>>a>>b>>c;
  if(a==b&&a!=c)cout<<"Yes"<<endl;
  else if(a!=b&&a==c)cout<<"Yes"<<endl;
  else if(a!=b&&b==c)cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
}

Measured memory_bytes: 256
# encoding: utf-8
N = int(input())

# define L

# adjust
ans = ""
while N != 0:
    # print(N, ans)
    if N % 4 == 0:
        ans = "00" + ans
        N -= 0
    elif N % 4 == 1:
        ans = "01" + ans
        N -= 1
    elif N % 4 == 2:
        ans = "10" + ans
        N -= -2
    else:
        ans = "11" + ans
        N -= -1
    N = int(N / 4)
    
for i in range(len(ans)):
    if ans[i] != "0":
        print(ans[i:])
        break
else:
    print(0)


Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
#define rep2(i, x, n) for(int i = x; i <= n; i++)
#define rep3(i, x, n) for(int i = x; i >= n; i--)
#define elif else if
#define sp(x) fixed << setprecision(x)
#define pb push_back
#define eb emplace_back
#define all(x) x.begin(), x.end()
#define sz(x) (int)x.size()
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pil = pair<int, ll>;
using pli = pair<ll, int>;
using pll = pair<ll, ll>;
const ll MOD = 1e9+7;
//const ll MOD = 998244353;
const int inf = (1<<30)-1;
const ll INF = (1LL<<60)-1;
const ld EPS = 1e-10;
template<typename T> bool chmax(T &x, const T &y) {return (x < y)? (x = y, true) : false;};
template<typename T> bool chmin(T &x, const T &y) {return (x > y)? (x = y, true) : false;};

template<typename T>
struct Max_Flow{
    struct edge{
        int to; T cap; int rev;
        edge(int to, T cap, int rev) : to(to), cap(cap), rev(rev) {}
    };

    vector<vector<edge>> es;
    vector<int> d, pos;
    const T INF_T;

    Max_Flow(int n) : INF_T(numeric_limits<T>::max()){
        es.resize(n), d.resize(n), pos.resize(n);
    }

    void add_edge(int from, int to, T cap, bool directed = true){
        es[from].eb(to, cap, sz(es[to]));
        es[to].eb(from, directed? 0 : cap, sz(es[from])-1);
    }

    bool bfs(int s, int t){
        fill(all(d), -1);
        queue<int> que;
        d[s] = 0, que.push(s);
        while(!que.empty()){
            int i = que.front(); que.pop();
            for(auto &e: es[i]){
                if(e.cap > 0 && d[e.to] == -1){
                    d[e.to] = d[i]+1;
                    que.push(e.to);
                }
            }
        }
        return d[t] != -1;
    }

    T dfs(int now, int t, T flow){
        if(now == t) return flow;
        for(int &i = pos[now]; i < sz(es[now]); i++){
            edge &e = es[now][i];
            if(e.cap > 0 && d[e.to] > d[now]){
                T f = dfs(e.to, t, min(flow, e.cap));
                if(f > 0){
                    e.cap -= f;
                    es[e.to][e.rev].cap += f;
                    return f;
                }
            }
        }
        return 0;
    }

    T max_flow(int s, int t){
        T flow = 0;
        while(bfs(s, t)){
            fill(all(pos), 0);
            T f = 0;
            while((f = dfs(s, t, INF_T)) > 0) flow += f;
        }
        return flow;
    }
};

int main(){
    int N;
    cin >> N;
    Max_Flow<ll> G(N+2);
    int s = 0, t = N+1;
    ll sum = 0;
    rep2(i, 1, N){
        ll a; cin >> a;
        if(a >= 0) G.add_edge(i, t, a), sum += a;
        else G.add_edge(s, i, -a);
        for(int j = 2; i*j <= N; j++) G.add_edge(i, i*j, INF);
    }
    cout << sum-G.max_flow(s, t) << endl;
}

Measured memory_bytes: 3664
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define f first
#define s second
#define go ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define mem(arr,v) memset(arr,v,sizeof(arr))
/*bool sortbysec(const pair<int,int> &a,
              const pair<int,int> &b)
{
    return (a.second < b.second);
} */
int main()
{
     ll t,sum=0,mx=0;
     cin>>t;
     string str;
     cin>>str;
     for(int i=0;i<str.size();i++)
     {
         if(str[i]=='I')
            sum++;
         else
            sum--;
         mx=max(mx,sum);
     }
     cout<<mx<<endl;
}


Measured memory_bytes: 256
n = int(input())
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]
#print(C) #Cはn-1こなことに注意

b = sum(B)
for i in range(n-1):
    if A[i]+1 ==A[i+1]:
        b += C[A[i]-1]
print(b)

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

int main(){
  string s;
  cin >> s;
  int cnt = 0, n=s.size();
  for(int i=0; i<n; ++i){
    cnt += s[i] - '0';
  }
  cout << (cnt%9 == 0 ? "Yes":"No") << endl;
}

Measured memory_bytes: 3728
#include<iostream>
#include<vector>
using namespace std;
int main() { 
    int n;
    while (cin>>n) {
        vector<int> cnt;
        int x;
        while (n--) {
            cin>>x;
            cnt.push_back(x);
        }
        for (int i = 0 ; i < cnt.size(); i++) {
            int tmp = cnt[i];
            for (int j = i-1; j >=0; j--) {
                if (tmp < cnt[j]) cnt[j+1] = cnt[j];
                else {
                    cnt[j+1] = tmp;
                    break;
                } 
            }
            if (tmp < cnt[0]) cnt[0] = tmp;
            cout<<cnt[0];
            for (int k = 1; k < cnt.size(); k++) {
                cout<<" "<<cnt[k];
            }
            cout<<endl;
        }

    }
}

Measured memory_bytes: 3148
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <map>
#include <numeric>
using namespace std;
typedef long long ll;


int main(){
  int h,w;cin>>h>>w;
  vector<int> a(h,1),b(w,1);
  string s[h];
  for(int i=0;i<h;i++)cin>>s[i];
  for(int i=0;i<h;i++){
      bool ok=0;
      for(int j=0;j<w;j++){
          if(s[i][j]=='#'){ok=1;break;}
      }
      if(!ok)a[i]=0;
  }
   for(int i=0;i<w;i++){
      bool ok=0;
      for(int j=0;j<h;j++){
          if(s[j][i]=='#'){ok=1;break;}
      }
      if(!ok)b[i]=0;
  }
//  for(int i=0;i<h;i++)if(!a[i])cout<<i<<endl;
  for(int i=0;i<h;i++){
      if(!a[i])continue;
      for(int j=0;j<w;j++){
          if(a[i]&&b[j])cout<<s[i][j];
      }
      cout<<endl;
  }
}

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

using namespace std;
using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;

namespace
{
	struct modint
	{
		static constexpr ll MOD = 1000000007;
		ll x_;
		modint() : x_(0) {}
		modint(ll x) : x_(x % MOD) {}
		modint& operator+=(const modint& src)
		{
			if ((x_ += src.x_) >= MOD)
				x_ -= MOD;
			return *this;
		}
		modint& operator-=(const modint& src)
		{
			if ((x_ += MOD - src.x_) >= MOD)
				x_ -= MOD;
			return *this;
		}
		modint& operator*=(const modint& src)
		{
			(x_ *= src.x_) %= MOD;
			return *this;
		}

		modint& operator/=(const modint& src)
		{
			return (*this) *= src.inv();
		}
		modint inv() const
		{
			return pow(MOD - 2);
		}
		modint pow(ll t) const
		{
			if (t == 0)
				return 1;
			modint a = pow(t >> 1);
			a *= a;
			if (t & 1)
				a *= *this;
			return a;
		}
	};
	modint operator+(modint lhs, const modint& rhs)
	{
		return (lhs += rhs);
	}
}

void EducationalDP_H()
{
	int H, W;
	cin >> H >> W;
	vvi grid(H, vi(W));
	for (int i = 0; i < H; ++i)
	{
		string str;
		cin >> str;
		for (int j = 0; j < W; ++j)
		{
			grid[i][j] = str[j] == '.' ? 0 : 1;
		}
	}
	vector<vector<modint> > dp(H + 1, vector<modint>(W + 1));
	for (int i = 0; i < H; ++i)
	{
		for (int j = 0; j < W; ++j)
		{
			dp[i + 1][j + 1] = (i == 0 && j == 0) ? 1 : grid[i][j] == 1 ? 0
				: dp[i][j + 1] + dp[i + 1][j];
		}
	}
	cout << dp[H][W].x_ << endl;
}

int main()
{
	EducationalDP_H();
	return 0;
}

Measured memory_bytes: 12032
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, s, e) for (int i = (int)(s); i <= (int)(e); i++)
#define printYesNo(is_ok) puts(is_ok ? "Yes" : "No");
#define printVector(v) rep(i, v.size()) cout << v[i] << endl;

int main()
{
  int N;
  cin >> N;
  vector<int> A(N);
  rep(i, N)
  {
    cin >> A[i];
  }
  vector<int> bit_count(20, 0);
  vector<int> max_bit_count(N + 1, 0);

  long long ans = 0;
  rep(i, N)
  {
    int n = A[i];
    int bit = 0;

    int max_count = 0;
    int max_max_count = 0;
    while (n != 0)
    {
      if (n & 1)
      {
        max_count = max(max_count, bit_count[bit]);
        bit_count[bit] = i + 1;
      }
      n = n >> 1;
      bit++;
    }
    max_bit_count[i + 1] = max(max_bit_count[i], max_count);
    long long num = i - max_bit_count[i + 1] + 1;
    ans += num;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 1920
// 1_abc138_a
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

using namespace std;
#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 SZ(x) ((int)(x).size())
#define INF (1e16)
#define MOD (1000000007)
typedef long long ll;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a;
    cin >> a;
    string s;
    cin >> s;

    if(a >= 3200) cout << s << endl;
    else cout << "red" << endl;
    return 0;
}


Measured memory_bytes: 256
import java.io.*;
import java.lang.reflect.Array;
import java.util.*;

public class Main {

    Random rand = new Random();


    public void solve() throws IOException {
        int n = nextInt();
        out.print("ABC" + n);

    }


    BufferedReader br;
    StringTokenizer sc;
    PrintWriter out;

    public static void main(String[] args) throws IOException {
        Locale.setDefault(Locale.US);
        new Main().run();
    }

    void run() throws IOException {
        try {
            br = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
//            br = new BufferedReader(new FileReader("sum2.in"));
//            out = new PrintWriter(new File("sum2.out"));
            solve();
            out.close();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(1);
        }
    }

    String nextToken() throws IOException {
        while (sc == null || !sc.hasMoreTokens()) {
            try {
                sc = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                return null;
            }
        }
        return sc.nextToken();
    }

    int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }
}

Measured memory_bytes: 23508
n = int(input())

p = list(map(int,input().split()))

M = 0
m = n
count = 0

for i in range(n):
    if p[i] > M:
        M = p[i]
    else:
        pass
    if p[i] < m:
        m = p[i]
    else:
        pass
    
    if p[i] <= m:
        count += 1
    else:
        pass

print(count)

Measured memory_bytes: 24744
#[allow(unused_imports)]
use std::cmp::{max, min, Ordering};
#[allow(unused_imports)]
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};
#[allow(unused_imports)]
use std::io::{stdin, stdout, BufWriter, Write};
#[allow(unused_imports)]
use std::iter::FromIterator;
mod util {
    use std::fmt::Debug;
    use std::io::{stdin, stdout, BufWriter, StdoutLock};
    use std::str::FromStr;
    #[allow(dead_code)]
    pub fn line() -> String {
        let mut line: String = String::new();
        stdin().read_line(&mut line).unwrap();
        line.trim().to_string()
    }
    #[allow(dead_code)]
    pub fn chars() -> Vec<char> {
        line().chars().collect()
    }
    #[allow(dead_code)]
    pub fn gets<T: FromStr>() -> Vec<T>
    where
        <T as FromStr>::Err: Debug,
    {
        let mut line: String = String::new();
        stdin().read_line(&mut line).unwrap();
        line.split_whitespace()
            .map(|t| t.parse().unwrap())
            .collect()
    }
    #[allow(dead_code)]
    pub fn with_bufwriter<F: FnOnce(BufWriter<StdoutLock>) -> ()>(f: F) {
        let out = stdout();
        let writer = BufWriter::new(out.lock());
        f(writer)
    }
}
#[allow(unused_macros)]
macro_rules ! get { ( [ $ t : ty ] ) => { { let mut line : String = String :: new ( ) ; stdin ( ) . read_line ( & mut line ) . unwrap ( ) ; line . split_whitespace ( ) . map ( | t | t . parse ::<$ t > ( ) . unwrap ( ) ) . collect ::< Vec < _ >> ( ) } } ; ( [ $ t : ty ] ; $ n : expr ) => { ( 0 ..$ n ) . map ( | _ | get ! ( [ $ t ] ) ) . collect ::< Vec < _ >> ( ) } ; ( $ t : ty ) => { { let mut line : String = String :: new ( ) ; stdin ( ) . read_line ( & mut line ) . unwrap ( ) ; line . trim ( ) . parse ::<$ t > ( ) . unwrap ( ) } } ; ( $ ( $ t : ty ) ,* ) => { { let mut line : String = String :: new ( ) ; stdin ( ) . read_line ( & mut line ) . unwrap ( ) ; let mut iter = line . split_whitespace ( ) ; ( $ ( iter . next ( ) . unwrap ( ) . parse ::<$ t > ( ) . unwrap ( ) , ) * ) } } ; ( $ t : ty ; $ n : expr ) => { ( 0 ..$ n ) . map ( | _ | get ! ( $ t ) ) . collect ::< Vec < _ >> ( ) } ; ( $ ( $ t : ty ) ,*; $ n : expr ) => { ( 0 ..$ n ) . map ( | _ | get ! ( $ ( $ t ) ,* ) ) . collect ::< Vec < _ >> ( ) } ; }
#[allow(unused_macros)]
macro_rules ! debug { ( $ ( $ a : expr ) ,* ) => { eprintln ! ( concat ! ( $ ( stringify ! ( $ a ) , " = {:?}, " ) ,* ) , $ ( $ a ) ,* ) ; } }
const BIG_STACK_SIZE: bool = true;
#[allow(dead_code)]
fn main() {
    use std::thread;
    if BIG_STACK_SIZE {
        thread::Builder::new()
            .stack_size(32 * 1024 * 1024)
            .name("solve".into())
            .spawn(solve)
            .unwrap()
            .join()
            .unwrap();
    } else {
        solve();
    }
}
#[allow(dead_code)]
fn read<T>() -> Vec<T>
where T:
    std::str::FromStr,
    T::Err: std::fmt::Debug {

    let mut buf = String::new();
    stdin().read_line(&mut buf).unwrap();
    buf.split_whitespace()
        .map(|s| s.trim().parse().unwrap())
        .collect()
}

fn solve() {
    let n = get!(f64);
    let sq = n.sqrt() as u64;
    println!("{}", sq*sq);
}


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

#define REP(i, m, n) for (int i = (m); i < (int)(n); i++)
#define REPS(i, m, n) for (int i = (m); i <= (int)(n); i++)
#define rep(i, n) REP(i, 0, n)
#define reps(i, n) for (int i = 0; i <= (int)(n); i++)
#define rrep(i, x) for (int i = ((int)(x)-1); i >= 0; i--)
#define rreps(i, x) for (int i = (int)(x); i >= 0; i--)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define pb push_back
#define fi first
#define se second
typedef long long ll;
typedef pair<int, int> P;
const int inf = INT_MAX;
const ll INF = 1LL << 60;
const ll mod = 1e9 + 7;
const double EPS = 1e-10;
const double PI = acos(-1.0);
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; }
template<typename A, size_t N, typename T> void Fill(A (&array)[N], const T &val) { fill( (T*)array, (T*)(array+N), val ); }
template <class T1, class T2, class Pred = std::less<T2> >
struct sort_pair_second {
    bool operator()(const std::pair<T1,T2>&left, const std::pair<T1,T2>&right) {
        Pred p;
        return p(left.second, right.second);
    }
};

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

    string S; cin >> S;
    bool flag = false;
    rep(i, S.size()-1) if (S[i] != S[i+1]) flag = true;
    if (flag) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<map>
#include<set>
#include<string>
#include<algorithm>
#include<cmath>
#include<vector>
#include<queue>
#include<stack>
 
using namespace std;
 
#define P(p) cout<<(p)<<endl
#define rep(i,m,n) for(int i = (m); i < (int)(n); i++)
#define rrep(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define vsort(v) sort(v.begin(), v.end());
#define rvsort(v) sort(v.begin(), v.end(),greater<int>());
#define YES cout<<"YES"<< endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl  
#define yes cout<<"yes"<<endl
#define no cout<<"no"<<endl
#define ret return
#define C(i) cin>>i
#define C2(i,j) cin>>i>>j
#define C3(i,j,k) cin>>i>>j>>k
#define C4(i,j,k,m) cin>>i>>j>>k>>m
////////////////////////////////////////////////////////////

int main(){
  string s;
  cin >> s;
  rep(i,0,s.size()){
    if(s[i] == '9'){
      Yes;
      ret 0;
    }
  }
  No;
  ret 0;
}

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

afters = []
for ai in range(N):
	for sign in [-1,0,1]:
		afters.append(A[ai]+sign)
		
uniq = set(afters)

countDic = {}
sas = sorted(afters)
for a in sas:
	if a in countDic.keys():
		countDic[a] += 1
	else:
		countDic[a] = 1
	
print(max(countDic.values()))

Measured memory_bytes: 37624
import Foundation

#if swift(>=4.0)
extension String {
    func split(by separator: String) -> [String] {
        return self.components(separatedBy: separator)
    }
    func toArray() -> [String] {
        return self.map{String($0)}
    }
}
func exponentiate(_ lhs: Int, _ rhs: Int) -> Int {
    return (0..<rhs).reduce(1){i,_ in i*lhs}
}
#else
extension String {
    func split(by separator: String) -> [String] {
        return self.componentsSeparatedByString(separator)
    }
    var count: Int {
        return self.characters.count
    }
    func toArray() -> [String] {
        return self.characters.map{String($0)}
    }
    func uppercased() -> String {
        return self.uppercaseString
    }
    func lowercased() -> String {
        return self.lowercaseString
    }
}
//extension Array where Element == String {
//    func joined(separator separator: String) -> String {
//        return self.joinWithSeparator(separator)
//    }
//}
extension Array where Element: Comparable {
    func max() -> Element {
        return self.maxElement()!
    }
    func min() -> Element {
        return self.minElement()!
    }
    func sorted() -> Array {
        return self.sort()
    }
    func reversed() -> Array {
        return self.reverse()
    }
    mutating func sort() {
        self.sortInPlace()
    }
}
extension Array {
    init(repeating: Element, count: Int) {
        self.init(count: count, repeatedValue: repeating)
    }
}
func stride<T: Strideable>(from start: T, to end: T, by stride: T.Stride) -> StrideTo<T> {
    return start.stride(to: end, by: stride)
}
func exponentiate(lhs: Int, _ rhs: Int) -> Int {
    return (0..<rhs).reduce(1){i,_ in i*lhs}
}
#endif
func readInt() -> Int? {
    return Int(readLine()!)
}
func readStringSplit(by separator: String) -> [String] {
    return readLine()!.split(by: separator)
}
func readIntSplit(by separator: String) -> [Int] {
    return readLine()!.split(by: separator).map{Int($0)!}
}

/*************** テストスペース ***************/

//var min, min2, count: Int!
//for i in 1...10 {
//    let x = Int(readLine()!)!
//    if i == 1 {
//        min = x
//        count = 1
//    } else if x < min {
//        min2 = min
//        min = x
//        count = 1
//    } else if x == min && count == 1 {
//        min2 = x
//        count = 2
//    }
//}
//print(min2)

/*************** メインプログラム ***************/

let s = readLine()!.toArray().sorted().joinWithSeparator("")
let t = readLine()!.toArray().sorted().reversed().joinWithSeparator("")
if s < t {
    print("Yes")
} else {
    print("No")
}


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

int main() {
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    string s;
    cin >> s;
    int ans = 0;
    for (int i = 0; i < s.length() / 2; ++i) {
        if (s[i] != s[s.length() - i - 1]) ans++;
    }
    cout << ans << '\n';
    return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main() {
  int n, s;
  while (true) {
    cin >> n;
    if (n == 0) break;
    int m = 1001, M = -1, sum = 0;
    for (int i = 0; i < n; i++) {
      cin >> s;
      if (s < m) m = s;
      if (s > M) M = s;
      sum += s;
    }
    sum = sum - m - M;
    cout << sum / (n - 2) << endl;
  }
  
  return 0;
}

Measured memory_bytes: 1160
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        final int H = sc.nextInt();
        final int W = sc.nextInt();
        String[] C = new String[H];
        for(int i=0; i<H; i++) {
            C[i] = sc.next();
        }
        for(int i=0; i<H; i++) {
            for(int j=0; j<2; j++) {
                System.out.println(C[i]);
            }
        }
    }
}


Measured memory_bytes: 22484
class UnionFind:
    def __init__(self, n):
        self.par = [i for i in range(n+1)]
        self.rank = [0] * (n+1)

    # 検索
    def find(self, x):
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    # 併合
    def unite(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        if self.rank[x] < self.rank[y]:
            self.par[x] = y
        else:
            self.par[y] = x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1

    # 同じ集合に属するか判定
    def same_check(self, x, y):
        return self.find(x) == self.find(y)


n, m = map(int, input().split())
uf = UnionFind(n)
for i in range(m):
    a, b = map(int, input().split())
    uf.unite(a - 1, b - 1)
d = [0] * n
ans = 0
for i in range(n):
    p = uf.find(i)
    if d[p] == 0:
        ans += 1
        d[p] = 1
print(ans - 1)


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

public class Main
{

	public static void main(String[] args) throws IOException
	{
		// TODO 自動生成されたメソッド・スタブ
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		for(int i = 1;; i++)
		{
			String str = br.readLine();
			int j = Integer.parseInt(str);
			if(j == 0)break;
			System.out.println("Case " + i + ": " + j);
		}
	}

	public static String[] input(int Num) throws IOException
	{
		String str[] = new String[Num];
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str2 = br.readLine();
		int j = 0;
		for(int i = 0; i < Num; i++)
		{
			if(i < Num - 1)
			{
				str[i] = str2.substring(j, str2.indexOf(" ", j));
				j = str2.indexOf(" ", j) + 1;
			}
			else
			{
				str[i] = str2.substring(j);
			}
		}
		return str;
	}

}



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

int main() {
  string A,B; cin >> A >> B;
  int C,D; cin >> C >> D;
  string E; cin >> E;
  
  if(A == E) cout << C-1 << " " << D << endl;
  else cout << C << " " << D-1 << endl;
  
  return 0;
}

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

int T; ll a, b, c, d;

int main(){
  for (cin>>T;T--;){
    cin>>a>>b>>c>>d;
    if (a<b||d<b){ puts("No"); continue; }
    a-=b; a%=d;
    ll g=__gcd(b,d);
    puts( (c-a+d)/g < (b-1-a+d)/g? "No": "Yes");
  }
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define M 1000000007
#define F first
#define S second
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll,ll> pll;
#define pb push_back
#define M6 1000009
#define M5 500009
#define pi 3.14159265
#define epsilon 1e-6
ll power(ll x,ll n,ll m){
    ll res=1;
    while(n>0){
        if(n&1) res=(res*x)%m;
        n/=2;
        x=(x*x)%m;
    }
    return res;
}
// ll sp[M6*10];
// void sieve(){
//     for(int i=2;i<M6*10;i++) sp[i]=i;
//     for(int i=2;i*i<M6*10;i++){
//         if(sp[i]!=i) continue;
//         for(int j=i*2;j<M6*10;j+=i) {
//             if(sp[j]==j) sp[j]=i;
//         }
//     }
// }
ll n,m,A[M5];
ld K[M5],C[M5];
bool same(ld a,ld b){
    return fabs(a-b)<epsilon;
}
ll pro[M5],nlr[M5],nrl[M5],ans[M5];
int  main()
{   ios_base::sync_with_stdio (0), cin.tie (0);
    //sieve();
    //init();
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    ll tc=1,t=0,i,j,k,l,r,a,b,c;
    //cin>>tc;
    while(t++<tc){
        //cout<<"Case #"<<t<<": ";
        string s;
        cin>>s;
                n=s.size();
        for(i=n;i>=1;i--){
            if(s[i-1]=='L') a=i;
            nlr[i]=a; //cout<<a<<" ";
        }
        //cout<<"\n";
        for(i=1;i<=n;i++){
            if(s[i-1]=='R') a=i;
            nrl[i]=a; //cout<<a<<" ";
        }
        //cout<<"\n";
        for(i=1;i<=n;i++){
            ll pos;
            if(s[i-1]=='R'){
                a=nlr[i]-i;
                if(a&1) pos=nlr[i]-1;
                else pos=nlr[i];
            }
            else{
                a=i-nrl[i];
                if(a&1) pos=nrl[i]+1;
                else pos=nrl[i];
            }
            //cout<<i<<" "<<pos<<"\n";
            ans[pos]++;
        }
        for(i=1;i<=n;i++) cout<<ans[i]<<" ";
    }
    return 0;
}

Measured memory_bytes: 9680
#include <iostream>
#include <queue>
#include <algorithm>
#include <vector>

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

typedef vector<int> vi;

const int inf=1<<29;

int graph[110][110];

int main(void){
	rep(i,110)rep(j,110) graph[i][j]=inf;
	int n;
	cin >> n;
	rep(i,n){
		int f;
		cin >> f; f--;
		int num;
		cin >> num;
		rep(j,num){
			int t;
			cin >> t; t--;
			graph[f][t]=1;
		}
	}
	rep(k,n)rep(i,n)rep(j,n) graph[i][j]=min( graph[i][j] , graph[i][k]+ graph[k][j]);
	int p;
	cin >> p;
	rep(i,p){
		int s,t,v;
		cin >> s >> t >> v;
		int res=graph[s-1][t-1]+1;
		if(v>=res)
			cout << res <<endl;
		else
			cout << "NA" << endl;
	}
	return 0;
}

Measured memory_bytes: 1212
#include<bits/stdc++.h>
#define ll long long int
#define FOR(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define REP(i,n) FOR(i,0,n)
#define REP1(i,n) FOR(i,1,n)
using namespace std;

int main()
{
	int W, H, x, y, r;
	cin >> W >> H >> x >> y >> r;
	if(x - r < 0 || x + r > W || y - r < 0 || y + r > H)
		cout << "No" << "\n";
	else
		cout << "Yes" << "\n";
	return 0;
}

Measured memory_bytes: 3100