akhauriyash/Code-Regression huggingface dataset:
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <utility>
#include <string>
#include <algorithm>
#include <map>
#include <vector>
#include <climits>
#include <numeric>
#include<stdio.h>
#include <queue>
#include <iomanip>
#include <float.h>
#include <set>
#include<functional>
#include <stack>
#include <time.h>
#include <climits>
#include <bitset>
#include <cmath>
using namespace std;
long long gcd(long long a, long long b) {
	if (a < b) gcd(b, a);
	long long  r;
	while ((r = a%b)) {
		a = b;
		b = r;
	}
	return b;
}
long long lcm(long long a, long long b) {
	return a / gcd(a, b) * b;
}
long long modpow(long long a, long long n, long long mod) {
	long long res = 1;
	while (n > 0) {
		if (n & 1) res = res * a % mod;
		a = a * a % mod;
		n >>= 1;
	}
	return res;
}

long long modinv(long long a, long long mod) {
	long long b = mod, u = 1, v = 0;
	while (b) {
		long long t = a / b;
		a -= t*b; swap(a, b);
		u -= t*v; swap(u, v);
	}
	u %= mod;
	if (u < 0) u += mod;
	return u;
}
inline long long mod(long long a, long long m) {
	return (a % m + m) % m;
}

// 拡張 Euclid の互除法
// ap + bq = gcd(a, b) となる (p, q) を求め、d = gcd(a, b) をリターンします
long long extGcd(long long a, long long b, long long &p, long long &q) {
	if (b == 0) { p = 1; q = 0; return a; }
	long long d = extGcd(b, a%b, q, p);
	q -= a / b * p;
	return d;
}

// 中国剰余定理
// リターン値を (r, m) とすると解は x ≡ r (mod. m)
// 解なしの場合は (0, -1) をリターン
//amari,mod,amari,mod
pair<long long, long long> ChineseRem(long long b1, long long m1, long long b2, long long m2) {
	long long p, q;
	long long d = extGcd(m1, m2, p, q); // p is inv of m1/d (mod. m2/d)
	if ((b2 - b1) % d != 0) return make_pair(0, -1);
	long long m = m1 * (m2 / d); // lcm of (m1, m2)
	long long tmp = (b2 - b1) / d * p % (m2 / d);
	long long r = mod(b1 + m1 * tmp, m);
	return make_pair(r, m);
}
typedef pair<int, int>p;
signed main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	string s;
	cin >> s;
	if (s[5] == '0' && (s[6] == '1' || s[6] == '2' || s[6] == '3' || s[6] == '4')) {
		cout << "Heisei";
	}
	else cout << "TBD";
}


Measured memory_bytes: 256
def greedy_sche(read_dir=1):
    res = []
    i = 1 if read_dir == 1 else n 
    cnt = 1
    while cnt <= k:
        if s[i - 1]:
            res.append(i)
            cnt += 1
            i += read_dir * (c + 1)
        else:
            i += read_dir
    return res


n, k, c = map(int, input().split())
s = [c == 'o' for c in input()]
[print(f) for f, b in zip(greedy_sche(1), greedy_sche(-1)[::-1]) if f == b]        


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

int main(){
	int N;
	cin>>N;
	int K;
	cin>>K;
	int cnt=0;
	for (int i =0;i<N;i++){
		int h;
		cin>>h;
		if(K<=h){
			cnt++;
		}
	}

	cout <<cnt;
}

Measured memory_bytes: 256
import sys
dic={"I":1,"V":5,"X":10,"L":50,"C":100,"D":500,"M":1000}
for line in sys.stdin.readlines():
    total,temp,left=0,0,line[0]
    for roman in line:
        if left==roman:
            temp+=dic[roman]
        else:
            if roman=="\n":
                total+=temp
                break
            if dic[left]>dic[roman]:
                total+=temp
            else:
                  total-=temp
            left=roman
            temp=dic[roman]
    print total

Measured memory_bytes: 23000
/* Author : Pranav Deshmukh
            PICT,Pune
   Purpose: Practice Atcoder
*/

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

#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")

#define int             long long
#define dip(type,var)   type var; cin>>var;
#define dipi(x)			int x; cin>>x;
#define w(x)            int x; cin>>x; while(x--)
#define mka(arr,n,type) type *arr=new type[n];
#define fo(i,n)			for(int i=0;i<n;i++)
#define mod             pow(10,9)+7
#define inf             1e18
#define pi 				3.141592653589793238
#define fo(i,n)        for(int i=0;i<n;i++)
#define endl			"\n"
#define ff              first
#define ss              second
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >

void c_p_c()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cin.tie(0);
#ifndef ONLINE_JUDGE

	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}

int32_t main() {
	c_p_c();
	dipi(n);
	dipi(m);
	mka(arr, m, int);
	int sum = 0;
	fo(i, m) {
		cin >> arr[i];
		sum += arr[i];
	}
	if (sum <= n)
		cout << n - sum << endl;
	else
		cout << "-1" << endl;
}

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

using namespace std;

int main(){
  int ans=1,cnt[1000005]={};
  int s; cin >> s;
  cnt[s]++;
  while(cnt[s]<2){
    if(s%2==0) s/=2;
    else s=3*s+1;
    cnt[s]++; ans++;
  }
  cout << ans << endl;
  
  return 0;
}


Measured memory_bytes: 4096
#include <bits/stdc++.h>
#define fastIO (cin.tie(0), cout.tie(0), ios::sync_with_stdio(false))
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define precise(i) fixed << setprecision(i)
using lint = long;
using llint = long long;
using namespace std;

int cnt = 0;

void merge(vector<int> &A, int left, int mid, int right) {
    int n1 = mid - left;
    int n2 = right - mid;

    vector<int> L(n1 + 1);
    vector<int> R(n2 + 1);
    for (int i = 0; i < n1; i++) {
        L.at(i) = A.at(left + i);
    }
    for (int i = 0; i < n2; i++) {
        R.at(i) = A.at(mid + i);
    }
    L.at(n1) = INT_MAX;
    R.at(n2) = INT_MAX;

    int i = 0, j = 0;
    for (int k = left; k < right; k++) {
        if (L.at(i) <= R.at(j)) {
            A.at(k) = L.at(i);
            i++;
        } else {
            A.at(k) = R.at(j);
            j++;
        }
        cnt++;
    }
}

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

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

    vector<int> A(n);
    rep(i, n) cin >> A.at(i);
    mergeSort(A, 0, A.size());
    for (size_t i = 0; i < A.size(); i++) {
        cout << A.at(i) << ((i != A.size() - 1) ? " " : "\n");
    }
    cout << cnt << endl;
}



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

typedef long long ll;

int main(void){
    while(true){
        int n;
        cin >> n;
        if(n==0) break;
        vector<pair<int, int>> v;
        for(int i=0; i<n; i++){
            int s1, s2;
            cin >> s1 >> s2;
            v.push_back({s2, s1});
        }
        sort(v.begin(), v.end());
        int sum=0;
        bool tf=true;
        for(int i=0; i<n; i++){
            sum+=v[i].second;
            if(sum>v[i].first){
                tf=false;
            }
        }
        cout << (tf ? "Yes":"No") << "\n";
        
    }
     
     
    return 0;
}


Measured memory_bytes: 2952
#include<bits/stdc++.h>
using namespace std;
#define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++)
#define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++)
#define MOD 1000000007
#define int long long
#define ALL(a) (a).begin(),(a).end()
#define vi vector<int>
#define vii vector<vi>
#define pii pair<int,int>
#define priq priority_queue<int>
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(int)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(int)(key)))
#define tii tuple<int,int,int>
#define Priq priority_queue<int,vi,greater<int>>
#define pb push_back
#define mp make_pair
#define INF (1ll<<60)
signed main(){
  string S; cin>>S;
  int ans=0,count=0;
  rep(i,0,S.size()-1){
    if(S[i]=='A') count++;
    else if(S[i]=='C') count=0;
    else{
      if(S[i+1]=='C'){
        ans+=count;
        i++;
      }
      else count=0;
    }
  }
  cout<<ans<<endl;
  }


Measured memory_bytes: 640
#include<bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define COUT(x) cout << (x) << endl
using namespace std;
typedef pair<int,int> P;
typedef long long int ll;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
const int MOD = 1000000007;

int n, m;
vector<int>  v(100100);
vector<bool> b(100100);

int main() {
    cin >> n >> m;
    rep(i, m) {
        int a; cin >> a;
        b[a] = true;
    }
    v[0] = 1;
    if(b[1] != true) v[1] = 1;
    
    for(int i = 2; i <= n; i++) {
        if(b[i] == true) v[i] = 0;
        else v[i] = (v[i - 1] + v[i - 2]) % MOD; 
    }

    COUT(v[n]);

    return 0;
}

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

#define FASTIO ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define ll long long

const ll mod = 1000000007;

ll prefix[105][100005];
ll dp[105][100005];
int arr[100005];

int main()
{
    FASTIO
    memset(dp,0,sizeof(dp));
    int n, k;
    cin >> n >> k;
    for(int i=0; i<n; i++) cin >> arr[i];
    for(int i=0; i<=k; i++) prefix[0][i] = 1;
    dp[0][0] = 1;
    for(int i=1; i<=n; i++)
    {
        for(int j=0; j<=k; j++)
        {
            int p = j-min(j,arr[i-1]);
            if(p == 0) dp[i][j] = prefix[i-1][j]%mod;
            else dp[i][j] = (prefix[i-1][j]%mod-prefix[i-1][p-1]%mod + mod)%mod;
            prefix[i][j] = (prefix[i][j-1]%mod+dp[i][j]%mod)%mod;
        }
    }
    cout << dp[n][k]%mod << "\n";
    return 0;
}

Measured memory_bytes: 164576
#include<bits/stdc++.h>
using namespace std;
int a[100005],b[100005];
int main(){
	int n;scanf("%d",&n);
	for(int i=1;i<=n;++i)scanf("%d",a+i);
	sort(a+1,a+n+1);
	int res=0;
	for(int i=1,j=0,k=0,l=0;i<=n;++i){
		// cout<<i<<' '<<j<<' '<<k<<' '<<l<<endl;
		if(a[i]==a[i-1])++l;
		else{
			if(a[i]==a[i-1]+1)j=k,k=l;
			else if(a[i]==a[i-1]+2)j=l,k=0;
			else j=k=0;
			l=1;
		}
		res=max(res,l+j+k);
	}
	cout<<res;
	return 0;
}

Measured memory_bytes: 640
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Stack;

class Main {
	public static void main(String args[]) throws IOException{
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);
		
		
		
		String str = br.readLine();
		String[] stA = (str.replaceAll("\\s+", " ")).split(" ", 0);
		
		//str.replaceAll("\\s+", " ") ??§??£?¶???????????????????????????????????????????????????????
		//?¬?????????????????????????????????????split(" ", 0)?????§?????????????????????????????¨??????????????????String???????????????
		
		Stack<String> stack = new Stack<String>();
		
		for(int i = 0; i < stA.length; i++) {
			if(stA[i].equals("+")) {
				//
				int a = new Integer(stack.pop().toString()).intValue();
				int b = new Integer(stack.pop().toString()).intValue();
				
				stack.push(String.valueOf(b+a));
				
			} else if(stA[i].equals("-")) {
				int a = new Integer(stack.pop().toString()).intValue();
				int b = new Integer(stack.pop().toString()).intValue();
				
				stack.push(String.valueOf(b-a));
				
			} else if(stA[i].equals("*")) {
				int a = new Integer(stack.pop().toString()).intValue();
				int b = new Integer(stack.pop().toString()).intValue();
				
				stack.push(String.valueOf(b*a));
				
			} else {
				stack.push(stA[i]);
			}
		}
		System.out.println(stack.pop());
	}
}

Measured memory_bytes: 24484
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<cmath>
#include<tuple>
#include<string>
typedef unsigned long long ll;
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define F first
#define S second
using namespace std;
const ll INF = 1e12;
const int i_INF = 2147483647;

int main() {
	int n, k;
	cin >> n >> k;
	vector<int> h(n);
	rep(i, 0, n)cin >> h[i];
	sort(h.begin(), h.end());
	int min = i_INF;
	rep(i, 0, n-k+1) {
		int d = h[i + k - 1] - h[i];
		if (d <= min)min = d;
	}
	cout << min << endl;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>

#define repd(i, a, b) for (ll i = (a); i < (b); i++)
#define rep(i, n) repd(i, 0, n)

using namespace std;

namespace mp = boost::multiprecision;
using Bint = mp::cpp_int;

using ll = long long;
ll mod = pow(10, 9) + 7;

template <typename T> void output(T, ll);
ll gcd(ll, ll);
ll lcm(ll, ll);
Bint comb(Bint, Bint);
void prime_map(map<ll, ll> &, ll);

int main() {
    // source
    int a, b;
    cin >> a >> b;
    int ans = max(0, a - 2 * b);
    cout << ans << endl;
    return 0;
}

Bint comb(Bint a, Bint b) {
    Bint ans = 1;

    if (a < b) {
        return 0;
    }

    rep(i, b) {
        ans *= a - i;
        ans /= i + 1;
    }

    return ans;
}

template <typename T> void output(T a, int precision) {
    if (precision > 0) {
        cout << setprecision(precision) << a << "\n";
    } else {
        cout << a << "\n";
    }
}

template <typename T> T min(T a, T b) {

    if (a < b) {
        return a;
    } else {
        return b;
    }
}

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

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

void prime_map(map<ll, ll> &m, ll num) {

    if (num == 1) {
        return;
    }
    ll cache = num;
    repd(i, 2, sqrt(num) + 2) {
        if (num % i == 0) {
            if (m[i] == 0) {
                m[i] = 1;
            } else {
                m[i]++;
            }

            num /= i;
            break;
        }
    }
    if (cache == num) {
        if (m[num] == 0) {
            m[num] = 1;
        } else {
            m[num]++;
        }

        return;
    }
    prime_map(m, num);
    return;
}


Measured memory_bytes: 768
#include <iostream>
#include <string>
#include <map>
#include <vector>

using namespace std;

int main(void){
  int n;
  cin >> n;
  vector<int> vs;
  for(int i = 0;i < n;i++){
    int tmp;
    cin >> tmp;
    vs.push_back(tmp);
  }
  map<int,int> fm,sm;
  vector<int> fs,ss;
  for(int i = 0;i < n;i++){
    if(i%2 != 0){
      fm[vs[i]]++;
      if(fm[vs[i]] == 1){
	fs.push_back(vs[i]);
      }
    }else{
      sm[vs[i]]++;
      if(sm[vs[i]] == 1){
	ss.push_back(vs[i]);
      }
    }
  }

  int fmax[2] = {0};
  int fcount[2] = {0};
  int smax[2] = {0};
  int scount[2] = {0};

  for(int i = 0;i < fs.size();i++){
    if(fmax[1]<fm[fs[i]]){
      fmax[1] = fm[fs[i]];
      fcount[1] = fs[i];
      if(fmax[0] < fmax[1]){
	int tmp = fmax[0];
	fmax[0] = fmax[1];
	fmax[1] = tmp;
	tmp = fcount[0];
	fcount[0] = fcount[1];
	fcount[1] = tmp;
      }
    }
  }
  for(int i = 0;i < ss.size();i++){
    if(smax[1]<sm[ss[i]]){
      smax[1] = sm[ss[i]];
      scount[1] = ss[i];
      if(smax[0] < smax[1]){
	int tmp = smax[0];
	smax[0] = smax[1];
	smax[1] = tmp;
	tmp = scount[0];
	scount[0] = scount[1];
	scount[1] = tmp;
      }
    }
  }

  int result = fmax[0] + smax[0];

  if(fcount[0] == scount[0]){
    if(fmax[0] + smax[1]> smax[0] + fmax[1]){
      result -= smax[0];
      result += smax[1];
    }else{
      result -= fmax[0];
      result += fmax[1];
    }
  }

  cout << n - result << endl;
}


Measured memory_bytes: 5752
# ABC061C - Big Array
import sys
input = sys.stdin.readline

def main():
    n, k = list(map(int, input().rstrip().split()))
    arr = sorted([list(map(int, input().rstrip().split())) for _ in range(n)])
    cur, cnt, ans = 0, 0, 0
    while cnt < k:
        cnt += arr[cur][1]
        ans = arr[cur][0]
        cur += 1
    print(ans)


if __name__ == "__main__":
    main()

Measured memory_bytes: 28640
#include "iostream"
using namespace std;
 
int main(){

  long int A,B;
  long int N,round=0;
  
  cin >> N >> A >> B;
  
  if((B-A)%2 == 0){
   	cout << (B-A)/2; 
  }else{
      
      if(A-1 < N-B){
        
        round +=A;
        B-=A;
        A=1;
        round += (B-A)/2;

      }else{
        
        round += ((N-B)+1);
        A += ((N-B)+1);
        B=N;
        round += (B-A)/2;        
        

      }
    
    cout << round;
   
  }
  
  return 0;
  
}

Measured memory_bytes: 256
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
using namespace std;
int main(){
int N,M;
cin>>N>>M;
int sum=0;
int A[M];
for(int i=0;i<M;i++){
    cin>>A[i];
}
for(int i=0;i<M;i++)sum+=A[i];
if(N-sum<0)cout<<"-1";
else cout<<N-sum;
return 0;
}

Measured memory_bytes: 3152
class SegmentTree:
    def __init__(self,n):
        self.siz = 1
        while self.siz < n: self.siz *= 2
        self.node = [0]*(2*self.siz-1)

    def update(self,i,x):
        i += self.siz-1
        self.node[i] = x
        while i > 0:
            i = (i-1)//2
            self.node[i] = self.node[i*2+1] | self.node[i*2+2]
    
    def query(self,a,b,k=0,l=0,r=-1):
        if r < 0: r = self.siz
        if r <= a or b <= l: return 0
        if a <= l and r <= b: return self.node[k]
        vl = self.query(a,b,k*2+1,l,(l+r)//2)
        vr = self.query(a,b,k*2+2,(l+r)//2,r)
        return vl | vr
    
n = int(input())
st = SegmentTree(n)
s = list(input())
def f(c): return 1<<(ord(c) - ord("a"))
for i in range(n): st.update(i,f(s[i]))
q = int(input())
for _ in range(q):
    typ,x,y = input().split()
    if typ == "1":
        i,c = int(x)-1,y
        if s[i] == c: continue
        st.update(i,f(c))
        s[i] = c
    else:
        l,r = int(x)-1,int(y)
        print(bin(st.query(l,r)).count("1"))

Measured memory_bytes: 117632
use std::cmp;
fn main() {
    let s = std::io::stdin();
    let mut sc = Scanner { reader: s.lock() };
    let n = sc.read();
    let a: usize = sc.read();
    let b: usize = sc.read();
    let p: Vec<usize> = sc.read_vec(n);

    let mut x: usize = 0;
    let mut y: usize = 0;
    let mut z: usize = 0;
    for &p in p.iter() {
        if p <= a {
            x += 1;
        } else if p <= b {
            y += 1;
        } else {
            z += 1;
        }
    }

    println!("{}", cmp::min(x, cmp::min(y, z)));
}

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

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


Measured memory_bytes: 4352
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<cstdio>
#include<cmath>
#include<numeric>
#include<queue>
#include<stack>
#include<cstring>
#include<limits>
#include<functional>
#include<unordered_set>
#define rep(i,a) for(int i=(int)0;i<(int)a;++i)
#define pb push_back
#define eb emplace_back
using ll=long long;
constexpr ll mod = 1e9 + 7;
constexpr ll INF = 1LL << 50;

template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
using namespace std;

void solve(){
    int n;
    cin>>n;
    map<pair<int,int>,int>a;
    rep(i,n){
        int x;
        cin>>x;
        x--;
        int y=i;
        if(x>y)swap(x,y);
        a[make_pair(x,y)]++;
    }
    int ans=0;
    for(auto x:a){
        if(x.second==2)++ans;
    }
    cout<<ans<<"\n";
}

signed main(){
	std::ios::sync_with_stdio(false);
    std::cin.tie(0);
	solve();
	return 0;
}


Measured memory_bytes: 6528
use std::cmp;
use std::collections::BTreeSet;

fn main() {
    let (r, w) = (std::io::stdin(), std::io::stdout());
    let mut sc = IO::new(r.lock(), w.lock());
    let n: usize = sc.read();
    let mut count = vec![0; 12 + 1];
    count[0] = 1;
    for _ in 0..n {
        let x: usize = sc.read();
        count[x] += 1;
        if x == 0 {
            println!("0");
            return;
        }
    }

    let mut fixed = vec![12];
    let mut floating = vec![];
    for i in 1..13 {
        if count[i] >= 3 {
            println!("0");
            return;
        }
        if count[i] == 2 {
            if i == 12 {
                println!("0");
                return;
            }
            fixed.push(12 - i);
            fixed.push(i + 12);
        }
        if count[i] == 1 {
            if i == 12 {
                fixed.push(0);
            } else {
                floating.push(i);
            }
        }
    }

    let n = floating.len();

    let mut ans = 0;
    for mask in 0..(1 << n) {
        let mut v = fixed.clone();
        for i in 0..n {
            if mask & (1 << i) != 0 {
                v.push(12 + floating[i]);
            } else {
                v.push(12 - floating[i]);
            }
        }
        v.sort();
        let v0 = v[0];
        v.push(v0);

        let mut s = 24;
        for i in 0..(v.len() - 1) {
            let d = (v[i + 1] + 24 - v[i]) % 24;
            let d = cmp::min(d, 24 - d);
            s = cmp::min(s, d);
        }
        ans = cmp::max(ans, s);
    }

    println!("{}", ans);
}

pub struct IO<R, W: std::io::Write>(R, std::io::BufWriter<W>);

impl<R: std::io::Read, W: std::io::Write> IO<R, W> {
    pub fn new(r: R, w: W) -> IO<R, W> {
        IO(r, std::io::BufWriter::new(w))
    }
    pub fn write<S: ToString>(&mut self, s: S) {
        use std::io::Write;
        self.1.write(s.to_string().as_bytes()).unwrap();
    }
    pub fn read<T: std::str::FromStr>(&mut self) -> T {
        use std::io::Read;
        let buf = self
            .0
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b' ' || b == b'\n' || b == b'\r' || b == b'\t')
            .take_while(|&b| b != b' ' && b != b'\n' && b != b'\r' && b != b'\t')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
            .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read()).collect()
    }
    pub fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
}


Measured memory_bytes: 4352
//#include <bits/stdc++.h>
//#include <stdio.h>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <vector>
#include <map>
#include <unordered_map>
#include <set>
#include <tuple>
#include <string>
#include <algorithm>
#include <functional>
#include <queue>
#include <stack>
#include <cmath>
#include <bitset>

using namespace std;
using ll=long long;
using intpair=pair<int,int>;
using intpv=vector<intpair>;
using llpair=pair<ll,ll>;
using llpv=vector<llpair>;
using intvec=vector<int>;
using llvec=vector<ll>;
using intq=queue<int>;
using llq=queue<ll>;
using intmat=vector<intvec>;
using llmat=vector<llvec>;
using pairmat=vector<llpv>;

template<typename T>
using matrix=vector<vector<T>>;
template<typename T>
using pque=priority_queue<T>;
template<typename T>
using lpque=priority_queue<T,vector<T>,greater<T>>;

#define PI 3.141592653589793
#define INTINF 1<<30
#define LLINF 1LL<<60
#define MPRIME 1000000007
#define MPRIME9 998244353

#define len length()
#define pushb push_back
#define fi first
#define se second

#define setpr fixed<<setprecision(15)
#define all(name) name.begin(),name.end()
#define rall(name) name.rbegin(),name.rend()
#define gsort(vbeg,vend) sort(vbeg,vend,greater<>())
#define matin(mat,H,W) for(int i__=0; i__<H; i__++)for(int j__=0; j__<W; j__++) cin>>mat[i__][j__]
#define out(n) cout<<n<<endl

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

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

template<class T>
inline void outmat(T& a, int y, int x) {
	for(int i=0; i<y; i++) {
		for(int j=0; j<x; j++) cout<<a[i][j]<<" ";
		cout<<endl;
	}
}

template<class T>
inline void init(T& v) {
	for(auto &a__: v) cin>>a__;
}
template<class T, class N>
inline void init(T& v, N n) {
	v.resize(n);
	for(auto &a__: v) cin>>a__;
}

template<class N> void resiz(N n) {} // empty
template<class N, class T, class... U>
void resiz(N n, T&& hd, U&&... tl) {
	hd.resize(n);
	resiz(n,forward<U>(tl)...);
}

ll GCD(ll a, ll b) { //最大公約数
	if(a==0||b==0) return 0;
	if(a<b) swap(a,b);
	ll tmp = a%b;
	while(tmp!=0) {
		a = b;
		b = tmp;
		tmp = a%b;
	}
	return b;
}

ll binpow(ll a, ll ex, ll p) { //繰り返し二乗法
	ll result=1;
	while(ex>0) {
		if(ex&1) result=result*a%p;
		ex>>=1;
		a=a*a%p;
	}
	return result;
}

ll Fact(ll x, ll p) { //階乗
	ll f=1;
	for(ll i=2; i<=x; i++) {
		f*=i;
		f%=p;
	}
	return f;
}

int DigitNum(ll n) { //桁数
	int digit=0;
	ll div=1LL;
	while(n/div) {
		digit++;
		div*=10;
	}
	return digit;
}


ll A;
int B;

void input() {
	cin>>A;
	string b; cin>>b;
	b.erase(b.begin()+b.find('.'));
	B=stoi(b);
}

void solve() {
	cout<<A*B/100<<endl;
}

int main() {
	while(1) {
		input();
		solve();
		break;
	}
}


Measured memory_bytes: 3628
import java.util.*;

public class Main{
    public static int calculatePoints(int n,int d,int[] a,int[] b){
        int ret = 0;
        for(int i=0;i<n;i++){
            if((long)a[i]*a[i]+(long)b[i]*b[i]<=(long)d*d) ret++;
        }
        return ret;
    }

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = 0,D = 0;
        int[] X = new int[1];
        int[] Y = new int[1];

        while(sc.hasNext()){
            N = sc.nextInt();
            D = sc.nextInt();
            X = new int[N];
            Y = new int[N];
            for(int i=0;i<N;i++){
                X[i] = sc.nextInt();;
                Y[i] = sc.nextInt();
            }
        }
        sc.close();
        System.out.println(calculatePoints(N,D,X,Y));

        /*int N = 12;
        int D = 3;
        int[] X = {1,1,1,1,1,1,2,2,2,3,3,3};
        int[] Y = {1,1,1,1,2,3,1,2,3,1,2,3};
        System.out.println(calculatePoints(N,D,X,Y));*/
    }
}


Measured memory_bytes: 61308
#include <iostream>
#include <limits>
#include <numeric>
#include <vector>

template <typename T>
T gcd(T the_one, T the_other)
{
    if (the_one < the_other)
    {
        std::swap(the_one, the_other);
    }

    while (0 < the_other)
    {
        T r = the_one % the_other;
        the_one = the_other;
        the_other = r;
    }

    return the_one;
}

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

    int min_mod;
    std::cin >> min_mod;
    for (int i = 1; i < N; ++i)
    {
        int a;
        std::cin >> a;
        min_mod = gcd<int>(min_mod, a);
    }

    std::cout << min_mod << std::endl;
}


Measured memory_bytes: 384
use proconio::{input, fastout};
use proconio::marker::{Chars};
use proconio::marker::Usize1;
use std::cmp::*;

macro_rules! debug {
      ($($a:expr),*) => {
          eprintln!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

#[fastout]
fn main() {
    input!{
        h: usize,
        w: usize,
    }

    let mut b: Vec<Vec<char>> = vec![vec!['#';w+2];1];
    for i in 0..h {
        let mut tmp: Vec<char> = vec!['#';1];
        input!{
            c: Chars,
        }
        tmp.extend(c);
        tmp.push('#');
        b.push(tmp);
    }
    b.push(vec!['#';w+2]);

    for i in 0..h+2 {
        for j in 0..w+2 {
            print!("{}",b[i][j]);
        }
        print!("\n");
    }
    print!("\n");

}


Measured memory_bytes: 2200
s = int(input())
checked = [s,]
for i in range(10**7):
    if checked[i] % 2 == 0:
        a_i = checked[i] // 2
    else:
        a_i = 3 * checked[i] + 1
    if a_i in checked:
        print(i+2)
        break
    checked.append(a_i)

Measured memory_bytes: 2940
using System;

class Program
{
    public static void Main(string[] args)
    {
        string[] str = Console.ReadLine().Split(' ');
        int a = int.Parse(str[0]);
        int b = int.Parse(str[1]);
        int c = int.Parse(str[2]);

        int ans = (c - (a - b));
        if (ans < 0) ans = 0;
        Console.WriteLine(ans);
    }
}


Measured memory_bytes: 11092
p=998244353
n=int(input())

a=list(map(int,input().split()))

kanou=True

if(a[0]!=0):
    print(0)
    kanou=False

a.sort()
#print(a)


cnt=[0]*n

if(kanou):
    if(n==1):
        if(a[0]==0):
            print(1)
        else:
            print(0)
        kanou=False
    elif(a[0]!=0 or a[1]==0):
        print(0)
        kanou=False



if(kanou):
    cnt[0]=1
    temp=0
    for c in a:
        if(c==0):
            continue
        if(c==temp):
            cnt[c]+=1
        elif(c==temp+1):
            cnt[c]+=1
            temp+=1
        else:
            kanou=False
            print(0)
            break

#print(cnt)
ans=1
if(kanou):
    for i in range(1,n):
        if(cnt[i]==0):
            break
        ans*=cnt[i-1]**cnt[i]
        ans%=p

    print(ans)



Measured memory_bytes: 14020
#include<iostream>
#include<vector>
#include<set>
#include<map>
#include <utility>
#include <cstdio>
#include<algorithm>
#include<queue>

using namespace std;
	int n,m;
int main(){
    cin>>n>>m;
    vector<int> p(m), q(m), c(m);
    vector<vector<pair<int, int> > > edges(n+1);
    for(int i=0; i<m; i++){
	scanf("%d %d %d", &p[i], &q[i], &c[i]);
	edges[p[i]].push_back(make_pair(q[i], c[i]));
	edges[q[i]].push_back(make_pair(p[i], c[i]));
    }

    vector<map<int, int> > cope; //company->penalty for each city
    cope.clear(); cope.resize(n+1);
    cope[1][-1] = 0;
    vector<int> lope(n+1, 1000000000);
    lope[1]=0;
    queue<int> cit; 
    cit.push(1);
    vector<int> vis(n+1,0); vis[1]=1;
    while(cit.size()){
	int city = cit.front(); cit.pop(); vis[city] = 0;
	for(int i=0; i<edges[city].size(); i++){
		

	    int ncit = edges[city][i].first;
	    int ncom = edges[city][i].second;
	    if(ncom<0)continue;
	    if(lope[ncit]<lope[city] )continue;
	    int res1 = 1000000000;
	    if(cope[city].count(ncom)) res1 = cope[city][ncom];
	    int res2 = lope[city]+1;
	    if(!cope[ncit].count(ncom))  cope[ncit][ncom]=1000000000;
	    int old = cope[ncit][ncom];
	    cope[ncit][ncom] = min(min(res1, res2),cope[ncit][ncom]);
	    
	    lope[ncit] = min(lope[ncit], cope[ncit][ncom]);
	    if( old > cope[ncit][ncom] && cope[ncit][ncom]-1<=lope[ncit]){if(!vis[ncit])cit.push(ncit);vis[ncit]=1;}
	    
	}
//	vis[city] = 0;
    }
    if(lope[n]==1000000000)lope[n]=-1;
    cout<<lope[n];
}

Measured memory_bytes: 28416
require 'matrix'
r, c = gets.chomp.split(' ').map(&:to_i)
colsum = Vector.elements(Array.new(c+1, 0))
while line = gets
  row = line.chomp.split(' ').map(&:to_i)
  rowsum = row.inject(:+)
  row << rowsum
  colsum += Vector.elements(row)
  print row.join(' '), "\n"
end
print colsum.to_a.join(' '), "\n"

Measured memory_bytes: 7224
import java.util.*;

class Player {
    private int score;

    public Player() {
        this.score = 0;
    }

    public void resetScore() {
        this.score = 0;
    }

    public void setScore(int score) {
        this.score += score;
    }

    public int getScore() {
        return this.score;
    }
}

class Rule {
    public Rule() {
    }

    public void playGame(Player player1, int cardOfPlayer1,
                    Player player2, int cardOfPlayer2) {
        if (cardOfPlayer1 > cardOfPlayer2) {
            player1.setScore(cardOfPlayer1 + cardOfPlayer2);
        } else if (cardOfPlayer1 < cardOfPlayer2) {
            player2.setScore(cardOfPlayer1 + cardOfPlayer2);
        } else {
            player1.setScore(cardOfPlayer1);
            player2.setScore(cardOfPlayer2);
        }
    }
}

public class Main {
    static public void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        Rule rule = new Rule();
        Player player1 = new Player();
        Player player2 = new Player();

        while (true) {
            int n = Integer.parseInt(sc.next());
            if (n == 0) break;

            player1.resetScore();
            player2.resetScore();
            
            for (int i = 0; i < n; i++)  {
                int cardOfPlayer1 = Integer.parseInt(sc.next());
                int cardOfPlayer2 = Integer.parseInt(sc.next());
                rule.playGame(player1, cardOfPlayer1, player2, cardOfPlayer2);
            }

            System.out.println(player1.getScore() + " " + player2.getScore());
        }
    }
}



Measured memory_bytes: 44012
N = int(input())
A = list(map(int,input().split()))
Q = int(input())
B = []
C = []
for i in range(Q):
    b,c = map(int,input().split())
    B.append(b)
    C.append(c)
S = sum(A)
NUM = [0] * 100005
for a in A:
    NUM[a] += 1
for k in range(Q):
    S += (C[k]-B[k]) * (NUM[B[k]])
    NUM[C[k]] += NUM[B[k]]
    NUM[B[k]] = 0
    print(S)



Measured memory_bytes: 22280
#include <bits/stdc++.h>
using namespace std;
int main()
{
	int n, m;
	cin >> n >> m;
	vector<int> vec(n + 1, 0);
	int a;
	for(int i = 0; i < m; i++)
	{
		cin >> a;
		vec[a]++;
	}
	int cnt = 0;
	for(int i = 1; i <= m; i++)
	{
		if(vec[i] > 0)
			continue;
		cnt++;
	}
	cout << cnt << endl;
	return 0;
}


Measured memory_bytes: 3104
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <functional>
#include <string>
#include <math.h>
#include <queue>

using namespace::std;


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

    int max, sum;
    sum = 0;
    max = 0;
 
    for(int i(0); i < n; ++i)
    {
        int l;
        cin >> l;
        if(max < l)
            max = l;
        sum += l;
    }
    if(sum > max*2)
        cout << "Yes" << endl;
    else
    {
        cout << "No" << endl;
    }
    

    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#define min(a,b) \
({ __typeof__ (a) _a = (a); \
    __typeof__ (b) _b = (b); \
    _a < _b ? _a : _b; })

int main(){
    int a, b, c;
    scanf("%d %d %d", &a, &b, &c);
    int x = a * b;
    printf("%d\n", min(x, c));
    return 0;
}

Measured memory_bytes: 128
#!/usr/bin/env python3
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


def sum_of_arithmetic_progression(s, d, n):
    return n * (2 * s + (n - 1) * d) // 2


def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


def lcm(a, b):
    g = gcd(a, b)
    return a / g * b


def solve():
    H, W, K = map(int, input().split())
    f = []
    for i in range(H):
        f.append(input())

    ans = 0
    for b1 in range(2**H):
        for b2 in range(2**W):

            c = 0
            for i in range(H):
                for j in range(W):
                    if (b1 >> i) & 1 or (b2 >> j) & 1:
                        continue
                    else:
                        c += f[i][j] == '#'

            if c == K:
                ans += 1
    print(ans)





def main():
    solve()


if __name__ == '__main__':
    main()


Measured memory_bytes: 9900
#include<stdio.h>

int main(){
  int a,b,c;

  scanf("%d %d",&a,&b);
  if(a < b){
    c = a;
    a = b;
    b= c;
  }
  while(1){
    if(a % b == 0){
      printf("%d\n",b);
      break;
    }
    c = a % b;
    a = b;
    b = c;
  }

  return 0;
}



Measured memory_bytes: 2104
#include <bits/stdc++.h>
#include <iomanip>
#include <math.h>
#include <unistd.h>
#include <stdio.h>
#define rep(i,x) for(ll i = 0;i<x;i++)
#define all(a) (a).begin(),(a).end()
#define vecin(a) rep(i,a.size())cin >> a[i]
#define vecout(a) rep(i,a.size())cout << a[i] << " ";cout << "\n"
#define vecvec(a) vector<vector<(a)>>
using ll = long long;
using ld = long double;
using namespace std;
using dou = double;
const ll inf = 2147483647;
const ll INF = 1LL << 60;
const ld pi = 3.14159265358;
const ll mod = 1000000007;
typedef pair<ll,ll> P;
using graph = vector<vector<ll>>;
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;}
template<class T> inline bool change(T a,T b){if(a > b){swap(a,b);return true;}return false;}
ll gcd(ll a,ll b){
    if(a < b)swap(a,b);
    if(a % b == 0)return b;
    else return gcd(b,a%b);
}
//素数判定O(sqrt(N))
bool isp(ll n){
    bool res = true;
    if(n == 1)return false;
    else{
        for(ll i = 2;i * i <= n;i++){
            if(n % i == 0){
                res = false;
                break;
            }
        }
        return res;
    }
}
const ll cmax = 1000000;
ll fac[cmax], finv[cmax], inv[cmax];

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (ll i = 2; i < cmax; i++){
        fac[i] = fac[i - 1] * i % mod;
        inv[i] = mod - inv[mod%i] * (mod / i) % mod;
        finv[i] = finv[i - 1] * inv[i] % mod;
    }
}

// 二項係数計算
ll nCk(ll n, ll k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % mod) % mod;
}
//nのm乗をMODで割ったあまりO(logN)
ll modpow(ll n,ll m,ll MOD){
    ll res = 1;
    while(m){
        if(m & 1)res = (res * n) % MOD;
        m >>= 1;
        n *= n;
        n %= MOD;
    }
    return res;
}

//printf("%.10f\n", N);
/*  vector<ll> vec = {1,2,5,6,8,9,10};
    cout << binary_search(all(vec),5) << endl; -> true*/
/*
    vector<ll> vec = {1,2,5,6,8,9,10};
    auto n = upper_bound(all(vec),4);
    cout << *n << endl; -> 5*/

//    cout << fixed << setprecision(15);

ll N,M;
const ll NMAX = 200005;
graph G(NMAX);
vector<ll> ans(NMAX),vist(NMAX);
void dfs(ll v){
    vist[v] = 1;
    for(auto x : G[v]){
        if(vist[x] == 1)continue;
        ans[x] += ans[v];
        dfs(x);
    }
}
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin >> N >> M;
    ll a,b;
    rep(i,N - 1){
        cin >> a >> b;
        a--;b--;
        G[a].push_back(b);G[b].push_back(a);
    }
    ll ten,cnt;
    rep(i,M){
        cin >> ten >> cnt;
        ans[ten - 1] += cnt;
    }
    dfs(0);
    rep(i,N){
        cout << ans[i];
        cout << (i == N - 1 ? "\n":" ");
    }
}

Measured memory_bytes: 23464
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <complex>
#include <cstdlib>
#include <cstring>
#include <numeric>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <functional>
 
#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define _D(p) std::cout<<"L"<<__LINE__<<" : " #p " = "<<(p)<<std::endl;
#define _D2(p,q) std::cout<<"L"<<__LINE__<<" : " #p " = "<<(p) << ", " #q " = "<<(q)<<std::endl;
#define _DN(v) std::cout<<"L"<<__LINE__<<" : " #v " = ["; rep(i,(v).size()) {std::cout<<v[i]<<(i==v.size()-1?"":", ");}std::cout<<"]"<<std::endl;
#define _DNN(v) std::cout<<"L"<<__LINE__<<" : " #v " = [" << std::endl; rep(i,(v).size()) {std::cout<<"	[";rep(j,(v)[0].size()){std::cout<<v[i][j]<<(j==v[0].size()-1?"":", ");}std::cout<<"],"<<std::endl;}std::cout<<"]"<<std::endl;
 
using namespace std;
 
typedef    long long          ll;
typedef    unsigned long long ull;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      pii;
 
const int INF=1<<29;
const double EPS=1e-9;
 
const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};

int main(int argc, char const *argv[]) {
	while(1) {

		int N;
		cin >> N;
		if (N == 0) break;

		int P[200][200] = {{0}};
		int I[200] = {0};
		for (int i = 0; i < N; ++i) {
			int M;
			cin >> M;
			for (int j = 0; j < M; ++j) {
				int temp;
				cin >> temp;
				temp--;
				P[i][temp] = 1;
			}
		}
		int K;
		cin >> K;
		for (int i = 0; i < N; ++i) {
			I[i] = 0;
		}
		for (int i = 0; i < K; ++i) {
			int temp;
			cin >> temp;
			temp--;
			I[temp] = 1;
		}

		vector<int> ans;

		for (int i = 0; i < N; ++i) {
			bool flag = true;
			for (int j = 0; j < N; ++j) {
				if (I[j] == 1 && P[i][j] == 0) {
					flag = false;
					break;
				}
			}
			if (flag) {
				ans.push_back(i);
			}
		}
		if (ans.size() == 1) {
			cout << ans[0] + 1<< endl;
		} else {
			cout << "-1" << endl;
		}


	}

	return 0;
}

Measured memory_bytes: 1380
#include <iostream>
#include <cmath>
using namespace std;
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n; cin >> n;
    double x1, y1, x2, y2, x3, y3;
    while (n--) {
        cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;

        if (y1 == y3) {
            swap(x3, x2);
            swap(y3, y2);
        }
        if (y2 == y3) {
            swap(x3, x1);
            swap(y3, y1);
        }
        double px, py, r;
        double a = x2 - x3;
        double b = y2 - y3;
        double c = x2 + x3;
        double d = y2 + y3;
        double e = x3 - x1;
        double f = y3 - y1;
        double g = x3 + x1;
        double h = y3 + y1;
        px = ((a/b)*(c/2) + d/2 - (e/f)*(g/2) - h/2) / (a/b - e/f);
        py = -(a/b) * px + (a/b) * c/2 + d/2;
        r = sqrt((x1 - px) * (x1 - px) + (y1 - py) * (y1 - py));

        cout.precision(3);
        cout << fixed << px << " " << py << " " << r << "\n";
    }
    return 0;
}

Measured memory_bytes: 1300
import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		long min = sc.nextLong();
		for(int i = 1; i < num; i ++) {
			min = gcd(min, sc.nextLong());
		}
		System.out.println(min);
	}

	public static long gcd(long a, long b) {
		if(b == 0) {
			return a;
		}else {
			return gcd(b, a % b);
		}
	}
}

Measured memory_bytes: 49448
program V1005;
 var
  a:array[0..200001] of longint;
  i,n:longint;
  min,s,s1:int64;
 begin
  readln(n);
  s:=0;
  s1:=0;
  for i:=1 to n do
   begin
    read(a[i]);
    inc(s1,a[i]);
   end;
  readln;
  min:=100820882000000000;
  for i:=1 to n-1 do
   begin
    inc(s,a[i]);
    dec(s1,a[i]);
    if abs(s-s1)<min then min:=abs(s-s1);
   end;
  writeln(min);
 end.


Measured memory_bytes: 896
#include<iostream>
#include<iomanip>
#include<cstdio>
#include<string>
#include<cstring>
#include<climits>
#include<algorithm>
#include<vector>
#include<cmath>
#include<map>
#include<set>
#include<stack>
#include<queue>
#include<deque>
#include<tuple>
#include<list>
#include<unordered_map>
#define ll long long
#define pii pair<int,int>
#define pp pair<pair<ll, ll>,pair<ll, ll>>
#define pll pair<ll,ll>
#define vii vector<int>
#define vll vector<ll>
#define lb lower_bound
#define pb push_back
#define mp make_pair
#define fi first
#define sc second
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep2(i,a,b) for(ll i=a;i<b;i++)
#define repr(i,n) for(ll i=n-1;i>=0;i--)
#define all(x) x.begin(),x.end()
#define LB(v,x) (lower_bound(v.begin(),v.end(),x)-v.begin())
#define UB(v,x) (upper_bound(v.begin(),v.end(),x)-v.begin())
#define ERASE(v) v.erase(unique(v.begin(),v.end()),v.end())
// #define int ll
using namespace std;
const int INF = (1 << 30 ) - 1;
const ll LLINF = (1LL << 60LL);
const int MOD = 1000000007;
const int MAX = 510000;
const double pi = acos(-1);
const double eps = 1e-9;


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    ll n;
    cin>>n;
    ll a[20010],sum[20010];
    rep(i,20010){
        a[i]=i+1;
        sum[i+1]=sum[i]+a[i];
    }
    ll s=*lower_bound(sum,sum+20010,n);
    ll t=lower_bound(sum,sum+20010,n)-sum;
    rep2(i,1,t+1){
        if(i!=s-n){
            cout<<i<<endl;
        }
    }
    return 0;
}

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

using namespace std;

int main()
{
  string s;
  cin >> s;
  int w;
  cin >> w;

  int index = 0;
  while(index < s.size()) {
    cout << s[index];
    index += w;
  }
  cout << endl;

  return 0;
}

Measured memory_bytes: 256
using System;
using System.Linq;
using System.Collections.Generic;

namespace aizu
{
    class OnlineJudge
    {
        static void Main()
        {
            int count;
            while((count = int.Parse(Console.ReadLine())) != 0) {
                List<int> total = new List<int>();
                for(int i=0; i < count; ++i) {
                    total.Add(Console.ReadLine().Split().Select(p => int.Parse(p)).Sum());
                }
                Console.WriteLine("{0} {1}", total.Max(), total.Min());
            }
        }
    }
}

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

int main()  {
    int N, K;
    cin>>N>>K;
    double p[N];
    double p1[N];
    for(int i=0;i<N;++i){
        cin>>p[i];
    }
    for(int i=0;i<N;++i){
        p1[i] = (p[i]+1)/2;
        /**
        if(p[i]%2==0){
            p1[i] = p[i]/2+0.5;
        }
        else {
            p1[i] = p[i]/2+1;
        }
        **/
    }
    /**
    for(int i=0;i<N;++i){
        cout<<p1[i]<<" ";
    }
    cout<<endl;
    **/
    double tmp = 0;
    double ans = 0;
    for(int i=0;i<K;++i){
        tmp += p1[i];
        ans += p1[i];
    }
    for(int i=0;i<N-K;++i){
        tmp += p1[K+i] - p1[i];
        if(ans<tmp)ans=tmp;
    }
    cout<<setprecision(10)<<ans<<endl;
}


Measured memory_bytes: 3328
import java.util.*;

class Main{
	public static void main(String[] $){
		Scanner s=new Scanner(System.in);
		int n=s.nextInt();
		for(int i=0;i*4<=n;++i) {
			if((n-i*4)%7==0) {
				System.out.println("Yes");
				return;
			}
		}
		System.out.println("No");
	}
}

Measured memory_bytes: 22868
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define dsync                         \
    std::ios::sync_with_stdio(false); \
    std::cin.tie(NULL);
#define pb push_back
#define mp make_pair
#define B begin()
#define E end()
typedef long long ll;

using namespace std;

int main()
{
    dsync;
    int n,q;
    cin>>q;
    n=q;
    if(n%1000==0){
        cout<<"0"<<"\n";
        return 0;
    }
    n /= 1000;
    n = (n+1)*1000;
    cout<<n-q<<"\n";
    return 0;
}


Measured memory_bytes: 3608