akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#include <cstring>
#include <utility>
#include <set>
#include <stack>
#include <climits>
#include <cmath>
#include <iomanip>
#include <unordered_map>
#include <map>
#include <boost/multiprecision/cpp_int.hpp>

#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define rep1(i,n) for(int i=1, i##_len=(n); i<=i##_len; ++i)
#define reps(i,s,n) for(int i=s, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
#define MEMSET(v, h) memset((v), h, sizeof(v))
typedef long long ll;
typedef long double ld;
const char sp = ' ';

using namespace boost::multiprecision;
using namespace std;

int main(void){
    ll A, B, X;
    cin>>A>>B>>X;
    cout<<((A<=X && X<=(A+B)) ? "YES" : "NO")<<endl;
    return 0;
}


Measured memory_bytes: 3580
n = int(input())
a = list(map(int, input().split()))
b = []
if n % 2 == 0:
    key = n - 1
else:
    key = n - 2
for i in range(key, 0, -2):
    b.append(a[i])
for i in range(0, n, 2):
    b.append(a[i])
if n % 2 != 0:
    b = b[::-1]
for i in range(n - 1):
    print(b[i], end = " ")
print(b[n - 1], end = "")
print()


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

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		PrintWriter pw = new PrintWriter(System.out);
		int[] x=new int[3];
		x[0]=sc.nextInt();
		x[1]=sc.nextInt();
		x[2]=sc.nextInt();
		Arrays.sort(x);
		if(x[0]==x[1]&&x[1]!=x[2]||x[1]==x[2]&&x[1]!=x[0])
			pw.println("Yes");
		else
			pw.println("No");
		pw.close();
	}

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s) {
			br = new BufferedReader(new InputStreamReader(s));
		}

		public Scanner(String file) throws FileNotFoundException {
			br = new BufferedReader(new FileReader(file));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

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

		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public String nextLine() throws IOException {
			return br.readLine();
		}

		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}

		public boolean ready() throws IOException {
			return br.ready();
		}
	}
}

Measured memory_bytes: 23124
//#include <ext/pb_ds/assoc_container.hpp> 
//#include <ext/pb_ds/tree_policy.hpp>
#include <bits/stdc++.h>

using namespace std;
//using namespace __gnu_pbds;
 
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
//typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;

#define FOR(i, a, b) for (int i=a; i<b; i++)
#define F0R(i, a) for (int i=0; i<a; i++)
#define FORd(i,a,b) for (int i = (b)-1; i >= a; i--)
#define F0Rd(i,a) for (int i = (a)-1; i >= 0; i--)
 
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound

const int MOD = 1000000007;
double PI = 4*atan(1);

int tim[26], tim1[26];

int main() {
	ios_base::sync_with_stdio(0);cin.tie(0);
	int n; cin >> n;
	F0R(i,26) tim[i] = MOD;
	F0R(i,n) {
		F0R(j,26) tim1[j] = 0;
		string s; cin >> s;
		for (char j: s) tim1[j-'a'] ++;
		F0R(j,26) tim[j] = min(tim[j], tim1[j]);
	}
	string ans;
	F0R(i,26) F0R(j,tim[i]) ans += ('a'+i);
	cout << ans;
}

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

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

    vector<int> ans(N + 1, 0);
    for (int x = 1; x * x <= N; x++)
    {
        for (int y = 1; y * y <= N; y++)
        {
            for (int z = 1; z * z <= N; z++)
            {
                int n = x * x + y * y + z * z + x * y + y * z + z * x;
                if (n <= N)
                {
                    ans[n]++;
                }
            }
        }
    }
    for (size_t i = 1; i <= size_t(N); i++)
    {
        cout << ans[i] << endl;
    }
}


Measured memory_bytes: 3628
PROGRAM ATCODER

implicit none
integer :: r,g,b,n,x,y,z,max_r,max_g,max_b,i,j,count=0

read*, r,g,b,n

max_r = n/r ; max_g = n/g ; max_b = n/b

do i = 0, max_r, 1
  do j = 0, max_g, 1
    x = i ; y = j ; z = (n - x*r - y*g)/b
    if ( mod(n - x*r - y*g,b) == 0 .and. z >=0 .and. z <= max_b ) then
      count = count + 1
    end if
  end do
end do

print'(i0)',  count

END PROGRAM ATCODER

Measured memory_bytes: 768
def next_i(i: int, S: str):
    while i < len(S):
        if S[i] == "W":
            return i
        else:
            i += 1
    return -1


def prev_i(i: int, S: str):
    while 0 <= i:
        if S[i] == "R":
            return i
        else:
            i -= 1
    return -1


def main():
    N = int(input())
    S = input()
    ans = 0

    left = next_i(0, S)
    right = prev_i(N - 1, S)

    while 0 <= left < right:
        ans += 1
        left = next_i(left + 1, S)
        right = prev_i(right - 1, S)

    print(ans)


main()


Measured memory_bytes: 9512
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;
typedef pair<ll,ll> pll;
const ll mod=1e9+7;
//const ll mod=998244353;
const ll inf=1LL<<61;

int main() {
  ll l,r,d;
  cin >> l >> r >> d;
  ll ans=0;
  for(ll i=l;i<=r;i++) {
    if(i%d==0) {
      ans++;
    }
  }
  cout << ans << endl;
}

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

int main(){
  int n;cin>>n;
  string s;cin>>s;
  int v[n];
  for(int i=0;i<n;i++){
    if(s[i]=='(') v[i]=1;
    else v[i]=-1;
  }
  int tmp=0;
  for(int i=0;i<n;i++){
    tmp+=v[i];
    if(tmp<0){
      s='('+s;
      tmp=0;
    }
  }
  while(tmp>0){
    s=s+')';
    tmp--;
  }
  cout<<s<<endl;
  return 0;
}

Measured memory_bytes: 888
#include<stdio.h>
#include<stdlib.h>
#define NIL NULL 

struct node {

  int key;
  struct node *left;
  struct node *right;
  struct node *parent;
};

typedef struct node* Node;
Node root;

Node treeSearch(Node x,int k) {
  if(x == NIL || k == x-> key) 
    return x;
  if(k < x->key)
    return treeSearch(x->left,k);
  else return treeSearch(x->right,k );
}

Node treeMinimum(Node u) {
  
  while(u->left != NIL)
    u = u->left;
  return u;
} 


Node treeSuccessor(Node u) {
  
  Node y;
  if(u->right != NIL) 
    return treeMinimum(u->right);
  
  y = u->parent;  
  while(y != NIL && u == y->right) {
    u = y;
    y = y->parent;
  }
  return y;
} 

void treeDelete(Node u) {
  
  Node y;
  Node x;
  
  if(u->left == NIL || u->right == NIL) 
    y = u;
  else y = treeSuccessor(u);

  if(y->left != NIL) 
    x = y->left;
  else x = y->right;

  if(x != NIL)
    x->parent = y->parent;
  
  if(y->parent == NIL)
    root = x;
  
  else {
    if(y == y->parent->left)
      y->parent->left = x;
    
    else y->parent->right = x;
    
    if(y != u) {
      u->key = y->key;
    }
    y = u; 
  }
}
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(x != NIL) {
    y = x;
  if(z->key < x->key)
    x = x->left;
  
  else x = x->right;
 }
  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->left != NIL)
    inorder(u->left);
  printf(" %d",u->key);
  if(u->right != NIL)  
    inorder(u->right); 
}

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

int main(void) {
  
  int i,n,x;
  char c[6];
  
  scanf("%d",&n);
  
  for(i=0;i<n;i++) {
    scanf("%s",c);
    if(c[0] == 'f') {
      scanf("%d",&x);
      if(treeSearch(root,x) != NIL)
	printf("yes\n");
      else printf("no\n");
    }
    else if(c[0] == 'i') {
      scanf("%d",&x);
      insert(x);
    }
    else if(c[0] == 'p') {
      if(root != NIL)   
	inorder(root);
      printf("\n");
      if(root != NIL)
	preorder(root);
      printf("\n");
    }  
    else if(c[0] == 'd') {
      scanf("%d",&x);
      treeDelete(treeSearch(root,x));
    }  
  }
  return 0;
}

Measured memory_bytes: 19364
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef string str;
const long long INF = INT64_MAX;

#define REP(i, n) for(ll i=0;i<n;i++)
#define ASC(v) sort((v).begin(), (v).end())
#define DESC(v) sort((v).rbegin(), (v).rend())
#define UNIQ(v) ASC(v);erase(unique(v.begin(), v.end()), v.end())
#define FIO ios_base::sync_with_stdio(false);cin.tie(NULL);

void solve() {
    map<ll, ll> ctr;
    ll N,K;
    cin >> N >> K;
    for (int i = 0; i < N; i++)
    {
        ll a;
        cin >> a;
        ctr[a]++;
    }
    vector<pair<ll, ll> > v(ctr.begin(), ctr.end());
    sort(v.begin(), v.end(), [](auto &l, auto &r) {
        return l.second < r.second;
    });
    ll kind = v.size();
    if(kind <= K) {
        cout << 0 << endl;
    }else {
        ll ans = 0;
        for(int k = kind, j = 0; k > K; k--, j++) {
            ans += v[j].second;
        }
        cout << ans << endl;
    }
}

int main() {
    FIO;
    solve();
    return 0;
}


Measured memory_bytes: 15872
using System;
using System.IO;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using System.Numerics;
using System.Diagnostics;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using static System.Math;

class P
{
    static void Main()
    {
        Console.WriteLine(Console.ReadLine().Count(x => x == '2'));
    }
}


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

#define endl '\n'
#define rep(i,s,n)      for (int i = s ; i < n ; i++)
#define repp(i,s,n)    for (int i = s ; i <= n ;i++)
#define all(a)      a.begin(),a.end()
#define sz(v)    (int)v.size()
#define NumofDigits(n)    ((long long)log10(n)+1)
#define Unique(n)         (n).erase(unique(all(n)), (n).end())
#define test    int s ; cin >> s; while (s--)
#define readArr    int n ; cin >> n ; int arr[n]; rep(i,0,n)cin>>arr[i]
#define isvowel(a)   (a == 'a' || a == 'e' || a == 'i' || a == 'o' || a == 'u')
#define fast        ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)

typedef long long ll ;

void readFromText ()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
#endif // ONLINE_JUDGE
}

const double Pi = acos(-1.0);

bool isMultiBy4 (int a ){
    return a%4==0;
}

bool myFun (int i , int j ) {

}

const int MAX = 1e6;
int mn [MAX+9];
int freq[MAX+9];
int pref[MAX+9];

int main()
{
    fast;
//    readFromText();
    int in = 0 ;
    for (int i = 0 ; i < 5 ; i++){
        int b ; cin >> b ;
        if (b==0)in=i+1;
    }
    cout << in << endl ;
    return 0;
}



Measured memory_bytes: 3592
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cmath>
using namespace std;

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

const int INF = 1e9;
const int MOD = 1e9 + 7;

// 4近傍、8近傍
int dx[] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[] = {0, 1, 0, -1, 1, 1, -1, -1};

int main() {
  // 入力
  int a, b;
  cin >> a >> b;
  string s;
  cin >> s;

  string ans = "Yes";
  for (int i = 0; i < s.size(); i++) {
    if (i == a) {
      if (s[i] != '-') ans = "No";
    } else {
      if (s[i] < '0' || '9' < s[i]) ans = "No";
    }
  }

  // 解答
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long
int n,m;
bool in(int y,int x){
  return 0<=y&&y<n&&0<=x&&x<m;
}
signed main(){
  while(cin>>n>>m,n||m){
    string s[n];
    for(int i=0;i<n;i++) cin>>s[i];
    int cnt[4][n][m];
    memset(cnt,0,sizeof(cnt));
    int ng=0;
    //AD
    //BC
    int sy[]={0,n-1,n-1,0};
    int sx[]={0,0,m-1,m-1};
    for(int i=0;i<4;i++){
      int y=sy[i],x=sx[i],dir=(i+2)%2;
      int gy=sy[(i+1)%4],gx=sx[(i+1)%4];
      int used[4][n][m];
      int ay[]={-1,0,1,0};
      int ax[]={0,-1,0,1};
      memset(used,0,sizeof(used));
      while(y!=gy||x!=gx){
	cnt[i][y][x]=1;
	if(used[dir][y][x]) break;
	used[dir][y][x]=1;
	//cout<<y<<" "<<x<<" "<<dir<<endl;
	int ny=y+ay[dir],nx=x+ax[dir];
	if(in(ny,nx)&&s[ny][nx]=='.'){
	  y=ny;x=nx;
	  ny=y+ay[(dir+3)%4];nx=x+ax[(dir+3)%4];
	  if(in(ny,nx)&&s[ny][nx]=='.'){
	    cnt[i][y][x]=1;
	    y=ny;x=nx;dir=(dir+3)%4;
	  }
	}else{
	  dir=(dir+1)%4;
	}
      }
      if(y!=gy||x!=gx){
	cout<<"NO"<<endl;
	ng=1;
	break;
      }
    }
    if(ng) continue;
    /*
    for(int k=0;k<4;k++){
      for(int i=0;i<n;i++){
	for(int j=0;j<m;j++){
	  cout<<cnt[k][i][j];
	}
	cout<<endl;
      }
      cout<<endl;
    }
    */
    bool flg=1;
    for(int i=0;i<n;i++){
      for(int j=0;j<m;j++){
	int tmp=0;
	for(int k=0;k<4;k++){
	  if(cnt[k][i][j]) tmp++;
	}
	if(tmp>1){
	  cout<<"NO"<<endl;
	  flg=0;
	}
	if(!flg) break;
      }
      if(!flg) break;
    }
    if(flg) cout<<"YES"<<endl;
  }
  return 0;
}

Measured memory_bytes: 3328
#include <bits/stdc++.h>
#define ALL(obj) begin(obj), end(obj)
#define debug(x) cerr << #x << ": " << x << '\n'
using namespace std;
template <class T>
vector<T> make_vec(size_t a) {
    return vector<T>(a);
}
template <class T, class... Ts>
auto make_vec(size_t a, Ts... ts) {
    return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}
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;
}

using ll = long long;
using ull = unsigned long long;
const int INF = 2100100100;
// const int MOD = 1e9 + 7;

int main() {
    int N;
    cin >> N;
    vector<int> num(100005, 0);
    for (int i = 0; i < N; i++) {
        int l, r;
        cin >> l >> r;
        num[l] += 1;
        num[r + 1] += -1;
    }
    int ans = 0;
    for (int i = 0; i < 100004; i++) {
        num[i + 1] += num[i];
        ans += num[i];
    }
    cout << ans << endl;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N,a,b;
  cin >> N >> a >> b;
  if (N*a == b) {
    cout << b << endl;
  }
  else if (N*a > b){
    cout << b << endl;
  }
  else {
    cout << N*a << endl;
  }
}

Measured memory_bytes: 256
// Why I am so dumb? :c
#include <bits/stdc++.h>

#define pb push_back
#define mp make_pair

#define all(x) (x).begin(), (x).end()

#define fi first
#define se second

using namespace std;

typedef long long ll;

int arr[100005];

int n, k;

void solve() {                   
	scanf("%d %d", &n, &k);
	int g = 0;

    for (int i = 1; i <= n; ++i) {
    	scanf("%d", &arr[i]);
    	g = __gcd(g, arr[i]);
    }
	
	if (k % g) {
		printf("IMPOSSIBLE\n");
		return;
	}

	if (k <= *max_element(arr + 1, arr + n + 1)) {
		printf("POSSIBLE\n");
	}
	else {
		printf("IMPOSSIBLE\n");
	}
}

int main() {    
    int tt = 1;

    while (tt--) {
        solve();
    }

    return 0;
}

Measured memory_bytes: 640
arr = []
5.times do
  arr.push gets.strip.to_i
end
k = gets.strip.to_i
r = 'Yay!'
4.downto(1) do |i|
  i.downto(0) do |j|
    if (arr[i] - arr[j]) > k
      r = ':('
      break
    end
  end
end
puts r

Measured memory_bytes: 1788
var GET=(function(){function f(s){return new g(s);}function g(s){this._s=s.trim().split("\n");this._y=0;}g.prototype.a=function(f){var s=this._s, y=this._y, r;if(typeof s[y]==="string")s[y]=s[y].split(" ").reverse();r=s[y].pop();if(!s[y].length)this._y++;return f?r:+r;};g.prototype.l=function(f){var s=this._s[this._y++].split(" ");return f?s:s.map(a=>+a);};g.prototype.m=function(n,f){var r=this._s.slice(this._y,this._y+=n).map(a=>a.split(" "));return f?r:r.map(a=>a.map(a=>+a));};g.prototype.r=function(n,f){var r=this._s.slice(this._y,this._y+=n);return f?r:r.map(a=>+a);};return f;})();
var o=GET(require("fs").readFileSync("/dev/stdin","utf8"));
function xArray(v){var a=arguments,l=a.length,r="Array(a["+--l+"]).fill(0).map(x=>{return "+v+";})";while(--l)r="Array(a["+l+"]).fill(0).map(x=>"+r+")";return eval(r);}

console.log(main());
function main(){
  var m = o.a();
  var d = o.a();
  var ans = 0;
  for(var i = 1; i <= m; i++){
    for(var j = 11; j <= d; j++){
      var a = j/10|0;
      var b = j % 10;
      if(a >= 2 && b >= 2 &&i === a*b)ans++;
    }
  }
  return ans;
}

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

struct input{
     int a,b;
};

int compare_int(const void *x,const void *y){
    if ( (*(struct input*)x).a > (*(struct input*)y).a ) return 1;
    if ( (*(struct input*)x).a < (*(struct input*)y).a ) return -1;
    return 0;
}

int main(void){
    int n,m,k,i;
    long int ans;
    k = 0, ans = 0;
    scanf("%d%d",&n,&m);
    struct input A[n];
    for(i=0; i<n; i++){
        scanf("%d%d",&A[i].a,&A[i].b );
    }
    qsort(A, n, sizeof(struct input), compare_int);


    for(i=0; k<=m; i++){
        if( k + A[i].b >= m ){
            ans += (long) A[i].a * (m - k);
            k += m - k;
            break;
        }else{
            ans +=(long) A[i].a * (long) A[i].b;
            k += A[i].b;
        }
    }
    printf("%ld\n",ans);

    return 0;
}

Measured memory_bytes: 1788
#include <bits/stdc++.h>
using namespace std;
struct Fast { Fast() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20);} } fast;

long long mod = 1000000007;

long long div(long long a, long long b, long long c){
    return b / c - (a - 1) / c;
}
int main() {
    long long n, max = 0, ans = 0;
    cin >> n;
    for (int i = 1; i < 10; i++){
        if (n % i != 0){
            continue;
        }else if (n / i < 10){
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstring>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <set>
#include <utility>
#include <cstdlib>
#include <queue>
#include <stack>
#include <iomanip>
#include <cstdio>
#include <map>

using namespace std;

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

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

#define all(x) (x).begin(), (x).end()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
#define chmin(x,y) (x=min(x,y))
#define chmax(x,y) (x=max(x,y))

//ll gcd(ll a, ll b){return b?gcd(b,a%b):a;}
int dx[4] = {1,0,-1,0};
int dy[4] = {0,1,0,-1};

const ll mod = 1e9 + 7;
const ll IMF = 1LL<<29;
const double PI = 3.14159265358979323846;



vector<int> A,B;
int n,sum;
int main(){
        int i,a;
        cin >> n;
        for(i = 1; i <= n; i++){
                cin >> a;
                sum += abs(a);
                if(a > 0){
                        A.push_back(a);
                }
                else{
                        B.push_back(a);
                }
        }

        sort(all(A));
        sort(all(B));

        if(B.empty()){
                cout << sum - A[0]*2 << endl;;

                for(i = 1; i+1 < A.size(); i++){
                        cout << A[0] << " " << A[i] << endl;
                        A[0] -= A[i];
                }
                cout << A.back() << " " << A[0] << endl;
                return 0;
        }
        if(A.empty()){
                cout << sum-abs(B.back() * 2) << endl;
                int sz = B.size();
                for(int i = 0; i+1 < sz; i++){
                        cout << B[sz-1] << " " << B[i] << endl;
                        B[sz-1] -= B[i];
                }
                return 0;
        }

        cout << sum << endl;
        for(i = 1; i < A.size(); i++){
                cout << B[0] << " " << A[i] << endl;;
                B[0] -= A[i];
        }
        cout << A[0] << " " << B[0] << endl;
        A[0] -= B[0];
        for(int i = 1; i < B.size(); i++){
                cout << A[0] << " " << B[i] << endl;
                A[0] -= B[i];
        }
}




Measured memory_bytes: 2424
#include<stdio.h>
#define MAX 1000000

void maxHeapify(int *A,int i,int H){
  int l,r,largest,t;
  l=i*2;
  r=i*2+1;
  if(l<=H && A[l]>A[i]) largest=l;
  else largest=i;
  if(r<=H && A[r]>A[largest]) largest=r;
  if(largest!=i){
    t=A[i];
    A[i]=A[largest];
    A[largest]=t;
    maxHeapify(A,largest,H);
  }
}
int main(){
  int n,H,i,A[MAX];
  scanf("%d",&H);
  for(i=1;i<=H;i++) scanf("%d",&A[i]);
  for(i=H/2;i>=1;i--){
    maxHeapify(A,i,H);
  }
  for(i=1;i<=H;i++) printf(" %d",A[i]);
  printf("\n");
  return 0;
}



Measured memory_bytes: 3704
-module('Main').
-export([main/1]).

calc([T1, X1, Y1 | L = [T2, X2, Y2 | _]]) ->
    T = T2 - T1,
    Dist = abs(X2 - X1) + abs(Y2 - Y1),
    case Dist =< T andalso (Dist + T) rem 2 =:= 0 of
        true -> calc(L);
        false -> false
    end;
calc(_) -> true.

solve() ->
    [N] = input("~d"),
    List = input(lists:flatten(lists:duplicate(3 * N, "~d"))),
    io:format("~s~n", [case calc([0, 0, 0 | List]) of
        true -> "Yes";
        false -> "No"
    end]),
    ok.

main(_) ->
    solve(),
    halt().

input(Pat) ->
    {ok, L} = io:fread("", Pat),
    L.


Measured memory_bytes: 142968
# ANSHUL GAUTAM
# IIIT-D

from math import *
from copy import *
from heapq import *
from string import *				# alpha = ascii_lowercase
from random import *				# l.sort(key=lambda l1:l1[0]-l1[1]) => ex: sort on the basis difference
from bisect import *				# bisect_left(arr,x,start,end)  => start and end parameters are temporary
from sys import stdin				# bisect_left return leftmost position where x should be inserted to keep sorted
from sys import maxsize
from operator import *				# d = sorted(d.items(), key=itemgetter(1))
from itertools import *
from collections import Counter		# d = dict(Counter(l))
from collections import defaultdict # d = defaultdict(list)

'''

'''

def solve(l):
	n = len(l)
	

N = int(stdin.readline())
ans = pi*(N*2)
print(ans)









Measured memory_bytes: 76580
#include <bits/stdc++.h>
using namespace std;
using ll=long long int;
using ld=long double;
using VI=vector<ll>;
using VD=vector<ld>;
using VVI=vector<VI>;
using VC=vector<char>;
using VB=vector<bool>;
using VVC=vector<VC>;
using VS=vector<string>;
using PLL =pair<ll,ll>;
using PLD=pair<ld,ld>;
using VPLL=vector<PLL>;
#define print(x) std::cout<<x<<"\n"
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define repd(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define ALL(x) (x).begin(),(x).end()
#define ALLR(x) (x).rbegin(),(x).rend()
#define SZ(x) ((ll)(x).size())
#define MAX(x) *max_element((x).begin(),(x).end())
#define MIN(x) *min_element((x).begin(),(x).end())
#define SORTR(x) sort((x).rbegin(),(x).rend())
#define SORT(x) sort((x).begin(),(x).end())
#define SUM(x) accumulate((x).begin(),(x).end(), 0)
#define FILL(x,a) fill(x.begin(),x.end(),a)
#define EACH(i,x) for(typeof((x).begin()) i=(x).begin(); i!=(x).end(); ++i)
#define EXIST(v, x) (std::find(v.begin(), v.end(), x) != v.end())

const ll INF = 1e18;
const ld EPS   = 1e-10;
const int MOD  = int(1e9)+7;
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; }
template <class BidirectionalIterator>
bool next_partial_permutation(BidirectionalIterator first, BidirectionalIterator middle,BidirectionalIterator last){reverse(middle, last); return next_permutation(first , last);}
ll gcd(ll x, ll y) { return (x % y)? gcd(y, x % y): y; }
ll lcm(ll x, ll y) { return x / gcd(x, y) * y; }
ll GCD(VI v){ll a = v[0]; for (ll i = 1; i<SZ(v); i++) {a = gcd(a, v[i]);} return a;}
ll LCM(VI v){ll a = v[0]; for (ll i = 1; i<SZ(v); i++) {a = lcm(a, v[i]);} return a;}
VI Bit2Vector(const ll bit, ll n) {	VI s;	rep(i,n) if (bit & (1 << i)) s.push_back(i); return s;}



void Main()
{
	//cout << "Hello world!" << endl;
	ll n;
	cin>>n;
	ll a[n+1];
	rep(i,n+1) cin>>a[i];
	if(n==0){
		if(a[0]==1) cout<<"1"<<endl;
		else cout<<"-1"<<endl;
		return;
	}
	ll leaf[n+1];
	leaf[n]=a[n];
	for(ll i=n-1;i>=0;i--){
		leaf[i]=a[i]+leaf[i+1];
	}
	ll ans=1;
	bool flag=true;
	ll lvl[n+1];
	lvl[0]=1;
	for(ll i=1;i<=n;i++){
		lvl[i]=min(2*(lvl[i-1] - a[i-1]),leaf[i]);
		if(lvl[i]<a[i]){
			flag=false;
			break;
		}
		ans+=lvl[i];
	}

	if(!flag){
		ans=-1;
	}
	ll res=ans;
	cout << res << "\n";
	return;
}

int main()
{
	std::cin.tie(0);
	std::ios_base::sync_with_stdio(false);
	std::cout << std::fixed << std::setprecision(15);
	Main();
}


Measured memory_bytes: 5992
#include <cstdio>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>

using namespace std;

int main(){
	
	string str;
	
	cin >> str;
	
	int ans = 0;
	
	for(int i = 0; i < 6; i++){
		if(str[i] == '1'){
			ans++;
		}
	}
	
	cout << ans << endl;
	
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <queue>
#include <map>
#include <set>
#include <vector>
#define rep(i,x,n) for(int i=x;i<n;i++)
#define repd(i,x,n) for(int i=x;i<=n;i++)
#define pii pair<int,int>
#define pll pair<long long ,long long>
#define gbtb std::ios::sync_with_stdio(false)
#define MS0(X) memset((X), 0, sizeof((X)))
#define MSC0(X) memset((X), '\0', sizeof((X)))
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define gg(x) getInt(&x)
using namespace std;
typedef long long ll;
inline void getInt(int* p);
/*** TEMPLATE CODE STARTS HERE ***/
ll n;
ll ans;
ll x;
ll a[200050];
ll ABS(ll x)
{
	return x>0?x:-1*x;
}
int main()
{
	// freopen("D:\\common_text\\code_stream\\out.txt","w",stdout);
	// freopen("D:\\common_text\\code_stream\\in.txt","r",stdin);
    ans=1e18;
    gbtb;
    cin>>n>>x;
    repd(i,1,n)
    {
    	cin>>a[i];
    	a[i]=a[i]+a[i-1];
    }
    for(int k=1;k<=n;++k)
    {
    	ll sum = 0;
    	ll now = 3;
    	for(int i=n;i>=1;i-=k)
    	{
    		sum+=(a[i]-a[max(0,i-k)])*max(now,5ll);
    		now+=2;
    		if(sum>=ans)
    		{
    			break;
    		}
    	}
    	ans=min(ans,sum+=1ll*(k+n)*x);

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

inline void getInt(int* p) {
    char ch;
    do {
        ch = getchar();
    } while (ch == ' ' || ch == '\n');
    if (ch == '-') {
        *p = -(getchar() - '0');
        while ((ch = getchar()) >= '0' && ch <= '9') {
            *p = *p * 10 - ch + '0';
        }
    }
    else {
        *p = ch - '0';
        while ((ch = getchar()) >= '0' && ch <= '9') {
            *p = *p * 123330 + ch - '0';
        }
    }
}


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

int main() {
  int N;cin >> N;
  vector<long> A(N),B(N),C(N);
  for (int i=0;i<N;i++) cin >> A.at(i);
  for (int i=0;i<N;i++) cin >> B.at(i);
  for (int i=0;i<N;i++) cin >> C.at(i);
  sort(A.begin(),A.end());
  sort(B.begin(),B.end());
  sort(C.begin(),C.end());
  vector<long> AB(N);vector<long> BC(N);
  for (int i=0;i<N;i++) {
    auto ir = lower_bound(A.begin(),A.end(),B.at(i));
    long d = distance(A.begin(),ir);
    if (i==0) AB.at(i) = d;
    else AB.at(i) = AB.at(i-1) + d;
  }
  long count = 0;
  for (int i=0;i<N;i++) {
    auto ir2 = lower_bound(B.begin(),B.end(),C.at(i));
    long d2 = distance(B.begin(),ir2);
    if (d2 != 0L) count += AB.at(d2-1L);
  }
  cout << count << endl;
}

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

int main(){
  int A[32] = {1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
  int K;
  cin >> K;
  int ans = A[K-1];
  cout << ans << endl;
  
  return 0;
}


Measured memory_bytes: 384
import java.util.*;

public class Main{
  public static void main(String[] args) {
    try {
      Scanner sc = new Scanner(System.in);
      int n,x, min = 1000;

      n = Integer.parseInt(sc.next());
      x = Integer.parseInt(sc.next());

      int m[] = new int[n];

      for(int i=0; i<n; i++){
        m[i] = Integer.parseInt(sc.next());
        x = x- m[i];
        if(m[i]<min){
          min = m[i];     
        }
      }

      System.out.println(n + x/min);

      
    }
    catch (Exception e) {
      
    }
  }
}

Measured memory_bytes: 21844
#include<vector>
#include<iostream>
#include<algorithm>
int ReturnNumberBaggage(std::vector<int> Baggage, int MaxWeightPerTruck, int k) {
	int NumberBaggage = 0, weightPerTruck = 0, NumberTruck = 0;
	for (int i = 0; i < Baggage.size(); ++i) {
		//next_truck
		if (weightPerTruck > 0 && MaxWeightPerTruck > 0 && weightPerTruck + Baggage[i] > MaxWeightPerTruck) {
			weightPerTruck = 0;
			++NumberTruck;
		}
		//finish_put
		if (NumberTruck == k) {
			break;
		}
		//put
		if (weightPerTruck + Baggage[i] <= MaxWeightPerTruck) {
			weightPerTruck += Baggage[i];
			++NumberBaggage;
		}
	}
	return NumberBaggage;
}
int main(void) {
	std::ios::sync_with_stdio(false);
	int n, k,max=0;
	std::cin >> n >> k;
	std::vector<int> Baggage(n, 0);
	for (int i = 0; i < n; ++i) {
		std::cin >> Baggage[i];
		max += Baggage[i];
	}
	int min = 1, MaxWeightPerTruck =(min+max)/2;
	while (min <= max) {
		if (n <= ReturnNumberBaggage(Baggage, MaxWeightPerTruck,  k)) {
			max = MaxWeightPerTruck - 1;
		}
		else {
			min = MaxWeightPerTruck + 1;
		}
		MaxWeightPerTruck = (min + max) / 2;
	}
	std::cout << MaxWeightPerTruck + 1 << std::endl;
	//	system("pause");
	return 0;
}

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

int main()
{
    int X, Y;
    cin >> X >> Y;
    int turu = 0;
    int kame = X - turu;
    rep(i, X + 1)
    {
        if (turu * 2 + kame * 4 == Y)
        {
            cout << "Yes" << endl;
            return 0;
        }
        turu++;
        kame = X - turu;
    }
    cout << "No" << endl;
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a,b;
  int digit_10000, digit_1000,digit_100, digit_10, digit_1;
  int count = 0;
  // 変数aで入力を受け取る
  cin >> a >>b;
  
 while (a <= b){
   digit_10000 = a/10000;
   digit_1000 = (a - 10000 * digit_10000) /1000;
   digit_100 =  (a - 10000 * digit_10000 - 1000 * digit_1000) / 100 ;
   digit_10 = (a - 10000 * digit_10000 - 1000 * digit_1000 - 100 * digit_100) / 10 ;
   digit_1 = (a - 10000 * digit_10000 - 1000 * digit_1000 - 100 * digit_100 - 10 * digit_10) / 1 ;
  
   if ( digit_10000 == digit_1 && digit_1000 == digit_10){
     count++;}
   
   a++;
 }
   
cout << count << endl;
}

Measured memory_bytes: 3588
#include <bits/stdc++.h>
using namespace std;
 
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define int long long

const int N = 1e5 + 5;

int32_t main()
{
	IOS;
	int n;
	cin >> n;
	int ans = 0;
	for(int i = 1; i <= n; i++)
		for(int j = 1; j <= n; j++)
			for(int k = 1; k <= n; k++)
				ans += __gcd(i, __gcd(j, k));
		cout << ans;
	return 0;
}

Measured memory_bytes: 3652
/********************************************************************
 * Ejercicio: Frog 2                                                *
 * Url: https://atcoder.jp/contests/dp/tasks/dp_b                   *
 * Lenguaje: c++                                                    *
 * Autor: Sebastian Vega                                            *
 * Fecha: 27-08-2020                                                *
 *******************************************************************/

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
#define forn(i, a, b) for (int i = a; i < b; ++i)
#define SZ(x) int(x.size())
#define pb push_back
#define F first
#define S second
void dbg_out() { cerr << endl; }
template <typename Head, typename... Tail>
void dbg_out(Head H, Tail... T) {
  cerr << ' ' << H;
  dbg_out(T...);
}

const int N = 1e5 + 1, INF = 1e9;
int n, k, h[N], dp[N];

int main() {
#ifdef LOCAL
  freopen("in.txt", "r", stdin);
// freopen("main.txt", "w", stdout);
#define dbg(...) cerr << "(" << #__VA_ARGS__ << "):", dbg_out(__VA_ARGS__)
#else
  ios::sync_with_stdio(0);
  cin.tie(0);
#define endl '\n'
#define dbg(...) 18
#endif
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> h[i];
  for (int i = 0; i < n; i++) {
    dp[i] = INF;
    for (int j = 1; j <= k; j++) {
      if (i - j < 0) break;
      dp[i] = min(dp[i], abs(h[i] - h[i - j]) + dp[i - j]);
    }
    dp[i] = dp[i] == INF ? 0 : dp[i];
  }
  cout << dp[n - 1] << endl;
  return 0;
}

Measured memory_bytes: 4400
// https://beta.atcoder.jp/contests/abc074
// status:

#define SUBMIT

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

int main() {
#ifdef SUBMIT
    auto& stream = cin;
#else
    stringstream stream(R"(5
20
11 12 9 17 12
)");
#endif
    int N, K;
    stream >> N >> K;

    int ans = 0;
    for (int i = 0; i < N; ++i) {
        int a;
        stream >> a;
        ans += 2 * min(abs(a - 0), abs(a - K));
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
/* ITP1_8_B: Sum of Numbers */

#include <iostream>
#include <string>
#include <vector>

int sum_digits(std::string s) {
    int sum = 0;
    for (int i = 0; i < s.length(); i++) {
        sum += s[i] - '0';
    }
    return sum;
}

int main() {
    std::ios::sync_with_stdio(false);

    std::vector<int> sums;
    std::string s;

    while (true) {
        std::cin >> s;
        if (s == "0") break;
        sums.push_back( sum_digits(s) );
    }

    for (int i = 0; i < sums.size(); i++) {
        std::cout << sums[i] << "\n";
    }

    return 0;
}

Measured memory_bytes: 1220
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
using namespace std;
typedef long long ll;
typedef pair<int, int> PII;

int main(){
  int N,K,ans = 0;
  cin >> N >> K;
  int syou,amari;
  syou = N;
  while(syou != 0){
    syou = syou / K;
    amari = N % K;
    ans ++;
  }
  cout << ans << endl;
  return 0;
}

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

#define pi 3.141592654
#define lit 1000000007
#define endl '\n'
#define io ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define fix(n) cout << fixed << setprecision(n)
#define mset(a,n) memset(a,n,sizeof a)
#define _max(a,b) ((a)>(b)?(a):(b))
#define _min(a,b) ((a)<(b)?(a):(b))
#define rep(i,a,b) for (__typeof((b)) i=(a);i<(b);i++)
#define repp(i,a,b,p) for(__typeof((b)) i=(a);i<(b);i+=p)
#define ren(i,a,b) for(__typeof((a)) i=(a);i>=(b);i--)
#define lbd lower_bound
#define ubd upper_bound
#define ll  long long
#define ull unsigned long long
#define ld long double
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define out(n) cout << n << " "
#define outl(n) cout << n << endl
#define line cout << endl
#define bug(n) {outl(n);return;}
#define debug(arr) cout << #arr << " = [ "; for(auto x : arr) cout << x << ' '; cout <<']' << endl;
#define print(mp) for(auto x : mp){ cout << #mp << " = [ "; cout << x.first << " , " << x.second << " ]" << endl;};
int main()
{
    io;

    #ifndef ONLINE_JUDGE
        freopen("input.txt","r",stdin);
        freopen("output.txt","w",stdout);
    #endif
    
    ll int lim = 100000;

    vector <ll int> v;

    for(ll  int i=0 ; i<lim ; i++)
    {
        v.pb(0);
    }

    ll int n,tot=0,temp;

    cin>>n;

    vector <ll int> ar(n);

    for (ll int i=0 ; i<n ; i++ )
    {
        cin>>temp;
        ar[i]=temp;
        tot=tot+temp;
        v[ar[i]-1]++;
    }

    ll int q,b,c;
    
    cin>>q;
    
    for (ll int i=0 ; i<q ; i++)
    {
        cin>>b>>c;
        tot=tot-(b*v[b-1])-(c*v[c-1]);
        v[c-1]=v[c-1]+v[b-1];
        tot=tot+(c*v[c-1]);
        v[b-1]=0;
        cout<<tot<<endl;
    }

    return 0;
}

Measured memory_bytes: 5048
#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; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 1e9

int main() {
    int N;
    cin >> N;
    vector<long long> A(N);
    vector<double> A_log(N);
    bool including_zero = false;
    for (int i=0; i<N; i++){
        cin >> A[i];
        A_log[i] = log10(A[i]);
        if (A[i] == 0){
            including_zero = true;
        }
    }
    if (including_zero){
        cout << 0 << endl;
        return 0;
    }

    float mul_log = 0;
    for (int j=0; j<N; j++){
        mul_log += A_log[j];
        if (mul_log > 19.0){
            cout << -1 << endl;
            return 0;
        }
    }
    

    long long int mul = 1;
    for (int j=0; j<N; j++){
        mul *= A[j];
    }
    if (mul > 1000000000000000000){
            cout << -1 << endl;
            return 0;
        }
    cout << mul << endl;
        return 0;
}


Measured memory_bytes: 4844
#include <iostream>


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


Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
#define ALL(x) (x).begin(), (x).end()
#define REP(i ,n) for(int i = 0; i < (int)(n); i++)
#define pb push_back
typedef vector<int>vint;
typedef vector<ll>vll;
template<typename T> istream &operator>>(istream &is, vector<T> &vec){ for (auto &v : vec) is >> v; return is; }
template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}
int main()
{
    string S,T;
    cin >> S >> T;
    int ans = 0;
    REP(i,S.size()){
        if(S[i] == T[i])ans++;
    }
    cout << ans << endl;
}

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

int main() {
	int N;
	cin >> N;
	vector<ll> A(N);
	for (int i = 0; i < N; i++) {
		cin >> A[i];
	}

	ll height = 0;
	ll step = 0;
	for (int i = 0; i < N; i++) {
		if (A[i] < height) {
			step += height - A[i];
		} else {
			height = A[i];
		}
	}
	cout << step << endl;

	return 0;
}

Measured memory_bytes: 4764
import java.util.*;
import java.awt.*;
import static java.lang.System.*;
import static java.lang.Math.*;
public class Main {
    static int mod=1000000007;
    public static void main(String[]$) {
        Scanner sc = new Scanner(in);
        int n=sc.nextInt();
        int h=sc.nextInt();
        int w=sc.nextInt();
        int ans=0;
        for (int i = 0; i < n; i++) {
            int a=sc.nextInt();
            int b=sc.nextInt();
            if(a>=h&&b>=w)ans++;
        }
        out.println(ans);
    }
    static long power(long x,int n){
        long mod=1000000007;
        long ans=1;
        while (n>0) {
            if((n&1)==1){
                ans=(ans*x)%mod;
            }
            x=(x*x)%mod;
            n>>=1;
        }
        return ans;
    }
    //最大公約数
    static int gcd (int a,int b) {
        int temp;
        while((temp = a%b)!=0) {
            a = b;
            b = temp;
        }
        return b;
    }
    //※最小公倍数はa*b/gcd(a,b)である
    static class UF{
        static int size=51;
        static int[] par=new int[size];
        //初期化
        static void init(){
            for (int i = 1; i <size ; i++) {
                par[i]=i;
            }
        }
        //根をたどる
        static int root(int x){
            if(par[x]==x){
                return x;
            }else{
                return par[x]=root(par[x]);
            }
        }
        //同じ根をもつか(同じ集合に属するか)判定
        static boolean same(int x,int y){
            return root(x)==root(y);
        }
        //合体
        static void unite(int x,int y){
            x=root(x);
            y=root(y);
            if(x==y)return;
            par[x]=y;
        }
    }
}

Measured memory_bytes: 26452
#include<iostream>
	#include<vector>
    using namespace std;
    int a[100005][4];
    int dp[100005][4];
    int n;
     
    int func(int ind, int flag) {
     
    	if (ind == n) return 0;
     
    	if (dp[ind][flag] != -1) return dp[ind][flag];
     
    	int maxi = 0;
    	if (flag == 0) {
    		maxi = max(maxi, a[ind][1] + func(ind + 1, 1));
    		maxi = max(maxi, a[ind][2] + func(ind + 1, 2));
    		maxi = max(maxi, a[ind][3] + func(ind + 1, 3));
    	}
    	else if (flag == 1) {
    		maxi = max(maxi, a[ind][2] + func(ind + 1, 2));
    		maxi = max(maxi, a[ind][3] + func(ind + 1, 3));
    	}
    	else if (flag == 2) {
    		maxi = max(maxi, a[ind][1] + func(ind + 1, 1));
    		maxi = max(maxi, a[ind][3] + func(ind + 1, 3));
    	}
    	else {
    		maxi = max(maxi, a[ind][1] + func(ind + 1, 1));
    		maxi = max(maxi, a[ind][2] + func(ind + 1, 2));
    	}
     
    	return dp[ind][flag] = maxi;
    }
     
    int main() {
     
    	cin >> n;
    	for (int i = 0; i < n; i++) {
    		for (int j = 1; j <= 3; j++) {
    			cin >> a[i][j];
    		}
    	}
     
    	memset(dp, -1, sizeof dp);
     
    	cout << func(0, 0);
     
    	return 0;
    }

Measured memory_bytes: 12564
#include <bits/stdc++.h>
#define dum(x) cout<<#x<<'='<<x<<endl
#define ll long long
using namespace std;

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

  double rad;
  double PI = acos(-1);
  rad = c * PI / 180;

  double s = a * b * sin(rad) * 0.5;
  double d = sqrt(a*a + b*b - 2 * a * b * cos(rad));
  double h = b * sin(rad);

  cout << fixed << setprecision(8) << s << endl;
  cout << fixed << setprecision(8) << a + b + d << endl;
  cout << fixed << setprecision(8) << h << endl;

}



Measured memory_bytes: 3576
#include <bits/stdc++.h>
#define SZ(c)       int(c.size())
#define FOR(i,a,b)  for (int i=a; i<(b); ++i)
#define DOWN(i,a,b) for (int i=(a)-1; i>=(b); --i)
using namespace std;
using i64 = long long;

int n;
int a[55];

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cout<<fixed<<setprecision(10);

  cin>>n;
  FOR(i,0,n) cin>>a[i];

  vector<pair<int,int>> res;
  int t=0;
  FOR(i,0,n) 
    if (abs(a[t])<abs(a[i])) t=i;

  if (a[t]!=0) {
    FOR(i,0,n)
      if ((a[t]<0 && a[i]>0) || (a[t]>0 && a[i]<0)) {
        a[i]+=a[t];
        res.emplace_back(t,i);
      }
  }

  if (a[t]>0) {
    FOR(i,0,n-1)
      if (a[i]>a[i+1]) {
        a[i+1]+=a[i];
        res.emplace_back(i,i+1);
      }
  } else if (a[t]<0) {
    DOWN(i,n,1)
      if (a[i]<a[i-1]) {
        a[i-1]+=a[i];
        res.emplace_back(i,i-1);
      }
  }

  cout<<SZ(res)<<endl;
  assert(SZ(res)<=2*n);
  FOR(i,0,n-1) assert(a[i]<=a[i+1]);
  FOR(i,0,SZ(res))
    cout<<res[i].first+1<<' '<<res[i].second+1<<'\n';

  return 0;
}


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

int main() {
	
	ll N;
	cin>>N;
	ce(N*800-(N/15)*200)
}

Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>
#define LEN 100000

typedef struct p{
  char name[10];
  int time;
}P;

P Q[LEN+1];
int head, tail, n;

//キューへの挿入
void enqueue(P x){
  Q[tail] = x;
  tail = (tail + 1)%LEN;
}
//キューからの取り出し
P dequeue(void){
  P x = Q[head];
  head = (head + 1)%LEN;
  return x;
}

int min(int a, int b){
  if(a <= b) return a;
  else return b;
}

int main(){
  int lap_time = 0, min_time, i, q;
  P x;
  scanf("%d %d", &n, &q);

  for (i = 1; i <= n; i++){
    scanf("%s", Q[i].name);
    scanf("%d", &Q[i].time);
  }

  head = 1;
  tail = n+1;

  while(head != tail){
    x = dequeue();
    min_time = min(q, x.time);
    x.time -= min_time;
    lap_time += min_time;
    if(x.time > 0){
      enqueue(x);
    }
    else{
      printf("%s %d\n",x.name ,lap_time);
    }
  }
  return 0;
}


Measured memory_bytes: 3288
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
#include<complex>
#include<numeric>
using namespace std;

//#define int long long
typedef long long ll;

typedef unsigned long long ul;
typedef unsigned int ui;
constexpr ll mod = 1000000007;
const ll INF = mod * mod;
typedef pair<int, int>P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
#define all(v) (v).begin(),(v).end()
typedef pair<ll, ll> LP;
typedef long double ld;
typedef pair<ld, ld> LDP;
const ld eps = 1e-12;
const ld pi = acos(-1.0);

ll mod_pow(ll a, ll n, ll m = mod) {
	a %= m;
	ll res = 1;
	while (n) {
		if (n & 1)res = res * a%m;
		a = a * a%m; n >>= 1;
	}
	return res;
}

struct modint {
	ll n;
	modint() :n(0) { ; }
	modint(ll m) :n(m) {
		if (n >= mod)n %= mod;
		else if (n < 0)n = (n%mod + mod) % mod;
	}
	operator int() { return n; }
};
bool operator==(modint a, modint b) { return a.n == b.n; }
modint operator+=(modint &a, modint b) { a.n += b.n; if (a.n >= mod)a.n -= mod; return a; }
modint operator-=(modint &a, modint b) { a.n -= b.n; if (a.n < 0)a.n += mod; return a; }
modint operator*=(modint &a, modint b) { a.n = ((ll)a.n*b.n) % mod; return a; }
modint operator+(modint a, modint b) { return a += b; }
modint operator-(modint a, modint b) { return a -= b; }
modint operator*(modint a, modint b) { return a *= b; }
modint operator^(modint a, int n) {
	if (n == 0)return modint(1);
	modint res = (a*a) ^ (n / 2);
	if (n % 2)res = res * a;
	return res;
}

ll inv(ll a, ll p) {
	return (a == 1 ? 1 : (1 - p * inv(p%a, a)) / a + p);
}
modint operator/(modint a, modint b) { return a * modint(inv(b, mod)); }
const int max_n = 1 << 18;
modint fact[max_n], factinv[max_n];
void init_f() {
	fact[0] = modint(1);
	for (int i = 0; i < max_n - 1; i++) {
		fact[i + 1] = fact[i] * modint(i + 1);
	}
	factinv[max_n - 1] = modint(1) / fact[max_n - 1];
	for (int i = max_n - 2; i >= 0; i--) {
		factinv[i] = factinv[i + 1] * modint(i + 1);
	}
}
modint comb(int a, int b) {
	if (a < 0 || b < 0 || a < b)return 0;
	return fact[a] * factinv[b] * factinv[a - b];
}

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


void solve() {
	int k, a, b; cin >> k >> a >> b;
	int s = (a + k - 1) / k;
	s = s * k;
	if (s <= b) {
		cout << "OK\n";
	}
	else {
		cout << "NG\n";
	}
}


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

Measured memory_bytes: 7748
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  long N, hakoberu[5];
  cin >> N;
  
  long minHakoberu = 10e15;
  for (int i = 0; i < 5; i++) {
    cin >> hakoberu[i];
    if (minHakoberu > hakoberu[i]) {
      minHakoberu = hakoberu[i];
    }
  }
  
  long ret;
  if (N % minHakoberu == 0) {
    ret = N / minHakoberu;
  } else {
    ret = N / minHakoberu + 1;
  }
  ret = ret - 1 + 5;
  
  cout << ret << endl;
}


Measured memory_bytes: 256