akhauriyash/Code-Regression huggingface dataset:
import java.util.*;
import java.io.*;

public class Main {
	private static void solve(){
		//Implement solution here.
		int n = ni();
		int[] a = na(n);
		int[] b = na(n);
		int[] c = na(n - 1);
		int result = 0;
		for(int i = 0; i < n; i++) {
			result += b[a[i] - 1];
			if(i > 0 && a[i] - a[i - 1] == 1) {
				result += c[a[i - 1] - 1];
			}
		}
		System.out.println(result);
	}

	//Switch input source (stdin/file)
	private static BufferedReader br  = new BufferedReader(new InputStreamReader(System.in));
	public static void main(String[] args){
		String debugDataPath = System.getenv("DD_PATH");        
		if(debugDataPath != null){
			try{
				br = new BufferedReader(new InputStreamReader(new FileInputStream(new File(debugDataPath))));
			}catch(Exception e){
				throw new RuntimeException(e);
			}
		}
		solve();
	}

	//Input read utility
	private static StringTokenizer tokenizer = null;
	public static String next() {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(br.readLine());
			} catch (Exception e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	}
	//Get next single int
	private static int ni() {
		return Integer.parseInt(next());
	}
	//Get next single long
	private static long nl() {
		return Long.parseLong(next());
	}
	//Get next single double
	private static double nd() {
		return Double.parseDouble(next());
	}
	//Get next int array from one line
	private static int[] na(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = ni();
		return a;
	}
	//Get next char array from one line
	private static char[] ns() {
		return next().toCharArray();
	}
	//Get next long array from one line
	private static long[] nal(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = nl();
		return a;
	}
}


Measured memory_bytes: 22228
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _20200719AtCorder
{
    class Class1
    {
        static void Main(string[] args)
        {
            var possession = int.Parse(Console.ReadLine());
            var cakeprice = int.Parse(Console.ReadLine());
            var donutprice = int.Parse(Console.ReadLine());
            //var afterpayingforcake = possession - cakeprice;
            var numberofdonutsyoucanbuy = (possession - cakeprice) / donutprice;
            var ans = (possession - cakeprice) - donutprice * numberofdonutsyoucanbuy;
            Console.WriteLine(ans);
            Console.ReadLine();
        }
    }
}

Measured memory_bytes: 27520
#include <iostream>
#include <cstdio>
#include <cstdlib>
#define MAX 2000001
#define VMAX 10000
using namespace std;

int main() {
 
  int C[VMAX+1];
  int n,i,j;
  scanf("%d",&n); 
  int A[n+1], B[n+1];
  for (i=0; i<=VMAX; i++) {
    C[i] = 0;
  }
  for (i=0; i<n; i++) {
    scanf("%d",&A[i+1]);
    C[A[i+1]]++;
  }
  for (i=1; i<=VMAX; i++) {
    C[i]=C[i]+C[i-1];
  }
  for (j=1; j<=n; j++) {
    B[C[A[j]]]=A[j];
    C[A[j]]--;
  }
  for (j=1; j<=n; j++) {
    if (j>1) {
      printf(" ");
    }
    printf("%d",B[j]);
  }
  printf("\n");
  return 0;
}



Measured memory_bytes: 18860
#include<bits/stdc++.h>
using namespace std;
int main(){
  string s;cin>>s;
  int n=s.size();
  int a=999;
  for(int i=0;i<n-2;i++){
    int number=(s[i]-'0')*100+(s[i+1]-'0')*10+(s[i+2]-'0');
    a=min(a,abs(number-753));}
  cout<<a;}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <algorithm>
#include <numeric>
#include <utility>
#include <random>
#include <chrono>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>

using namespace std;

using LL = long long;
using ULL = unsigned long long;
using PII = pair<int, int>;
using PIL = pair<int, LL>;
using PLL = pair<LL, LL>;
const int mod = 1e9 + 7;
// const int mod = 998244353;

inline void quickread() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
}

int f[10000][100][2];
string k;
int d;

int dp(int pos, int stats, int bound) {
    if (pos == k.size()) {
        return stats == 0;
    }
    if (f[pos][stats][bound] != -1) {
        return f[pos][stats][bound];
    }
    f[pos][stats][bound] = 0;
    for (int i = 0, im = (bound ? k[pos] - 48 : 9); i <= im; ++i) {
        f[pos][stats][bound] += dp(pos + 1, (stats + i) % d, bound && (i == im));
        f[pos][stats][bound] %= mod;
    }
    return f[pos][stats][bound];
}

inline void work() {
    cin >> k >> d;
    memset(f, -1, sizeof(f));
    cout << (dp(0, 0, 1) + mod - 1) % mod << "\n";
}

int main() {
    // freopen("input.txt", "r", stdin);
    quickread();
    work();
    return 0;
}

Measured memory_bytes: 8960
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>
#include<sstream>
using namespace std;
typedef  long long int lint;
typedef pair<int, int> P;
typedef pair<lint, lint> LLP;
typedef pair<char, char>CP;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, n) for (int i = n; i >= 0; i--)
#define sort(v) sort((v).begin(), (v).end())
#define reverse(v) reverse((v).begin(), (v).end())
#define upper(v,hoge) upper_bound(v.begin(),v.end(),hoge)
#define lower(v,hoge) lower_bound(v.begin(),v.end(),hoge)
#define llower(v,hoge) *lower_bound(v.begin(), v.end(), hoge)
#define lupper(v,hoge) *upper_bound(v.begin(), v.end(), hoge)
/*
vector<char>al(26);
al = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
vector<char>AL(26);
AL = {'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
vector<char>NUM(10);
	NUM = { '0','1','2' ,'3' ,'4' ,'5' ,'6' ,'7' ,'8' ,'9' };
*/



int main() {
	int A, B, C;
	cin >> A >> B >> C;
	if (B - A == C - B) {
		cout << "YES" << endl;
	}
	else {
		cout << "NO" << endl;
	}
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<stdlib.h>
using namespace std;

int main() {

	int A, B, T;
	cin >> A >> B >> T;

	int time = 0;
	int count = 1;
	int total = 0;

	time += A;
	count++;

	while (T >= time) {
		total += B;
		time += A;

		count++;
	}

	cout << total << endl;
}



Measured memory_bytes: 256
import java.io.*;
        import java.util.*;
        public class Main{
          public static void main(String[] args) throws IOException{
            BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
            String s = reader.readLine();
            int[] rec = new int[26];
            for(int i = 0;i<s.length();i++){
                rec[s.charAt(i)-'a'] += 1;
            }
            System.out.println(solve(rec));
              
          }
            public static String solve(int[] list){
                int i = 0;
                while(i<list.length){
                    if(list[i]%2!=0) return "No";
                    i++;
                }
                return "Yes";
            }
        }

Measured memory_bytes: 25172
#include<bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(),v.end()
#define INF INT_MAX;
typedef long long ll;
using namespace std;

int main(){
  int A ,B;
  string S;
  cin >> A >> B>> S;
  int a=0,b=0;
  for(int i=0;i<S.size();i++){
    if(S.at(i)!='-'){
      b++;
    }else{
      a=b;
      b=0;
    }
  }
  if(A==a&&B==b) puts("Yes");
  else puts("No");
}


Measured memory_bytes: 256
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

V, E = map(int, input().split())
G = []
for _ in range(E):
    s, t, w = map(int, input().split())
    G.append((w, s, t))
G.sort()
ans = 0
uf = UnionFind(V)
# print(G)
for i in range(E):
    if not uf.same(G[i][1], G[i][2]):
        ans += G[i][0]
        uf.union(G[i][1], G[i][2])

print(ans)


Measured memory_bytes: 23192
import sys, os, math, bisect, itertools, collections, heapq, queue
# from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
from decimal import Decimal
from collections import defaultdict, deque

sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    L, R, d = il()

    ret = 0
    for n in range(L, R + 1):
        if n % d == 0: ret += 1
    print(ret)


if __name__ == '__main__':
    main()


Measured memory_bytes: 10228
N=int(input())
S=input()
a='ABC'
x=0
y=0
for  i in range(N-2):
    x=0
    for j in range(3):
        if S[i+j]==a[j]:
            x+=1
        else:
            break
    if x==3:
        y+=1
print(y)

Measured memory_bytes: 9124
import java.util.*;
import java.lang.*;

public class Main{
    Main(){
	Scanner sc = new Scanner(System.in);

	while(sc.hasNext()){
	    int n = sc.nextInt(), m = sc.nextInt();
	    if(n+m == 0) break;
	    if(m == 1){
		for(int i = 0; i < n; i++) m = sc.nextInt();
		System.out.println("1");
	    } else {
		St[] a = new St[m];
		for(int i = 0; i < m; i++) a[i] = new St(i+1);

		for(int i = 0; i < n; i++)
		    for(int j = 0; j < m; j++)
			a[j].num += sc.nextInt();

		Arrays.sort(a);
		a[0].print();
		for(int i = 1; i < m; i++) a[i].print2();
		System.out.println();
	    }
	}
    }

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

class St implements Comparable{
    public int num, id;

    St() {}
    St(int id) {
	this.id = id;
	num = 0;
    }

    public int compareTo(Object obj){
	St st = (St)obj;

	if(this.num < st.num) return 1;
	if(this.num > st.num) return -1;
	return 0;
    }

    public void print(){
	System.out.print(Integer.toString(this.id));
    }

    public void print2(){
	System.out.print(" ");
	this.print();
    }
}

Measured memory_bytes: 12000
#!/usr/bin/env python3
import sys
import collections
input = lambda: sys.stdin.buffer.readline()[:-1].decode('utf-8')
sys.setrecursionlimit(10**8)
inf = float('inf')
mod = 10**9+7

ans=[]
V,E = map(int,input().split())
G=[[] for i in range(V)]
# div=[0]*V
for i in range(E):
    s,t=map(int,input().split())
    G[s].append(t)
#     div[t]+=1
# used=[0]*V

def Topological_Sort(G):
    # DAGの隣接リストを受け取って、トポロジカルソートしたリストを返す
    V=len(G)
    div=[0]*V
    for gi in G:
        for ei  in gi:
            div[ei]+=1
    used=[0]*V
    result=[]

    def bfs(node):
        que = collections.deque([node])
        used[node] = 1
        while que:
            tmp = que.popleft()
            result.append(tmp)
            for v in G[tmp]:
                div[v] -= 1
                if div[v] == 0 and not used[v]:
                    que.append(v)
                    used[v] = 1

    for i in range(V):
        if div[i]==0 and not used[i]:
            bfs(i)
    return result

    
ans=Topological_Sort(G)
print(*ans,sep="\n")

# def bfs(node):
#     que=collections.deque([node])
#     used[node]=1
#     while que:
#         tmp=que.popleft()
#         ans.append(tmp)
#         for v in G[tmp]:
#             div[v]-=1
#             if div[v]==0 and not used[v]:
#                 que.append(v)
#                 used[v]=1
    



# for i in range(V):
#     if div[i]==0 and not used[i]:
#         bfs(i)

# for a in ans:
    # print(a)



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

int main() {
  int N;
  cin >> N;
  int i,l,r;
  int sum;
  for(i=0;i<N;i++){
    cin >> l >> r;
    sum += (r-l+1);
  }
  cout << sum << endl;
}

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

typedef long long ll;
#define MIN(x, y) (x < y ? x : y)
#define MAX(x, y) (x > y ? x : y)

using namespace std;

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

	if(abs(x - a) < abs(x - b)){
		cout << "A" << endl;
	} else {
		cout << "B" << endl;
	}
}


Measured memory_bytes: 256
import java.util.*;
public class Main{
public static void main(String[] args){
Scanner scan=new Scanner(System.in);
double r=scan.nextDouble();
double S=Math.PI*r*r*1.0;
double d=2*Math.PI*r*1.0;
System.out.println(String.format("%5f",S)+" "+String.format("%5f",d));
}}

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

#define pi          (3.141592653589)
#define mod         1e9+7
#define int         long long
#define pb          push_back
#define mp          make_pair
#define ff          first
#define ss          second
#define all(c)      cc.begin(), c.end()
#define clear       memset(a,0,sizeof(a));
#define rrep(i, n)  for(int i=n-1;i>=0;i--)
#define rep(i,n)    for(int i=0;i<n;i++)

void fast()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
}

int32_t main()
{
    fast();
    int t = 1;
    //cin>>t;
    while (t--)
    {
        int n;
        cin >> n;

        vector<int> a(n + 1);

        a[0] = 0;

        int sum = 0;

        int j , i;

        for (i = 1; i <= n; ++i) {
            for (j = i; j <= n; j += i) {
                a[j] += 1;
            }
        }

        for (int j = 1; j <= n; ++j) {
            sum += (j * a[j]);
        }

        cout << sum << '\n';
    }
    return 0;
}

Measured memory_bytes: 81252
N,K=[int(s) for s in input().split()]
maruta=[int(s) for s in input().split()]

def possible(x):
  cut=0
  for e in maruta:
    if e%x==0:
      cut+=(e//x-1)
    else:
      cut+=e//x
  if cut<=K:
    return True
  else:
    return False

a=1
b=max(maruta)
while b-a>1:
  c=(a+b)//2
  if possible(c):
    b=c
  else:
    a=c

if possible(1):
  print(1)
else:
  print(b)


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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, n) for (int i = 1; i <= (int)(n); i++)
using ll = long long;
using P = pair<ll,ll>;
#define pb push_back
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

/*
 string -> int : stoi(S);
 int -> string : to_string(N);
 Sのn文字以降をm文字取り出す : S.substr(n,m)
cout << fixed << setprecision(2) << 3.14 << endl; //3.1

 int: -2,147,483,648 ～ 2,147,483,647 (2×10^9)
 ll: -9,223,372,036,854,775,808 ~ 9,223,372,036,854,775,807 (9×10^18)

*/

int main() {

  ll n, m, count=0, ans=0;
  string s;
 
  cin >> n;
  vector<ll> r(n);
  vector<ll> Min(n);
  m=10000000000000;
  rep(i,n){
    cin >> r[i];
    m=min(m,r[i]);
    Min[i]=m;
  }
  ll M = -1000000000000000;
  rep2(i,n-1){
    chmax(M,r[i]-Min[i-1]);
  }


  cout << M << endl;
}


Measured memory_bytes: 5908
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <bitset>

using namespace std;

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

#define RANGE(a,i,b) ((a)<=(i)&&(i)<=(b))

#define pb push_back
#define mp make_pair

#define ALL(a) (a).begin(), (a).end()

#define SET(a,c) memset(a,c,sizeof(a))
#define CLR(a) memset(a,0,sizeof(a))

#define INF 1001001001
#define LLINF 1001001001001001001LL

typedef long long ll;
typedef pair<int,int> PII;
typedef vector<int> VI;

#define PQ priority_queue

#define FST first
#define SEC second

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

//------------------HEAD---------------------


bitset<10000> field[10];
int R,C;

int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);
    while(cin>>R>>C,R||C){
        rep(i,R){
            rep(j,C){
                int t;
                cin>>t;
                field[i][j]=t;
            }
        }

        int ans=0;
        rep(i,1024){
            bitset<10> bi=i;
            int res=0;
            rep(r,R){
                if(bi[r])field[r].flip();
            }
            rep(c,C){
                int cnt=0;
                rep(r,R){
                    cnt+=field[r][c];
                }
                res+=max(cnt,R-cnt);
            }
            ans=max(ans,res);
            rep(r,R){
                if(bi[r])field[r].flip();
            }        
        }
        cout<<ans<<endl;
    }
    return 0;
}


Measured memory_bytes: 3076
#![allow(unused_imports)]

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

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

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

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

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

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

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

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

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

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

use std::cmp::{min, max};
use std::collections::{HashMap, HashSet, VecDeque, BinaryHeap};

fn main() {
    input!{
        x: i64,
        n: usize,
        v: [i64; n]
    }
    let mut ans = 0;
    'next: for i in 0..102 {
        for j in 0..n {
            if v[j] == i {
                continue 'next;
            }
        }
        if (x - ans).abs() > (x - i).abs() {
            ans = i;
        }
    }
    println!("{}", ans);
}


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

int main(){
    int A,B;
    cin >> A >>B;
    for(int i=0;i<10000;i++){
        int a = (int)(i*0.08);
        int b = (int)(i*0.1);
        if(a==A&&b==B){
            cout << i << endl;
            return 0;
        }
    }
    cout << -1 << endl;
    return 0;
}

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

#define rep(i, a, b) for(int i = a; i < b; i++)

using namespace std;

int main() {
	vector<int> W, K;
	int tmp;

	rep(i, 0, 10) {
		cin >> tmp;
		W.push_back(tmp);
	}
	rep(i, 0, 10) {
		cin >> tmp;
		K.push_back(tmp);
	}
	
	sort(W.begin(), W.end(), greater<int>());
	sort(K.begin(), K.end(), greater<int>());
	
	int sw = W[0] + W[1] + W[2];
	int sk = K[0] + K[1] + K[2];

	cout << sw << " " << sk << endl;

	return 0;
}

Measured memory_bytes: 1220
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repr(i, n) for (int i = (int)(n); i >= 0; i--)
#define REP(i, m, n) for (int i = (int)(m); i < (int)(n); i++)
#define INF 1e9
#define all(v) v.begin(), v.end()
typedef long long ll;

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

  int min = l;
  int max = l+n-1;

  int eat;
  if(min>0) eat = min;
  else if(max<0) eat = max;
  else eat = 0;

  int ans = (min+max)*n/2 - eat;
  cout << ans << endl;

  return 0;
}


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

typedef long long ll;
typedef long double ld;
const ll MOD = 1000000007;
const ld PI = acos(-1);  
const ld EPS = 0.0000000001;


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

    for(ll i=1; i<=3500; i++){
        for(ll j=1; j<=3500; j++){
            ll c=n*i*j, p=4*i*j-n*(i+j);
            if(0<p && c%p==0){
                ll w = c/p;
                if(w<=0 || 3500<w) continue;
                cout << i << ' ' << j << ' ' << w << endl;
                return 0;

            }

        }
    }
}

Measured memory_bytes: 256
import java.util.*;
class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s= sc.next();

        if(s.contains("a") && s.contains("b") && s.contains("c")) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
}

Measured memory_bytes: 23124
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using static MyIO;


public class D
{
	public static readonly int offset = 8000;

	public static void Main()
	{
		string s = GetString() + "T";
		int x = GetInt();
		int y = GetInt();

		List<int> numX = new List<int>(8192);
		List<int> numY = new List<int>(8192);

		int num = 0;
		int turn = 0;
		for(int i = 0; i < s.Length; i++)
		{
			if(s[i] == 'F')
			{
				num++;
				continue;
			}

			if(turn == 0)
				numX.Add(num);
			else
				numY.Add(num);

			turn ^= 1;
			num = 0;
		}

		HashSet<int> currentX = new HashSet<int>();
		currentX.Add(offset + numX[0]);
		for(int i = 1; i < numX.Count; i++)
		{
			HashSet<int> nextX = new HashSet<int>();
			foreach(int j in currentX.ToList())
			{
				if(j - numX[i] >= 0)
					nextX.Add(j - numX[i]);

				if(j + numX[i] <= 16000)
					nextX.Add(j + numX[i]);

				currentX = nextX;
			}
		}

		HashSet<int> currentY = new HashSet<int>();
		currentY.Add(offset);
		for(int i = 0; i < numY.Count; i++)
		{
			HashSet<int> nextY = new HashSet<int>();
			foreach(int j in currentY.ToList())
			{
				if(j - numY[i] >= 0)
					nextY.Add(j - numY[i]);

				if(j + numY[i] <= 16000)
					nextY.Add(j + numY[i]);

				currentY = nextY;
			}
		}
		
		Console.WriteLine(
			(currentX.Contains(x + offset) && currentY.Contains(y + offset)) ? 
			"Yes" : "No");
	}
}


public static class MyIO
{
	private static string[] args = null;
	private static int num = -1;
	private static int used = -1;

	private static string getArg()
	{
		if(used == num)
		{
			args = Console.ReadLine().Split(' ');
			num = args.Length;
			used = 0;
		}
		return args[used++];
	}

	public static int GetInt(){ return int.Parse(getArg()); }
	public static long GetLong(){ return long.Parse(getArg()); }
	public static double GetDouble(){ return double.Parse(getArg()); }
	public static string GetString(){ return getArg(); }
}

Measured memory_bytes: 35496
#include<cstdio>
#include<iostream>
#include<set>
using namespace std;
bool isprime(int a)
{
  if( a == 2) return true;
  if( a < 2 || a % 2 ==0) return false;
  int i=3;
  while(i*i <= a)
  {
    if(a % i == 0) {return false;}
    i += 2;
  }
  return true;
}
int main()
{
  int n, a;
  set<int> s;
  scanf("%d", &n);
  for(int i=0; i<n; i++)
  {
    scanf("%d", &a);
    if(isprime(a)) s.insert(a);
  }
  printf("%d\n", s.size());

  return 0;
}



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

using namespace std;
using ll = long long;
using vec = vector<ll>;
using mat = vector<vec>;
using vec_b = vector<bool>;
using vec_str = vector<string>;

#define INF (1LL << 60)
#define MOD 1000000007

#define REP(i,m,n) for(ll (i)=(m),i##_len=(n);(i)<(i##_len);++(i))
#define FORR(i,v) for(auto (i):v)
#define ALL(x) (x).begin(), (x).end()
#define _PR(x) cout << (x) << endl
#define _PS(x) cout << (x) << " "
#define SZ(x) ((ll)(x).size())
#define MAX(a,b) (((a)>(b))?(a):(b))
#define MIN(a,b) (((a)<(b))?(a):(b))
#define pb push_back
#define mp make_pair

int main()
{
    ll N, K;
    cin >> N >> K;
    vec A(N);
    REP(i,0,N) {
        cin >> A[i];
        --A[i];
    }

    vec T;
    vec C(N, -1);
    ll to = 0;
    ll p = K+1, r = 0;
    ll f = 1;
    REP(i,0,K+1) {
        if(C[to] == -1) {
            C[to] = i;
            T.pb(to);
            to = A[to];
        }
        else {
            //_PR(i);
            //_PR(to);
            //_PR(C[to]);
            p = i - C[to];
            r = C[to];
            if(r == 0) f = 0;
            break;
        }
    }
    //_PR(p);
    //_PR(r);
    _PR(T[(K-r)%p+r]+1);

    return 0;
}

/*



*/

Measured memory_bytes: 8476
#include <cstdint>
#include <iostream>

using namespace std;

int64_t Diff(int64_t a, int64_t b, int64_t c)
{
    return max(a, max(b, c)) - min(a, min(b, c));
}

int64_t BestDiff(int64_t rows, int64_t cols)
{
    int64_t res = rows * cols;
    for (int64_t i = 1; i + 1 <= rows; i += 1) {
        auto a = cols * i;
        auto b = (cols + 1) / 2 * (rows - i);
        auto c = cols / 2 * (rows - i);
        res = min(res, Diff(a, b, c));
    }
    return res;
}

int64_t Solve(int64_t rows, int64_t cols)
{
    return min(BestDiff(rows, cols),
           min(BestDiff(cols, rows),
           min(Diff((cols + 2) / 3 * rows, (cols + 1) / 3 * rows, cols / 3 * rows),
               Diff((rows + 2) / 3 * cols, (rows + 1) / 3 * cols, rows / 3 * cols))));
}

int main()
{
    int64_t rows, cols;
    cin >> rows >> cols;

    auto res = Solve(rows, cols);
    cout << res << "\n";

    return 0;
}


Measured memory_bytes: 764
#include<stdio.h>
#include<string.h>
int main(){
    char a[100],b[100];
    memset(a,0,sizeof(a));
    memset(b,0,sizeof(b));
    scanf("%s",a);
    scanf("%s",b);
    int max = strlen(a)>strlen(b) ?strlen(a):strlen(b);
    for(int i = 0; i < max; i++){
        if(a[i]!=0)
        printf("%c",a[i]);
        if(b[i]!=0)
          printf("%c",b[i]);
    }
    return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
#define rep(i, m, n) for(int i = m; i < (n); i++)
#define print(x) cout << (x) << endl;
#define printa(x,n) for(int i = 0; i < n; i++){ cout << (x[i]) << " ";} cout << endl;
#define printa2(x,m,n) for(int i = 0; i < m; i++){ for(int j = 0; j < n; j++){ cout << x[i][j] << " ";} cout << endl;}
#define printp(x,n) for(int i = 0; i < n; i++){ cout << "(" << x[i].first << ", " << x[i].second << ") "; } cout << endl;
#define INF (1e18)
using namespace std;
typedef long long ll;
const ll MOD = 1e9 + 7;
typedef struct{
    int x;
    int y;
} P;
typedef struct{
    ll to;
    ll cost;
} edge;
typedef pair<ll, ll> lpair;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    priority_queue<ll> pq;
    ll N,T;
    ll A[100010];
    cin >> N >> T;
    rep(i,0,N){
        cin >> A[i];
    }
    ll diff_max[100010] = {};
    for(int i = N-2; i >= 0; i--){
        pq.push(A[i+1]);
        ll val = pq.top();
        diff_max[i] = pq.top() - A[i];
    }
    // rep(i,0,N-1){
    //     pq.pop();
    //     ll val = pq.top();
    //     diff_max[i] = max(0, val - A[i]);
    // }
    sort(diff_max, diff_max + N-1, greater<ll>());
    ll ans = 1;
    ll dd = diff_max[0];
    rep(i,1,N){
        if(dd == diff_max[i]){
            ans++;
        }
    }
    print(ans);



}


Measured memory_bytes: 2936
#include<bits/stdc++.h>
using namespace std;
const long long INF=1LL<<62;
inline void read(int &x){
    x=0;int f=1;
    char ch=getchar();
    while(!isdigit(ch)) {if(ch=='-') f=-1;ch=getchar();}
    while(isdigit(ch)) x=x*10+ch-'0',ch=getchar();x*=f;
}
int main(){
    int a,b,c;
    read(a),read(b),read(c);
    if(a<b&&b<c) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    return 0;
}


Measured memory_bytes: 3088
# -*- coding: utf-8 -*-

a = [int(input()) for i in range(5)]

b = int(input())

c = 0
count = 0
# print(a, b)

for i in a:
    for j in a:
        c = j - i

        if c > b:
            count += 1

if count >= 1:
    print(':(')
else:
    print('Yay!')


Measured memory_bytes: 3064
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <deque>

int main(){
  int N;
  scanf("%d", &N);
  std::string S1, S2;
  std::cin >> S1;
  std::cin >> S2;
  int i=0;
  std::vector<int > input;
  while (i<N){
    if (S1[i]==S2[i]){
      input.push_back(0); // 0:縦
      i++;
    } else {
      input.push_back(1); // 1:横
      i+=2;
    }
  }
  long long ans = 1;
  long long mod = 1e9+7;
  for (int i=0; i<input.size(); i++){
    if (i==0){
      if (input[i]==0){
        ans *= 3;
      } else {
        ans *= 6;
      }
      ans %= mod;
    } else {
      if (input[i-1]==0 && input[i]==0){
        ans *= 2;
      } else if (input[i-1]==0 && input[i]==1){
        ans *= 2;
      } else if (input[i-1]==1 && input[i]==0){
        ans *= 1;
      } else if (input[i-1]==1 && input[i]==1){
        ans *= 3;
      }
      ans %= mod;
    }
  }
  //ans %= mod;
  //ans *= 6;
  printf("%lld\n", ans);
  return 0;
}


Measured memory_bytes: 384
#include<bits/stdc++.h>
#define inf 0x3f3f3f3f
using namespace std;
const int N=1e5+5;
int n,m,xx,yy,bk[N],t[N<<2];
char s[N];
void fix(int l,int r,int k,int x,int v)
{
    if(l==r)
    {
        t[k]=v;return;
    }
    int m=l+r>>1;
    if(x<=m) fix(l,m,k<<1,x,v);
    else fix(m+1,r,k<<1|1,x,v);
    t[k]=min(t[k<<1],t[k<<1|1]);
}
void query(int l,int r,int k,int x,int y)
{
    if(r<x||l>y||t[k]>=xx) return;
    if(l==r)
    {
        xx=t[k];yy=l;return;
    }
    int m=l+r>>1;
    query(l,m,k<<1,x,y);
    query(m+1,r,k<<1|1,x,y);
}
int main()
{
    memset(t,inf,sizeof(t));
    scanf("%d%d",&n,&m);
    scanf("%s",s);
    fix(1,n,1,n,0);
    for(int i=n-1;i>=0;i--)
    {
        if(s[i]=='1') continue;
        xx=inf;yy=-1;
        query(1,n,1,i+1,min(n,i+m));
        if(xx!=inf)
        {
            bk[i]=yy;
            fix(1,n,1,i,xx+1);
        }
    }
    if(!bk[0]) printf("-1\n");
    else
    {
        queue<int>q;
        int now=0;
        while(now!=n)
        {
            q.push(bk[now]-now);
            now=bk[now];
        }
        while(!q.empty())
        {
            printf("%d",q.front());q.pop();
            if(q.empty()) printf("\n");
            else printf(" ");
        }
    }
}


Measured memory_bytes: 2944
#include <iostream>
#include <algorithm>
#include <bitset>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <cstring>
#include <utility>
#include <vector>
#include <complex>
#include <valarray>
#include <fstream>
#include <cassert>
#include <cmath>
#include <functional>
#include <iomanip>
#include <numeric>

#define rep(X,Y) for (int (X) = 0;(X) < (Y);++(X))
#define rrep(X,Y) for (int (X) = Y-1;(X) >= 0;--(X))
#define repa(X,A,Y) for (int (X) = A;(X) <= (Y);++(X))
#define all(X) (X).begin(),(X).end()
#define mod(n, m) (((n)%(m)+(m))%m)
#define fi first
#define sc second
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> Pii;
typedef pair<ll,ll> Pll;
const int INFINT = 1 << 30;                          // 1.07x10^ 9
const ll INFLL = 1LL << 60;                          // 1.15x10^18
const double EPS = 1e-10;
const int MOD = 1000000007;
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};

const int MAX_N = 100000;
int N;
ll A[MAX_N];
ll B[MAX_N];
ll C[MAX_N];


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

  cin >> N;
  rep(i, N) cin >> A[i] >> B[i];

  rep(i, N) C[i] = A[i] + B[i];
  sort(C, C+N);
  reverse(C, C+N);

  ll sumB = 0;
  rep(i, N) sumB += B[i];

  ll ans = 0;
  for (int i = 0; i < N; i += 2) {
      ans += C[i];
  }
  ans -= sumB;

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 2560
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
 
#define ll long long
#define ull unsigned long long
#define db long double
#define pb push_back
#define ppb pop_back
#define F first
#define S second
#define mp make_pair
#define all(x) (x).begin(), (x).end()
 
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef vector <int> vi;
typedef vector <ll> vll;

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

const int N = 1e5 + 123, K = 17;
int n, U, V, h[N], tin[N], tout[N];
int timer, up[K][N];
vi adj[N];

void go(int v, int p) {
	tin[v] = ++timer;
	up[0][v] = p;
	for (int i = 1; i < K; i++) {
		up[i][v] = up[i - 1][up[i - 1][v]];
	}
	for (int to : adj[v]) {
		if (to == p) {
			continue;
		}
		h[to] = h[v] + 1;
		go(to, v);
	}
	tout[v] = timer;
}

bool upper(int x, int y) {
	return tin[x] <= tin[y] && tout[y] <= tout[x];
}

int lca(int x, int y) {
	if (upper(x, y)) {
		return x;
	}
	if (upper(y, x)) {
		return y;
	}
	for (int i = K - 1; i >= 0; i--) {
		if (!upper(up[i][x], y)) {
			x = up[i][x];
		}
	}
	return up[0][x];
}

int d(int x, int y) {
	return h[x] + h[y] - 2 * h[lca(x, y)];
}

int ans = 0;

void dfs(int v, int p) {
	if (d(U, v) < h[v]) {
		ans = max(ans, h[v] - 1);
	}
	for (int to : adj[v]) {
		if (to == p) {
			continue;
		}
		dfs(to, v);
	}
}

int main() {
	ios_base::sync_with_stdio(false), cin.tie(NULL);
	#ifdef LOCAL
		freopen("input.txt", "r", stdin);
	#endif
	
	cin >> n >> U >> V;
	for (int i = 1; i < n; i++) {
		int x, y;
		cin >> x >> y;
		adj[x].pb(y);
		adj[y].pb(x);
	}
	go(V, V);
	dfs(V, V);
	cout << ans;
}


Measured memory_bytes: 17408
#include<map>
#include<iostream>
using namespace std;
int main(){
  int i;
  int n,p;
  int mx,mn;
  map<int,int> a;
  while(cin>>n&&n){
    mx=-1;
    a.clear();
    for(i=0;i<n;i++){
      cin>>p;
      a[p]++;
      if(mx==-1||mn<a[p]){
	mx=p;
	mn=a[mx];
      }
    }
    if(mn>n/2)
      cout<<mx<<endl;
    else
      cout<<"NO COLOR"<<endl;
  }
  return 0;
}

Measured memory_bytes: 0
import sys
N, M = [int(i) for i in input().split(' ')]
S, = [i for i in input().split(' ')]
T, = [i for i in input().split(' ')]
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

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

if S[0] != T[0]:
    print(-1)
else:
    x = lcm(N,M)
    a = x // N
    b = x // M
    c = lcm(a, b)
    ii = 1
    while ii * c + 1 <= x:
#        print(S[ii * (c//a)])
#        print(T[ii * (c//b)])
        if S[ii * (c//a) ] != T[ii * (c//b) ]:
            print(-1)
            sys.exit()
        ii += 1
    print(x)


Measured memory_bytes: 3316
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include <iomanip>
#include <map>
#include <set>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <iterator>
#include <string>
#include <limits>

using namespace std;

using i64 = int64_t;
using P = pair<i64, i64>;
i64 mod = 1000000007;
//i64 mod = 998244353;
int int_max = 2147483647;
i64 INF = 1e16;
int max_n = 1e5;


int main(int argc, char **argv) {
    i64 n,k;
    cin >> n >> k;

    vector<i64> v(n);
    for (int i=0; i<n; ++i) {
        cin >> v[i];
    }

    for (int i=0; i<n-k; ++i) {
        i64 j = i+k;
        if (v[i] < v[j]) {
            cout << "Yes" << endl;
        } else {
            cout << "No" << endl;
        }
    }

    return 0;
}

Measured memory_bytes: 4840
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define sz(x) (int)(x).size()
#define uni(x) x.erase(unique(rng(x)),x.end())
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
#define EPS (1e-10)
#define equals(a, b) (fabs((a)-(b)) < EPS)
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
typedef set<int> S;
typedef queue<int> Q;
typedef queue<P> QP;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
const int MOD = 1000000007;
  
int main() {
  int A,B,C;
  cin >> A >> B >> C;
  if(C>=A&&C<=B) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}

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

struct Card { char suit; int value; };

void Print(vector<Card>& A) {
  for (int i = 0; i < A.size(); ++i) {
    if (i) cout << " ";
    cout << A[i].suit << A[i].value;
  }
  cout << endl;
}

void SelectionSort(vector<Card>& A) {
  for (int i = 0; i < A.size(); ++i) {
    int mini = i;
    for (int j = i; j < A.size(); ++j) {
      if (A[j].value < A[mini].value) {
        mini = j;
      }
    }
    swap(A[i], A[mini]);
  }
}

void BubbleSort(vector<Card>& A) {
  int counter = 0;
  for (int i = 0; i < A.size(); ++i) {
    for (int j = A.size() - 1; j >= i + 1; --j) {
      if (A[j].value < A[j - 1].value) {
        swap(A[j], A[j - 1]);
        ++counter;
      }
    }
  }
}

void PrintIsStable(vector<Card>& A, vector<Card>& B) {
  auto itrB = B.begin();
  for (auto& a : A) {
    if (a.suit != (*itrB).suit) {
      cout << "Not stable" << endl;
      return;
    }
    ++itrB;
  }
  cout << "Stable" << endl;
}

int main() {
  int n;
  cin >> n;
  vector<Card> A(n);
  for (auto& a : A)
    cin >> a.suit >> a.value;
  auto B = A;
  BubbleSort(A);
  SelectionSort(B);
  Print(A);
  cout << "Stable" << endl; //Bubble Sort is Stable
  Print(B);
  PrintIsStable(A, B);
  //system("pause");
}

Measured memory_bytes: 3060
#include<iostream>
#include<vector>
#include<algorithm>
#include <cmath>

using namespace std;
#define rep(i, s, n) for(int i = s;i<n;i++)
#define repe(i, s, n) for(int i = s;i<=n;i++)
using ll = long long int;

int main(void) {
    int K, S;
    int cnt = 0;
    cin >> K >> S;
    repe(x, 0, K) {
        repe(y, 0, K) {
            int z = S - x - y;
            if (z >= 0 && z <= K) { cnt++; }
        }
    }
    cout << cnt << endl;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<vector>
#include<algorithm>
#include<string>
#include<iostream>
using namespace std;
typedef long long ll;
typedef pair<ll, ll>pii;
pii get(ll a, ll b, ll x, ll y)
{
	return make_pair(x*a + y, y*b + b - 1 - x);
}
int main()
{
	ll num, a, b;
	scanf("%lld%lld%lld", &num, &a, &b);
	if (num < a + b - 1 || a*b < num)printf("-1\n");
	else
	{
		vector<pii>v;
		for (ll i = 0; i < a; i++)v.push_back(get(a, b, 0, i));
		for (ll i = 1; i < b; i++)v.push_back(get(a, b, i, a - 1));
		num -= a + b - 1;
		for (ll i = 1; i < b; i++)
		{
			for (ll j = 0; j < a - 1; j++)
			{
				if (num == 0)goto l01;
				num--;
				v.push_back(get(a, b, i, j));
			}
		}
	l01:;
		sort(v.begin(), v.end());
		vector<ll>z;
		for (int i = 0; i < v.size(); i++)z.push_back(v[i].second);
		sort(z.begin(), z.end());
		for (int i = 0; i < v.size(); i++)printf("%d\n", lower_bound(z.begin(), z.end(), v[i].second) - z.begin() + 1);
	}
}


Measured memory_bytes: 16232
n = gets.to_i
dic = {}

max = 1

n.times do 
  s = gets.chomp
  if dic.has_key?(s)
    dic[s] += 1
    max = [max, dic[s]].max
  else
    dic[s] = 1
  end
end


dic.select{|k, v| v == max}.sort.to_a.each do |a, b|
  puts a
end


Measured memory_bytes: 53480
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <bitset>
#include <iostream>
#include <deque>
#include <functional>
#include <iterator>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <string>
#include <vector>

using namespace std;

// #define int long long

#define ALL(v) begin(v), end(v)
#define RALL(v) rbegin(v), rend(v)

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

#define debug(x) cerr << #x << ": " << x << endl;

const int MOD = 1e9 + 7;

signed main(void)
{
  int n;
  cin >> n;
  cout << (double(n / 2) + (double)(n % 2)) / (double)n << endl;
}


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

int main(){
    string s;
    cin >> s;
    if(s == "Sunny")cout << "Cloudy" << endl;
    else if(s == "Cloudy")cout << "Rainy" << endl;
    else cout << "Sunny" << endl;
}

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

int main() {
	int A, B, ans = 0; cin >> A >> B;
	
	vector<int> PN(100000);
	for( int a = 0; a < 10; a++ )
	for( int b = 0; b < 10; b++ )
	for( int c = 0; c < 10; c++ ){
		PN[a*10001 + b*1010 + c*100]++;
	}
	
	for( int i = A; i <= B; i++ ){
		ans += PN[i];
	}
	
	cout << ans << endl;
}

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

int main(){
  int n;
  cin>>n;
  vector<int> a(n-1), b(n, 0);
  for(int i=0;i<n-1;i++){
    cin>>a[i];
    b[a[i]-1]++;
  }
  
  for(int i=0;i<n;i++)cout<<b[i]<<endl;
  return 0;
}

Measured memory_bytes: 4836
#include <bits/stdc++.h>
#ifdef DEBUG
#include "_debug.cpp"
#include "callable.hpp/callable.hpp"
#endif
#define endl '\n'
using namespace std;
using ll = long long;
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int a, x;
    cin >> a >> x;
    cout << 2 * x - a << endl;
    return 0;
}


Measured memory_bytes: 256
# util functions

# debug
$debugFlag = ( ARGV[0] != nil )
p "==== DEBUG MODE ====" if $debugFlag

def pd(str)
  p str if $debugFlag
end

def printd(str)
  print str if $debugFlag
end

# input
inputs = []
lc = 0
while l = $stdin.gets do
  if false
    inputs << l.chomp.split(" ").map(&:to_s)
  else
    inputs << l.chomp.split(" ").map(&:to_s)
  end
  lc += 1
end

# input check
if $debugFlag
  p "--- INPUT (begin) ---"
  inputs.each do |l_i|
    p l_i
  end
  p "--- INPUT (end) ---"
  print "\n"
end

aa = inputs[0][0]
bb = inputs[1][0]

# body
if $debugFlag
end

if aa == bb
  puts "Yes"
  exit
end

aa.length.times do |i|
  if aa[i..-1] + aa[0..i-1] == bb
    puts "Yes"
    exit
  end
end

puts "No"


Measured memory_bytes: 1788
#include <iostream>
#include <unordered_map>

using namespace std;

int v,e;
unordered_map<int,unordered_map<int,int> > g;

int dfs(int pos, int flow, unordered_map<int,bool> &arrived) {
	if(pos==v-1) return flow;
	arrived[pos] = true;
	for(pair<int,int> p : g[pos]) {
		int next = p.first;
		int capacity = p.second;
		if(!arrived[next]&&capacity>0) {
			int res = dfs(next,min(flow,capacity),arrived);
			if(res>0) {
				g[pos][next] -= res;
				g[next][pos] += res;
				if(g[pos][next]<=0) g[pos].erase(next);
				return res;
			}
		}
	}
	return 0;
}

int main() {
	cin >> v >> e;
	for(int i = 0; i < e; i++) {
		int u,v2,c;
		cin >> u >> v2 >> c;
		g[u][v2] = c;
	}
	int ans = 0;
	while(true) {
		unordered_map<int,bool> arrived(v);
		int flow = dfs(0,1<<30,arrived);
		if(flow<=0) break;
		else ans += flow;
	}
	cout << ans << endl;
}



Measured memory_bytes: 3124
#include<stdio.h>
#include<stdlib.h>
#define N 10001
#define M 10000001
struct node{
  int key;
  int cost;
  struct node *next;
};
typedef struct node *GG;
 
GG G[10001];
GG MNode(int,int,GG);
void Insert(int,int,int);
int main()
{
  int i,j,n,count=0,v,c,c1,v1;
  int color[N],d[N],pi[N],mincost,ii;
  GG GGG;
  scanf("%d",&n);
  for(i=0;i<n;i++)G[i]=MNode(0,0,NULL);
  for(i=0;i<n;i++){
    scanf("%d%d",&v,&c);
    for(j=0;j<c;j++){
      scanf("%d%d",&v1,&c1);
      Insert(i,v1,c1);
    }
  }
  for(i=0;i<n;i++){
    color[i]=0;
    pi[i]=-1;
    d[i]=M;
  }
  d[0]=0;
  
  while(1){
    mincost=M;
    for(i=0;i<n;i++){
      if(color[i]!=2 && d[i]<mincost){
        mincost=d[i];
        ii=i;
      }
    }
    if(mincost==M)break;
    color[ii]=2;
    for(GGG=G[ii];GGG!=NULL;GGG=GGG->next){
      if(color[GGG->key]!=2 && (GGG->cost+d[ii])<d[GGG->key]){
	pi[GGG->key]=ii;
	d[GGG->key]=GGG->cost+d[ii];
	color[GGG->key]=1;
      }
    }
  }
  for(i=0;i<n;i++)printf("%d %d\n",i,d[i]);
  
  return 0;
}
 
GG MNode(int key,int cost,GG Node)
{
  GG n;
  n=(GG)malloc(sizeof(struct node));
  n->key=key;
  n->cost=cost;
  n->next=Node;
  return n;
}
void Insert(int s,int t,int u)
{
  GG GGG;
  GGG=MNode(t,u,G[s]->next);
  G[s]->next=GGG;
}



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

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define FOR(i,n,m) for(int i=(int)(n); i<=(int)(m); i++)
#define RFOR(i,n,m) for(int i=(int)(n); i>=(int)(m); i--)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define RITR(x,c) for(__typeof(c.rbegin()) x=c.rbegin();x!=c.rend();x++)
#define setp(n) fixed << setprecision(n)

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

#define ld long double
#define ll long long
#define vll vector<ll>
#define vi vector<int>
#define pll pair<ll,ll>
#define pi pair<int,int>

#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define ins insert

using namespace std;

/* Some Libraries */

//-------------------------------------------------

int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n; cin>>n;
    set<ll> s;
    rep(i,n){
        ll a; cin>>a;
        if (s.count(a)){
            s.erase(a);
        }else{
            s.ins(a);
        }
    }
    cout<<s.size()<<endl;
    return 0;
}


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

const int64_t INF = 1e18;

int main() {
    int N, K;
    cin >> N >> K;
    vector<int64_t> A(N);
    for(int i = 0; i < N; ++i) cin >> A[i];
    int64_t ans = INF;
    for(int bit = 0; bit < (1 << (N - 1)); ++bit) {
        if(__builtin_popcount(bit) != K - 1) continue;
        int64_t now = A[0], sum = 0;
        for(int i = 0; i < N - 1; ++i) {
            if(bit & (1 << i)) {
                if(now < A[i + 1]) {
                    now = max(now, A[i + 1]);
                } else {
                    sum += now - A[i + 1] + 1;
                    now++;
                }
            } else {
                now = max(now, A[i + 1]);
            }
        }
        ans = min(ans, sum);
    }
    cout << ans << '\n';
    return 0;
}


Measured memory_bytes: 256