akhauriyash/Code-Regression huggingface dataset:
import std.stdio;
import std.algorithm;
import std.string;
import std.conv;
import std.math;

void main(){

    while(true){
	auto s = readln();
	if(stdin.eof()) break;
	auto s1 = split(chomp(s),',');
	real w = to!real(s1[1]);
	real h = to!real(s1[2]);
	real bmi = w / (h*h);
	if(bmi>=25) writeln(s1[0]);
    }
}

Measured memory_bytes: 2460
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int ans = 0;
		for (int i = 1; i < n + 1; i++) {
			ans += i;
		}
		System.out.println(ans);
	}
}

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

int main() {
  vector<int>n(5);
  for(int i=0; i<5; i++){
    cin >>n[i];
  }
  
  vector<int>m(5);
  
  for(int i=0; i<5; i++){
    if(n[i]%10 !=0){
      m[i] =(10-n[i]%10)*-1;
    }
    else{
      m[i] =0;
    }
  }
  
  sort(m.begin(),m.end());
  
  int x =abs(m[1]+m[2]+m[3]+m[4])+n[0]+n[1]+n[2]+n[3]+n[4];
  
  cout <<x <<endl;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
			Scanner scan = new Scanner(System.in);
			int num = scan.nextInt();
			int h = num / 3600;
			int m = (num%3600)/60;
			int s = (num%3600)%60;
			System.out.println(h + ":" + m + ":" + s);
	}
}

Measured memory_bytes: 26220
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  vector<char> a(3);
  for (char &x : a)
    cin >> x;

  int sum = 0;
  for (char x : a) {
    if (x == '1') {
      sum++;
    }
  }

  cout << sum << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<cstdlib>
#include<cmath>
#include<vector>
#include<utility>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<bitset>
#include<iomanip>
#include<list>
#include<deque>
using namespace std;
//#define MODE 1
#ifdef MODE
#define DEB(X) cout<< #X <<": "<<X<<" ";
#define DEB2(X) cout<<X<<" ";
#define END cout<<endl;
#else
#define DEB(X) {}
#define DEB2(X) {}
#define END {}
#endif
typedef long long ll;
#define int ll
#define uset unordered_set
#define umap unordered_map
//typedef std::pair<int,int> P;
struct edge{int to,cost;};
const int INF=100000000000000000;
const int INF2=9223372036854775807;
const int MOD=1000000007;
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define min(X,Y) (((int)(X)<(int)(Y))?(X):(Y))
#define max(X,Y) (((int)(X)>(int)(Y))?(X):(Y))
#define NP(X,Y) next_permutation(X,Y)
#define setdouble(X,Y) cout<<fixed<<setprecision(X)<<Y
int ceil2(int a,int b){if(a%b==0){return a/b;}else{return a/b+1;}}
int pow2(int a,int b){int r=1;for(int i=1;i<=b;i++){r*=a;}return r;}
int Log2(int a){int t=0;while(1){if(a==0||a==1){break;}a/=2;t++;}return t;}

string S;

signed main(){
	cin>>S;
	if(S.back()=='3'){
		cout<<"bon"<<endl;
	}
	else if(S.back()=='0'||S.back()=='1'||S.back()=='6'||S.back()=='8'){
		cout<<"pon"<<endl;
	}
	else{
		cout<<"hon"<<endl;
	}
	return 0;
}


Measured memory_bytes: 3636
#include <bits/stdc++.h>
#include <iostream>
#include <limits>
#include <stdio.h>
#include <algorithm>
#define INF 100000000
using namespace std;
typedef long long int ll;
typedef vector<int> vi;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) for(int i=0;i<(n);++i)


int main() {
    int N;
    cin >> N;
    vi P(N), Q(N);
    rep(i, N) cin >> P.at(i);
    rep(i, N) cin >> Q.at(i);

    vi A(N);
    rep(i, N) A.at(i) = i+1;

    int counter1 = 0;
    int counter2 = 0;

    while (P != A) {
        next_permutation(A.begin(), A.end());
        counter1++;
    }

    vi B(N);
    rep(i, N) B.at(i) = i+1;

    while (Q != B) {
        next_permutation(B.begin(), B.end());
        counter2++;
    }

    cout << abs(counter1 - counter2) << endl;
}

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

  return 0;
}


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

int main() {
  
  int N,M;
  cin >> N >> M;
    vector<int> A(M);
    vector<int> B(M);  
  for (int i = 0 ;i < M;i++){
    cin >> A.at(i) >> B.at(i);
  }
  for (int i=0;i<N;i++){
    int a;a=0;
    for (int j=0;j<M;j++){
      if (A.at(j) == i+1){
      a++;}
      if (B.at(j) == i+1){
      a++;}
    }
    cout << a << endl;
  }
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<cctype>
#include<utility>
#include<string>
#include<cmath>
#include<cstring>
#include<queue>
#include<map>
#include<set>
#include<climits>

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)

using namespace std;

typedef long long int ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;


template<typename T>
vector<T> make_v(size_t a) { return vector<T>(a); }
template<typename T, typename... Ts>
auto make_v(size_t a, Ts... ts) {
	return vector<decltype(make_v<T>(ts...))>(a, make_v<T>(ts...));
}
template<typename T, typename V>
typename enable_if<is_class<T>::value == 0>::type
fill_v(T& t, const V& v) { t = v; }
template<typename T, typename V>
typename enable_if<is_class<T>::value != 0>::type
fill_v(T& t, const V& v) {
	for (auto& e : t) fill_v(e, v);
}


#define ARRAY_MAX 100005
const int INF = INT32_MAX / 3;
const ll MOD = 1e9 + 7;

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


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


int main() {

	cin.tie(nullptr);
	ios::sync_with_stdio(false);

    int a;
    string s;
    cin >> a;
    cin >> s;
    if(a >= 3200){
        cout << s << endl;
    }else{
        cout << "red" << endl;
    }

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
using namespace std;
long long a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;
string S[1010];
int main()
{
	cin>>n>>k;
	for(i=0;i<n;i++)
	{
		cin>>S[i];
	}
	sort(S,S+n);
	for(i=0;i<n;i++)
	{
		cout<<S[i];
	}
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
#define MAX 10000000
int main()
{
  bool p[MAX+1]={0};
  int i,j;
  p[0]=p[1]=1;
  for(i=4;i<=MAX;i+=2)p[i]=1;
  for(i=3;i*i<=MAX;i+=2)
    if(!p[i])for(j=i+i;j<=MAX;j+=i)p[j]=1;

  int n;
  while(cin>>n,n){
    for(;n>13;n--)if(!p[n]&!p[n-2]&!p[n-6]&!p[n-8])break;
    cout<<n<<endl;
  }
}

Measured memory_bytes: 10000
#include<bits/stdc++.h>
using namespace std;
int main(){
    string n;
    bool flag=0;
    cin>>n;
    int len=n.length()-1;
    for(int i=0;i<=len;i++){
        if(n[i]=='C')flag=1;
        if(flag&&n[i]=='F'){
            puts("Yes");
            return 0;
        } 
    }
    puts("No");
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <cmath>
#include <numeric>
#include <utility>
#include <iomanip>

using namespace std;
using int64 = long long;

struct aaa{aaa(){cin.tie(nullptr); ios::sync_with_stdio(false); cout<<fixed<<setprecision(20);};}aaa;

int main() {
    int d, t, s;
    cin >> d >> t >> s;
    cout << ((double)d/s<=t?"Yes":"No") << endl;
}


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

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

#define rep(i, n) for(int i = 0; i < (n); i++)
#define repto(i, n) for(int i = 0; i <= (n); i++)
#define all(c) (c).begin(), (c).end()
#define uniq(c) c.erase(unique(all(c)), (c).end())
#define _1 first
#define _2 second
#define pb push_back
#define mp make_pair
#define INF 1145141919
#define MOD 1000000007
#define DEBUG(x) cout << #x << ": " << x << endl;
template<typename T> T gcd(T a, T b) { if (b == 0) return a; return gcd(b, a % b); }

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

  int x, y;
  cin >> x >> y;
  if (y % 2 == 0 && y>=2*x && y <=4*x)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}


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

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

  ll N, M; cin >> N >> M;
  ll *A = new ll[M];
  for (int i = 0; i < M; i++) {
    cin >> A[i];
  }

  for (int i = 0; i < M; i++) {
    N -= A[i];
  }
  if (N < 0) {
    cout << "-1" << endl;
  } else {
    cout << N << endl;
  }

  return 0;
}


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

int main()
{
  int n;
  cin>>n;
  map<string,int> m;
  string s;
  for(int i=0;i<n;i++)
  {
    cin>>s;
    if(m.find(s)==m.end())
      m.insert(make_pair(s,1));
    else
       m[s]++;
  }
  vector<int> v;
  for(auto it=m.begin();it!=m.end();it++)
  {
  	v.push_back(it->second);
  }
  sort(v.begin(),v.end(),greater<int>());
  int max=v[0];
  for(auto it=m.begin();it!=m.end();it++)
  { if(it->second==max)
    cout<<it->first<<"\n";
  }
  return 0;
}
    

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

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

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

    int a[n];
    rep(i, n){
        cin >> a[i];
    }

    rep(i, n - 1){
        a[i + 1] = gcd(a[i], a[i+1]);
    }

    cout << a[n - 1] << endl;
    return 0;
}


Measured memory_bytes: 640
import java.util.Scanner;

public class Main {
  
  public static void main(String[] args) {
    Scanner input = new Scanner(System.in);
    int[] h = new int[10];
    
    for (int i = 0; i < 10; i ++) {
      h[i] = input.nextInt();
      int j = i;
      while (j > 0 && h[j] > h[j - 1]) {
        int t = h[j];
        h[j] = h[j - 1];
        h[j - 1] = t;
        j --;
      }
    }
    
    for (int i = 0; i < 3; i ++)
      System.out.println(h[i]);
  }

}

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

const int MAXN = 2e5+4;
int a[MAXN];
const int MAXM = 1e6;
bool flag[MAXM+4];

int main() {
	int n;
	scanf("%d", &n);
	for (int i=1; i<=n; i++) {
		scanf("%d", &a[i]);
	}

	sort(a+1, a+n+1);

	int ans = 0;
	for (int i=1; i<=n; i++) {
		//判断
		if (false==flag[a[i]]) {
			if (a[i]!=a[i+1]) {
				ans++;
			}

			for (int j=1; a[i]*j<=MAXM; j++) {
				flag[a[i]*j] = true;
			}
		}
	}

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

	return 0;
}

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

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
#define FOR(i, a, b) for (int (i) = (a); (i) <= (b); (i)++)
#define ROF(i, a, b) for (int (i) = (a); (i) >= (b); (i)--)
#define REP(i, n) FOR(i, 0, (n)-1)
#define sqr(x) ((x) * (x))
#define all(x) (x).begin(), (x).end()
#define reset(x, y) memset(x, y, sizeof(x))
#define uni(x) (x).erase(unique(all(x)), (x).end())
#define BUG(x) cerr << #x << " = " << (x) << endl
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define _1 first
#define _2 second
#define chkmin(a, b) a = min(a, b)
#define chkmax(a, b) a = max(a, b)

ll a, b;

int main() {
  cin >> a >> b;
  cout << a / __gcd(a, b) * b;
}


Measured memory_bytes: 256
#include<cstdio>
#include<queue>
#include<utility>
#include<cstring>
#include<stack>
#include<algorithm>
#include<cmath>
#include<iostream>
#include<map>
#define MAX_N 100001
#define INF_INT 2147483647
#define INF_LL 9223372036854775807
#define REP(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> P;
void init(int n);
int find(int n);
void unite(int x,int y);
bool same(int x, int y);
ll bpow(ll,ll,ll);
typedef vector<int> vec;
typedef vector<vec> mat;
mat mul(mat &A,mat &B);
mat pow(mat A,ll n);
int dx[4] = {1,0,0,-1};
int dy[4] = {0,1,-1,0};


bool cmp_P(const P &a,const P &b){
  return a.second < b.second;
}
int main()
{
  int N,nT,t[201],T[401],v[201],tmp,nv,ov;
  double S=0;
  vector<int> mv(40002,0);
  cin >> N;
  T[0] = 0;
  REP(i,N){
    cin >> t[i];
    t[i] *= 2;
    T[i+1] = T[i] + t[i];
  }
  REP(i,N){
    cin >> v[i];
    v[i] *= 2;
  }
  v[N] = 0;
  mv[T[N]+1] = -1;
  for(int i=N;i>=1;i--){
    nT = T[i];
    for(int j=nT;j>T[i-1];j--){
      if(j == nT){
        mv[j] = min(min(v[i-1],v[i]), mv[j+1] + 1);
      }else{
        mv[j] = min(v[i-1], mv[j+1] + 1);
      }
      
    }
   
  }
  nv = 0;
  for(int j=0;j<N;j++){
    for(int i=T[j];i<T[j+1];i++){
      ov = nv;
      nv = min(mv[i+1], min(nv + 1,v[j]));
      S += (double)(ov+nv)/2.00;
    }
  }
  printf("%.10lf\n",S/4.0);
  return 0;
}

int par[MAX_N];
int ranks[MAX_N];

//n要素で初期化
void init(int n){
  REP(i,n){
    par[i] = i;
    ranks[i] = 0;
  }

}

//木の根を求める
int find(int x){
  if(par[x] == x){
    return x;
  }else{
    return par[x] = find(par[x]);
  }
}

void unite(int x,int y){
  x = find(x);
  y = find(y);
  if(x == y) return ;
  if(ranks[x] < ranks[y]){
    par[x] = y;
  }else{
    par[y] = x;
    if(ranks[x] == ranks[y]) ranks[x]++;
  }
}

bool same(int x, int y){
  return find(x) == find(y);
}

ll bpow(ll a, ll n,ll mod){
  int i = 0;
  ll res=1;
  while(n){
    if(n & 1)
      res = (res*a) % mod;
    a = (a*a) % mod;
    n >>= 1;
  }
  return res;
}
const int MOD = 1000000007;
mat mul(mat &A, mat &B){
  mat C(A.size(),vec(B[0].size()));
    REP(i,A.size())REP(k,B.size())REP(j,B[0].size()){
    C[i][j] = (C[i][j] + A[i][k] * B[k][j]) % MOD;
  }
  return C;
}

mat pow(mat A,ll n)
{
  mat B(A.size(),vec(A.size()));
  REP(i,A.size()){
    B[i][i] = 1;
  }
  while(n > 0){
    if ( n & 1) B = mul(B,A);
    A = mul(A,A);
    n >>= 1;
  }
  return B;
}


Measured memory_bytes: 384
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <queue>
#include <map>
#include <numeric>
#include <unordered_map>
#include <iomanip>
#include <functional>
#include <bitset>
#include <complex>

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define all(x) (x).begin(),(x).end()

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

typedef long long ll;

using namespace std;


int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;cin>>n;
  if(n>999)cout<<"ABD"<<endl;
  else cout<<"ABC"<<endl;

  return 0;

}


Measured memory_bytes: 256
N,x=map(int,input().split())
a = list(map(int,input().split()))
nin=0
ryo=x
a.sort()

for i in range(N-1):
  if ryo>=a[i]:
    ryo=ryo-a[i]
    nin+=1
if ryo==a[N-1]:
  nin+=1


print(nin)

Measured memory_bytes: 3064
m,d = map(int,input().split())


cnt = 0
for i in range(1,m+1):
    for j in range(1,d+1):
        #print(i,j)
        num = 1
        d2 = (j-j%10)//10
        d1 = j%10
        if d2 >=2 and d1 >=2:
            num =d1*d2
            #print(i,j,num,d1,d2)
        #print(i,j,num,(j-j%10),j%10)
            if num == i:
                cnt +=1
print(cnt)

Measured memory_bytes: 64844
#include<stdio.h>
#include<math.h>
#include<stdlib.h>

int isprime(int);

int main(){
  int n,i,x,ip,count=0;

  scanf("%d",&n);
  //constraint
  if(n<1 || n>10000){
    exit(1);
  }

  for(i=0;i<n;i++){
    scanf("%d",&x);
    
    ip=isprime(x);

    if(ip==1){ //prime
      count++;
    }
  }

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

  return 0;
}

//primality test
int isprime(int x){
  int i;

  if(x==2){
    return 1;
  }else if(x<2 || x%2==0){
    return 0;
  }

  i=3;

  while(i<=sqrt(x)){
    if(x%i==0){
      return 0;
    }

    i=i+2;
  }

  return 1;
}

Measured memory_bytes: 596
#include<bits/stdc++.h>
using namespace std;
long double PI=acos(-1.0);
int main(){
	int a,b,x; cin>>a>>b>>x;
	long double y=(x/(long double)a);
	long double z=(0.5*(long double)a*b); 
	if(y<z){
	 long double f=atan2(b,(2*x)/(long double)(a*b)); 
	 long double ans = (f*180)/PI;
	 cout<<fixed<<setprecision(10)<<ans<<"\n"; 
	 }
	else{
	long double f=(2*x-(a*a*b));
	f/=(a*a);
	f=b-f; 
	f=atan2(f,a); 
	long double ans=(f*180)/PI; 
	cout<<fixed<<setprecision(10)<<ans<<"\n"; 
	 }
	 return 0;
	 }

Measured memory_bytes: 3796
// inputに入力データ全体が入る
function Main(input) {
    input = input.split(" ").map(num => Number(num)).sort((a,b) => a-b);
    console.log(input[0] * input[1]/2);
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 7372
#include <iostream>







bool hantei(bool value[3][3])
{
	// yoko
	for (int i = 0; i < 3; ++i)
	{
		bool flg = true;
		for (int j = 0; j < 3; ++j)
		{
			flg &= value[i][j];
		}
		if (flg)
			return true;
	}

	// tate
	for (int i = 0; i < 3; ++i)
	{
		bool flg = true;
		for (int j = 0; j < 3; ++j)
		{
			flg &= value[j][i];
		}
		if (flg)
			return true;
	}

	// naname
	{
		bool flg = true;
		for (int j = 0; j < 3; ++j)
		{
			flg &= value[j][j];
		}
		if (flg)
			return true;
	}
	{
		bool flg = value[0][2] & value[1][1] & value[2][0];
		if (flg)
			return true;
	}


	return false;
}




int main(int argc, char** argv)
{
	int bingo[3][3];

	for (int i = 0; i < 3; ++i)
	{
		int a, b, c;
		std::cin >> a >> b >> c;
		bingo[i][0] = a;
		bingo[i][1] = b;
		bingo[i][2] = c;
	}

	int count;
	std::cin >> count;

	bool flg[3][3] = { false };
	for (int i = 0; i < count; ++i)
	{
		int value;
		std::cin >> value;

		for (int i = 0; i < 3; ++i)
		{
			for (int j = 0; j < 3; ++j)
			{
				if (bingo[i][j] == value)
				{
					flg[i][j] = true;
					goto END;
				}
			}
		}
	END:
		if (hantei(flg))
		{
			std::cout << "Yes" << std::endl;
			return 0;
		}
	}
	std::cout << "No" << std::endl;
	return 0;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
     
    using namespace std;
     
    int main()
    {
       int n,m,sum=0,count=0;
       cin>>n>>m;
       int a[n];
       for(int i=0;i<n;i++)
       {
           cin>>a[i];
           sum+=a[i];
       }
      float s=float(sum)/(4.0*m);
       
       for(int i=0;i<n;i++)
       {
           if(a[i]>=s)
           count++;
       }
       if(count>=m)
       cout<<"Yes"<<endl;
       else
       cout<<"No"<<endl;
     
        return 0;
    }

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

def is_even(a):
	is_even_all = True
	new_a = []
	for ai in a:
		if int(ai) % 2 == 1:
			is_even_all = False
			break
		else:
			new_a.append(int(ai / 2))
	return new_a, is_even_all
	
a = list(map(int, input().split()))
is_even_all = True
num = 0
while is_even_all:
	a, is_even_all = is_even(a)
	if is_even_all:
		num += 1
print(num)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
int main () {
	int n;
	cin >> n;
	std::vector<int> v(n);
	for (int i = 0; i < n; ++i)
	{
		cin >> v[i];
	}
	sort(v.begin(), v.end());
    reverse(v.begin(),v.end());
	int sumA = 0;
	int sumB = 0;
	for (int i = 0; i < n; ++i)
	{
		if(i % 2 == 0){
			sumA += v[i];
		}else{
			sumB += v[i];
		}
	}
	cout << sumA - sumB << endl;
}

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

int H, W, N;

int painted_cells(int row, int col) {
	return W * row + H * col - row * col;
}

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

    int ans = 9999999;
    for (int i=0; i<=H; i++) {
    	for (int j=0; j<=W; j++) {
    		int p = painted_cells(i, j);

    		if (p >= N) {
    			int c = i + j;
    			if (ans > c) ans = c;
    		}
    	}
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
//----AUTHOR:kkdrummer----/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include<ext/rope>
using namespace __gnu_cxx;
using namespace __gnu_pbds;
using namespace std;
typedef    long long   ll;
typedef    long double   ld;
//typedef    unordered_set<ll>   usll;
//typedef    unordered_multiset<ll>   umsll;
typedef    multiset<ll>   msll;
typedef    set<ll>   sll;
typedef    vector<ll>   vll;
typedef    pair<ll,ll>   pll;
typedef    vector<pll>   vpll;
typedef    priority_queue<ll>   pqll;
typedef    vector<int>   vi;
typedef    set<int>   si;
typedef    multiset<int>   msi;
//typedef    unordered_multiset<int>   umsi;
//typedef    unordered_set<int>   usi;
typedef     pair<int,int>   pi;
typedef    vector<pi>   vpi;
typedef    pair<double,double>   pd;
typedef    vector<pd>   vpd;
typedef    priority_queue<int>   pqi;
typedef    tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>   ind_set;
typedef    tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update>   ind_setll;
#define    in   insert
#define    fi   first
#define    se   second
#define    pb   push_back
#define    mp   make_pair
#define    be   begin
#define    en   end
#define    itr   iterator
#define io ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define    mo   1000000007
#define    inf  9223372036854775807
#define    ninf   -inf
#define    ima   2147483647
#define    imi   -ima
#define    oncnt    __builtin_popcount
#define    zerobegin   __builtin_clz
#define    zeroend   __builtin_ctz
#define    parity   __builtin_parity
#define all(x) x.be(),x.en()
#define    eps   1e-9
#define    coutd   cout<<setprecision(10)<<fixed
const    ld   PI=3.14159265359;
inline ll modpow(ll x,ll n){if(n==0)return 1;if(n==1)return(x%mo);ll u=(modpow(x,n/2));u=(u*u)%mo;if(n%2!=0)u=(u*x%mo)%mo;return u;}
inline ll modinv(ll x){return modpow(x,mo-2);}
inline ll mmul(ll a,ll b){    if(a>=mo)a=a%mo;if(b>=mo)b=b%mo;if(a*b>=mo)return(a*b)%mo;return(a*b);}
inline ll madd(ll a, ll b){if(a>=mo)a=a%mo;if(b>=mo)b=b%mo;if(a+b>=mo)return(a+b)%mo;return(a+b);}
inline ll msub(ll a, ll b){if(a>=mo)a=a%mo;if(b>=mo)b=b%mo;return(((a-b)%mo+mo)%mo);}
inline ll mdiv(ll a,ll bb){if(a>=mo)a=a%mo;ll b=modinv(bb);if(b>=mo)b=b%mo;if(a*b>=mo)return(a*b)%mo;return(a*b);}
inline ll gcd(ll a,ll b){return __gcd(a,b);}



int main()
{
io
int testcases=1;//cin>>testcases;
while(testcases--)
{
ld r;
cin>>r;
ld ans=(2*PI*r);
coutd<<ans;











}return 0;}


Measured memory_bytes: 3804
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;

int solve_testcase() {
    int T, D, L; cin >> T >> D >> L;
    if(T == 0) return 1;

    const int INF = 1e9;
    int last = -INF, ans = 0;
    for(int i=0; i<T; i++) {
        int x; cin >> x;
        if(last != -INF) ans++;
        if(x >= L) last = i;
        if(i - last == D) last = -INF;
    }

    cout << ans << endl;
    return 0;
}

int main() {
    while(!solve_testcase());
    return 0;
}



Measured memory_bytes: 3052
#!/usr/bin/env python
# coding: utf-8

# In[7]:


H,W = map(int, input().split())
s_mat = []
for _ in range(H):
    s_mat.append(input())


# In[32]:


dp = [[1000 for i in range(W+1)] for j in range(H+1)]
dp[0][1] = 0
dp[1][0] = 1

for h in range(H):
    for w in range(W):
        dp[h+1][w+1] = min(
            dp[h][w+1] + (s_mat[h][w] == "#" and (h==0 or s_mat[h-1][w] == ".")),
            dp[h+1][w] + (s_mat[h][w] == "#" and (w==0 or s_mat[h][w-1] == "."))
        )
        
print(dp[-1][-1])


# In[ ]:






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

namespace AtCoderBeginnerContest177
{
	class Program
	{
		static void Main(string[] args)
		{
			var source = Console.ReadLine();
			var target = Console.ReadLine();

			var result = source.Length;
			for (var i = 0; i <= source.Length - target.Length; i++)
			{
				var count = 0;
				for (var j = 0; j < target.Length; j++)
				{
					if (source[i + j] != target[j])
					{
						count++;
					}
				}
				if (result > count)
				{
					result = count;
				}
			}

			Console.WriteLine(result);
		}
	}
}


Measured memory_bytes: 25856
#include <bits/stdc++.h>
using namespace std;
int main(){
  long long a,b,ans=0,cnt1;
  cin >> a >> b;
  if(a%2==0){
    cnt1=(b-a+1)/2;
  }else{
    cnt1=(b-a)/2;
    ans=a;
  }
  if(cnt1%2==1){
    ans^=1;
  }else{
    ans^=0;
  }
  if(b%2==0){
    ans^=b;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
/*input
11 7 5
24979445 861648772 623690081 433933447 476190629 262703497 211047202 971407775 628894325 731963982 822804784
*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

#define int long long 
#define double long double
#define f first
#define s second
#define mp make_pair
#define pb push_back

#define RE(i,n) for (int i = 1; i <= n; i++)
#define RED(i,n) for (int i = n; i > 0; i--)
#define REPS(i,n) for(int i = 1; (i*i) <= n; i++)
#define REP(i,n) for (int i = 0; i < (int)n; i++)
#define FOR(i,a,b) for (int i = a; i < b; i++)
#define REPD(i,n) for (int i = n-1; i >= 0; i--)
#define FORD(i,a,b) for (int i = a; i >= b; i--)

#define all(v) v.begin(),v.end()
#define pii pair<int,int>
#define vi vector<int>
#define vvi vector<vi>
#define print(arr) for (auto it = arr.begin(); it != arr.end(); ++it) cout << *it << " "; cout << endl;
#define debug(x) cout << x << endl;
#define debug2(x,y) cout << x << " " << y << endl;
#define debug3(x,y,z) cout << x << " " << y << " " << z << endl;

typedef tree<
int,
null_type,
less<int>,
rb_tree_tag,
tree_order_statistics_node_update>
ordered_set;

const int INF = 1e18+1;
const int MOD = 1e9+7;
const double PI = 3.14159265358979323846264338;

int raise(int a,int n,int m = MOD){
  if(n == 0)return 1;
  if(n == 1)return a;
  int x = 1;
    x *= raise(a,n/2,m);
    x %= m;
    x *= x;
    x %= m;
    if(n%2)x*= a;
    x %= m;
    return x;
}

int floor1(int n,int k){
    if(n%k == 0 || n >= 0)return n/k;
    return (n/k)-1;
}

int ceil1(int n,int k){
    return floor1(n+k-1,k);
}

const int N = 2001;
int a[N];
int n,k,q;
int b[N];

bool check(int l,int r){
	int got = 0;
	int ones = 0;
	int twos = 0;
	int sz = 0;
	for(int i = 1;i <= n;i++){
		if(a[i] < l){
			if(sz >= k){
				ones = min(ones,sz-(k-1) );
				got += ones;
			}
			ones = twos = sz = 0;
		}
		else if(a[i] > r){
			twos++;
			sz++;
		}
		else{
			ones++;
			sz++;
		}
	}
	if(sz >= k){
		ones = min(ones,sz-(k-1) );
		got += ones;
	}
	return (got >= q);
}

void solve(){
  	cin >> n >> k >> q;
  	RE(i,n){
  		cin >> a[i];
  		b[i] = a[i];
  	}
  	int ans = INF;
  	sort(b+1,b+n+1);
  	//check(1,2);
  	RE(i,n){
  		if(!check(b[1],b[i]))continue;
  		int lo = 1;
  		int hi = i;
  		while(lo < hi){
  			int mid = (lo+hi+1)/2;
  			if(check(b[mid],b[i]))lo = mid;
  			else hi = mid-1;
  		}
  		ans = min(ans,b[i]-b[lo]);
  	}
  	cout << ans;
}	

signed main(){
  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
  //freopen(".in","r",stdin);freopen(".out","w",stdout);
  int t = 1;
  //cin >> t;
  while(t--){
    solve();
  }
  return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main()
{
  int a, b;
  int ans = 0;
  cin >> a >> b;
  
  if (a < 4) ans += (4-a) * 100000;
  if (b < 4) ans += (4-b) * 100000;
  
  if (a == b && a == 1) ans += 400000;
  
  cout << ans << endl;
}

Measured memory_bytes: 256
package main

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

const mod = 1000000007

// 1MB
const ioBufferSize = 1 * 1024 * 1024

var sc = func() *bufio.Scanner {
	sc := bufio.NewScanner(os.Stdin)
	sc.Buffer(make([]byte, ioBufferSize), ioBufferSize)
	sc.Split(bufio.ScanWords)
	return sc
}()

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func main() {
	a := make([]int, 5)

	for i := 0; i < 5; i++ {
		a[i] = nextInt()
	}

	last := 0
	for i := 1; i < 5; i++ {
		if a[i]%10 != 0 && a[last]%10 > a[i]%10 {
			last = i
		}
	}

	res := 0
	for i := 0; i < 5; i++ {
		if i == last {
			res += a[i]
		} else {
			res += (a[i] + 9) / 10 * 10
		}
	}

	fmt.Println(res)
}


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

int main() {
  int a, b;
  cin >> a >> b;
  if (a % 3 == 0 || b % 3 == 0 || (a + b) % 3 == 0) {
    cout << "Possible" << endl;
  } else {
    cout << "Impossible" << endl;
  }
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,o,n) for(long long i = o;i<n;i++)
#define oneforall ios::sync_with_stdio(false);cin.tie(0);
#define all(v) (v).begin(),(v).end()
#define ini(...) int __VA_ARGS__; in(__VA_ARGS__)
#define inl(...) long long __VA_ARGS__; in(__VA_ARGS__)
#define ins(...) string __VA_ARGS__; in(__VA_ARGS__)
const long long INF=1e18;
void in(){} template <typename T,class... U> void in(T &t,U &...u){ cin >> t; in(u...);}
void out(){cout << "\n";} template <typename T,class... U> void out(const T &t,const U &...u){ cout << t; if(sizeof...(u)) cout << " "; out(u...);}
typedef vector<int> vi;
typedef vector<long long> vl;
typedef long long ll;
typedef vector<pair<long,long>> vpll;
typedef vector<pair<int,int>> vpii;

struct union_find
{
	typedef vector<int> vi;
	vi par,cnt,rank;
	union_find(int x):par(x),cnt(x,1),rank(x,0){
		for (int i = 0;i < x; i++) {
			par[i] = i;
		}
	}

	int find(int x){
		if(par[x] == x)return x;
		return par[x] = find(par[x]);
	}

	void unite(int x_,int _x){
		x_ = find(x_);
		_x = find(_x);
		if(x_!=_x){
			if(rank[x_] >= rank[_x]){
				if(rank[x_] == rank[_x]){rank[x_]++;}
				par[_x] = x_;
				cnt[x_] += cnt[_x];
			}
			else{
				par[x_] = _x;
				cnt[_x] += cnt[x_];
			}
		}
	}

	int count(int x){
		return cnt[find(x)];
	}

	bool same(int x_,int _x){
		return find(x_) == find(_x);
	}

};
int main() {
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	ini(n);
	ini(n1);
	ini(n_);
	vector<vi> fr(n);
	vector<vi> bl(n);
	union_find uf(n);
	FOR(i,0,n1){
		ini(x);
		x--;
		ini(x1);
		x1--;
		fr[x].push_back(x1);
		fr[x1].push_back(x);
		uf.unite(x,x1);
	}
	FOR(i,0,n_){
		ini(x);
		x--;
		ini(x1);
		x1--;
		bl[x].push_back(x1);
		bl[x1].push_back(x);
	}
	FOR(i,0,n){
		int total = uf.count(i)-fr[i].size()-1;
		for(auto x:bl[i]){
			if(uf.same(i,x)){
				total--;
			}
		}
		cout<<total<<" ";
	}
	return 0;
}

Measured memory_bytes: 13048
fn main() {
    let s = std::io::stdin();
    let mut sc = Scanner { stdin: s.lock() };

    let n: usize = sc.read();
    let mut a: Vec<u64> = sc.vec(n);

    a.sort_by(|a, b| b.cmp(a));
    let ans: u64 = (0..n - 1).map(|k| a[(k + 1) / 2]).sum();
    println!("{}", ans);
}

pub struct Scanner<R> {
    stdin: R,
}

impl<R: std::io::Read> Scanner<R> {
    pub fn read<T: std::str::FromStr>(&mut self) -> T {
        use std::io::Read;
        let buf = self
            .stdin
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b' ' || b == b'\n' || b == b'\r')
            .take_while(|&b| b != b' ' && b != b'\n' && b != b'\r')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
            .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read()).collect()
    }
    pub fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
}

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

typedef long long lint;
#define fint register int
#define flint register lint

inline int ty()
{
	fint a=0,b=1,c=getchar();
	while(!isdigit(c))b^=c=='-',c=getchar();
	while(isdigit(c))a=a*10+c-48,c=getchar();
	return b?a:-a;
}

const int _ = 3007 , mo = 1000000007;
#define ad(a,b) (a=(1ll*a+(1ll*b%mo+mo)%mo)%mo)

int n,m;
lint f[_][_][2]={0};

int main()
{
	n=ty(),m=ty();
	for(fint i=1;i<=n;i++)f[0][i][0]=1;
	f[0][0][1]=1;

	for(fint i=0;i<m;i++)
	{
		for(fint j=0;j<=n;j++)
		{
			if(f[i][j][0])
			{
				if(j>0)ad(f[i+1][j][j==1],f[i][j][0]);// -w +w
				if(j>0)ad(f[i+1][j-1][j==1],f[i][j][0]);// -w +b
				if(j<n)ad(f[i+1][j+1][0],f[i][j][0]);// -b +w
				if(j<n)ad(f[i+1][j][0],f[i][j][0]);// -b +b
			}
			if(f[i][j][1])
			{
				if(j>0)ad(f[i+1][j][1],f[i][j][1]);// -w +w
				if(j>0)ad(f[i+1][j-1][1],f[i][j][1]);// -w +b
				if(j<n)ad(f[i+1][j+1][1],f[i][j][1]);// -b +w
				if(j<n)ad(f[i+1][j][1],f[i][j][1]);// -b +b
			}
		}
	}

	flint ans=0;
	for(fint i=0;i<=n;i++)ad(ans,f[m][i][1]);
	printf("%lld\n",ans);
	
	return 0;
}


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

using ll = long long;

int main() {
  int a;
  cin >> a;
  vector<int> h(a), t(a, 0);
  for (int i = 0; i < a; ++i) cin >> h[i];

  ll ans = 0;
  for (int i = 0; i < 100; ++i) {
    bool flag = false;
    for (int j = 0; j < a; ++j) {
      if (t[j] < h[j]) {
        flag = true;
        t[j] += 1;
      } else if (t[j] >= h[j]) {
        if (flag) {
          flag = false;
          ans += 1;
        }
      }
    }
    if (flag) ans += 1;
  }
  
  cout << ans << endl;
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-

import sys


def prod2d(vec1, vec2):
    return vec1[0]*vec2[1] - vec1[1]*vec2[0]

lineNumber = 0
#for line in [ "0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5", "0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0"]:
for line in sys.stdin.readlines():
    lineNumber += 1

    # get data
    List = map(float, line.strip().split())

    # set data
    nodes = [ [List[0], List[1]], [List[2], List[3]], [List[4], List[5]] ]
    point = [List[6], List[7]]

    
    ABvec = [ nodes[1][0] - nodes[0][0], nodes[1][1] - nodes[0][1] ]
    BCvec = [ nodes[2][0] - nodes[1][0], nodes[2][1] - nodes[1][1] ]
    CAvec = [ nodes[0][0] - nodes[2][0], nodes[0][1] - nodes[2][1] ]
    APvec = [ point[0] - nodes[0][0], point[1] - nodes[0][1] ]
    BPvec = [ point[0] - nodes[1][0], point[1] - nodes[1][1] ]
    CPvec = [ point[0] - nodes[2][0], point[1] - nodes[2][1] ]

    a = prod2d(CAvec, APvec)
    b = prod2d(ABvec, BPvec)
    c = prod2d(BCvec, CPvec)

    if   a > 0 and b > 0 and c > 0: print "YES"
    elif a < 0 and b < 0 and c < 0: print "YES"
    else                          : print "NO"

Measured memory_bytes: 4332
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>
#include<climits>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<bitset>
#include<iomanip>
#include<functional>
using namespace std;

#define rep(i,j,n) for(int i=(j);i<(n);i++)
#define erep(i,j,n) for(int i=(j);i<=(n);i++)
#define all(i) i.begin(),i.end()
#define rall(i) i.rbegin(),i.rend()
#define INF 1e9
const int mod = 1e9+7;

typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<string> vs;
typedef vector<vector<string>> vvs;
typedef pair<int, int> pi;
typedef long long i64;

int main() {
  int a, b, c, d, f;
  double e;
  cin >> a >> b >> c >> d >> e >> f;
  vector<double> water;
  int i = 0;
  while(100 * i * a <= f) {
    int j = 0;
    while(100 * (i * a + j * b) <= f) {
      if(i == 0 && j == 0) {
        j++;
        continue;
      }
      water.push_back(100 * (i * a + j * b));
      j++;
    }
    i++;
  }
  vector<double> sugar;
  i = 0;
  while(c * i <= f) {
    int j = 0;
    while(c * i + d * j <= f) {
      sugar.push_back(c * i + d * j);
      j++;
    }
    i++;
  }
  pi ans = {0, 0};
  double tmp = -810;
  rep(k, 0, water.size()) {
    rep(j, 0, sugar.size()) {
      if(water[k] + sugar[j] <= f && sugar[j] <= e * (water[k] / 100)) {
        double x = (100 * sugar[j]) / (water[k] + sugar[j]);
        if(x > tmp) {
          ans.first = water[k] + sugar[j];
          ans.second = sugar[j];
          tmp = x;
        }
      }
    }
  }
  cout << ans.first << " " << ans.second << endl;
}


Measured memory_bytes: 2420
def chmin(a, b):
  if a > b:
    return b
  return a

def main():
  N = int(input())
  hs = [i for i in map(int, input().split())]
  
  INF = 1e12
  dp = [INF]*N
  dp[0] = 0
  for i in range(1, N):
    dp[i] = chmin(dp[i], dp[i-1] + abs(hs[i]-hs[i-1]))
    if i > 1:
      dp[i] = chmin(dp[i], dp[i-2] + abs(hs[i]-hs[i-2]))
  print(dp[N-1])
  return

if __name__ == '__main__':
  main()

Measured memory_bytes: 13716
package main

import (
	"fmt"
	"sort"
)

type shop struct {
	a, b int
}

type byPrice []shop

func (a byPrice) Len() int           { return len(a) }
func (a byPrice) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
func (a byPrice) Less(i, j int) bool { return a[i].a < a[j].a }

func main() {
	var n, m int
	fmt.Scan(&n, &m)
	s := make([]shop, n)
	for i := 0; i < n; i++ {
		fmt.Scan(&s[i].a, &s[i].b)
	}

	sort.Sort(byPrice(s))

	c := 0
	for i := 0; i < n; i++ {
		if s[i].b >= m {
			c += s[i].a * m
			fmt.Println(c)
			return
		}
		m -= s[i].b
		c += s[i].a * s[i].b
	}
}


Measured memory_bytes: 5376
#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <math.h>
#include <iomanip>
#include <limits>
#include <list>
#include <queue>
#include <tuple>
#include <map>
#include <stack>
#include <set>
using namespace std;
#define MOD (long long int)(1e9+7)
#define ll long long int
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define reps(i,n) for(int i=1; i<=(int)(n); i++)
#define REP(i,n) for(int i=n-1; i>=0; i--)
#define REPS(i,n) for(int i=n; i>0; i--)
#define INF (int)(1123456789)
#define LINF (long long int)(112345678901234567)
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
#define chmin(a, b) a = (((a)>(b)) ? (b) : (a))
#define all(v) v.begin(), v.end()

const int N = 1234567;

ll mpow(ll a, ll b){
	if(b==0) return 1;
	else if(b%2==0){ll memo = mpow(a,b/2); return memo*memo%MOD;}
	else return mpow(a,b-1) * a % MOD;
}
ll gcd(ll a, ll b){
	if(b==0) return a;
	else return gcd(b, a%b);
}
vector<ll> kaijo_memo;
ll kaijo(ll n){
	if(kaijo_memo.size() > n) return kaijo_memo[n];
	if(kaijo_memo.size() == 0) kaijo_memo.push_back(1);
	while(kaijo_memo.size() <= n) kaijo_memo.push_back(kaijo_memo[kaijo_memo.size()-1] * kaijo_memo.size() % MOD);
	return kaijo_memo[n];
}
ll nCr(ll n, ll r){
	if(n < r || r < 0) return 0;
	ll ret = 1;
	ret *= kaijo(n); ret %= MOD;
	ret *= mpow(kaijo(r), MOD-2); ret %= MOD;
	ret *= mpow(kaijo(n-r), MOD-2); ret %= MOD;
	return ret;
}

int main(void){
	int n;
	cin>>n;
	int t,a;
	cin>>t>>a;
	int h;
	int ans_i = -1;
	double ans_t = INF;
	reps(i,n){
		cin>>h;
		if(ans_t > abs(t - h * 0.006 - a)){
			ans_i = i;
			ans_t = abs(t-h*0.006-a);
		}
	}
	cout<<ans_i<<endl;

	return 0;
}


Measured memory_bytes: 256
def make7(i, f, sum):
    if i == 3:
        if sum == 7:
            print(f + "=7")
            exit()
    else:
        make7(i+1, f+"+"+S[i+1], sum+int(S[i+1]))
        make7(i+1, f+"-"+S[i+1], sum-int(S[i+1]))


S = input()
n = len(S)

make7(0, S[0], int(S[0]))


Measured memory_bytes: 9120
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#define MOD 1000000007
using namespace std;

typedef pair<int, int> P;

int main() {
    int N, A, B;
    cin >> N;
    if (N == 1) cout << "Hello World" << endl;
    if (N == 2) {
        cin >> A >> B;
        cout << A + B << endl;
    }
    return 0;
}

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

int main(){
	int a;
	scanf("%d",&a);
	if(a/100==a%10)printf("Yes\n");
	else printf("No\n");
}

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

#define INF 1.0e9

int cnt = 0;

void merge(vector<int> &A, int left, int mid, int right){
    int n1 = mid-left;
    int n2 = right - mid;
    vector<int> L(n1+1,0);
    for(int i=0; i<n1; ++i){
        L[i] = A[left+i];
    }
    vector<int> R(n2+1,0);
    for(int i=0; i<n2; ++i){
        R[i] = A[mid+i];
    }
    L[n1] = INF;
    R[n2] = INF;
    int i=0;
    int j=0;
    for(int k=left; k<right; ++k){
        if( L[i] < R[j] ){
            A[k] = L[i];
            ++i;
            ++cnt;
        }else{
            A[k] = R[j];
            ++j;
            ++cnt;
        }
    }
    return;
}

void mergesort(vector<int> &A, int left, int right){
    if( left+1 < right ){
        int mid = (left+right)/2;
        mergesort(A, left, mid);
        mergesort(A,mid,right);
        merge(A, left, mid, right);
    }

    return;
}

int main()
{
    int n;
    cin >> n;
    vector<int> A(n,0);
    for(auto&& x : A){
        cin >> x;
    }

    mergesort(A,0,n);
    for(int i=0; i<n; ++i){
        if(i>0)
            cout << " ";
        cout << A[i];
    }
    cout << endl;
    cout << cnt << endl;

}



Measured memory_bytes: 6784
#include<bits/stdc++.h>
using namespace std;
///Welcome to Nasif's Code
#define bug printf("bug\n");
#define bug2(var) cout<<#var<<" "<<var<<endl;
#define co(q) cout<<q<<endl;
#define all(q) (q).begin(),(q).end()
typedef long long int ll;
typedef unsigned long long int ull;
const int MOD = (int)1e9+7;
const int MAX = 1e6;
#define pi acos(-1)
#define inf 1000000000000000LL
#define FastRead    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int main()
{
    FastRead
    //freopen("output.txt", "w", stdout);
    int n;
    cin>>n;
    for(int i=n;i<=1000;i++){
        int temp=i;
        set<int>s;
        while(temp>0){
            s.insert(temp%10);
            temp/=10;
        }
        if(s.size()==1){
            cout<<i<<endl;
            return 0;
        }
    }

    return 0;
}


Measured memory_bytes: 3640
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
#include<stdio.h>
#include <cstdint>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
using ll = long long;
const int inf = 1e9 + 7;
const ll longinf = 1LL << 60;
const ll mod = 1e9 + 7;

int r;

int main(){

	cin >> r;
	cout << r * r * 3 << endl;

	return 0;
}

Measured memory_bytes: 764
//的場梨沙★担当
//結城晴★副担当
//日野茜★副担当
#include <vector>
#include <list>
#include <map>
#include <climits>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string.h>
#include <string>
#include <cstring>
#include <ctime>
#include <queue>
#include <random>
#include <cctype>
#include <complex>
#include <regex>
#include <unordered_map>
#include <string>
#include <algorithm>
#include <cctype>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <iomanip>
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <vector>
#include <stdio.h>

using namespace std;

int main(void) {
    int a;
    cin>>a;

    int ans=a+a*a+a*a*a;

    cout<<ans<<endl;
}

Measured memory_bytes: 3584
#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<map>
#include<vector>
using namespace std;

int main() {
	char A[200001];
	long long cnt[26], len;
	long long ans;
	scanf("%s", A);
	len = strlen(A);
	for (int i = 0; i < 26; i++) {
		cnt[i] = 0;
	}
	for (int i = 0; i < len; i++) {
		cnt[A[i] - 'a']++;
	}

	ans = 1;
	for (int i = 0; i < 26; i++) {
		for (int j = i + 1; j < 26; j++) {
			ans = ans + cnt[i] * cnt[j];
		}
	}
	
	printf("%lld\n", ans);
}

Measured memory_bytes: 384
# coding:utf-8

import sys
from collections import Counter

INF = float('inf')
MOD = 10 ** 9 + 7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()


n, m = LI()
A = LI()

C = [0]
for a in A:
    C.append(a + C[-1])

cnt = Counter([c % m for c in C])
ans = 0
for v in cnt.values():
    ans += v * (v - 1) // 2

print(ans)


Measured memory_bytes: 19588
#include<iostream>
using namespace std;
int main(){
    int a,b;
    cin>>a>>b;
    if(a<b){
        cout<<"a < b"<<endl;
    }
    if(a==b){
        cout<<"a == b"<<endl;
    }
    if(a>b){
        cout<<"a > b"<<endl;
    }
    return 0;
}


Measured memory_bytes: 3120
from collections import defaultdict
import sys,heapq,bisect,math,itertools,string
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
AtoZ = [chr(i) for i in range(65,65+26)]
atoz = [chr(i) for i in range(97,97+26)]

a,b,c = map(int,(input().split()))

#最大公約数
def gcd(a,b):
	while b:
		a,b = b, a%b
	return a

#最小公倍数
def lcm(a,b):
	return a*b // gcd(a,b)


p = gcd(a,b)

if c % p == 0:
	print('YES')
else:
	print('NO')

Measured memory_bytes: 3824
/*
...........__________    							 |										    ___  __
.............|       |     						     |											 |   /
.............|       |     						     |									  		 |  /
.............|       |                               |                         __                | /      _______
.............|_______|  _______            _______   |______   ________   /|  /  |               |/       |      |
.............| \               | |      | |          |      |          | / | /   |               |\       |
.............|  \       _______| |      | |_______   |      |   _______|   |/    |               | \      |
.............|   \      |      | |      |         |  |      |  |       |   |     |               |  \     |
.........  __|    \__|  |______| |______| ________|  |      |_ |_______|   |     |__|           _|   \__ _|        .

*/
#include<bits/stdc++.h>
using namespace std ;
#define int 				long long
#define ull 				unsigned long long int
#define ld 					long double
#define vi 					vector<int>
#define vii 				vector<pair<int,int>>
#define vvi 				vector<vector<int>>
#define pf 					push_front
#define popb 				pop_back
#define pb 					push_back
#define eb 					emplace_back
#define pii 				pair<int,int>
#define prec(x) 			fixed<<setprecision(15)<<x
#define all(x) 				x.begin(),x.end()
#define rall(x) 			x.rbegin(),x.rend()
#define mset(a,b) 			memset(a,b,sizeof(a))
#define mcpy(a,b) 			memcpy(a,b,sizeof(a))
#define fo0(i,n) 			for(int i=0,i##end=n;i<i##end;i++)
#define fo1(i,n) 			for(int i=1,i##end=n;i<=i##end;i++)
#define fo(i,a,b) 			for(int i=a,i##end=b;i<=i##end;i++)
#define foe(i,x)			for(__typeof((x).end())i=(x).begin();i!=(x).end();++i)
#define fre(i,x)			for(__typeof((x).rend())i=(x).rbegin();i!=(x).rend();++i)
#define fast ios_base::sync_with_stdio(false); cin.tie(0);cout.tie(0)
#define inf 1e18
const int mod=1e9+7;
const int N=4e5+10;
// int max(int a, int b) { return (a > b)? a : b; } 
void raushan_kumar(){
	int n,weight;cin>>n>>weight;
	int wt[n],val[n];
	fo0(i,n){
		cin>>wt[i]>>val[i];
	}
	int dp[n+1][weight+1];
	// mset(dp,0);
	for(int i=0;i<=n;i++){
		for(int w=0;w<=weight;w++){
			if(i==0 or w==0){
				dp[i][w]=0;
			}
			else if(wt[i-1]<=w){
				dp[i][w]=max((val[i-1]+dp[i-1][w-wt[i-1]]),dp[i-1][w]);
			}
			else{
				dp[i][w]=dp[i-1][w];
			}
		}
	}
	cout<<dp[n][weight];
}

int32_t main()
{
	
	fast;int t=1;
	//cin>>t;
	while(t--){
		raushan_kumar();
	}

}

Measured memory_bytes: 79232