akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < n; i++)
#define reps(i,n) for(int i = 1; i <= n; i++)
#define rrep(i,n) for(int i = n-1; i >= 0; i--)
#define rreps(i,n) for(int i = n; i >= 1; i--)
#define mrep(i,from,n) for(int i = from; i < n; i++)
#define mreps(i,from,n) for(int i = from; i <= n; i++)
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define ERASE(x,val) x.erase(remove(all(x), val), x.end())
typedef long long ll;
typedef pair<int, int> P;
template<class T>inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; }return false; }
template<class T>inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; }return false; }
ll MOD = 1000000007;
int INF = 1001001001;
double PI = acos(-1);

void solve()
{
    double r;cin >> r;
    cout << 2*r*PI << endl;
    return;
}

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    solve();
    return 0;
}


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

using namespace std;
typedef long long ll;

#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)
#define ALL(x) (x).begin(),(x).end()
#define SIZE(x) ((ll)(x).size())
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))
#define D()
#define INF 1000000000000
#define MOD 10000007
#define MAXR 100000
#define PB push_back
#define MP make_pair
#define F first
#define S second

int main() {
    string a, b;
    int inp;
    cin >> a >> b;
    inp = stoi(a + b);
    FOR(i, 1, 1000) {
        if (pow(i, 2) == inp) {
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;
    return 0;
}

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

constexpr int64_t mod = 1'000'000'007; //'

int main(){
    int n, m;
    cin >> n >> m;
    int s[2000], t[2000];
    for(int i=0;i<n;i++) cin >> s[i];
    for(int i=0;i<m;i++) cin >> t[i];

    static int64_t dp[2001][2001];
    for(int i=0;i<=2000;i++) dp[i][0] = dp[0][i] = 1;
    for(int i=1;i<=n;i++){
        for(int j=1;j<=m;j++){
            dp[i][j] = (dp[i-1][j] + dp[i][j-1]) % mod;
            if(s[i-1] != t[j-1]) dp[i][j] = (dp[i][j] + mod - dp[i-1][j-1]) % mod;
        }
    }

    cout << dp[n][m] << endl;
    
    return 0;
}

Measured memory_bytes: 31488
using System;
class Program{
  static void Main(){
    int N=int.Parse(Console.ReadLine());
    string[] d = Console.ReadLine().Split(' ');
    int sum=0;
    for(int n1=0;n1<N;n1++){
      for(int n2=0;n2<N;n2++){
        if(n1!=n2)sum+=int.Parse(d[n1])* int.Parse(d[n2]);   
    }
    }
    Console.WriteLine(sum/2);
  }
}

Measured memory_bytes: 11092
#include <bits/stdc++.h>
#include <math.h>
#include <string>
#include <algorithm>
using namespace std;

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

  long a[A],b[B],x[M],y[M],c[M];
  for(int i=0;i<A;i++){
      cin >> a[i];
  }

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

  for(int i=0;i<M;i++){
      cin >> x[i] >> y[i] >> c[i];
  }


  int mina = 100000;
  for(int i=0;i<A;i++){
    if(mina > a[i]) mina = a[i];
  }

  int minb = 100000;
  for(int i=0;i<B;i++){
    if(minb > b[i]) minb = b[i];
  }

  int ans = mina+minb;
  int tmp;
  for(int i=0;i<M;i++){
      tmp = a[x[i]-1]+b[y[i]-1]-c[i];
      ans = min(ans,tmp);
  }

  cout << ans << endl;




}

Measured memory_bytes: 7488
/** 
 *  Author : Parth Prajapati aka (PARTH_4399, hungry_chef)
 *  Institute : Pandit Deendayal Petroleum University
 **/
#include<bits/stdc++.h>

using namespace std; 

#define start_cooking int main()
#define food_is_ready return 0;
#define main_ingredient_added ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

void cook()
{
    // start with your recipe
    int x, n, t;
    cin>>x>>n;
    map<int, int> mp;
    for(int i=0;i<n;++i)
    {
        cin>>t;
        ++mp[t];
    }
    int k = 0;
    while(1)
    {
        if(mp[x-k] == 0)
        {
            cout<<x-k;
            exit(0);
        }
        if(mp[x+k] == 0)
        {
            cout<<x+k;
            exit(0);
        }
        ++k;
    }
}

start_cooking
{
    main_ingredient_added
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    int t = 1; 
    //cin>>t;
    while(t--)
        cook();
    food_is_ready
}

Measured memory_bytes: 3656
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rep2(i, a, n) for(ll i = a; i < (ll)(n); i++)
#define memi cout << endl
#define kono(n) cout << fixed << setprecision(n)
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define hina cout << ‘ ‘
const ll mei = (ll)1e9 + 7;

int main(){
  ll n;
  string s;
  cin >> n >> s;
  if(n < 3200)
    cout << "red";
  else
    cout << s;
  memi;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <functional>
using namespace __gnu_pbds;
using namespace std;
typedef tree<
    pair<int, int>,
    null_type,
    less_equal<pair<int, int>>,
    rb_tree_tag,
    tree_order_statistics_node_update>
    ordered_set;
#define int long long
#define double long double
#define all(a) (a).begin(), (a).end()
#define x first
#define y second
#define lb(v, z) lower_bound(all(v), z)
#define ub(v, z) upper_bound(all(v), z)
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define rdp(i, a, b) for (int i = (a); i >= (b); i--)
#define rlt(i, a, b) for (int i = (a); i < (b); i++)
#define cns(z) cout << (z) << ' '
#define cnl(z) cout << (z) << '\n'
#define M1 1000000007
#define M2 998244353
#define MAXN 300005
#define INF (1ll << 60)
#define endl "\n"
#define garr(ip)       \
    for (auto &x : ip) \
        cin >> x;
#define parr(ip)          \
    for (auto &x : ip)    \
        cout << x << " "; \
    cout << endl;
#define nl cout << endl
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<pair<int, int>> vp;

void solve(int testCaseNumber = 1)
{
    string s;
    cin >> s;
    cnl(s == "ABC" ? "ARC" : "ABC");
}

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    solve();
}

Measured memory_bytes: 3592
#include<iostream>
#include<vector>
#include<stack>
#include<algorithm>
#include<string>
#include<set>
#include<numeric>
#include<functional>
#include<unordered_map>
#include<cmath>
#include<cstdlib>

class Bus {
public:
	long long time, num;
};

int main()
{
	long long N, C, K;
	std::cin >> N >> C >> K;
	std::vector<long long> T(N);
	for (int i = 0; i < N; i++)
		std::cin >> T[i];
	//K時間まで, 定員C
	sort(T.begin(), T.end());
	long long counter = 1;
	Bus bus;
	bus.time = T[0];
	bus.num = 0;
	for (int i = 0; i < N; i++) {
		//乗せられるか判定
		if (bus.num < C && bus.time + K >= T[i]) {
			//乗せるだけ
			bus.num++;
		} else {
			//出発
			counter++;
			//printf("%d\n", i);

			//新しいバスを準備
			bus.time = T[i];
			bus.num = 1;
		}
	}
	std::cout << counter << std::endl;
}

Measured memory_bytes: 1024
#include<stdio.h>
int main(void)
{
	int a,b,n;
	int x,y;
	int i,j;
	int kouzi[17][17];
	int suu[17][17];
	
	scanf("%d %d",&a,&b);
	while(a!=0 || b!=0){
		for(i=1;i<=a;i++){
			for(j=1;j<=b;j++){
				kouzi[i][j]=0;
			}
		}
		scanf("%d",&n);
		for(i=0;i<n;i++){
			scanf("%d %d",&x,&y);
			kouzi[x][y]=1;
		}
		for(i=1;i<=a;i++){
			for(j=1;j<=b;j++){
				if(i==1 && j==1){
					suu[i][j]=1;
				}
				else {
					if(kouzi[i][j]==1){
						suu[i][j]=0;
					}
					else {
						if(i==1){
							suu[i][j]=suu[i][j-1];
						}
						else if(j==1){
							suu[i][j]=suu[i-1][j];
						}
						else {
							suu[i][j]=suu[i][j-1]+suu[i-1][j];
						}
					}
				}
			}
		}
		printf("%d\n",suu[a][b]);
		scanf("%d %d",&a,&b);
	}
	return 0;
}

Measured memory_bytes: 604
def solve():
    ans = 10**12
    for i in range(1, int(N**0.5)+1):
        if N % i == 0:
            ans = min(ans, i + (N//i) -2)
    if N == 2:
        print(1)
    elif N == 3:
        print(2)
    else:
        print(ans)
            
if __name__ == "__main__":  
    N = int(input())
    solve()  


Measured memory_bytes: 9412
import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    int tasu = a + b;
    int hiku = a - b;
    int kake = a * b;
    int ans = Math.max(tasu,hiku);
    ans = Math.max(ans,kake);
    System.out.println(ans);

  }
}


Measured memory_bytes: 21972
import java.util.Scanner;

public class Main {

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

    private static int[] bubbleSort(int[] a) {
        int count = 0;
        boolean flag = true;
        while (flag) {
            flag = false;
            for (int i = 1; i < a.length; i++) {
                if (a[i - 1] > a[i]) {
                    int tmp = a[i];
                    a[i] = a[i - 1];
                    a[i - 1] = tmp;
                    flag = true;
                    count++;
                }
            }
        }
        printArray(a);
        System.out.println(count);
        return a;
    }

    private static void printArray(int[] array) {
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < array.length; i++) {
            sb.append(array[i]);
            if (i != array.length - 1) {
                sb.append(" ");
            }
        }
        System.out.println(sb);
    }
}

Measured memory_bytes: 26372
#include <iostream>
#include <cstdio>
#include <vector>
#include <math.h>

using namespace std;

typedef long long int ll;
typedef long double ld;

#define rep(i,n) for(int i = 0; i < (n); ++i)
#define vsort(a) sort(a.begin(), a.end())
#define rev(a) reverse(a.begin(), a.end())

const int MOD = 1000000007;
const int INF = INT_MAX;


int main(){

    int a, b;
    cin >> a >> b;

    if (b%a == 0) cout << a+b << endl;
    else cout << b-a << endl;
}





//              g++ -std=c++1z

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

int main() {
  int n;
  cin>>n;
  long long a[n],b[n];
  for(int i=0;i<n;i++)b[i]=0;
  for(int i=0;i<n;i++){
    long long l;
    cin>>l;
    a[i]=l;
    b[l-1]++;
  }
  long long ans=0;
  for(int i=0;i<n;i++){
    ans+=b[i]*(b[i]-1)/2;
  }
  for(int i=0;i<n;i++){
    long long t=ans;
    t-=(b[a[i]-1]-1);
    cout<<t<<endl;
  }
}


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

/* define */
#define FOR(I, X, Y) for(long long(I) = (X); (I) < (Y); (I)++)
#define REP(I, X, Y) for(long long(I) = (Y)-1; (I) >= (X); (I)--)
#define ALL(X) (X).begin(), (X).end()
#define pb push_back
#define COUNT(V, X)                                                            \
    (upper_bound((V).begin(), (V).end(), X) -                                  \
     lower_bound((V).begin(), (V).end(), X))
#define debug(x) cerr << #x << ':' << x << endl;
#define DEBUG(v)                                                               \
    {                                                                          \
        cerr << #v << ':';                                                     \
        for(auto xv : v) cerr << xv << ' ';                                    \
        cerr << endl;                                                          \
    }
#define Yes(X) cout << (X ? "Yes" : "No") << endl;
#define YES(X) cout << (X ? "YES" : "NO") << endl;
#define ctoi(C) (C - '0')
#define pow2(x) ((long long)((long long)1 << x))

/* alias */
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vii = vector<vector<int>>;
using vl = vector<long long>;
using vll = vector<vector<long long>>;
using pi = pair<int, int>;
using pl = pair<long long, long long>;
template <typename T> using PQ = priority_queue<T>;
template <typename T> using minPQ = priority_queue<T, vector<T>, greater<T>>;

/* const */
const long long dx[] = {1, 0, -1, 0};
const long long dy[] = {0, 1, 0, -1};
const long long dx8[] = {1, 1, 0, -1, -1, -1, 0, 1};
const long long dy8[] = {0, 1, 1, 1, 0, -1, -1, -1};
const long long dx9[] = {1, 1, 0, -1, -1, -1, 0, 1, 0};
const long long dy9[] = {0, 1, 1, 1, 0, -1, -1, -1, 0};
const int INF = 1000000007;
const long long LINF = 1000000000000000007;

/* func */
template <typename T1, typename T2> inline bool chmin(T1 &a, const T2 &b) {
    if(a > b) a = b;
    return a > b;
}
template <typename T1, typename T2> inline bool chmax(T1 &a, const T2 &b) {
    if(a < b) a = b;
    return a < b;
}
long long max(long long x, int y) {
    return max(x, (long long)y);
}
long long max(int x, long long y) {
    return max((long long)x, y);
}
long long min(long long x, int y) {
    return min(x, (long long)y);
}
long long min(int x, long long y) {
    return min((long long)x, y);
}

/* liblary */

/* main */

signed main() {
    ll r, D, x2000;
    cin >> r >> D >> x2000;
    ll x = x2000;
    FOR(i, 0, 10) {
        x = r * x - D;
        cout << x << endl;
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
	string s;
	cin>>s;
	if(s[0]=='a'||s[0]=='e'||s[0]=='i'||s[0]=='o'||s[0]=='u')cout<<"vowel"<<endl;
	else cout<<"consonant"<<endl;
}

Measured memory_bytes: 256
n=int(input())
a = list(map(int,input().split()))
step=[0]*n
for i in range(n-1):
  step[i+1]+=a[i]+step[i]-a[i+1]
  if step[i+1]<0:
    step[i+1]=0
    
total=sum(step)
print(total)

Measured memory_bytes: 32236
n = int(input())
t = [int(i) for i in input().split()]
m = int(input())
d = [[int(i) for i in input().split()] for _ in range(m)]
for i in range(m):
  p, x = d[i]
  print(sum(x if j + 1 == p else t[j] for j in range(n)))

Measured memory_bytes: 3064
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define lop(i, n) for(i=0; i<n; i++)

int main()
{
	int s, w;
	scanf("%d %d", &s, &w);
	
	if(w>=s)printf("unsafe");
	else printf("safe");
	
return 0;
}

Measured memory_bytes: 1732
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG //GCC5.4.1で配列の範囲外アクセスをエラーにする

//cmdで g++ test.cpp とするとコンパイルできる
//制限1秒なら10^6は余裕 10^7は多分間に合う 10^8はよほど単純でないと厳しい

#define ALL(x) x.begin(),x.end()
#define get_tp(t,i) get<i>(t)
#define len(x) (ll)(x.size())
#define ub(a,x) (upper_bound(ALL(a),x)-a.begin())
#define lb(a,x) (lower_bound(ALL(a),x)-a.begin())
typedef long long ll; //long long
typedef pair<int,int> pii; //pair<int,int>
typedef pair<long long,long long> pllll; //pair<ll,ll>
typedef vector<int> vi; //vector<int>
typedef vector<vector<int>> vvi; //vector<vector<int>>
typedef vector<ll> vll; //vector<long long>
typedef vector<vector<ll>> vvll; //vector<vector<long long>>
typedef priority_queue<int, vector<int>, greater<int> > gpq; //逆順priority_queue
typedef priority_queue<int> pq;

//const int MOD=998244353;
const int MOD=1000000007; //10^9+7
const long double PI=3.1415926535897932;

int main(){
    int N;
    cin>>N;
    vi a(N+1);
    vi ans(N+1,-1);
    for(int i=1;i<=N;i++)cin>>a[i];
    for(int i=N;i>=1;i--){
        int count=0;
        for(int j=i*(N/i);j>i;j-=i){
            if(ans[j]==1)count++;
        }
        if((a[i]+count)%2){
            ans[i]=1;
        }else{
            ans[i]=0;
        }
    }
    vi b(0);
    for(int i=1;i<=N;i++){
        if(ans[i]==1)b.push_back(i);
    }
    cout<<b.size()<<endl;
    for(int i=0;i<b.size();i++){
        cout<<b[i];
        if(i<b.size()-1){
            cout<<" ";
        }else{
            cout<<endl;
        }
    }
}


Measured memory_bytes: 5424
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
 
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  /* freopen("input.txt","r",stdin);
     freopen("output.txt","w",stdout);
  */ 
  ll n,m;
  cin>>n>>m;
  ll arr[m],i,sum=0;
  for(i=0;i<m;i++)
  {
     cin>>arr[i];
  }
  for(i=0;i<m;i++)
  {
     sum=sum+arr[i];
  }
  if(sum>n)
  {
     cout<<"-1\n";
  }
  else
  {
     cout<<n-sum<<'\n';
  }
   
   
  return 0;
}

Measured memory_bytes: 3688
import java.io.PrintWriter;
import java.util.*;

public class Main {
    void run() {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        int n = sc.nextInt();
        long[] arr = new long[n];
        for (int i = 0; i< n;i ++) {
            arr[i] = sc.nextLong();
        }

        int count = 0;
        for (int i =0 ; i< n; i++) {
            for (int j = i + 1; j < n; j++) {
                for (int k = j + 1; k < n; k++) {
                    long a1 = arr[i];
                    long a2 = arr[j];
                    long a3 = arr[k];
                    if (a1 != a2 && a2 != a3 && a3 != a1) {
                        if (a1 + a2 > a3 && a2 + a3 > a1 && a3 + a1 > a2) {
                            count++;
                        }
                    }
                }
            }
        }
        System.out.println(count);
        // out.println("Hello World");
        out.flush();
    }

    void debug(Object... os) {
        System.err.println(Arrays.deepToString(os));
    }

    public static void main(String[] args) {
        new Main().run();
    }
}


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

#define rep(i, n) for(int i = 0; i<(n); i++)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
using namespace std;
using ll = long long;

const ll mod = 1000000007;

int main() {
    int N;
    cin >> N;
    vector<ll> A(N);
    rep(i, N) cin >> A[i];
    ll ans = 0;
    ll total = 0;
    rep(i, N) total += A[i];
    rep(i, N) {
        total -= A[i];
        ans += (A[i] * (total % mod)) % mod;
        ans %= mod;
    }

    cout << ans << endl;
}


Measured memory_bytes: 4792
//{{{
#include<algorithm>
#include<cmath>
#include<deque>
#include<fstream>
#include<iomanip>
#include<iostream>
#include<map>
#include<numeric>
#include<queue>
#include<random>
#include<set>
#include<sstream>
#include<sys/time.h>
#include<unordered_map>
#include<unordered_set>
#include<vector>
using ll = long long;
enum : int { M = (int)1e9 + 7 };
enum : ll { MLL = (ll)1e18L + 9 };
using namespace std;
#ifdef LOCAL
#include"rprint2.hpp"
#else
#define FUNC(name) template <ostream& out = cout, class... T> void name(T&&...){ }
FUNC(printde) FUNC(printdbe) FUNC(printdwe) FUNC(printdu) FUNC(printe) FUNC(printe0);
#endif
template <template <class T, class = std::allocator<T>> class V, class E>
istream& operator >> (istream& in, V<E>& v){ for(auto& e : v){ in >> e; } return in; }
//}}}

int main(){
    cin.tie(0); ios::sync_with_stdio(false);
    int n; cin >> n;
    string xs; cin >> xs;
    int cnt = 0;
    for(int i = 0; i < n; i++){
        cnt += xs[i] == '1';
    }
    int mods[2] = {cnt - 1, cnt + 1};
    vector<vector<int>> memo(2, vector<int>(n, -1));
    memo[0][0] = 0;
    memo[1][0] = 0;
    vector<vector<int>> pow2mods(2, vector<int>(n));
    int baseMods[2];

    for(int i = 0; i < 2; i++){
        if(mods[i] == 0){ continue; }
        int num = 0;
        for(int j = 0; j < n; j++){
            num = (num * 2 + (xs[j] == '1')) % mods[i];
        }
        baseMods[i] = num;

        num = 1;
        for(int j = 0; j < n; j++){
            pow2mods[i][j] = num;
            num = (num * 2) % mods[i];
        }

        for(int j = 1; j < n; j++){
            memo[i][j] = memo[i][j % __builtin_popcount(j)] + 1;
        }
    }
    printde(mods);
    printde(memo);

    for(int i = 0; i < n; i++){
        // int cnt2 = cnt + (xs[i] == '1' ? -1 : 1);
        bool plus = xs[i] == '0';
        if(mods[plus] == 0){
            cout << 0 << '\n';
            continue;
        }
        int num = (baseMods[plus] + (plus ? 1 : -1) * pow2mods[plus][n - 1 - i] + mods[plus]) % mods[plus];
        // int num = (baseMods[plus] + (plus ? 1 : -1) * pow2mods[plus][i] + mods[plus]) % mods[plus];
        // printde(i, plus, baseMods[plus], pow2mods[plus][i]);
        // printde(num, memo[plus][num] + 1);
        cout << memo[plus][num] + 1 << '\n';
    }
}


Measured memory_bytes: 6896
A=list(map(int,input().split()))
ans = 0
if A[0] >= A[3]:
    ans = A[3]
else:
    A[3] = A[3]-A[0]
    ans = A[0]
    A[3] = A[3] -A[1]
    if A[3] > 0:
        ans = ans - A[3]
print(ans)

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

using namespace std;

#define rep(i, n) REP(i, 0, n)
#define REP(i, a, n) for(int i=(a); i<(n); i++)

int h, w, c;
int p[10][10];
int q[10][10];
bool visited[10][10];

void change(int i, int j, int c) {
    if(visited[i][j]) return;
    visited[i][j] = true;
    if(i>0 && q[i-1][j]==q[i][j]) change(i-1, j, c);
    if(j>0 && q[i][j-1]==q[i][j]) change(i, j-1, c);
    if(i<h-1 && q[i+1][j]==q[i][j]) change(i+1, j, c);
    if(j<w-1 && q[i][j+1]==q[i][j]) change(i, j+1, c);
    q[i][j] = c;
}

int count(int i, int j) {
    if(visited[i][j]) return 0;
    visited[i][j] = true;
    int ret = 1;
    if(i>0 && q[i-1][j]==q[i][j]) ret += count(i-1, j);
    if(j>0 && q[i][j-1]==q[i][j]) ret += count(i, j-1);
    if(i<h-1 && q[i+1][j]==q[i][j]) ret += count(i+1, j);
    if(j<w-1 && q[i][j+1]==q[i][j]) ret += count(i, j+1);
    return ret;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
	while(cin>>h>>w>>c, h+w+c) {
	    rep(i, h) rep(j, w) cin >> p[i][j];
	    int ans = -1;
	    REP(c1, 1, 7) REP(c2, 1, 7) REP(c3, 1, 7) REP(c4, 1, 7) {
	        rep(i, h) rep(j, w) q[i][j] = p[i][j];
	        memset(visited, false, sizeof(visited)); change(0, 0, c1);
	        memset(visited, false, sizeof(visited)); change(0, 0, c2);
	        memset(visited, false, sizeof(visited)); change(0, 0, c3);
	        memset(visited, false, sizeof(visited)); change(0, 0, c4);
	        memset(visited, false, sizeof(visited)); change(0, 0, c);
	        memset(visited, false, sizeof(visited)); ans = max(ans, count(0, 0));
	    }
	    cout << ans << endl;
	}
}





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

int main()
{
	int A, B;
	scanf("%d %d", &A, &B);
	if (A >= 13)
		printf("%d\n", B);
	else if (A >= 6 and A <= 12)
		printf("%d\n", B / 2);
	else
		printf("0\n");
	return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using static System.Console;
using static System.Convert;
using static System.Math;
//using static System.Globalization.CultureInfo;

class Program
{
    static void Main(string[] args)
    {
        var num = Add.num;
        var ar = new List<long> { int.MinValue };
        ar.AddRange(Add.arL);
        ar.Add(int.MaxValue);
        var arr=ar.OrderBy(v=>v).ToArray();
        var low = Search.LowerBound(arr, (arr[num] + 1) / 2);
        var di = Abs(arr[low] - (arr[num] + 1) / 2) < Abs(arr[low - 1] - (arr[num] + 1) / 2) ? arr[low] : arr[low - 1];
        WriteLine($"{arr[num]} {di}");
    }
}

public class Add
{
    public static string read => ReadLine();
    public  static int[] ar => Array.ConvertAll(read.Split(' '), int.Parse);
    public  static int num => ToInt32(read);
    public  static long[] arL => Array.ConvertAll(read.Split(' '), long.Parse);
    public  static long numL => ToInt64(read);
    public  const string Alfa = "abcdefghijklmnopqrstuvwxyz";
    public  const int MOD = 1000000007;
}

public class Search
{
    public static int UpperBound<T>(T[] array,T value)
        where T:IComparable<T>
    {
        var low = 0;
        var high = array.Length;
        while (high > low)
        {
            var mid = (high + low) / 2;
            if (array[mid].CompareTo(value) == 1) high = mid;
            else low = mid + 1;
        }
        return low;
    }

    public static int LowerBound<T>(T[] array,T value)
        where T : IComparable<T>
    {
        var low = 0;
        var high = array.Length;
        while (high > low)
        {
            var mid = (high + low) / 2;
            if (array[mid].CompareTo(value) != -1) high = mid;
            else low = mid + 1;
        }
        return low;
    }
}


Measured memory_bytes: 26080
#include <cstdio>
#include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>
#include <string>
#include <list>

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define all(c) c.begin(),c.end()

using namespace std;

int N, M, K, W,X;

int main() {
	int A, B;

	cin >> N;

	if (N == 1) {
		cout << "Hello World";
	}
	else {
		cin >> A >> B;
		cout << A + B;

	}
}

Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
typedef long long ll;
ll w,ans,c[210001],b[210001];
int a[210001],i,j,k,n,m;
int main(){
	//freopen("a.in","r",stdin);freopen("a.out","w",stdout);
	scanf("%d%d",&n,&m);memset(b,0,sizeof(b));memset(c,0,sizeof(c));
	for (i=1;i<=n;i++) scanf("%d",&a[i]);
	for (i=1,k=w=0;i<n;i++){
		if (a[i]==a[i+1]) continue;
		if (a[i]+1==a[i+1]||a[i]==m&&a[i+1]==1){
			w++;continue;
		}
		if (a[i]<a[i+1]){
			w+=a[i+1]-a[i];
			b[a[i]+1]--;b[a[i+1]]++;c[a[i+1]+1]+=a[i+1]-a[i]-1;
		}else{
			w+=a[i+1];
			k--;b[a[i+1]]++;b[a[i]+1]--;c[a[i+1]+1]+=a[i+1]+m-a[i]-1;
		}
	}
	for (i=1,ans=(1LL<<60);i<=m;i++){
		w+=c[i];
		//printf("%d %lld\n",i,w);
		ans=min(ans,w);
		k+=b[i];w+=k;
	}
	printf("%lld\n",ans);
	return 0;
}

Measured memory_bytes: 3840
#include <bits/stdc++.h>
using namespace std;
#define FAST  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define ll long long int 

//power of 2 ...n&(n-1)==0

int main()
{
	FAST;
	//#ifndef ONLINE_JUDGE
	//	freopen("input.txt","r",stdin);
	//	freopen("output.txt","w",stdout);
	//#endif
	 //ll testcase;
	 //cin>>testcase;
	 //for(ll t=0;t<testcase;t++)
	{
		// use long long
		//donot memeset other than 0 or 1 or -1
		//segmentation fault-> check for uninitialized global variable or out of bounds
		//always check for bottle neck (whether original constraints can be reduced by introducing some condition)
		//dont rush to writing code think through the logic	
		//implement dijkstra again ---it is bfs because we vis all the points connected to the current point first
		//from every not visited cell we will update the distances of cell which can be visited
		ll a;double b;
		cin>>a>>b;
		int d=(int)round(b*100);
		ll ans=(ll)(a*d);
		cout<<(ll)(ans/100)<<'\n';
	}
	return 0;
}





























































Measured memory_bytes: 3720
n=int(input())
A=sorted(list(map(int,input().split())))

minA=min(A)
while len(A)!=1:
    B=[]
    for i in range(len(A)):
        if A[i]%minA!=0:
            B.append(A[i]%minA)
    B.append(minA)
    A=B
    minA=min(A)
print(minA)

Measured memory_bytes: 14252
#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int maxn=(1<<16)+5;
const int mod=1e9+7;
ll n,m,a[maxn],jc[maxn],jcn[maxn];
ll sta[maxn],cnt[maxn],dp[20][maxn];
bool cmp(int a,int b){return a>b;}
ll C(int n,int m)
{
	if(n<0||m<0||n<m) return 0;
	return jc[n]*jcn[m]%mod*jcn[n-m]%mod;
}
ll ksm(ll x,ll k)
{
	ll res=1;
	while(k)
	{
		if(k&1) res=res*x%mod;
		x=x*x%mod;k>>=1;
	}
	return res;
}
void init()
{
	
  	sta[0]=1;
  	for(int i=1;i<=16;i++) sta[i]=sta[i-1]<<1;
  	int aim=sta[n];
  	jc[0]=1;
	for(int i=1;i<=aim;i++)
		jc[i]=jc[i-1]*i%mod;
  	jcn[aim]=ksm(jc[aim],mod-2);
  	for(int i=aim-1;i>=0;i--)
	  	jcn[i]=jcn[i+1]*(i+1)%mod;
  	for(int s=1;s<sta[n];s++)
    	cnt[s]=cnt[s^(s&-s)]+1;
  	for(int s=0;s<sta[n];s++)
	  	cnt[s]=(cnt[s]&1)?mod-1:1;
}
int main()
{
	scanf("%d%d",&n,&m);
  	for(int i=1;i<=m;i++) scanf("%d",&a[i]);
  	sort(a+1,a+m+1,cmp);
	init();
  	dp[0][0]=1;
	int aim=sta[n];
  	for(int i=1;i<=m;i++)
    	for(int s=0;s<aim;s++)
      	{
    		dp[i][s]=dp[i-1][s];
    		for(int j=0;j<n;j++)
      			if(s&sta[j])
        		{
          			int t=s^sta[j];
          			int ml=dp[i-1][t]*C(aim-a[i]-t,sta[j]-1)%mod;
          			dp[i][s]=(dp[i][s]+ml*jc[sta[j]])%mod;
        		}
      	}
  	ll ans=0;
  	for(int s=0,U=sta[n]-1;s<sta[n];s++)
      	ans=(ans+cnt[s]*dp[m][s]%mod*jc[U^s])%mod;
  	printf("%lld\n",ans*aim%mod);
  	return 0;
}

Measured memory_bytes: 12032
import heapq
n, m = map(int, input().split())
work = [0]*n
for i in range(n):
  work[i] = list(map(int, input().split()))

work.sort()
k = 0
workable = []
heapq.heapify(workable)
ans = 0
for i in range(m):
  while k < n:
    if work[k][0] <= i+1:
      heapq.heappush(workable, -work[k][1])
      k += 1
    else:
      break
  if workable:
    ans += -heapq.heappop(workable)
print(ans)

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

using namespace std;


int main (void) 
{

  /* Variable_Proclamation */
  int N;    // input
  string ans;  // output

  int i, j;    // subscript
  int sum;



  /* Input, Array_Proclamation */
  cin >> N;


  /* Initialize */
  ans = "No";


  /* Calculation */
  for(i=0; i<=25; i++)
  {
    for(j=0; j<=15; j++)
    {
      sum = i*4 + j*7;
      if(N == sum)
      {
        ans = "Yes";
        goto ESCAPE;
      }
    }
  }
  ESCAPE:

  /* Output */
  cout << ans << endl;


  return 0;

}


Measured memory_bytes: 256
import java.util.*;

public class Main {

    void run() {
        Scanner sc = new Scanner(System.in);

        int MOD =  1000000007;
        int n = sc.nextInt();
        int m = sc.nextInt();
        boolean[] aArr = new boolean[n + 100];
        int[] dp = new int[n + 100];

        for (int i = 0; i < m; i++) {
            aArr[sc.nextInt()] = true;
        }

        dp[0] = 1;

        for (int i = 0; i < n; i++) {
            if (!aArr[i + 1]) dp[i + 1] = (dp[i + 1] + dp[i]) % MOD;
            if (!aArr[i + 2]) dp[i + 2] = (dp[i + 2] + dp[i]) % MOD;
        }

//        for (int i = 0; i < n; i++) {
//            debug("i: " + dp[i]);
//        }
//
        System.out.println(dp[n]);
    }

    void debug(Object... os) {
        System.err.println(Arrays.deepToString(os));
    }

    public static void main(String[] args) {
        new Main().run();
    }
}


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

int fact(int n){
    int ans=1;
    while(n>0){
        ans=ans*n;
        n--;
    }
    return ans;
}
int npr(int n, int r){
    int ans = 1;
    for(int i=n; i>(n-r); i--){
        ans =ans*i; 
    }
    return ans;
}
int comb(int n, int r) {
    int ans;
    if (n>=r){
        ans = npr(n,r)/fact(r);
    } else {
        ans =0;
    }
    return ans;
}

int main(void){
    int N,M;
    cin >> N >> M;
    cout << comb(N,2)+comb(M,2);
    
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#define Would
#define you
#define all(n)  n.begin(),n.end()
#define rall(n) n.rbegin(),n.rend()
typedef long long ll;
const ll INF = 1e18;
const ll MOD = 1e9 + 7;
const double EPS = 1e-10;
const double pi = acos(-1);//3.1415926535897932384626433832795028...
const ll SIZE = 1 << 17;
int dx[] = { 1,0,-1,0 }, dy[] = { 0,1,0,-1 }, alp[30];
ll fac[200005], finv[200005], inv[200005];
vector<ll>dij;
struct edge { ll to, cost; };
vector<vector<edge> >G;

ll mod_pow(ll a, ll b) {
	ll res = 1, mul = a;
	for (int i = 0; i < 31; ++i) {
		if (b >> i & 1) {
			res *= mul;
			res %= MOD;
		}
		mul = (mul * mul) % MOD;
	}
	return res;
}

void addedge(int from, int to, int cost) {
	G[from].push_back({ to,cost });
	G[to].push_back({ from,cost });
}

template<typename T>
vector<T> make_v(size_t a) { return vector<T>(a); }

template<typename T, typename... Ts>
auto make_v(size_t a, Ts... ts) {
	return vector<decltype(make_v<T>(ts...))>(a, make_v<T>(ts...));
}

template<typename T, typename V>
typename enable_if<is_class<T>::value == 0>::type
fill_v(T & t, const V & v) { t = v; }

template<typename T, typename V>
typename enable_if<is_class<T>::value != 0>::type
fill_v(T & t, const V & v) {
	for (auto& e : t) fill_v(e, v);
}

template<typename T>
void outp(vector<T>v) {
	for (int i = 0; i < v.size(); ++i) {
		cout << v[i];
		if (i != v.size() - 1) { cout << " "; }
	}
}

double add(double a, double b) {
	if (abs(a + b) < EPS * (abs(a) + abs(b))) { return 0; }
	return a + b;
}


int main() {
	int a, b, ans;
	cin >> a >> b;
	ans = a;
	if (a > b) { --ans; }
	cout << ans << endl;
}

Measured memory_bytes: 256
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <set>
#include <map>
#include <queue>
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstring>
#include <cctype>
#include <cassert>
#include <limits>
#include <functional>
#include <iomanip>
#include <complex>
#include <bitset>
#include <stack>
 
using namespace std;
 
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define repl(i,s,n) for(int i=s; i<=n; ++i)
#define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i))
#define reu(i,l,u) for(int (i)=(int)(l);(i)<(int)(u);++(i))
#if defined(_MSC_VER) || __cplusplus > 199711L
#define aut(r,v) auto r = (v)
#else
#define aut(r,v) __typeof(v) r = (v)
#endif
#define each(it,o) for(aut(it, (o).begin()); it != (o).end(); ++ it)
#define ktya(x) sort(all(x))
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define all(o) (o).begin(), (o).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define mset(m,v) memset(m,v,sizeof(m))
#define INF 1e18
#define INFLL 1000000000000000007LL
#define SIZE 200105
#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
#define mind(a,b) (a>b?b:a)
#define maxd(a,b) (a>b?a:b)

typedef vector<int> vi; typedef pair<int, int> pii; typedef vector<pair<int, int> > vpii; typedef long long ll;
typedef pair<int,ll> pill; typedef pair<ll,int> plli; 
typedef pair<double, int> pdi;
template<typename T, typename U> inline void amin(T &x, U y) { if(y < x) x = y; }
template<typename T, typename U> inline void amax(T &x, U y) { if(x < y) x = y; }
typedef complex<double> P;
ll MOD = 1000000007;
//ll MOD=998244353;
typedef ll Weight;
struct Edge {
	int src, dst;
	Weight weight;
};
bool operator < (const Edge &e, const Edge &f) {
	return e.weight != f.weight ? e.weight > f.weight : // !!INVERSE!!
	e.src != f.src ? e.src < f.src : e.dst < f.dst;
}
typedef vector<Edge> Edges;
int N,Q;
vector<ll>score;

int main(){
	cin>>N;

	rep(i,N){
		ll x;
		cin>>x;
		score.pb(x);
	}
	ll ans=0;
	ll sumA[114514]={0};
	ll sumdif[114514]={0};
	for(int dif=1;dif<=N-1;dif++){
		int res=(N-1)%dif;
		ll now=0;
		for(int cnt=0;cnt<=(N-1-res)/dif;cnt++){
			now+=score[dif*cnt];
			sumdif[cnt]=now;
			//cout<<sumdif[cnt]<<" ";
		}
		//cout<<endl;
		now=0;
		for(int cnt=0;cnt<=(N-1-res)/dif;cnt++){
			now+=score[res+dif*cnt];
			sumA[cnt]=now;
			//cout<<sumA[cnt]<<" ";
		}
		//cout<<endl;
		for(int ind=0;res+ind*dif+dif<N-1;ind++){
			int B=res+ind*dif;
			int A=B+dif;
			ll sum=0;
			if(res!=0){
				sum = sumA[(N-1-res)/dif] -sumA[ind] + sumdif[(N-1-A)/dif];
			}else{
				if(A>N-1-A){
					sum = sumA[(N-1-res)/dif] -sumA[ind] + sumdif[(N-1-A)/dif];
				}
			}
			ans=max(ans,sum);
			//cout<<A<<" "<<B<<" "<<sum<<endl;
		}
	}
	cout<<ans<<endl;
}

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

#define endl '\n'
#define lfs cout<<fixed<<setprecision(10)
#define ALL(a)  (a).begin(),(a).end()
#define ALLR(a)  (a).rbegin(),(a).rend()
#define spa << " " <<
#define fi first
#define se second
#define MP make_pair
#define MT make_tuple
#define PB push_back
#define EB emplace_back
#define rep(i,n,m) for(ll i = (n); i < (ll)(m); i++)
#define rrep(i,n,m) for(ll i = (m) - 1; i >= (ll)(n); i--)
using ll = long long;
using ld = long double;
const ll MOD1 = 1e9+7;
const ll MOD9 = 998244353;
const ll INF = 1e18;
using P = pair<ll, ll>;
template<typename T>
bool chmin(T &a,T b){if(a>b){a=b;return true;}else return false;}
template<typename T>
bool chmax(T &a,T b){if(a<b){a=b;return true;}else return false;}
ll median(ll a,ll b, ll c){return a+b+c-max({a,b,c})-min({a,b,c});}
void ans1(bool x){if(x) cout<<"Yes"<<endl;else cout<<"No"<<endl;}
void ans2(bool x){if(x) cout<<"YES"<<endl;else cout<<"NO"<<endl;}
void ans3(bool x){if(x) cout<<"Yay!"<<endl;else cout<<":("<<endl;}
template<typename T1,typename T2>
void ans(bool x,T1 y,T2 z){if(x)cout<<y<<endl;else cout<<z<<endl;}  
template<typename T>
void debug(vector<vector<T>>&v,ll h,ll w){for(ll i=0;i<h;i++)
{cout<<v[i][0];for(ll j=1;j<w;j++)cout spa v[i][j];cout<<endl;}};
void debug(vector<string>&v,ll h,ll w){for(ll i=0;i<h;i++)
{for(ll j=0;j<w;j++)cout<<v[i][j];cout<<endl;}};
template<typename T>
void debug(vector<T>&v,ll n){if(n!=0)cout<<v[0];
for(ll i=1;i<n;i++)cout spa v[i];cout<<endl;};
template<typename T>
vector<vector<T>>vec(ll x, ll y, T w){
  vector<vector<T>>v(x,vector<T>(y,w));return v;}
ll gcd(ll x,ll y){ll r;while(y!=0&&(r=x%y)!=0){x=y;y=r;}return y==0?x:y;}
vector<ll>dx={1,0,-1,0,1,1,-1,-1};
vector<ll>dy={0,1,0,-1,1,-1,1,-1};
template<typename T>
vector<T> make_v(size_t a,T b){return vector<T>(a,b);}
template<typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v(ts...))>(a,make_v(ts...));
}
template<typename T1, typename T2>
ostream &operator<<(ostream &os, pair<T1, T2>&p){
  return os << p.first << " " << p.second;
}  
int main(){
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  ll res=0,buf=0;
  bool judge = true;
  string s;cin>>s;
  cout<<s.substr(0,4)+" "+s.substr(4,8)<<endl;
  return 0;
}

Measured memory_bytes: 256
fun main(args: Array<String>) {
    val (n, k, q) = readLine()!!.split(" ").map(String::toInt)
    val As = Array(q) {
        readLine()!!.toInt()
    }
    val Cs = Array(n) {0}
    As.forEach { Cs[it-1]++ }
    for (i in 0 until n) {
        println(if(k+Cs[i]-q > 0) "Yes" else "No")
    }
}

Measured memory_bytes: 45808
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <unordered_map>
#include <queue>
#include <algorithm>

#include <bits/stdc++.h>
#include <cmath>
#include <limits>

using namespace std;
typedef long long LL;
using Graph = vector<vector<int>>;

static long long INF = (1LL<<62);

LL N;
vector<string> S;

int main(int argc, char* argv[]){
	cin.tie(0);
	ios::sync_with_stdio(false);

	cin >> N;
	LL ans = 0;
	// ca:Aで終わる文字列の個数, cb:Bで始まる文字列の個数, cab:Bで始まりかつAで終わる文字列の個数
	LL ca = 0, cb = 0, cab=0;

	for(int i=0; i<N; i++){
		string t, s;
		cin >> t;
		for(int j=0; j<t.size(); j++){
			if(t[j] == 'A' && j+1<t.size() && t[j+1] == 'B'){
				s.push_back('X');
				s.push_back('X');
				j++;
				ans++;
			}
			else{
				s.push_back(t[j]);
			}
		}
		S.push_back(s);
		if(s[s.size()-1] == 'A'){
			ca++;
		}
		if(s[0] == 'B'){
			cb++;
		}
		if(s[0] == 'B' && s[s.size()-1] == 'A'){
			cab++;
		}
	}

	LL u = ca - cab;
	LL v = cb - cab;
	LL w = cab;
	if(w == 0){
		ans += min(ca, cb);
	}
	else if(u == 0 && v == 0){
		ans += (w - 1);
	}
	else if(v == 0){
		if(w >= u){
			ans += (u + (w - u));
		}
		else{
			ans += w;
		}
	}
	else if(u == 0){
		if(w >= v){
			ans += (v + (w - v));

		}
		else{
			ans += w;
		}
	}
	else{
		if(u >= v){
			ans += v;
			LL d = u - v;
			ans += (d + (w - d));

		}
		else{
			ans += u;
			LL d = v - u;
			ans += (d + (w - d));
		}
	}
	printf("%lld\n", ans);
	return 0;
}


Measured memory_bytes: 3852
using System;
using System.Collections.Generic;

class Program {
    static int Main(string[] args) {
        string v = Console.ReadLine();
        
        Decimal r = Decimal.Parse(v);


        Decimal a = (Decimal)Math.PI * r * r;
        Decimal b = (Decimal)2 * (Decimal)Math.PI * r;

        Console.WriteLine(string.Format("{0} {1}", a, b));

        return 0;
    }
}

Measured memory_bytes: 9376
#include<iostream>
#include<fstream>
#include<algorithm>
#include<cmath>
#include<string>
#include<cstring>
#include<cstdio>
using namespace std;
long long n,xiao=2100000000,h,a;
int main()
{
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>a;
		h=0;
		while(a%2==0)
		{
			a/=2;
			h++;
		}
		if(h<xiao)xiao=h;
	}
	cout<<xiao<<endl;
    return 0;
}

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



int main() {
    int n, m;
    cin >> n >> m;
    
    if(n == m)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
    
    
    return 0;
}


Measured memory_bytes: 3600
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;

public class Main {
    public void solve(BufferedReader stdin, PrintWriter stdout) throws NumberFormatException, IOException {
        String[] first = stdin.readLine().split(" ");
        int x = Integer.parseInt(first[0]);
        int y = Integer.parseInt(first[1]);

        int ans = f(x) + f(y);
        if (x == 1 && y == 1) ans += 400000;
        stdout.println(ans);
    }

    public int f(int x) {
        if (x == 1) return 300000;
        if (x == 2) return 200000;
        if (x == 3) return 100000;
        return 0;
    }

    public static void main(String[] args) throws NumberFormatException, IOException {
        BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter stdout = new PrintWriter(System.out, false);
        new Main().solve(stdin, stdout);
        stdout.flush();
    }
}


Measured memory_bytes: 21332
#include "bits/stdc++.h"
#define ALL(x) x.begin(), x.end()
#define LEN(x) (int)x.size()
#define iostreamBooster() do{ cin.tie(nullptr); ios_base::sync_with_stdio(false); }while(0)
using namespace std;
typedef int64_t i64;
typedef pair<int,int> pii;
template<class A, class B>inline bool chmax(A &a, const B &b){return b>a ? a=b,1 : 0;}
template<class A, class B>inline bool chmin(A &a, const B &b){return b<a ? a=b,1 : 0;}
constexpr int INF = 0x3f3f3f3f;

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

  int ans = 0;

  for (int i = 0; i <= a; ++i) {
    for (int j = 0; j <= b; ++j) {
      for (int k = 0; k <= c; ++k) {
        if (500*i + 100*j + 50*k == x) {
          ++ans;
        }
      }
    }
  }

  cout << ans << endl;

  return 0;
}



Measured memory_bytes: 256
a = int(input())
b = int(input())
c = int(input())
x = int(input())
ans = 0

for i in range(a + 1):
    for j in range(b + 1):
        for k in range(c + 1):
            if (i*500) + (j*100) + (k*50) == x:
                ans += 1
print(ans)

Measured memory_bytes: 3064
//For higher stack size use g++ -O2 -std=c++11 -Wall -Wl,--stack=268435456 a.cpp -o a.exe in cmd
    #include <bits/stdc++.h>
    #include <cstdio>
    #include <cstring>
    #include <cmath>
    #include <cstring>
    #include <chrono>
    #include <complex>
    #define ll long long
    #define ld long double
    #define vi vector<int>
    #define vll vector<ll>
    #define vvi vector < vi >
    #define pii pair<int,int>
    #define pll pair<long long, long long>
    #define mod 998244353
    #define inf 1000000000000000001;
    #define all(c) c.begin(),c.end()
    #define mp(x,y) make_pair(x,y)
    #define mem(a,val) memset(a,val,sizeof(a))
    #define eb emplace_back
    #define pb push_back
    #define f first
    #define s second
    
    using namespace std;

    ll dp[3001][3001];

    int main()
    {
        std::ios::sync_with_stdio(false);
        int T;
        T=1;
        // cin.ignore(); must be there when using getline(cin, s)
        while(T--)
        {
            int n,i,j,s;
            cin>>n>>s;
            int ar[n+1];
            for(i=1;i<=n;++i)
            {
                cin>>ar[i];
            }
            dp[1][0]=1;
            dp[1][ar[1]]=1;
            for(i=2;i<=n;++i)
            {
                for(j=0;j<=s;++j)
                {
                    dp[i][j]=(2*dp[i-1][j])%mod;
                }

                dp[i][ar[i]]=(dp[i][ar[i]]+dp[i-1][0]*2+mod)%mod;
                // cout<<i<<"..."<<dp[i][ar[i]]<<" "<<dp[i-1][ar[i]]<<endl;
                for(j=1;j+ar[i]<=s;++j)
                {
                    dp[i][j+ar[i]]=(dp[i][j+ar[i]]+dp[i-1][j])%mod;
                }
                
            }
            cout<<dp[n][s]<<endl;
        }
        return 0;
    }


Measured memory_bytes: 73956
from itertools import product
N,A,B,C=map(int,input().split())
l=[]
for _ in range(N):
    l.append(int(input()))
ans=10**18
for i in product(range(4),repeat=N):
    mp=0
    bamboo=[0,0,0]
    for j in range(N):
        s=i[j]
        if s==3:
            continue
        else:
            if bamboo[s]!=0:
                mp+=10
            bamboo[s]+=l[j]
    if bamboo[0]==0 or bamboo[1]==0 or bamboo[2]==0:
        continue
    mp+=abs(A-bamboo[0])
    mp+=abs(B-bamboo[1])
    mp+=abs(C-bamboo[2])
    ans=min(ans,mp)
print(ans)

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
typedef long long giant;
const int q=998244353;
inline int Plus(int x,int y) {return x+y>=q?(x+y-q):(x+y);}
inline int Multi(int x,int y) {return 1ll*x*y%q;}
inline int& Pe(int &x,int y) {return x=Plus(x,y);}
const int maxn=3e5+1;
namespace num {
	int fac[maxn],ifac[maxn],inv[maxn];
	void init() {
		fac[0]=fac[1]=ifac[0]=ifac[1]=inv[1]=1;
		for (int i=2;i<maxn;++i) {
			inv[i]=Multi(q-q/i,inv[q%i]);
			fac[i]=Multi(fac[i-1],i);
			ifac[i]=Multi(ifac[i-1],inv[i]);
		}
	}
	int __initer__=(init(),0);
	inline int C(int n,int m) {
		if (n<m) return 0;
		return 1ll*fac[n]*ifac[m]%q*ifac[n-m]%q;
	}
}
int n;
giant a,b,c;
int main() {
	scanf("%d%lld%lld%lld",&n,&a,&b,&c);
	int ans=0;
	for (giant i=0;i<=n;++i) {
		giant as=a*i;
		giant bs=c-as;
		if (bs<0 || bs%b) continue;
		giant j=bs/b;
		if (j>n) continue;
		Pe(ans,Multi(num::C(n,i),num::C(n,j)));
	}
	printf("%d\n",ans);
	return 0;
}


Measured memory_bytes: 3712
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1LL<<62
#define inf 1000000007

vector<pair<ll,ll>>a;
int main() {
	ll n,k;
	cin>>n>>k;
	for(int i=0;i<n;i++){
		ll x,y;
		cin>>x>>y;
		a.push_back(make_pair(x,y));
	}
	sort(a.begin(),a.end());
	ll now=0,ans=0;
	priority_queue<ll>q;
	for(int i=1;i<=k;i++){
		while(now<a.size()&&a[now].first<=i){
			q.push(a[now].second);
			now++;
		}
		if(!q.empty()){
		ans+=q.top();q.pop();
		}
	}
	cout << ans;
	return 0;
}

Measured memory_bytes: 3568
import sys
import bisect

n = int(input())
arr = []
lines = sys.stdin.readlines()
ans = [None] * n
d = {}
for i in range(n):
    q, *arg = lines[i].split()
    key = arg[0]
    idx = bisect.bisect_left(arr, arg[0])
    if q == '0':    # insert
        if idx == len(arr) or arr[idx] != key:
            arr.insert(idx, key)
        d[key] = arg[1]
    elif q == '1':  # get
        ans[i] = d[key] if idx != len(arr) and arr[idx] == key else '0'
    elif q == '2':  # delete
        if idx < len(arr) and arr[idx] == key:
            del arr[idx]
            del d[key]
    elif q == '3':  # dump L R
        r_idx = bisect.bisect_right(arr, arg[1])
        ans[i] = '\n'.join([f'{key_} {d[key_]}' for key_ in arr[idx:r_idx]]) if (r_idx - idx) != 0 else None

[print(x) for x in ans if x is not None]


Measured memory_bytes: 85332