akhauriyash/Code-Regression huggingface dataset:
#ifdef DEBUG
#define _GLIBCXX_DEBUG
#endif
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
typedef long double ld;
typedef long long ll;
const int maxN = (int)1e5 + 100;
int n;
int l[maxN], r[maxN];
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    //freopen("input.txt", "r", stdin);
    cin >> n;
    vector < pair < int, int > > all;
    all.resize(n);
    vector < pair < int, int > > all_by_R;
    for(auto& it : all) {
        cin >> it.first >> it.second;
    }
    sort(all.begin(), all.end());
    int mx = 0;
    for (int i = 0; i < n; i++) {
        l[i + 1] = all[i].first;
        r[i + 1] = all[i].second;
        mx = max(mx, r[i + 1] - l[i + 1] + 1);
        all_by_R.emplace_back(r[i + 1], l[i + 1]);
    }
    int cur_l = 0;
    int cur_r = 1e9 + 100;
    for (auto it : all) {
        if (it.second < l[n]) {
            cur_r = min(cur_r, it.second);
            cur_l = max(cur_l, it.first);
        }
    }
    int mx_g = mx;
    if (cur_l > cur_r) {
        cout << mx;
        return 0;
    }
    sort(all_by_R.begin(), all_by_R.end());
    for (int i = 0; i < all_by_R.size(); i++) {
        if (all_by_R[i].first < l[n]) continue;
        mx = max(mx, min(cur_r - cur_l + 1, mx_g) + (all_by_R[i].first - l[n] + 1));
        cur_l = max(cur_l, all_by_R[i].second);
        cur_r = min(cur_r, all_by_R[i].first);
        if (cur_l > cur_r) break;
        // l[n] .. all_by_R[i].second
    }
    cout << mx;
    return 0;
}

Measured memory_bytes: 2680
n = int(input())
m = [int(input()) for _ in range(n)]

def fx(raw):
    min_n = raw[0]
    max_n = raw[1] - raw[0]
    for i in raw[1:]:
        if i - min_n >= max_n:
            max_n = i - min_n
        if i < min_n:
            min_n = i
    return max_n


if __name__ == '__main__':
    print(fx(m))


Measured memory_bytes: 15100
#include<bits/stdc++.h>
#define REP(x,y,z) for(int x=y;x<=z;x++)
#define FORD(x,y,z) for(int x=y;x>=z;x--)
#define MSET(x,y) memset(x,y,sizeof(x))
#define FOR(x,y) for(__typeof(y.begin()) x=y.begin();x!=y.end();x++)
#define F first
#define S second
#define MP make_pair
#define PB push_back
#define SZ size()
#define M 
void RI(){}
template<typename... T>
void RI( int& head, T&... tail ) {
  scanf("%d",&head);
  RI(tail...);
}
using namespace std;
typedef long long LL;
int main()
{  
	int a, b;
	cin >> a >> b;
	if(b > a) swap(a, b);
	int sum = max(a+a-1, a+b);
	cout << sum << endl;
  return 0;
}


Measured memory_bytes: 256
import kotlin.math.max

fun intList() = readLine()?.split(" ")?.map(String::toInt) ?: TODO()
fun main() {
    data class Count(var value: Int)

    fun Count?.count(): Int {
        return this?.value ?: 0
    }

    class XY(var x: Count?, var y: Count?) {
        fun total() = x.count() + y.count()
        override fun toString(): String {
            return total().toString()
        }
    }
    val (h, w) = intList()
    val matrix = 0.until(h).map {
        readLine() ?: return
    }
    val array = Array(h) { Array(w) { XY(null, null) } }
    matrix.forEachIndexed { y, s ->
        var xCount = Count(0)
        s.forEachIndexed { x, v ->
            if (v == '.') {
                array[y][x].x = xCount
                if (y == 0) {
                    array[y][x].y = Count(1)
                } else {
                    val count = array[y - 1][x].y
                    if (count == null) {
                        array[y][x].y = Count(1)
                    } else {
                        count.value += 1
                        array[y][x].y = count
                    }
                }
                xCount.value += 1
            } else {
                xCount = Count(0)
            }
        }
    }
    var m = 0
    array.forEach {
        it.forEach {
            m = max(m, it.total() - 1)
        }
    }
    println(m.toString())
}


Measured memory_bytes: 213800
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<queue>
#include<climits>
#include<cmath>
#include<sstream>
#include<iomanip>
#include <map>
#include <stack>
 
const int64_t cc = pow( 10, 9 );
 
bool sort_pair( std::pair< char, int64_t > origin, std::pair< char, int64_t > another )
{
    return origin.first < another.first;
}

int main()
{
    int64_t a,b,c,d,e;
    std::cin>> a;
    std::cin>> b;

    std::vector< int64_t > list( a );

    for( int i = 0; i < a; i++ )
    {
        std::cin>> list[i];
        list[i] += 1;
    }

    int64_t max = 0;

    std::vector< int64_t > add_list( a + 1, 0 );
    
    for( int i = 0; i < a; i++ )
    {
        add_list[i+1] = add_list[i] + list[i];
    }

    for( int i = 0; i + b <= a; i++ )
    {
        max = std::max( max, add_list[i+b] - add_list[i] );
    }

    std::cout<< std::fixed << std::setprecision(10) << ( double )( max ) / 2;
    //std::cout<< static_cast<double>( max ) / 2;
}


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

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

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

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

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

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

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

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

fn main() {
    input! {
        n: usize,
        b: [usize; n-1]
    };
    let mut sum_a = b[0];
    for i in 0..n - 2 {
        let ai = ::std::cmp::min(b[i], b[i + 1]);
        sum_a += ai;
    }
    sum_a += b[n - 2];
    println!("{}", sum_a);
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, s, n) for (int i = (s); i < (n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
  int a, b, c, k;
  cin >> a >> b >> c >> k;
  rep(i, k) {
    if (a >= b)
      b *= 2;
    else if (b >= c)
      c *= 2;
  }
  if (a < b && b < c && a < c)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}

Measured memory_bytes: 3632
#include<bits/stdc++.h>
using namespace std;
int main(){
  int N; cin>>N;
  string S; cin>>S;
  if(N%2==1)
    cout<<"No"<<endl;
  
  else{
    int L=0;
    for(int i=0; i<N/2; i++){
      if(S.at(i)==S.at(N/2+i))
        L++;
      else continue;
    }
    if(L==N/2)
      cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
  }
  
}


Measured memory_bytes: 3596
//2008dC
I;int parse(char *p){switch(*p){
	case'F':return 0;
	case'T':return 1;
	case'-':return!parse(p+1);
	case'(':{
		int x=0;
		char*q=++p;
		for(;;p++){
			if(*p=='(')x++;
			if(*p==')')x--;
			if(x==0&&*p!='-')break;
		}
		switch(*(++p)){
			case'*':return parse(q)&parse(p+1);
			case'+':return parse(q)|parse(p+1);
			case'-':return!parse(q)|parse(p+2);
		}
	}
}return(I>>(*p-97))&1;}
char p[1001],*q;main(){for(;scanf("%s",p),*p-'#';puts(I==2048?"YES":"NO"))for(q=strchr(p,'=')+1,I=0;I<2048;I++)if(parse(p)!=parse(q))break;exit(0);}

Measured memory_bytes: 552
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String[] s = new String[n];
        for (int i = 0; i < n; i++) {
            s[i] = sc.next();
        }

        int[][] cnt = new int[n][26];
        for (int i = 0; i < n; i++) {
            String str = s[i];
            for (int j = 0; j < str.length(); j++) {
                cnt[i][str.charAt(j) - 'a']++;
            }
        }
        int[] ans = new int[26];
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < ans.length; j++) {
                if (i == 0) {
                    ans[j] = cnt[i][j];
                    continue;
                }
                ans[j] = Math.min(ans[j], cnt[i][j]);
            }
        }
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < 26; i++) {
            if (ans[i] == 0) {
                continue;
            }
            for (int j = 0; j < ans[i]; j++) {
                sb.append((char) (i + 'a'));
            }
        }
        System.out.println(sb.toString());
    }

}


Measured memory_bytes: 21972
/*input
3 100
7 6 5
9 9 9
*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

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

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

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

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

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

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

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

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

const int N = 401;
int dp[N][N];// come till ith given c already
int pref[N][N];// has 1 to N raised to j
int a[N];
int b[N];
int n,c;

void solve(){
  	cin >> n >> c;
  	RE(i,n)cin >> a[i];
  	RE(i,n)cin >> b[i];
  	RE(i,N-1){
  		REP(j,N){
  			pref[i][j] = pref[i-1][j]+raise(i,j,MOD);
  			pref[i][j] %= MOD;
  		}	
  	}
  	dp[0][0] = 1;
  	RE(i,n){
  		REP(j,c+1){
  			REP(give,j+1){
  				int powsum = pref[b[i]][give];
  				powsum -= pref[a[i]-1][give];
  				powsum %= MOD;
  				if(powsum < 0)powsum += MOD;
  				dp[i][j] += dp[i-1][j-give]*powsum;
  				dp[i][j] %= MOD;
  			}
  			//cout << i << " " << j << " " << dp[i][j] << endl;
  		}
  	}
  	int ans = dp[n][c];
  	if(ans < 0)ans += MOD;
  	cout << ans;
}

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

Measured memory_bytes: 2816
//X: Yet Another Die Game

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define int long long
#define rep(i,x,y) for(ll i=x;i<y;i++)
#define irep(i,a) for(auto i = a.begin(); i != a.end(); ++i)
#define nvarep(n,a) ll n;cin>>n;vector<ll>a(n);rep(i,0,n)cin>>a[i]
#define vecrep(n,a,type) vector<type>a(n);rep(i,0,n)cin>>a[i]
#define lcm(a,b) (a/__gcd(a, b)*b)
#define range(a) (a).begin(),(a).end() 
#define pb push_back
#define mp make_pair
#define nnn "\n"
#define spa " "
using p = pair<ll, string>;
using garph = vector<vector<ll>>;
const int inf = 2147483647;//2*10^9
const ll INF = 9223372036854775807;//9*10^18

signed main (){
    ll a;cin>>a;
    int e = a/11;
    int r = a%11;
    if(r==0)cout<<e*2<<nnn;
    else if(r<=6)cout<<e*2+1<<nnn;
    else cout<<e*2+2<<nnn;
    return 0;
}

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

using ll = long long;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  while (true) {
    int n, m;
    cin >> n >> m;
    if (n + m == 0) return 0;
    
    vector<ll> a(m), x(m - 1);
    for (int i = 0; i < m - 1; i++) {
      cin >> a.at(i) >> x.at(i);
      x.at(i)--;
    }
    cin >> a.at(m - 1);
    
    vector<ll> stre(n, 0);
    for (int i = 0; i < m - 1; i++) {
      stre.at(x.at(i)) += a.at(i);
      for (int j = x.at(i) + 1; j < n; j++) {
        ll keep = a.at(i) - (j - x.at(i)) * (j - x.at(i));
        if (keep <= 0) break;
        stre.at(j) += keep;
      }
      for (int j = x.at(i) - 1; j >= 0; j--) {
        ll keep = a.at(i) - (x.at(i) - j) * (x.at(i) - j);
        if (keep <= 0) break;
        stre.at(j) += keep;
      }
    }
    
    auto f = [&](ll mid) -> bool {
      int ax = n + 100000;
      for (ll i = 0; i < n; i++) {
        if (stre.at(i) + max(0LL, a.at(m - 1) - (ax - i) * (ax - i)) >= mid) continue;
        if (stre.at(i) + a.at(m - 1) < mid) return false;
        ll need = mid - stre.at(i);
        ll keep = a.at(m - 1) - need;
        ll dis = sqrt<ll>(keep);
        //if (dis * dis < need) dis++;
        if (i + dis <= ax) {
          ax = i + dis;
        }
        else {
          if (i - dis <= ax) continue;
          else return false;
        }
      }
      return true;
    };
    
    ll l = 0, r = 1e18;
    while (r - l > 1) {
      ll mid = (l + r) / 2;
      if (f(mid)) l = mid;
      else r = mid;
    }
    
    cout << l << '\n';
  }
}


Measured memory_bytes: 12300
#include <iostream>
#include <cstring>
using namespace std;
char s[1002]; int k;
int vis[302][302][302], dp[302][302][302];
int dfs(int l, int r, int k) {
    if (k < 0) return - 100000;
    if (l == r)return 1;
    if (l > r) return 0;
    if (vis[l][r][k]) return dp[l][r][k];
    vis[l][r][k] = 1;
    
    int mx = max(dfs(l, r, k-1), 0);

    if (s[l] == s[r]) {
        mx = max(dfs(l+1,r-1,k) + 2, mx);
    } else {
        mx = max(dfs(l+1,r-1,k), mx);
        mx = max(dfs(l+1,r-1,k-1) + 2, mx);
    }
    mx = max(dfs(l+1,r,k), mx);
    mx = max(dfs(l,r-1,k), mx);
    return dp[l][r][k] = mx;
}
int main() {
    scanf("%s %d", s+1, &k);
    int n = strlen(s+1);
    int ans = dfs(1,n,k);
    printf("%d\n", ans);
}






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

class prog{
  static void Main(){
    string[] input = Console.ReadLine().Split();
    string ans = "" + (char)(input[0][0] - 'a' + 'A') + (char)(input[1][0] - 'a' + 'A') + (char)(input[2][0] - 'a' + 'A');
    Console.WriteLine(ans);
  }
}

Measured memory_bytes: 13140
#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <algorithm>
#include <math.h>
#include <map>
#include <string.h>
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;


int main()
{
//回答が整数の場合
int ans=0;
//整数値の入力
int a,b,k;
cin >> a>>b>>k;
int temp=0;
for(int i=100;i>0;i--){
   if(a%i==0&&b%i==0){
      temp++;
   }
   if(temp==k){ans=i;break;}

}
//回答
cout << ans << endl;
return 0;
}



Measured memory_bytes: 256
def main():
    h1, m1, h2, m2, k = list(map(int, input().split()))
    t1 = h1 * 60 + m1
    t2 = h2 * 60 + m2
    return t2 - t1 - k


print(main())
#print('Yes' if main() else 'No')
#print('YES' if main() else 'NO')


Measured memory_bytes: 9156
#line 2 "header.hpp"

//%snippet.set('header')%
//%snippet.fold()%
#ifndef HEADER_H
#define HEADER_H

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

// varibable settings
const long long INF = 1e18;

#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for (ll i = (ll)(a); i < (ll)(b); ++i)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
#define _rrep(i, n) rrepi(i, 0, n)
#define rrepi(i, a, b) for (ll i = (ll)((b)-1); i >= (ll)(a); --i)
#define r_rep(...) _overload3(__VA_ARGS__, rrepi, _rrep, )(__VA_ARGS__)
#define each(i, a) for (auto &&i : a)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
#define pb(a) push_back(a)
#define mp(a, b) make_pair(a, b)
#define mt(...) make_tuple(__VA_ARGS__)
#define ub upper_bound
#define lb lower_bound
#define lpos(A, x) (lower_bound(all(A), x) - A.begin())
#define upos(A, x) (upper_bound(all(A), x) - A.begin())
template <class T>
inline void chmax(T &a, const T &b) {
    if ((a) < (b)) (a) = (b);
}
template <class T>
inline void chmin(T &a, const T &b) {
    if ((a) > (b)) (a) = (b);
}

#define divceil(a, b) ((a) + (b)-1) / (b)
#define is_in(x, a, b) ((a) <= (x) && (x) < (b))
#define uni(x)    \
    sort(all(x)); \
    x.erase(unique(all(x)), x.end())
#define slice(l, r) substr(l, r - l)

typedef long long ll;
typedef long double ld;

template <typename T>
using PQ = priority_queue<T, vector<T>, greater<T>>;
struct Fast {
    Fast() {
        std::cin.tie(0);
        ios::sync_with_stdio(false);
    }
} fast;
void check_input() {
    assert(cin.eof() == 0);
    int tmp;
    cin >> tmp;
    assert(cin.eof() == 1);
}

#if defined(PCM) || defined(LOCAL)
#else
#define dump(...) ;
#define dump_1d(...) ;
#define dump_2d(...) ;
#define cerrendl ;
#endif

#endif /* HEADER_H */
//%snippet.end()%
#line 2 "solve.cpp"
template<class T=ll> using vec = vector<T>;


int solve() {
    string s,t;cin>>s>>t;

    int n = sz(s);

    rep(i, n){
        // s[0]とt[i]が一致
        bool valid = true;
        rep(j, n){
            if (s[0+j]!=t[(i+j)%n]){
                valid = false;
            }
        }
        if (valid) {
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;

    return 0; 
}


int main(){/*{{{*/
    solve();
    check_input();
    return 0;
}/*}}}*/


Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cmath>
#include <complex>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#include <stack>
#include <string>
#include <vector>

const int MOD = 1e9 + 7;
const int iINF = 2147483647 / 2;
const long long int llINF = 9223372036854775807 / 2;

using namespace std;
using ll = long long int;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using vvvl = vector<vector<vector<ll>>>;

typedef pair<ll, ll> pll;
bool paircomp(const pll &a, const pll &b) {
  if (a.first == b.first)
    return a.second < b.second;
  return a.first < b.first;
}

#define REP(i, n) for (ll i = 0; i < (n); i++)
#define RREP(i, n) for (ll i = (n)-1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define AUTO(i, m) for (auto &i : m)
#define ALL(a) (a).begin(), (a).end()
#define MAX(vec) *std::max_element(vec.begin(), vec.end())
#define MIN(vec) *std::min_element(vec.begin(), vec.end())
#define ARGMAX(vec)                                                            \
  std::distance(vec.begin(), std::max_element(vec.begin(), vec.end()))
#define ARGMIN(vec)                                                            \
  std::distance(vec.begin(), std::min_element(vec.begin(), vec.end()))
#define REV(T) greater<T>()
#define PQ(T) priority_queue<T, vector<T>, greater<T>>
#define VVL(a, b, c) vector<vector<ll>>(a, vector<ll>(b, c))
#define VV(T, a, b, c) vector<vector<T>>(a, vector<T>(b, c))
#define VVVL(a, b, c, d)                                                       \
  vector<vector<vector<ll>>>(a, vector<vector<ll>>(b, vector<ll>(c, d)))
#define VVV(T, a, b, c, d)                                                     \
  vector<vector<vector<T>>>(a, vector<vector<T>>(b, vector<T>(c, d)))
#define SP(a) setprecision(a)
#define SQRT(a) sqrt((long double)(a))
#define DPOW(a, b) pow((long double)(a), (long double)(b))
#define UNIQUE(vec)                                                            \
  do {                                                                         \
    sort(ALL((vec)));                                                          \
    (vec).erase(std::unique(ALL((vec))), (vec).end());                         \
  } while (0)

ll POW(ll n, ll m) {
  if (m == 0) {
    return 1;
  } else if (m % 2 == 0) {
    ll tmp = POW(n, m / 2);
    return (tmp * tmp);
  } else {
    return (n * POW(n, m - 1));
  }
}

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

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long double a, b, x;
  cin >> a >> b >> x;
  long double mid = (long double)(a * a * b) / 2;
  if (x >= mid) {
    long double po = x / (a * a);
    long double c = (po * 2) - b;
    cout << SP(20) << atan2(b - c, a) * 180 / M_PI << endl;
  } else {
    long double d = (long double)2 * x / (a * b);
    cout << SP(20) << atan2(b, d) * 180 / M_PI << endl;
  }

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
//----***やべーやつら***----
using namespace std;
#define int long long

//----***型定義***----
using ll = long long;
using P = pair<int,int>;

//----***Like a Pythonista***----
#define REP(ii,jj,nn) for (ll ii=jj;ii<(nn);ii++)
#define RREP(ii,nn,jj) for (ll ii = nn; jj<ii;ii--)
#define each(i,...) for (auto&& i:__VA_ARGS__)
#define ALL(vec) (vec).begin(),(vec).end()
#define sum(...) accumulate(ALL(__VA_ARGS__),0LL)
#define dsum(...) accumulate(ALL(__VA_ARGS__),0.0)
#define vec(type,name,...) vector<type> name(__VA_ARGS__)
template<class T> inline auto max(const T& a){ return *max_element(ALL(a)); }
template<class T> inline auto min(const T& a){ return *min_element(ALL(a)); }
inline ll gcd(ll a,ll b){if(b == 0) return a;return  gcd(b,a%b);}
inline ll lcm(ll a,ll b){ll g = gcd(a,b);return a / g * b;}

//----***定数***----
#define MOD 1000000007
#define INF 100000000000000000
#define EPS 1e-9
const vector<vector<int>> DXY={{-1,0},{1,0},{0,-1},{0,1}};

//----***パーツ***----
#define fi first
#define se second
#define pb push_back
#define re return
#define br break

//----***入出力***---
void print() { std::cout << "\n"; }
template <class T>void print(const T &x) {std::cout << x<<"\n";}
template <class T, class... Args>void print(const T &x, const Args &... args) {std::cout << x << " ";print(args...);}
#define debug(var)  do{std::cerr << #var << " ↓ "<<"\n";view(var);}while(0);
#define dbg cerr<<"🥺🥺🥺🥺🥺🥺"<<endl;
template<typename T> void view(T e){std::cout << e << std::endl;}
template<typename T> void view(const std::vector<T>& v){for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void view(const std::vector<std::vector<T> >& vv){ for(const auto& v : vv){ view(v); } }

//----***初期時読み込み***----
struct initial{initial(){cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(15);};}initial_;

signed main(){
  int N;cin>>N;
  int ans=0,a,b,c;
  b=-1;
  int now=0;
  REP(i,0,N){
    cin>>a;
    if(now==1&&b>a){
      b=-1;
    }
    else if(now==-1&&b<a){
      b=-1;
    }
    if(b==-1){
      b=a;
      now=0;
      ans++;
      continue;
    }
    if(now==0&&b<a)now=1;
    else if(now==0&&b>a)now=-1;
    b=a;
  }
  print(ans);


}


Measured memory_bytes: 256
#include <bits/stdc++.h>
typedef long long int ll;
typedef long double ld;
using namespace std;
const long long int INF = 1e18;
const long long int mod = 1e9+7;

typedef pair<ll, ll> pairs;
typedef vector<pairs> p;

struct Edge{
    ll to, weight;
    Edge(ll t, ll w) : to(t), weight(w){}
};
using graph = vector<vector<ll>>;
using Graph = vector<vector<Edge>>;


ll gcd(ll a,ll b){
    if(b == 0){
        return a;
    }else{
        return gcd(b, a%b);
    }
}

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

ll keta(ll N){
    int tmp{};
    while( N > 0 ){
        tmp += ( N % 10 );
        N /= 10;
    }
    N = tmp;
    return N;
}

// 回文
bool kai(string S){
    bool flag = true;
    for(ll i=0;i<S.size()/2;++i){
        if(S[i] != S[S.size()-i-1]){
            flag = false;
            break;
        }
    }
    return flag;
}
// ---------------------------------------------

int main(){
    ll n;
    cin>>n;
    vector<string> s(n);
    vector<ll> a(26, INF);
    for(ll i=0;i<n;++i){
        cin>>s[i];
        vector<ll> x(26, 0);
        for(ll j=0;j<s[i].size();++j){
            x[s[i][j]-'a']++;
        }
        for(ll j=0;j<26;++j){
            a[j] = min(a[j], x[j]);
        }
    }

    vector<char> k;
    for(ll i=0;i<26;++i){
        if(a[i] != INF){
            for(ll j=0;j<a[i];++j){
                k.push_back('a'+ i);
            }
        }
    }
    for(ll i=0;i<k.size();++i){
        cout<<k[i];
    }
    cout<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define repi(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rrepi(i,a,b) for(int i=((int)(b)-1);i>=(a);--i)
#define rep(i,n) repi(i,0,n)
#define rrep(i,n) rrepi(i,0,n)
#define debug(var)  do{std::cout << #var << " : "; view(var);}while(0)
#define fi first
#define se second
using namespace std;
using ll = long long;
using P = pair<int,int>;
template<typename T> void view(const std::vector<T>& v){for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void view(const std::vector<std::vector<T> >& vv){for(const auto& v : vv){ view(v); } }
template<typename T> void view(T e){std::cout << e << std::endl;}
template<typename T> void viewarr(T arr[], int n) { for(int i = 0; i < n; ++i) std::cout << arr[i] << " "; std::cout << std::endl; }
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; }
const int INF = 1e9;
const int MOD = 1e9 + 7;
const int MAX_N = 1e5;

int main() {
    int H, N;
    cin >> H >> N;
    vector<int> A(N);
    rep(i,N) cin >> A[i];
    int sum = 0;
    rep(i,N) sum += A[i];
    cout << (sum >= H ? "Yes" : "No") << endl;
    return 0;
}


Measured memory_bytes: 640
n, k = map(int, input().split())
ds = [[] for _ in range(n)] # ネタの種類t(<=n)別においしさdのリスト
for _ in range(n):
    t, d = map(int, input().split())
    t -= 1
    ds[t].append(d)

y0, y1 = [], []
for i in range(n):
    if len(ds[i]) == 0:
        continue
    ds[i].sort()    # 各ネタでおいしさのsort
    y1.append(ds[i][-1])    # 各ネタで最大のおいしさをpopしy1に追加
    ds[i].pop()
    y0.extend(ds[i])        # 各ネタで2番目以降のおいしさのリストをy0に追加
y0.sort(reverse=True)   # ネタの種類が増えないおいしさのリスト（各ネタで2番目以降）を降順sort
y1.sort(reverse=True)   # ネタの種類が増えるおいしさ（各ネタで最大）のリストを降順sort

ans = 0
Y = max(0, k-len(y0))   # Y: ネタの種類の最小値（kまで増やしながら貪欲するため）
X = 0
for i in range(Y):
    X += y1[i]      # Y個 ネタの種類が増えるおいしさ（各ネタで最大）を大きい順に加算
for i in range(k-Y):
    X += y0[i]      # k-Y個 ネタの種類が増えないおいしさを大きい順に加算

while True:
    ans = max(ans, X+Y*Y)
    if (Y>=k or Y>=len(y1)):   # Yをkまで増やしながら貪欲
        break
    X += y1[Y]      # ネタの種類が増えるおいしさ（各ネタで最大）を大きい順に1つ追加
    X -= y0[k-Y-1]  # ネタの種類が増えない大きさを小さい順に1つ除外
    Y += 1
print(ans)


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

int main() {
  int a, b, c, x, ans = 0;
  cin >> a >> b >> c >> x;
  for (int i = a; i >= 0; i--) {
    if (500 * i < x) {
      for (int j = b; j >= 0; j--) {
        if (500 * i + 100 * j < x) {
          for (int k = c; k >= 0; k--) {
            if (500 * i + 100 * j + 50 * k == x) {
              ans++;
            }
          }
        } else if (500 * i + 100 * j == x) {
          ans++;
        }
      }
    } else if (500 * i == x) {
      ans++;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#include <tuple>
#include <iomanip>
#include <numeric>
#include <unordered_map>
#include <sstream>
#include<limits.h>
#include<float.h>
#include<list>
#include <array>
#include <complex>
#include<stdio.h>
#include<string.h>
#include <bitset>
#include<assert.h>

using namespace std;
#define int long long

#define I32_MAX 2147483647
#define I64_MAX 9223372036854775807LL
#define I64_MAX2 1223372036854775807LL
#define INF I64_MAX2
#define MOD 1000000007
// #define MOD 998244353 
#define MEM_SIZE 10000
#define DEBUG_OUT true
#define ALL(x) (x).begin(), (x).end()

template<typename T> void DEBUG(T e){if(DEBUG_OUT == false)return; std::cout << e <<" ";}
template<typename T> void DEBUG(const std::vector<T>& v){if(DEBUG_OUT == false)return;for(const auto& e : v){std::cout<< e << " "; } std::cout << std::endl;}
template<typename T> void DEBUG(const std::vector<std::vector<T> >& vv){if(DEBUG_OUT == false)return;for(const auto& v : vv){ DEBUG(v); } }
template<class T,class... Ts> void DEBUG(T d, Ts... e){if(DEBUG_OUT == false)return;DEBUG(d);DEBUG(e...);}
template <class T> void corner(bool flg, T hoge) {if (flg) {cout << hoge << endl; abort();}}
template< typename T1, typename T2 > inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template< typename T1, typename T2 > inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }



void solve(void)
{
  int N;cin>>N;
  vector<int> vec (N,0);
  vector<int> res (N,0);
  for (int i = 0; i < N; i++)
  {
     cin>>vec[i];
     int X = vec[i];
     if(i%2 == 1)X *= -1;
     res[0] += X;
  }
  for (int i = 1; i < N; i++)
  {
    res[i] = 2*(vec[i-1] - res[i-1]/2);
  }
  for (int i = 0; i < N; i++)
  {
    if(i != 0)cout<<" ";
    cout<<res[i];
  }
  cout<<endl;
  
  



  return;
}
int32_t main(int32_t argc, const char *argv[])
{
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  std::cout << std::fixed;
  std::cout << std::setprecision(11);
  solve();

  return 0;
}


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

int main() {
  int n;
  cin >> n;
  vector<int> L(n);
  rep(i,n) cin >> L[i];
  sort(L.begin(), L.end());
  int ans = 0;
  rep(b,n)rep(a,b) {
    int ab = L[a]+L[b];
    int r = lower_bound(L.begin(), L.end(), ab) - L.begin();
    int l = b+1;
    // c = [l,r)
    ans += max(0,r-l);
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <math.h>
#include <string>
#include <algorithm>

#define MIN(x, y) (x < y ? x : y)
#define MAX(x, y) (x > y ? x : y)

using namespace std;


int main(){
	int A, B;
	cin >> A >> B;

	int max = MAX(-1000000, A + B);
	max = MAX(max, A - B);
	max = MAX(max, A * B);
	

	cout << max << endl;
}

	

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

int main(){
  int n,q;
  cin >> n >> q;
  string s;
  cin >> s;
  int l[10000000],r[10000000];
  FOR(i,q){
    cin >> l[i] >> r[i];
  }

  int dp[10000000];
  dp[0]=0;
  for(int i=1;i<n;i++){
    if(s[i-1]=='A' && s[i]=='C'){
      dp[i]=dp[i-1]+1;
    }else{
      dp[i]=dp[i-1];
    }
  }
  int a,b;
    FOR(i,q){
    a=l[i]-1;
    b=r[i]-1;
    cout << dp[b]-dp[a] << endl;
   }
}


Measured memory_bytes: 11264
text = ""
ans = [0 for i in range(26)]
while True:
	try:
		text += raw_input().lower()
	except:
		for s in text:
			if s.isalpha():
				ans[ord(s)-97] += 1
		for j in range(len(ans)):
			print "{} : {}".format(chr(j+97),ans[j])
		break

Measured memory_bytes: 4212
#include<stdio.h>
int main()
{
	long long int a, b, n,minNum,ans;
	scanf("%lld%lld%lld", &a, &b, &n);
	minNum = (b-1 > n) ? n : (b-1);
	ans = (a * minNum) / b;
	printf("%lld", ans);
}

Measured memory_bytes: 1728
#include <iostream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <cmath>
#include <limits>
#include <climits>
#include <utility>
#include <algorithm>
#include <numeric>

using namespace std;

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

int main()
{
    ll X, Y, Z, K;
    cin >> X >> Y >> Z >> K;

    vector<ll> A(X);
    vector<ll> B(Y);
    vector<ll> C(Z);

    for (ll i = 0; i < X; ++i) {
        cin >> A[i];
    }

    for (ll i = 0; i < Y; ++i) {
        cin >> B[i];
    }

    for (ll i = 0; i < Z; ++i) {
        cin >> C[i];
    }

    vector<ll> u;
    for (ll i = 0; i < X; ++i) {
        for (ll j = 0; j < Y; ++j) {
            u.emplace_back(A[i] + B[j]);
        }
    }

    sort(begin(u), end(u));
    reverse(begin(u), end(u));
    u.resize(3000);

    vector<ll> v;
    for (ll i = 0; i < u.size(); ++i) {
        for (ll j = 0; j < Z; ++j) {
            v.emplace_back(u[i] + C[j]);
        }
    }

    sort(begin(v), end(v));
    reverse(begin(v), end(v));

    for (ll i = 0; i < K; ++i) {
        cout << v[i] << endl;
    }

    return 0;
}


Measured memory_bytes: 42984
#include<stdio.h>
#include<stdlib.h>
typedef struct {
	int v,p;
}st;
st a[100010];
int comp(const void *a, const void *b){
	return ((st*)a)->v-((st*)b)->v;
}
int main(void){	
	int n;
	scanf("%d",&n);
	for (int i=1;i<=n;i++) scanf("%d",&a[i].v),a[i].p=i;
	qsort(a+1,n,sizeof(st),comp);
	int ans=0;
	for (int i=1;i<=n;i++)
	{
		if ((a[i].p&1)+(i&1)==1){
			ans++;
		}
	}
	printf("%d",(ans+1)/2);
}

Measured memory_bytes: 1788
from collections import Counter
n = int(input())
l = list(map(int,input().split()))
c = Counter(l)

l.sort()
check = [-1]*(10**6+2)

ans = 0
for i in l:
    if check[i] == -1:
        if c[i] == 1:
            ans += 1
        for j in range(i,10**6+2,i):
            check[j] = i
print(ans)



Measured memory_bytes: 117228
#include <bits/stdc++.h>
using namespace std;
int main(){
  int n;cin>>n;
  int s[n];
  for(int i=0;i<n;i++)cin>>s[i];
  sort(s,s+n);
  int sum=0;
  for(int i=0;i<n;i++)sum+=s[i];
  int res;
  if(sum%10)res=sum;
  else{
    int i=0;
    while(s[i]%10==0&&i<n)i++;
    if(i==n)res=0;
    else res=sum-s[i];
  }
  cout<<res<<endl;
  return 0;
}

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

#define int long long

#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;

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

signed main(){
    int N,P;
    cin>>N>>P;

    int sb=0;
    vint v;
    rep(i,N){
        int w,b;
        cin>>w>>b;
        sb+=b;
        v.pb((100-P)*w+P*b);
    }

    sort(all(v));reverse(all(v));
    int sum=0;
    rep(i,N){
        sum+=v[i];
        if(sum>=P*sb){
            cout<<i+1<<endl;
            return 0;
        }
    }
    return 0;
}


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

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

    int A;
    priority_queue<int> q;
    for (int i = 0; i < N; i++) {
        cin >> A;
        q.push(A);
    }

    int top;
    for (int i = 0; i < M; i++) {
        top = q.top();
        q.pop();
        q.push(top / 2);
    }

    long long ans = 0;
    for (int i = 0; i < N; i++) {
        ans += q.top();
        q.pop();
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 892
n = int(input())
x= [[] for _ in range(n+1)]
c = [0 for _ in range(n+1)]
flag = n
for i in range(n-1):
  ai,bi = map(int,input().split())
  x[ai].append(bi)
  x[bi].append(ai)
  c[ai] += 1
  c[bi] += 1
cc = list(map(int,input().split()))
cc.sort(reverse=True)
print(sum(cc[1:]))
d = [0 for _ in range(n+1)]
e = [i for i in range(1,n+1)]
flag = 1
while flag <= n-1 :
  for i in e:
    if c[i] == 1:
      d[i] = flag
      flag += 1
      e.remove(i)
      c[i] = 0
      j = x[i][0]
      x[j].remove(i)
      c[j] -= 1
for i in range(1,n+1):
  print(cc[-d[i]],end=" ")
  
  
  

Measured memory_bytes: 6160
#include <iostream>
#include<vector>
#include<algorithm>
#include<string>
using namespace std;
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define INF 1000000000
int main(){
cin.tie(0);
ios::sync_with_stdio(false);

	int N,T;
	cin>>N>>T;
	vector<int>t(N);
	long long int ans=0;
	REP(i,N)cin>>t[i];
	if(N==1){
		cout<<T<<endl;
		return 0;
	}
	FOR(i,1,N){
		if(t[i]-t[i-1]<=T)
			ans+=t[i]-t[i-1];
		else
			ans+=T;
	}
	ans+=T;
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 1024
# AGC007B

import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))



n = int(input())
ps = [item - 1 for item in map(int, input().split())]

aind = [0]*n
bind = [0]*n

for i,p in enumerate(ps):
    aind[p] = i
    bind[p] = i
    
for i in range(1,n):
    aind[i] += aind[i-1]
    bind[-i-1] += bind[-i]
    
for i in range(n):
    aind[i] += i+1
    bind[i] += n-i
    
print(" ".join(map(str, aind)))
print(" ".join(map(str, bind)))

Measured memory_bytes: 47896
#include <stdio.h>

void swap(int *, int *);

int main(){
  int i,j,N,minj,count=0;
  int A[100];

  scanf("%d",&N);

  for(i = 0; i < N; i++){
    scanf("%d",&A[i]);
  }

  for(i = 0; i < N-1; i++){
    minj = i;
    for(j = i; j < N; j++){
      if(A[j] < A[minj]){
	minj = j;
      }
    }
    if(A[i] != A[minj]){
      swap(&A[i],&A[minj]);
      count++;
    }
  }

  for(i = 0; i < N; i++){
    printf("%d",A[i]);
    if(i != N-1) printf(" ");
  }

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

  return 0;
}

void swap(int *x, int *y){
  int p;

  p = *x;
  *x = *y;
  *y = p;
}



Measured memory_bytes: 2124
#include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define ll long long int
#define pb push_back
typedef pair<ll,ll> ipair;
#define F first
#define S second
 
/*
//functions from gfg
 
long long int power(long long int x,long long int y,long long  int p)
{
    long long int res = 1;     // Initialize result
 
    x = x % p;  // Update x if it is more than or 
                // equal to p
 
    while (y > 0)
    {
        // If y is odd, multiply x with result
        if (y & 1)
            {//d=(long double)x/p;
            res = (res*x) % p;
            }
 
        // y must be even now
        y = y>>1; // y = y/2
        x=(x*x)%p;
        
    }
    return res%p;
}
 
long long int gcd(long long int a,long long int b) 
{ 
    if (a == 0) 
        return b; 
    return gcd(b % a, a); 
}
 
long long int binomialCoeff(long long int n, ll k) 
{ 
    ll res = 1; 
  
    // Since C(n, k) = C(n, n-k) 
    if (k > n - k) 
        k = n - k; 
  
    // Calculate value of [n*(n-1)*---*(n-k+1)] / [k*(k-1)*---*1] 
    for (ll i = 0; i < k; ++i) 
    { 
        res *= (n - i); 
        res /= (i + 1); 
    } 
  
    return res; 
} 
 

void sieve(int n, vector<ll> &primes) 
{ 
    vector<int> prime(n,1);
    ll p;
    for ( p=2; p*p<=n; p++) 
    { 
        // If prime[p] is not changed, then it is a prime 
        if (prime[p] == 1) 
        { 
            
            for (int i=p*p; i<=n; i += p) 
                prime[i] = 0; 
        } 
    } 
  
    for(p=2;p<=n;p++)
    {
        if(prime[p])
        primes.pb(p);
    }
   
} 


void dfs(vector<ll> adj[] ,ll src,vector<ll> &vis)
{
    vis[src]=1;
    for(ll i=0;i<adj[src].size();i++)
    {
        if(vis[adj[src][i]]==0)
        dfs(adj,adj[src][i],vis)
    }
}
 
*/

int main() {
	ios_base::sync_with_stdio(false);
    std::cin.tie(NULL);
    std::cout.tie(NULL);
    
    
	ll n,i,j,p,k,m,t,ans=0;
    cin>>n>>t;
    ll dp[3005][3005];
    memset(dp, 0, sizeof(dp)); 
    vector<ll> a(n),b(n);
    vector<pair<ll,ll> > val(n);
    for(i=0;i<n;i++)
    {
        cin>>a[i]>>b[i];
        val[i].F=a[i];
        val[i].S=b[i];
    }
    sort(val.begin(),val.end());
    for(i=0;i<n;i++)
    {
        a[i]=val[i].F;
        b[i]=val[i].S;
    }
    for(i=0;i<t;i++)
    {
        for(j=0;j<n;j++)
        {
            if(i+a[j]<t)
            {
                dp[j+1][i+a[j]] = max(dp[j][i]+b[j],dp[j+1][i+a[j]]);
            }
            else
            {
                //>=t means that jth element will be last one picked.
                ans= max(ans,dp[j][i]+b[j]);
            }
            dp[j+1][i] = max(dp[j][i],dp[j+1][i]);
            
        }
    }
    cout<<ans<<endl;
    
    // for(i=0;i<n;i++)
    // {
    //     cout<<a[i]<<" ";
    // }
    // cout<<endl;
    
	return 0;
}

Measured memory_bytes: 74256
#include <iostream>
#define ll long long
using namespace std;

int main() {
	ll A[7];
	for(int i=0; i<7; ++i) cin >> A[i];
	ll ans=A[1];
	if(A[0]<1 || A[3]<1 || A[4]<1){
	    cout << ans+(A[0]/2)*2+(A[3]/2)*2+(A[4]/2)*2 << endl;
	    return 0;
	}
	if(A[0]%2 + A[3]%2 + A[4]%2 >1){
	    ans += 3;
	    --A[0];
	    --A[3];
	    --A[4];
	}
	cout << ans+(A[0]/2)*2+(A[3]/2)*2+(A[4]/2)*2 << endl;
	return 0;
}



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

using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<string> vs;
typedef unordered_set<int> si;
typedef pair<int, int> pp;

#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
#define all(e) (e).begin(), (e).end()


template <typename T>
void printV(vector<T> A) {
    if (A.empty()) cerr << "EMTPY\n";
    else { 
        cerr << "[";
        for (int i = 0; i < A.size() -1 ; ++i) {
            cerr << A[i] << ", ";
        }
        if (A.size()) cerr << A.back() << "]\n";
    }
}


template <typename T>
void printVV(vector<vector<T>> A) {
    cerr << "[";
    for (auto v : A) {
        printV<T>(v);
    }
    cerr << "]";
}

template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
    cerr << name << ": " << arg1 << endl;
}

template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&& ...args) {
    const char* comma = strchr(names + 1, ',');
    cerr.write(names, comma - names) << ": " << arg1 << " |";
    __f(comma + 1, args...);
}

int main(int argc, char **argv) {
    ios::sync_with_stdio(false);
    cin.tie(0);
    string s; cin >> s;
    if (s[0] == s[1] && s[1] == s[2]) cout << "No\n";
    else cout << "Yes\n";
    return 0;
}



Measured memory_bytes: 256
import java.util.Scanner;
public class Main{
	int x;
	
	public void solve(){
		Scanner sc = new Scanner(System.in);
		x = sc.nextInt();
		System.out.println(x*x*x);
	}
	
	public static void main(String[] args){
		Main obj = new Main();
		obj.solve();
	}
}

Measured memory_bytes: 17356
constexpr bool isDebugMode = false;
int testcase = 1;
#include <bits/stdc++.h>
#if __has_include(<atcoder/all>)
    #include <atcoder/all>
    using namespace atcoder;
#endif
using namespace std;
typedef long long ll;
typedef pair<long long, long long> P;
struct edge{long long to,cost;};
const int inf = 1 << 27;
const long long INF = 1LL << 60;
const int COMBMAX = 1001001;
const long long MOD = 1000000007; //998244353;
const long long dy[] = {-1, 0, 0, 1};
const long long dx[] = {0, -1, 1, 0};
const string abc = "abcdefghijklmnopqrstuvwxyz";
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define eachdo(v, e) for (const auto &e : (v))
#define all(v) (v).begin(), (v).end()
#define lower_index(v, e) (long long)distance((v).begin(), lower_bound((v).begin(), (v).end(), e))
#define upper_index(v, e) (long long)distance((v).begin(), upper_bound((v).begin(), (v).end(), e))
long long mpow(long long a, long long n, long long mod = MOD){long long res = 1; while(n > 0){if(n & 1)res = res * a % mod; a = a * a % mod; n >>= 1;} return res;}
void pt(){cout << endl; return;}
template<class Head> void pt(Head&& head){cout << head; pt(); return;}
template<class Head, class... Tail> void pt(Head&& head, Tail&&... tail){cout << head << " "; pt(forward<Tail>(tail)...);}
void dpt(){if(!isDebugMode) return; cout << endl; return;}
template<class Head> void dpt(Head&& head){if(!isDebugMode) return; cout << head; pt(); return;}
template<class Head, class... Tail> void dpt(Head&& head, Tail&&... tail){if(!isDebugMode) return; cout << head << " "; pt(forward<Tail>(tail)...);}
template<class T> void enu(T v){rep(i, v.size()) cout << v[i] << " " ; cout << endl;}
template<class T> void enu2(T v){rep(i, v.size()){rep(j, v[i].size()) cout << v[i][j] << " " ; cout << endl;}}
template<class T> void debug(T v){if(!isDebugMode) return; rep(i, v.size()) cout << v[i] << " " ; cout << endl;}
template<class T> void debug2(T v){if(!isDebugMode) return; rep(i, v.size()){rep(j, v[i].size()) cout << v[i][j] << " " ; cout << endl;}}
template<class T1, class T2> inline bool chmin(T1 &a, T2 b){if(a > b){a = b; return true;} return false;}
template<class T1, class T2> inline bool chmax(T1 &a, T2 b){if(a < b){a = b; return true;} return false;}
template<class T1, class T2> long long recgcd(T1 a, T2 b){return a % b ? recgcd(b, a % b) : b;}
bool valid(long long H, long long W, long long h, long long w) { return 0 <= h && h < H && 0 <= w && w < W; }

void solve();

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    // cin >> testcase;
    while(testcase--) solve();
    return 0;
}

void solve(){
    ll N; cin >> N;
    vector<ll> a(N);
    rep(i, N) cin >> a[i];
    ll ans = 0;
    rep(i, N - 1){
        if(a[i] % 2){
            if(a[i + 1] > 0){
                ans += (a[i] + 1) / 2;
                a[i + 1]--; 
            }else{
                ans += a[i] / 2;
            }
        }else{
            ans += a[i] / 2;
        }
    }
    ans += a[N - 1] / 2;
    pt(ans);
}

Measured memory_bytes: 3924
#define _USE_MATH_DEFINES

#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cmath>
#include <bitset>
using namespace std;

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



const int BIG_NUM = 1e9;
const ll INF = 1000000000000000000;
//const ll MOD = 1e9 + 7;
const ll MOD = 998244353;




int main() {
	int n;
	cin >> n;
	vector<int> a(n + 1);
	for (int i = 0; i <= n; i++) {
		cin >> a[i];
	}



	vector<ll> b(n + 1);
	vector<ll> sum(n + 2);
	for (int i = n; i >= 0; i--) {
		sum[i] = sum[i + 1] + a[i];
	}

	b[0] = 1 - a[0];

	for (int i = 1; i <= n; i++) {
		b[i] = min(2 * b[i - 1] - a[i], sum[i + 1]);

	}
	ll ans = 0;
	for (int i = 0; i <= n; i++) {
		ans += a[i] + b[i];
		if (b[i] < 0) {
			cout << -1 << endl;
			return 0;
		}
	}

	cout << ans << endl;
}


Measured memory_bytes: 5052
#include<bits/stdc++.h>
#define int long long
using namespace std;
signed main(){
  int N,K;
  cin>>N>>K;
  vector<int> A(N);
  for(int &i:A)
    cin>>i;
  for(int i=K;i<N;i++){
    if(A[i-K]<A[i])puts("Yes");
    else puts("No");
  }
}

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

int main(int argc, char *argv[])
{
    int H, W, N;
    int S;

	scanf("%d", &H);
    scanf("%d", &W);
    scanf("%d", &N);

	S = W;
	if (H>W) S = H;

	printf("%d\n", N/S + (N%S)%2);

	return 0;
}


Measured memory_bytes: 128
#include<bits/stdc++.h>
// Begin Header {{{
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i,n) for(ll i=0; i<n; i++)
#define loop(i, j, n) for(ll i=j; i<n; i++)
#define all(x) (x).begin(), (x).end()
constexpr int INF  = 0x3f3f3f3f;
const long long mod=1e9+7;
const long double PI = acos(-1);
// }}} End Header

int main() {
	int n, m, x, cnt = 0;
	cin >> n >> m >> x;
	rep(i,m){
		int a; cin >> a;
		if(a > x){
			cnt = i;
			break;
		}
	}
	cout << min(cnt, m-cnt) << endl;
	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

    public static void main(String[] args){

        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        int x = Math.min(a, b);
        int y = Math.max(0, a + b - n);
        System.out.println(x + " " + y);
    }

}


Measured memory_bytes: 23252