akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>

#define N_TIMES(i, n)     for ( uint64_t i = 0;     i <  n; ++i )
#define N_TIMES_REV(i, n) for (  int64_t i = n - 1; i >= 0; --i )
#define SQRTI(n) static_cast<uint64_t>(::floor(::sqrt(static_cast<double>(n))))

const uint64_t MOD = 1e+9 + 7;

int main()
{
  uint64_t N;
  std::string S;
  std::cin >> N >> S;
  
  std::vector<uint64_t> c('z' - 'a' + 1, 0);
  N_TIMES(n, N) { ++c[S[n] - 'a']; }
  
  uint64_t T = 1;
  N_TIMES(i, 'z' - 'a' + 1) {
    T = (T * (c[i] + 1)) % MOD;
  }
  std::cout << (T - 1) << std::endl;
  
  return 0;
}


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

using namespace std;

const int dx[] = {0, 1, 0, -1};
const int dy[] = {-1, 0, 1, 0};
int w, h;
int div;
string map[100];

void dfs(int x, int y, char c) 
{
    map[y][x] = '-';

    for (int i = 0; i < 4; i++) {
        int nx = x + dx[i];
        int ny = y + dy[i];

        if (nx < 0 || ny < 0 || nx >= w || ny >= h) 
            continue;
        else if (c == map[ny][nx])
            dfs(nx, ny, c);
    }
}

int main()
{
    while (cin >> h >> w, h || w) {
        for (int y = 0; y < h; y++)
            cin >> map[y];

        div = 0; 
        for (int y = 0; y < h; y++) 
            for (int x = 0; x < w; x++) {
                char ch = map[y][x];
                if (ch == '#' || ch == '*' || ch == '@') {
                    dfs(x, y, ch);
                    div++;
                }
            }

        cout << div << endl;
    }

    return 0;
}

Measured memory_bytes: 2160
#include <bits/stdc++.h>
using namespace std;
int main()
{
    long long a, b, c;
    cin >> a >> b >> c;
    if (a % 2==1  && b % 2==1 && c % 2==1)
    {
        long long x = a * b;
        long long y = b * c;
        long long z = c * a;
        cout << min(min(x, y), z) << endl;
    }
    else
        cout << 0 << endl;
}


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

struct node{
  struct node *right;
  struct node *left;
  struct node *parent;
  int key;
};
typedef struct node * Node;
#define NIL NULL

Node root;

Node treeMinimum(Node x){
  for(;;){
    if(x->left==NIL){
      break;
    }
    else{
      x=x->left;
      return x;
    }
  }

}

Node treeMaximum(Node x){
  for(;;){
    if(x->right==NIL){
      break;
    }
    else{
      x=x->right;
      return x;
    }
  }

}

Node treeSearch(Node u, int k){


}

Node treeSuccessor(Node x){


}

void treeDelete(Node z){
  Node y; // node to be deleted
  Node x; // child of y



}

void insert(int k){
  Node y = NIL;
  Node x = root;
  Node z;

  z = malloc(sizeof(struct node));
  z->key = k;
  z->left = NIL;
  z->right = NIL;

  while(1){
    if(x==NIL){
      break;
    }
    else{
      y=x;
      if(x->key < z->key){
	x=x->right;
       
      }
      else{
	x=x->left;
      }


    }
  }
  z->parent=y;

  if(y==NIL){
    root=z;

  }
  else{
  if(z->key < y->key){
    y->left=z;

  }
  else{
    y->right=z;
  }

  }
}

void inorder(Node u){
  if( u == NIL ) return ;
  inorder( u->left );
  printf(" %d",u->key);
  
  inorder( u->right );
}
void preorder(Node u){
  if( u == NIL ) return ;
  printf(" %d",u->key);
   
  preorder( u->left );
  preorder( u->right );
}


int main(){
  int n, i, x;
  char com[20];
  scanf("%d", &n);

  for ( i = 0; i < n; i++ ){
    scanf("%s", com);
    if ( com[0] == 'f' ){
      scanf("%d", &x);
      Node t = treeSearch(root, x);
      if ( t != NIL ) printf("yes\n");
      else printf("no\n");
    } else if ( com[0] == 'i' ){
      scanf("%d", &x);
      insert(x);
    } else if ( com[0] == 'p' ){
      inorder(root);
      printf("\n");
      preorder(root);
      printf("\n");
    } else if ( com[0] == 'd' ){
      scanf("%d", &x);
      treeDelete(treeSearch(root, x));
    }
  }

  return 0;
}

Measured memory_bytes: 24040
using System;
using System.Collections.Generic;
using System.Linq;
using BitArray = System.Collections.BitArray;
using BigInteger = System.Numerics.BigInteger;

namespace AtCoderProject
{
    public class Program
    {
        public object Calc()
        {
            var line = consoleReader.SplitInt();
            var A = line[0];
            var B = line[1];
            if (A <= 5) return 0;
            else if (A < 13) return B / 2;
            else return B;
        }

        public const int mod = 1000000007;
        #region いつもの
        private readonly ConsoleReader consoleReader;
        public Program() : this(new ConsoleReader()) { }
        public Program(ConsoleReader consoleReader) { this.consoleReader = consoleReader; }
        static void Main() => Console.WriteLine(new Program().Calc()); static string MultiLine<T>(IEnumerable<T> source) => string.Join("\n", source);
        #endregion
    }

    #region Console
    public class ConsoleReader { public virtual string String() => Console.ReadLine(); public int Int() => int.Parse(String()); public long Long() => long.Parse(String()); public ulong ULong() => ulong.Parse(String()); public double Double() => double.Parse(String()); public string[] Split() => String().Split().ToArray(); public int[] SplitInt() => String().Split().Select(int.Parse).ToArray(); public long[] SplitLong() => String().Split().Select(long.Parse).ToArray(); public ulong[] SplitULong() => String().Split().Select(ulong.Parse).ToArray(); public double[] SplitDouble() => String().Split().Select(double.Parse).ToArray(); public IEnumerable<string> Repeat(int count) { for (int i = 0; i < count; i++) yield return String(); } public IEnumerable<int> RepeatInt(int count) { for (int i = 0; i < count; i++) yield return Int(); } public IEnumerable<long> RepeatLong(int count) { for (int i = 0; i < count; i++) yield return Long(); } public IEnumerable<string[]> RepeatSplit(int count) { for (int i = 0; i < count; i++) yield return Split(); } public IEnumerable<int[]> RepeatSplitInt(int count) { for (int i = 0; i < count; i++) yield return SplitInt(); } }
    #endregion
}

Measured memory_bytes: 13268
#include <stdio.h>

int main()
{
 int i, n, m, t, ans=0;
 int a[10000];
 scanf("%d", &n);

 for(i=0; i<n; i++){
  scanf("%d", a+i);
 }

 scanf("%d", &m);

 while(m-- > 0){
  scanf("%d", &t);
  for(i=0; i<n; i++){
   if(a[i] == t){
    ans++;
    break;
   }
  }
 }

 printf("%d\n", ans);
 return 0;
}

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

using namespace std;
using ll=long long;
using ull=unsigned long long;
using pii=pair<int,int>;

#define INF LONG_MAX
#define MOD 1000000007
#define rng(a) a.begin(),a.end()
#define rrng(a) a.end(),a.begin()
#define endl "\n"

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

  int N,M;
  cin>>N>>M;
  cout<<N*(N-1)/2+M*(M-1)/2<<endl;
  return 0;
}


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

int main()
{
	int L;
	scanf("%d", &L);
	double s = (double)L/3;
	printf("%.12f", pow((double)s, 3));
	// int L;
	// cin >> L;
	// if (L >= 3)
	// 	cout << long(pow((double)L / 3, 3));
	// else
	// 	cout << double(pow((double)L / 3, 3));
	return (0);
}


Measured memory_bytes: 384
#include<iostream>
#include<cstdlib>
#include<string>
#include<vector>
#include<queue>
#include<algorithm>
using namespace std;
using ll = long long int;
const int mod = 1e9 + 7;
#define rep(i, a, b) for(int i = a;i < b; i++)

int main() {

	ll n, k, q;
	cin >> n >> k >> q;

	vector<int> b(n);
	rep(i, 0, n) b[i] = k;

	int a;
	rep(i, 0, q) {
		cin >> a;
		b[a - 1]++;
	}

	rep(i, 0, n) {
		if (b[i] - q > 0) cout << "Yes" << endl;
		else cout << "No" << endl;
	}

	return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <queue>
#include <vector>
#include <stack>
#include <cmath>
#include <memory.h>
#include <iomanip>
#include <cassert>
using namespace std;

#define maxn
#define FOR(i, l, r) for (int i=l; i<=r; ++i)
#define FORD(i, r, l) for (int i=r; i>=l; --i)
#define REP(i, r) for (int i=0; i<(int)r; ++i)
#define REPD(i, r) for (int i=(int)r-1; i>=0; --i)
#define fi first
#define se second
#define mk make_pair
#define nil NULL
#define y0 y902
#define y1 y232
#define x0 x92
#define x1 x899
#define next asdfa
#define sz size
#define Debug(X) {cerr << #X << " = " << X << '\n';}
#define PR(A, n) {cerr << #A << " = "; FOR(i, 1, n) cerr << A[i] << ' '; cerr << '\n';}
#define PR0(A, n) {cerr << #A << " = "; REP(i, n) cerr << A[i] << ' '; cerr << '\n';}
typedef long long ll;
typedef double db;
typedef pair<db, db> dd;
typedef pair<int, int> ii;
typedef vector<int> vi;
const int inf = 1e9;
template<class T> int getbit(T x, int pos) {return (x>>(pos-1)) & 1;}
template<class T> void turn_on(T &x, int pos) {x = x | ((T)1<<(pos-1));}
template<class T> void turn_off(T &x, int pos) {x = x & ~((T)1<<(pos-1));}
template<class T> T sqr(T a) {return a*a;}

int main() {
    //freopen("icetea.inp", "r", stdin);
    //freopen("", "w", stdout);
    ios::sync_with_stdio(0); cin.tie(0);
    ll q, h, s, d, n, res = 0;
    cin >> q >> h >> s >> d >> n;
    if (s*2>d && h*4>d && q*8>d) {
        res += (n/2)*d;
        n %= 2;
    }
    if (h*2>s && q*4>s) {
        res += n*s;
        n = 0;
    }
    if (q*2>h) {
        res += (n*2)*h;
        n = 0;
    }
    res += n*4*q;
    cout << res;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long int
#define pi 3.14159265358979323846
#define mod 1000000007
using namespace std;
int main()
{
    ll n,k,sum1=0,sum2=0,diff1=0,diff2=0,diff3=0,s21=0,s22=0,cnt=0;
    cin>>n>>k;
    n=n+1;
    for(int i=k;i<=n;i++)
    {
        diff1=i-1;
        sum1=diff1*(diff1+1)/2;
        diff2=n-1;
        s21=diff2*(diff2+1)/2;
        diff3=n-i-1;
        s22=diff3*(diff3+1)/2;
        sum2=s21-s22;
       // cout<<sum1<<" "<<sum2<<endl;
        cnt+=(sum2-sum1+1);
        //cout<<"cnt "<<cnt<<endl;
    }
   // cout<<cnt<<endl;
    ll kk=cnt%mod;
    cout<<kk<<endl;
}

Measured memory_bytes: 3604
#include<stdio.h>
#define MAXN 1000000007
#define ll long long

int min(int a,int b){
    return a > b ? b : a;
}
int max(int a,int b){
    return a > b ? a : b;
}
int abs(int a){
    return a < 0 ? -a :a;
}
int main(){
    int a,b;

    while(scanf("%d%d",&a,&b)!=EOF){
    ll sum = 1;
    if(abs(a-b)>=2)
        sum = 0;
    else if(a==b){
        for(int i=1;i<=a;i++){
            sum*=i;
            sum%=MAXN;
        }
        sum=sum*sum*2%MAXN;
    }
    else{
        for(int i=1;i<=min(a,b);i++){
            sum*=i;
            sum%=MAXN;
        }
        sum=sum*sum%MAXN;
        sum = sum*max(a,b)%MAXN;
    }
    printf("%lld\n",sum);
    }
    return 0;
}


Measured memory_bytes: 128
//#include <tourist>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <iostream>
#include <string>
#include <iomanip>
#include <limits>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <list>
#include <queue>
#include <tuple>
#include <deque>
#include <algorithm>
#include <numeric>
#include <iomanip>
#include <utility>
#include <complex>
#include <functional>
using namespace std;
const int MOD = 1000000007;
typedef long long ll;
typedef pair<ll, ll> p;
const int INF = (1 << 28);
const int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0};
const int Dx[8] = {0, 1, 1, 1, 0, -1, -1, -1}, Dy[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl
#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 INF 2e9
#define ALL(v) v.begin(), v.end()
//setprecision(15)有効数字15桁
//-std=c++14
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b)
{
    return a * b / gcd(a, b);
}
struct edge {
    int to, cost;
};
ll n;
vector<ll> a;
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> n;
    for (int i = 0; i < n; i++)
    {
        ll temp;
        cin >> temp;
        a.push_back(temp);
    }
    reverse(ALL(a));
    ll ansmax=2;
    ll ansmin=2;
    for(int i=0;i<n;i++){
        if((ansmin-1)/a[i]==ansmax/a[i]){
            cout<<-1<<"\n";
            return 0;
        }
        ansmin=a[i]*((ansmin+a[i]-1)/a[i]);
        ansmax=a[i]*(ansmax/a[i])+a[i]-1;
        //cout << ansmin<<" "<<ansmax << "\n";
    }
    cout << ansmin<<" "<<ansmax << "\n";
}



Measured memory_bytes: 1400
import itertools


def pattern_sum_is_even_number(input_n, input_m):
    even_num = [i*2 for i in range(1, input_n+1)]
    odd_num = [i*2+1 for i in range(1, input_m+1)]

    even_num.extend(odd_num)
    all_num_combination = itertools.combinations(even_num, 2)
    sum_is_even_combinations = 0
    for n in all_num_combination:
        if (n[0] + n[1]) % 2 == 0:
            sum_is_even_combinations += 1
    return sum_is_even_combinations


if __name__ == '__main__':
    n, m = map(int, input().split())
    print(pattern_sum_is_even_number(n, m))

Measured memory_bytes: 3188
#include <bits/stdc++.h>
#define X first
#define Y second
using namespace std;

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

const int MAXN = 1e5 + 1;

map<int, vector<int>> xy;
map<int, vector<int>> yx;
map<pii, int> x_to_v;
pii v_to_x[MAXN];
int T;

vector<int> nxt[MAXN];
bool vis[MAXN];
set<int> cnt_x, cnt_y;

int cnt(int v) {
	vis[v] = 1;
	cnt_x.insert(v_to_x[v].X);
	cnt_y.insert(v_to_x[v].Y);
	int ret = 1;
	for(int w : nxt[v]) {
		if(vis[w]) continue;
		ret += cnt(w);
	}

	return ret;
}


int get_v(int x, int y) {
	if(!x_to_v[{x,y}]) {
		x_to_v[{x,y}] = ++T;
		v_to_x[T] = {x,y};
	}
	return x_to_v[{x, y}];
}

void add_edges(map<int, vector<int>> *xs, bool xy) {
	for(auto p : *xs) {
		for(int i = 1; i < (int)p.Y.size(); i++) {
			int v[2];
			for(int j = 0; j < 2; j++) {
				if(xy) 
					v[j] = get_v(p.X, p.Y[i-j]);
				else
					v[j] = get_v(p.Y[i-j], p.X);
			}
			for(int j = 0; j < 2; j++) {
				nxt[v[j]].push_back(v[1-j]);
			}
		}
	}
}

int main() {
	ios_base::sync_with_stdio(0);
	
	int n;
	cin >> n;
	for(int i = 0; i < n; i++) {
		int x, y;
		cin >> x >> y;
		xy[x].push_back(y);
		yx[y].push_back(x);
	}

	for(auto p : xy) sort((p.Y).begin(), (p.Y).end());
	for(auto p : yx) sort((p.Y).begin(), (p.Y).end());
	

	add_edges(&xy, 1);
	add_edges(&yx, 0);
	

	ll ans = 0;

	for(int v = 1; v <= n; v++) {
		if(!vis[v]) {
			cnt_x.clear();
			cnt_y.clear();
			int t = cnt(v);
			ans += (ll)cnt_x.size() * cnt_y.size() - t;
		}
	}

	cout << ans << '\n';

	return 0;
}

Measured memory_bytes: 30464
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <stack>
#include <queue>
#include <map>
#include <set>

using namespace std;

struct ListNode {
    int val;
    ListNode *next;
    ListNode *prev;
};

set <int> s;

int main() {

    int N, K;

    cin >> N >> K;

    vector <long long int> H(N);

    for (int i = 0; i < N; i++) {
        cin >> H[i];
    }

    sort(H.begin(), H.end());

    long long int answer = 0;

    for (int i = 0; i < N - K; i++) {
        answer += H[i];
    }

/* 
    stack <int> monster;
    for (int i = 0; i < N; i++) {
        monster.push(H[i]);
        printf("%d ", monster.top());
    }
    cout << endl;
*/

cout << answer << endl;

return 0;

}

Measured memory_bytes: 1792
import sys
input = sys.stdin.readline
N = int(input())
A = list(map(int, input().split()))
def check(x):
  r = 0
  for i in range(N):
    r += abs(A[i] - (x + i + 1))
  return r
l = -2 * 10 ** 14
r = 2 * 10 ** 14
x1 = 0
x2 = 0
c = 0
while c < 300:
  c += 1
  x1 = (2 * l + r) // 3
  x2 = (l + 2 * r) // 3
  lres = check(x1)
  rres = check(x2)
  if lres > rres:
    l = x1
  else:
    r = x2
#print(x1, x2)
print(min(check(x1), check(x2)))

Measured memory_bytes: 79188
#include<iostream>
#include<cmath>
#include<algorithm>

using namespace std;

int dy[]={-1,0,1,0};
int dx[]={0,1,0,-1};
  
int t[3][3];
int limit;
  
int Puzzle_1(){
  int res=0,a;
  for(int i=0;i<3;i++){
    for(int j=0;j<3;j++){
      if(t[i][j]==0)continue;
      a=t[i][j]-1;
      res+=abs(a/3-i)+abs(a%3-j);
    }
  }
  return res;
}
  
bool confirm(int depth,int prev,int py,int px){
  int heuri=Puzzle_1();
  if(heuri+depth>limit)return false;
  if(heuri==0)return true;
  for(int i=0;i<4;i++){
    if(abs(i-prev)==2)continue;
    int ny=py+dy[i],nx=px+dx[i];
    if(ny<0||nx<0)continue;
    if(ny>=3||nx>=3)continue;
    swap(t[ny][nx],t[py][px]);
    if(confirm(depth+1,i,ny,nx)) return true;
    swap(t[ny][nx],t[py][px]);
  }
  return false;
}
  
void solve(int py,int px){
  for(limit=0;;limit++){
    if(confirm(0,99,py,px)){
      cout<<limit<<endl;
      return;
    }
  }
}
int main(){
  int py,px;
  for(int i=0;i<3;i++){
    for(int j=0;j<3;j++){
      cin>>t[i][j];
      if(t[i][j]==0){
    py=i;
    px=j;
      }
    }
  }
  solve(py,px);
  return 0;

}




Measured memory_bytes: 3120
using System;
using System.Linq;
using System.Collections.Generic;
using static System.Console;
using System.Text;
using System.IO;
using static System.Math;
using System.Numerics;

namespace AtCoder
{
    class Program
    {
        static public long[] Sarray() { return ReadLine().Split().Select(long.Parse).ToArray(); }
        static public List<long> Slist() { return ReadLine().Split().Select(long.Parse).ToList(); }
        static long Mod = (long)1e9 + 7;
        static void Main(string[] args)
        {
            SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
            Solve();
            Out.Flush();
            Read();
        }
        static void Solve()
        {
            var NMQ = Sarray();
            var N = NMQ[0];
            var M = NMQ[1];
            var Q = NMQ[2];
            var exSecs = new long[N, N];
            var exSecRui = new long[N, N + 1];
            for (var i = 0; i < M; ++i)
            {
                var lr = Sarray();
                var l = lr[0] - 1;
                var r = lr[1] - 1;
                ++exSecs[l, r];
            }
            for (var i = 1; i <= N; ++i)
                for (var j = 0; j < N; ++j)
                    exSecRui[j, i] = exSecRui[j, i - 1] + exSecs[j, i - 1];
            for (var i = 0; i < Q; ++i)
            {
                var pq = Sarray();
                var p = pq[0] - 1;
                var q = pq[1] - 1;
                var ans = 0L;
                for (var j = p; j <= q; ++j)
                    ans += exSecRui[j, q + 1] - exSecRui[j, p];
                WriteLine(ans);
            }
        }
    }
}

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

#define _GLIBCXX_DEBUG
#define all(v) (v).begin(),(v).end()

using namespace std;

using ll=long long;
using pii=pair<int, int>;
using vi=vector<int>;

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

int main(){
   int N; cin >> N;
   vi A(N);
   vi cnt((int)1e5+1, 0);
   ll sum=0;
   for(int i=0; i<N; i++){
       cin >> A[i];
       sum+=A[i];
       cnt[A[i]]++;
   }
   int Q; cin >> Q;
   vi B(Q), C(Q);
    for(int i=0; i<Q; i++){
        cin >> B[i] >> C[i];
    }
    for(int i=0; i<Q; i++){
        sum=sum-(ll)B[i]*cnt[B[i]]+(ll)C[i]*cnt[B[i]];
        cnt[C[i]]+=cnt[B[i]];
        cnt[B[i]]=0;
        cout << sum << endl;
    }
    return 0;
}


Measured memory_bytes: 4836
#include "bits/stdc++.h"
using namespace std;

int main()
{
	double a, b, x;
	cin >> a >> b >> x;

	int pattern;
	if (x > a * a * b / 2) {
		pattern = 1;
	} else {
		pattern = 2;
	}

	double ans;
	if (pattern == 1) {
		double tan = (2 / (a * a)) * (a * b - x / a);
		ans = atan(tan);
	} else {
		double tan = a * b * b / (2 * x);
		ans = atan(tan);
	}
	double PI = 3.1415926535;
	ans = ans * 180 / PI;
	cout << fixed << setprecision(8) << ans << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b)  for(int i=(a),i##formax=(b);i< i##formax;i++)
#define FORR(i,a,b) for(int i=(a),i##formin=(b);i>=i##formin;i--)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define pcnt __builtin_popcount
#define sz(x) (int)(x).size()
#define maxs(x,y) x=max((x),(y))
#define mins(x,y) x=min((x),(y))
#define show(x) cout<<#x<<" = "<<(x)<<endl;
#define all(a) ((a).begin()),((a).end())
#define each(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)
#define bit(n) (1LL<<(n))
typedef long long ll;
typedef __int128_t lll;
template<class T>using V=vector<T>;
template<class T>using VV=V<V<T>>;
template<class T,class Y>using P=pair<T,Y>;
template<class T,class Y>ostream& operator<<(ostream&o,P<T,Y>&p){return o<<"("<<p.fi<<","<<p.se<<")";}
template<class T>ostream& operator<<(ostream&o,V<T>&v){for(T&t:v)o<<t<<",";return o;}
template<class T>void uniq(V<T>&v){sort(all(v));v.erase(unique(all(v)), v.end());}
template<class A,size_t N,class T>void Fill(A(&a)[N],const T&v){fill((T*)a,(T*)(a+N),v);}

const int MOD = 1e9+7; //998244353;

lll gcd(lll a,lll b,lll&x,lll&y){if(!b){x=1;y=0;return a;}lll d=gcd(b,a%b,y,x);y-=a/b*x;return d;}
ll modInv(ll a,ll m=MOD){lll x,y;gcd(a,m,x,y);return(x%m+m)%m;}
ll modPow(lll a,lll n,ll m=MOD){lll p=1;for(;n;n>>=1,a=a*a%m)if(n&1)p=p*a%m;return p;}
//V<ll>Fac,Rac;void setF(int n,int m=MOD){Fac=Rac=V<ll>(++n);Fac[0]=1;FOR(i,1,n)Fac[i]=Fac[i-1]*i%m;Rac[n-1]=modInv(Fac[n-1],m);FORR(i,n-1,1)Rac[i-1]=Rac[i]*i%m;}
//ll comb(int a,int b,int m=MOD){return a<b||b<0?0:Fac[a]*Rac[b]%m*Rac[a-b]%m;}

const int IINF = 1e9+6;
const ll LINF = 1e18;
const int N = 2e5;
double l;
main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> l;
  l /= 3;
  printf("%.12f\n", l*l*l);
}

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

A.sort()

m_a = max(A)
check = [0]*(m_a+2)

for i in A:
    check[i]+=1
    if check[i]==1:
        for j in range(i*2,m_a+1,i):
            check[j]+=100

print(check.count(1))


Measured memory_bytes: 40252
#include<stdio.h>
#define N 100
#define INF (1<<21)

int min(int x, int y){
  if(x<y) return x;
  else return y;
}

int main(){
  int i,j,k,l,n,q,p[N+1],M[N+1][N+1];
  scanf("%d",&n);
  for(i=1;i<=n;i++){
    scanf("%d%d",&p[i-1],&p[i]);
  }
  for(i=1;i<=n;i++) M[i][i]=0;
  for(l=2;l<=n;l++){
    for(i=1;i<=n-l+1;i++){
      j=i+l-1;
      M[i][j]=INF;
      for(k=i;k<=j-1;k++){
        q=M[i][k]+M[k+1][j]+p[i-1]*p[k]*p[j];
        M[i][j]=min(M[i][j],q);
      }
    }
  }
  printf("%d\n",M[1][n]);
  return 0;
}

Measured memory_bytes: 636
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr long double PI = acosl(-1);
void Yes() {cout << "Yes\n";}
void No() {cout << "No\n";}
void YES() {cout << "YES\n";}
void NO() {cout << "NO\n";}

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

	int n;
	cin >> n;
	vector<ll> d1(n), d2(n);
	int cnt = 0;
	bool flag = false;
	for (int i = 0; i < n; i++) {
		cin >> d1[i] >> d2[i];
		if (d1[i] == d2[i]) cnt++;
		else cnt = 0;
		if (cnt == 3) flag = true;
	}
	if (flag) Yes();
	else No();

	return 0;
}

Measured memory_bytes: 3656
#include <iostream>
#include <algorithm>
#include <string>
#include  <queue>
#include <vector>
#include  <cstdio>
#include <cstring>
#include<map>
#include<set>
#include<bits/stdc++.h>
#define ll long long int
#define ull unsigned long long int
#define I(a) scanf("%d",&a)
#define I2(a,b) scanf("%d%d",&a,&b)
#define I3(a,b,c) scanf("%d%d%d",&a,&b,&c)
#define L(a) scanf("%lld",&a)
#define L2(a,b) scanf("%lld%lld",&a,&b)
#define L3(a,b,c) scanf("%lld%lld%lld",&a,&b,&c)
#define PI(a) printf("%d",a)
#define PL(a) printf("%lld",a)
#define PT(t) printf("Case %d: ",t)
#define PB push_back
#define x first
#define y second
#define xx first.first
#define xy first.second
#define yx second.first
#define yy second.second
#define SC scanf
#define PC printf
#define NL printf("\n")
#define SET(a) memset(a,0,sizeof a)
#define SETR(a) memset(a,-1,sizeof a)
#define SZ(a) ((int)a.size())-1
#define f(i,a,b) for(int i=a;i<=b; i++)
#define fr(i,a,b) for(int i=a;i<=b; i++)
#define frr(i,a,b) for(int i=a;i>=b; i--)
#define frv(i,a)  for(int i=0;i<a.size();i++)
#define pi 2.0*acos(0.0)
#define R(a) freopen(a, "r", stdin);
#define W(a) freopen(a, "w", stdout);
#define CB(x) __builtin_popcount(x)
#define STN(a) stringtonumber<ll>(a)
#define lol printf("BUG\n")
#define Endl "\n"
#define mk make_pair
using namespace std;
template <class T> inline T BM(T p, T e, T M)
{
    ll ret = 1;
    for(; e > 0; e >>= 1)
    {
        if(e & 1) ret = (ret * p) % M;
        p = (p * p) % M;
    }
    return (T)ret;
}
template <class T> inline T mul(T p, T e, T M)
{
    ll ret = 0;
    for(; e > 0; e >>= 1)
    {
        if(e & 1) ret = (ret + p) ;
        p = (p + p) ;
        if(ret>=M)ret-=M;
        if(p>=M)p-=M;
    }
    return (T)ret;
}
template <class T> inline T gcd(T a, T b)
{
    if(b == 0)return a;
    return gcd(b, a % b);
}
template <class T> inline T mdINV(T a, T M)
{
    return BM(a, M - 2, M);
}
template <class T> inline T PW(T p, T e)
{
    ll ret = 1;
    for(; e > 0; e >>= 1)
    {
        if(e & 1) ret = (ret * p);
        p = (p * p);
    }
    return (T)ret;
}
 
 
template <class T>bool ISLEFT(T a, T b, T c)
{
    if(((a.xx - b.xx) * (b.yy - c.yy) - (b.xx - c.xx) * (a.yy - b.yy)) < 0.0)return 1;  //Uporer dike //A,b,c, x okkher ordera sorted
    else return 0;
}
 

#define  mx 200004
#define base 193ll
 
typedef pair<int,int >P;
//////////////////////////
////////////////////////
#define F(i,a,b) for(int i=a;i<b; i++)
#define LL long long
#define MX  200007
#define md 998244353ll
///////////////////////////
///////////////////////////
///


int main(){

    int n, m;
    I2(n, m);
    ll ar[n+2];
    ll sum = 0;
    ll ma = 0;
    for(int i = 1;i<=n;i++){
        L(ar[i]);
    }

    sort(ar + 1, ar+ n+1);
    ll ans = ar[n];
    for(int i = 1;i<=n-m+1;i++){
        ans = min(ans, ar[i+m-1]- ar[i]);
    }

    cout<<ans<<endl;




    return 0;
}

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

using namespace std;

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

    int N, W;
    cin >> N >> W;
    int v[N], w[N], m[N];
    for (int i = 0; i < N; ++i) {
        cin >> v[i] >> w[i] >> m[i];
    }

    int dp[W + 1];
    int deq[W + 1];
    int deqv[W + 1];

    memset(dp, 0, sizeof(dp));
    memset(deq, 0, sizeof(deq));
    memset(deqv, 0, sizeof(deqv));

    for (int i = 0; i < N; ++i) {
        for (int a = 0; a < w[i]; ++a) {
            int s = 0, t = 0;
            for (int j = 0; j * w[i] + a <= W; ++j) {
                int val = dp[j * w[i] + a] - j * v[i];
                while (s < t && deqv[t - 1] <= val) t--;
                deq[t] = j;
                deqv[t++] = val;
                dp[j * w[i] + a] = deqv[s] + j * v[i];
                if (deq[s] == j - m[i]) s++;
            }
        }
    }

    cout << dp[W] << '\n';

    return 0;
}



Measured memory_bytes: 3328
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n - 1; 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());

using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<ll, ll>;
//zaki_UnionFind
class UnionFind
{
    std::vector<int> data;

  public:
    UnionFind(int size) : data(size, -1) {}
    bool unite(int x, int y)
    {
        x = root(x);
        y = root(y);
        if (x != y)
        {
            if (data[y] < data[x])
                std::swap(x, y);
            data[x] += data[y];
            data[y] = x;
        }
        return x != y;
    }
    bool find(int x, int y)
    {
        return root(x) == root(y);
    }
    int root(int x)
    {
        return data[x] < 0 ? x : data[x] = root(data[x]);
    }
    int size(int x)
    {
        return -data[root(x)];
    }
};

struct edge{
  	ll from, to, cost;
};

bool comp(const edge& e1, const edge& e2){
  	return e1.cost < e2.cost;
}

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

  	ll n;
  	cin >> n;
    ll x, y;
    vector<P> px, py;
    REP(i, n){
        //各軸について考えると数直線上である点をまたぐような辺は複数本繋いだ辺と等価なので考えなくていい
        //すなわち辺候補は各軸での数直線上のものに限られるのでX座標とY座標でソート
        //このとき頂点番号を記憶する必要がある
        cin >> x >> y;
        px.push_back(P{x, i});
        py.push_back(P{y, i});
    }
    VSORT(px);
    VSORT(py);
    ll xa, xb, xc, ya, yb, yc;
  	vector<edge> es;
  	REP(i, n - 1){
        //i~i+1番目を結ぶ2*(n-1)本の辺を候補に追加
        xa = px[i + 1].second, xb = px[i].second, xc = px[i + 1].first - px[i].first;
        ya = py[i + 1].second, yb = py[i].second, yc = py[i + 1].first - py[i].first;
        es.push_back((edge){xa, xb, xc});
        es.push_back((edge){ya, yb, yc});
  	}
  	sort(es.begin(), es.end(), comp);
  	ll res = 0;
  	UnionFind uf(n);
  		for(auto e : es){
    		if(!uf.find(e.from, e.to)){
      			uf.unite(e.from, e.to);
      			res += e.cost;
    		}
  		}
  	cout << res << endl;
  	return 0;
}


Measured memory_bytes: 13024
use std::io;

fn procon_read<T: std::str::FromStr>() ->  Vec<T> {
	let mut buf = String::new();
	io::stdin().read_line(&mut buf).expect("");
	let iter = buf.split_whitespace();
	let mut v: Vec<T> = Vec::new();
	for i in iter {
		v.push(i.parse().ok().unwrap());
	}
	v
}

fn main() {
    let v:Vec<i32> = procon_read();
    println!("{}", v[0]*v[1]);
}

Measured memory_bytes: 2156
#include <bits/stdc++.h>
using namespace std;
 
int main(){
	ios_base::sync_with_stdio(false); 
    cin.tie(NULL); 
#ifndef ONLINE_JUDGE 
    freopen("input.txt", "r", stdin); 
    freopen("output.txt", "w", stdout); 
#endif
  string s;
    cin>> s;
  if (s=="ABC"){
  cout<<"ARC";
  }
  else{
  cout<<"ABC";
  }
	return 0;
}

Measured memory_bytes: 3604
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,m;string s;
	cin>>n>>m>>s;
	int last = 0;
	for(int i=0;i<s.length();++i){
		if(s[i]=='1'){
			last++;
			if(last==m){
				cout<<-1<<endl;
				return 0;
			}
		}else{
			last = 0;
		}
	}
	vector<int> track;
	int now = s.length()-1;
	track.push_back(now);
	
	while(now!=0){
		if(m>=now){
			track.push_back(0);
            break;
		}

		for(int i=m;i>0;--i){
			if(s[now-i]=='0'){
				track.push_back(now-i);
				break;
			}
		}
		now = track[track.size()-1];
	}
	//for(auto i:track)cout<<i<<" ";cout<<endl;
	int zs = track.size();
	for(int i=zs-2;i>=0;--i){
		cout<<(track[i]-track[i+1])<<" ";
	}
	cout<<endl;
	return 0;
}

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

using namespace std;

int main(){
    int n;
    cin >> n;
    auto hs=vector<int>(n);
    for(int i=0; i<n; ++i){
        cin >> hs[i];
    }
    int min_h=*min_element(hs.begin(), hs.end());
    auto buf=vector<int>(n, min_h);
    int res=min_h;
    for(int level=min_h+1,
            elevel=*max_element(hs.begin(), hs.end()); level<=elevel; ++level){
        bool first=true;
        for(int i=0; i<n; ++i){
            if(buf[i]!=hs[i]){
                ++buf[i];
                if(first){
                    ++res;
                    first=false;
                }
            } else{
                first=true;
            }
        }
    }
    cout << res << endl;
    return 0;
}


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

#define pb push_back
#define mp make_pair
#define all(x) x.begin(),x.end()
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int,int> ii;

int main(){
    int n;
    scanf("%d",&n);
    vi num;
    for(int i=1;i<=n;i++){
        int temp;
        scanf("%d",&temp);
        num.pb(temp);
    }
    sort(all(num),greater<int>());
    //for(auto i = num.begin();i!=num.end();i++){
    //    printf("%d ",*i);
    //}
    printf("\n");
    ll res=0;
    int index=0;
    int count=0;
    res+=num[index];
    index++;
    for(int i=3;i<=n;i++){
        if(count==2){
            index++;
            count=0;
        }
        res+=num[index];
        count++;
    }
    printf("%lld\n",res);
}







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

int main(){
	int n,m;
	long long a[60],b[60],c[60],d[60];
	cin >> n >> m;
	for(int i=0; i<n; i++){
		cin >> a[i] >> b[i];
	}
	for(int i=0; i<m; i++){
		cin >> c[i] >> d[i];
	}
	for(int i=0; i<n; i++){
		int minnum=1e9,mini=51;
		for(int k=0; k<m; k++){
			int tmp =abs(a[i]-c[k])+abs(b[i]-d[k]);
			if(tmp<minnum){
				minnum=tmp;
				mini=k;
			}
		}
		cout << mini+1 << endl;
	}

}







Measured memory_bytes: 256
n=int(input())
if n==0:
  print(0)
  exit()
if n==1:
  print(1)
  exit()
ans=[]
while n!=1:
  r=n%2
  ans.append(str(r))
  n=(n-r)//(-2)
ans.append(str(1))
ans.reverse()
print(''.join(ans))
      

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

using namespace std;

const int MOD = 200'003;

namespace FFT {
  using Complex = complex<double>;
  const double PI = acos(-1);

  void DiscreteFourier(vector<Complex>& a, bool invert) {
    int n = a.size();
    for (int i = 1, j = 0; i < n; i++) {
      int bit = n >> 1;
      for (; j & bit; bit >>= 1) {
        j ^= bit;
      }
      j ^= bit;
      if (i < j) {
        swap(a[i], a[j]);
      }
    }
    for (int len = 2; len <= n; len <<= 1) {
      double ang = 2 * PI / len * (invert ? -1 : 1);
      Complex wlen(cos(ang), sin(ang));
      for (int i = 0; i < n; i += len) {
        Complex w(1);
        for (int j = 0; j < len / 2; j++) {
          Complex u = a[i + j], v = a[i + j + len/2] * w;
          a[i + j] = u + v;
          a[i + j + len / 2] = u - v;
          w *= wlen;
        }
      }
    }
    if (invert) {
      for (Complex& x : a) {
        x /= n;
      }
    }
  }  
  vector<long long> Convolve(const vector<int>& a, const vector<int>& b) {
    int n = 1;
    while (n < a.size() + b.size()) 
      n <<= 1;
    vector<Complex> fa(a.begin(), a.end());
    vector<Complex> fb(b.begin(), b.end());
    fa.resize(n), fb.resize(n);
    DiscreteFourier(fa, false);
    DiscreteFourier(fb, false);
    for (int i = 0; i < n; i++)
      fa[i] *= fb[i];
    DiscreteFourier(fa, true);
    vector<long long> result(n);
    for (int i = 0; i < n; i++)
      result[i] = llround(fa[i].real());
    return result;
  }
};

void Run() {
  vector<int> dlog(MOD);
  vector<int> power(MOD - 1);
  int pw = 1;
  for (int it = 0; it < MOD - 1; ++it) {
    power[it] = pw;
    dlog[pw] = it;
    pw *= 2;
    pw %= MOD;
  }
  int n;
  cin >> n;
  vector<int> a(n);
  vector<int> occ(MOD - 1);
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    if (a[i]) {
      ++occ[dlog[a[i]]];
    }
  }
  vector<long long> res = FFT::Convolve(occ, occ);
  long long ans = 0;
  for (int i = 0; i < 2 * (MOD - 1); ++i) {
    if (i % 2 == 0) {
      res[i] -= occ[i / 2];
    }
    res[i] /= 2;
    ans += 1LL * power[i % (MOD - 1)] * res[i];
  }
  cout << ans << '\n';
}

int main() {
  srand(time(0));
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  Run();
  return 0;
}

Measured memory_bytes: 27212
#include <stdio.h>
int main(){
    int S ,h ,m ,s;
    scanf("%d" ,&S);
    h = S / 3600;
    m = (S % 3600) / 60;
    s = S % 60;
    printf("%d:%d:%d\n" ,h ,m ,s);
    return 0;
}

Measured memory_bytes: 1820
fun intList() = readLine()?.split(" ")?.map(String::toInt) ?: TODO()
fun main(args: Array<String>) {
    val n = readLine()?.toInt() ?: return
    repeat(n) {
        val (a, b, c) = intList().sorted()
        if(a*a + b*b == c*c) {
            println("YES")
        }
        else {
            println("NO")
        }
    }
}



Measured memory_bytes: 31716
def main():
    a = int(input())
    b = int(input())
    c = int(input())
    x = int(input())
    cnt = 0
    for i in range(a+1):
        for j in range(b+1):
            for k in range(c+1):
                if i*500+j*100+k*50 == x:
                    cnt += 1
    print(cnt)

if __name__ == "__main__":
    main()


Measured memory_bytes: 9120
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); i++)
#define For(i,start,end) for(i64 i = start; i < end; i++)
#define newline std::cout<<'\n';
#define newlinedx(num) for(int i=0;i<num;i++)std::cout<<'\n';
using namespace std;
typedef long long ll;
typedef unsigned long ul;

using i8  = int8_t;
using u8  = uint8_t;
using i16 = int16_t;
using u16 = uint16_t;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;
using f32 = float;
using f64 = double;
using ui = uint64_t;

//----------------library in this time--------------------------------
template <class T>
T gcd(const T a,const T b) {
    return (b == 0) ? a : gcd (b, a % b);
}
template <class T>
T lcm(const T a, const T b) {
    return a * b / gcd(a,b);
}
template <class T>
inline T ave(const T a, const T b) {
    return (a + b) / 2.0f;
}

long long squareTwo(const long long a,const long long b) {
    return (b == 1) ? a : squareTwo(a * 2, b - 1);
}

template <class T>
inline T Max(const T a,const T b) {
    return (a >= b) ? a : b;
}

template <class T>
inline T Min(const T a,const T b) {
    return (a <= b) ? a : b;
}

template <class T>
inline void show(T a) {
    cout << a << endl;
}

typedef struct{
    ll x;
    ll y;
}idx;


//------------------------main function-------------------------------
void Main(){
    string s,t,u;
    int a,b;
    cin >> s >> t;
    cin >> a >> b;
    cin >> u;
    if(u == s){
        cout << a-1 << " " << b << endl;
    }else{
        cout << a << " " << b-1 << endl;
    }
    
}
//--------------------------------------------------------------------
int main(){
    std::cin.tie(nullptr);
    std::ios_base::sync_with_stdio(false);
    std::cout<<std::fixed<<std::setprecision(10);
     
    Main();
    return 0;
}


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

int main(){
  int a,b,c,d;
  
  cin >> a >> b >> c >> d;
  
  if (a+b > c+d)
    cout << "Left" << endl;
  else if (a+b == c+d)
    cout << "Balanced" << endl;
  else
    cout << "Right" << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  string a,b;
  cin>>a>>b;
  long int res=0;
  for(long int i=0;i<a.size();i++){
    if(a[i]!=b[i])
      res++;
  }
  cout<<res<<endl;
  return 0;
}


Measured memory_bytes: 3924
#include <iostream>

using namespace std;
int main(void){
    int H,W;

    while(true){
        cin >> H >> W;
        
        if(H==0 and W==0) break;
        
        for(int i=0;i<H;i++){
            for(int j=0;j<W;j++){
                if(i==0 or j==0 or (H-i)==1 or (W-j)==1){
                    cout << "#";
                }else{
                    cout << ".";
                }
            }
            cout << endl;
        }
        cout << endl;
    }

    return 0;
}



Measured memory_bytes: 3080
#include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9+7;
const long long LINF = 1e18;
#define dump(x)  cout << 'x' << ' = ' << (x) << ` `;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define FOREACH(x,a) for(auto& (x) : (a) )
typedef long long ll;
using namespace std;
typedef pair<ll, ll> P;

template<typename T>
void print(const vector<T> &x) {
    int n = x.size();
    rep(i,n) {
        cout << x[i];
        if (i!=n-1) cout<<" ";
        else cout << endl;
    }
}

template<typename T>
void print(const vector<vector<T>> &x) {
    int n = x.size();
    rep(i,n) {
        rep(j,x[i].size()) {
            cout << x[i][j] << " ";
        }
        cout << endl;
    }
}

template<typename T>
void print(const vector<T> &x, int n) {
    rep(i,n) {
        cout << x[i];
        if (i!=n-1) cout<<" ";
        else cout << endl;
    }
}

template<typename T>
void print(const vector<vector<T>> &x, int n, int m) {
    rep(i,n) {
        rep(j,m) {
            cout << x[i][j] << " ";
        }
        cout << endl;
    }
}

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

void input_init() {
    cin.tie(0); ios::sync_with_stdio(false);
}

int main(int argc, char const *argv[]) {
    ll d,t,s; cin>>d>>t>>s;
    if (s*t >= d) {
        cout << "Yes" << '\n';
    }
    else {
        cout << "No" << '\n';
    }
    return 0;
}

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

using namespace std;

using VI = vector<int>;
using VVI = vector<VI>;
using VB = vector<bool>;
using VVB = vector<VB>;
using VD = vector<double>;
using VVD = vector<VD>;
using VS = vector<string>;
using PII = pair<int, int>;
using VPII = vector<PII>;
using VL = vector<long long>;
using VVL = vector<VL>;

#define sz(var) (int)var.size()
#define REP(var, start, end) for(int var = start; var < (int)end; ++var)
#define REPC(var, start, end) for(int var = start; var <= (int)end; ++var)
#define CLEAR(var, with) memset(var, with, sizeof(var))
#define ALL(x) x.begin(), x.end()
#define LL long long
#define ULL unsigned long long
#define TIME cerr << "Time elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms" << endl;
#define DBG(x) cerr << x << endl;

/*
	http://abc069.contest.atcoder.jp/tasks/arc080_a
*/
int n;
VI A;
bool isPossible()
{
	int four = 0, two = 0;
	for(auto i : A) {
		if(i % 4 == 0) ++four;
		else if(i % 2 == 0) ++two;
	}

	return (four + (two / 2)) >= n / 2 ? true : false;
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
#ifndef ONLINE_JUDGE
	//freopen("tmp.in", "r", stdin);
//	freopen("tmp.out", "w", stderr);
#endif
	cin >> n;
	
	A.resize(n);
	REP(i, 0, n) cin >> A[i];

	cout << (isPossible() ? "Yes" : "No") << endl;

	return 0;
}

Measured memory_bytes: 640
import java.io.IOException;
import java.io.InputStream;
import java.util.NoSuchElementException;

public class Main {
	public static void main(String[] args) {
		FastScanner sc = new FastScanner();
		char[] s = sc.next().toCharArray();

		int pt = 0;
		for (int i = 0; i < s.length; i++) {
			if (i % 2 == 1 && s[i] == 'g')
				pt++;
			else if (i % 2 == 0 && s[i] == 'p')
				pt--;
		}
		System.out.println(pt);
	}

}

class FastScanner {
	public static String debug = null;

	private final InputStream in = System.in;
	private int ptr = 0;
	private int buflen = 0;
	private byte[] buffer = new byte[1024];
	private boolean eos = false;

	private boolean hasNextByte() {
		if (ptr < buflen) {
			return true;
		} else {
			ptr = 0;
			try {
				if (debug != null) {
					buflen = debug.length();
					buffer = debug.getBytes();
					debug = "";
					eos = true;
				} else {
					buflen = in.read(buffer);
				}
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (buflen < 0) {
				eos = true;
				return false;
			} else if (buflen == 0) {
				return false;
			}
		}
		return true;
	}

	private int readByte() {
		if (hasNextByte())
			return buffer[ptr++];
		else
			return -1;
	}

	private static boolean isPrintableChar(int c) {
		return 33 <= c && c <= 126;
	}

	private void skipUnprintable() {
		while (hasNextByte() && !isPrintableChar(buffer[ptr]))
			ptr++;
	}

	public boolean isEOS() {
		return this.eos;
	}

	public boolean hasNext() {
		skipUnprintable();
		return hasNextByte();
	}

	public String next() {
		if (!hasNext())
			throw new NoSuchElementException();
		StringBuilder sb = new StringBuilder();
		int b = readByte();
		while (isPrintableChar(b)) {
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	public long nextLong() {
		if (!hasNext())
			throw new NoSuchElementException();
		long n = 0;
		boolean minus = false;
		int b = readByte();
		if (b == '-') {
			minus = true;
			b = readByte();
		}
		if (b < '0' || '9' < b) {
			throw new NumberFormatException();
		}
		while (true) {
			if ('0' <= b && b <= '9') {
				n *= 10;
				n += b - '0';
			} else if (b == -1 || !isPrintableChar(b)) {
				return minus ? -n : n;
			} else {
				throw new NumberFormatException();
			}
			b = readByte();
		}
	}

	public int nextInt() {
		return (int) nextLong();
	}

	public long[] nextLongList(int n) {
		return nextLongTable(1, n)[0];
	}

	public int[] nextIntList(int n) {
		return nextIntTable(1, n)[0];
	}

	public long[][] nextLongTable(int n, int m) {
		long[][] ret = new long[n][m];
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < m; j++) {
				ret[i][j] = nextLong();
			}
		}
		return ret;
	}

	public int[][] nextIntTable(int n, int m) {
		int[][] ret = new int[n][m];
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < m; j++) {
				ret[i][j] = nextInt();
			}
		}
		return ret;
	}
}

Measured memory_bytes: 9684
#include<iostream>
#include<vector>
#include<map>
#include<algorithm>
#include<math.h>
#include<string>
#include <iomanip>
#include<deque>
#include<queue>
#include<stack>
#include<set>


using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef int itn;
const ll LINF = 1e18;
const int INF = 1e9;

//マクロ定義
#define vvint(vec,n,m,l) vector<vector<int>> vec(n, vector<int>(m,l));	// lで初期化
#define vvll(vec,n,m,l) vector<vector<ll>> vec(n,vector<ll>(m,l));
#define vint vector<int>
#define pint pair<int,int>
#define rep(i,a) for(int i=0;i<(a);i++)
#define all(x) (x).begin(),(x).end()
#define debug system("pause")				//デバッグ用
#define ret return 0

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

#define ketasitei setprecision(15) //15桁表示



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

	ll n, k, s;
	cin >> n >> k >> s;

	if (n == k)
	{
		for (int i = 0; i < n - 1; i++)
		{
			cout << s << " ";
		}
		cout << s << endl;
	}
	else
	{
		for (int i = 0; i < k; i++)
		{
			cout << s << " ";
		}
        if(s==1)
		  cout << 2;
        else
            cout<<1;
		for (int i = k + 1; i < n; i++)
		{
            if(s!=1000000000)
			cout << " " << 1000000000;
            else
                cout<<" "<<1;
		}
		cout << endl;
	}

	return 0;
}

Measured memory_bytes: 1280
#include <stdio.h>
#include <math.h>
int main() {
	int N;
	double V, H;
	while (scanf(" %lf", &V) != EOF) {
		H = 4.9 * pow(V / 9.8, 2.0);
		for (N = 1;; N++) {
			if (H <= (double)(5 * N - 5)) {
				printf("%d\n", N);
				break;
			}
		}
	}
	return 0;
}

Measured memory_bytes: 628
#include <stdio.h>
#include <string.h>
#define MN 500
int h,w;
char p[MN+5][MN+5],b[MN+5][MN+5],r[MN+5][MN+5];
int main(){
	memset(b,'.',sizeof(b));
	memset(r,'.',sizeof(r));
	scanf("%d%d",&h,&w);
	for(int i=1;i<=h;i++)
		scanf("%s",&p[i][1]);
	for(int i=1;i<=h;i++){
		b[i][1]='#';
		r[i][w]='#';
	}
	for(int i=1;i<=h;i+=2)
		for(int j=2;j<=w-1;j++)
			b[i][j]='#';
	for(int i=2;i<=h;i+=2)
		for(int j=2;j<=w-1;j++)
			r[i][j]='#';
	for(int i=1;i<=h;i++)
		for(int j=1;j<=w;j++)
			if(p[i][j]=='#'){
				b[i][j]='#';
				r[i][j]='#';
			}
	for(int i=1;i<=h;i++){
		for(int j=1;j<=w;j++)
			putchar(b[i][j]);
		putchar('\n');
	}
	putchar('\n');
	for(int i=1;i<=h;i++){
		for(int j=1;j<=w;j++)
			putchar(r[i][j]);
		putchar('\n');
	}
}

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

int main() {
  int H,W;
  while(cin>>H&&cin>>W&&(H!=0&&W!=0)){
    for(int i=0;i<H;i++){ 
      for(int j=0;j<W;j++){
        if((i+j)%2>0){cout<<'.';}
        else{cout<<'#';}
        if(j==W-1){cout<<endl;}}
       if(i==H-1){cout<<endl;}
                  }       
      }
  return 0;
}



Measured memory_bytes: 3080
#include <bits/stdc++.h>
using namespace std;
int INF = 1e9+7;
using ll = long long;
int main()
{
    int n, m;
    cin >> n >> m;
    priority_queue<int> que;
    for(int i = 0; i < n; i++)
    {
        int a;
        cin >> a;
        que.push(a);
    }
    for(int i = 0; i < m; i++)
    {
        int cand = que.top();
        que.pop();
        que.push(cand / 2);
    }
    ll ans = 0;
    while(que.size())
    {
        ans += que.top();
        que.pop();
    }
    cout << ans << endl;
}



Measured memory_bytes: 892
#include <bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin>>n;
  int x=0,y=0,z=0;
  for(int i=0;i<n;++i){
    int a,b,c;
    cin >> a >> b >> c;
    int x1 = a + max(y,z);
    int x2 = b + max(x,z);
    int x3 = c + max(y,x);
    x=x1,y=x2,z=x3;
  }
  cout << max(x,max(y,z)) << "\n";
}


Measured memory_bytes: 384
#include "bits/stdc++.h"

using namespace std;

using ll = long long;
using P = pair<int,int>;

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

    int q;cin>>q;
    vector<int> v;
    int t,p;
    while(q--)
    {
        cin>>t;
        if(t==0)
        {
            cin>>p;
            v.push_back(p);
        }
        else if(t==1)
        {
            cin>>p;
            cout << v[p] << endl;
        }
        else
        {
            v.pop_back();
        }
    }
}



Measured memory_bytes: 3912