akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

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

int main() {
    int c1, c2, c3;
    int a[10];

    while(~scanf("%d%d%d",&c1,&c2,&c3)) {
        rep(i,10) a[i] = i+1;

        int safe = 0;
        rep(i,10) {
            if(a[i]==c1 or a[i]==c2 or a[i]==c3) continue;
            if(c1 + c2 + a[i] <= 20) safe++;
        }

        if(safe/7.0 >= 0.5)
            puts("YES");
        else
            puts("NO");
    }

    return 0;
}

Measured memory_bytes: 1168
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long;
using P = pair<int,int>;
const int INF = 1001001001;
const int mod = 1000000007;


int main(){
    deque<char> a, b, c;
    string sa, sb, sc;
    cin >> sa >> sb >> sc;
    rep(i, sa.size()){
        a.push_back(sa[i]);
    }
    rep(i, sb.size()){
        b.push_back(sb[i]);
    }
    rep(i, sc.size()){
        c.push_back(sc[i]);
    }
    char now = 'a';
    while(true){
        if(now == 'a'){
            if(a.empty()){
                cout << 'A' << endl;
                return 0;
            }
            now = a.front();
            a.pop_front();
        }else if(now == 'b'){
            if(b.empty()){
                cout << 'B' << endl;
                return 0;
            }
            now = b.front();
            b.pop_front();
        }else if(now == 'c') {
            if (c.empty()) {
                cout << 'C' << endl;
                return 0;
            }
            now = c.front();
            c.pop_front();
        }
    }
}


Measured memory_bytes: 256
S = input()

L = [0]*(len(S)+1)
R = [0]*(len(S)+1)
l = 0
for k in range(len(S)):
    if S[-k-1] == ">":
        l += 1
    else:
        l = 0
    L[-k-2] = l

r = 0
for k in range(len(S)):
    if S[k] == "<":
        r += 1
    else:
        r = 0
    R[k+1] = r

ans = 0
for k in range(len(S)+1):
    ans += max(L[k],R[k])
print(ans)


Measured memory_bytes: 51272
#include <iostream>
using namespace std;
int main(void){
    int a, b, c, tmp;
    cin >> a >> b >> c;
    tmp=b;
    b=a;
    a=tmp;
    tmp=a;
    a=c;
    c=tmp;
    cout << a << " " << b << " "<< c << endl;
}

Measured memory_bytes: 3636
#include <stdio.h>

int main(void){
  int s, h, m;

  scanf("%d", &s);

  h = s / (60 * 60); s -= h * (60 * 60);
  m = s /  60;       s -= m *  60;

  printf("%d:%d:%d\n", h, m, s);

  return 0;
}

Measured memory_bytes: 592
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define rrep(i,n) for(int i=((int)(n)-1);i>=0;(i)--)
#define rrep1(i,n) for(int i=((int)(n));i>0;(i)--)
#define sz(c) ((int)(c).size())
#define all(x) (x).begin(),(x).end()
#define mp make_pair
#define pb push_back

using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int, int> P;
typedef pair<int, pair<int, int> > PP;
//const int MAX=;

int main(){
	int ct[26];
	rep(i,26)ct[i]=0;
	rep(_,4){
		char z;
		cin>>z;
		int t=z-'A';
		ct[t]++;
	}
	int tw=0;
	rep(i,26)if(ct[i]==2)tw++;
	if(tw==2)cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
}

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

struct node {
	int key;
	node *p, *l, *r;
};

node *root, *NIL;

void insert(int k)
{
	node* y = NIL;
	node* x = root;
	node* z;

	z = (node*)malloc(sizeof(node));
	z->key = k;
	z->l = NIL;
	z->r = NIL;

	while (x != NIL)
	{
		y = x;
		if (z->key < x->key) x = x->l;
		else x = x->r;
	}

	z->p = y;
	if (y == NIL) {
		root = z;
	}
	else {
		if (z->key < y->key) y->l = z;
		else y->r = z;
	}
}

void inorder(node *n)
{
	if (n == NIL) return;

	inorder(n->l);
	cout << " " <<  n->key;
	inorder(n->r);

	return;
}

void preorder(node *n)
{
	if (n == NIL) return;

	cout << " " << n->key;
	preorder(n->l);
	preorder(n->r);

	return;
}

int main(void)
{
	int N, k;
	string s;
	list<node> t;
	cin >> N;
	for (int i = 0; i < N; i++)
	{
		cin >> s;
		if (s == "insert"){
			cin >> k;
			insert(k);
		}
		else if (s == "print") {
			inorder(root);
			cout << endl;
			preorder(root);
			cout << endl;
		}
	}
	

	return 0;
}


Measured memory_bytes: 26548
#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;

int main(){
    char ch;
    int count[26] = {};
    while( scanf("%c", &ch) != EOF ){
        if(isalpha(ch)){
            ch = tolower(ch);
            int num = ch - 'a';
            count[num]++;
        }
    }
    for(int i = 0; i < 26; i++){
        printf("%c : %d\n", i + 'a', count[i]);
    }
    return 0;
}


Measured memory_bytes: 3200
#include <bits/stdc++.h>
#include <math.h>
#include <string>
using namespace std;
const int MAX_N =1e9 - 1;
int main()
{
	long long x, k, d, temp,temp2;
	cin >> x >> k >> d;
	temp = (abs(x)) / d;
	temp2 = abs(x) % d;
	if(temp >= k)
	{
			cout << abs(x) - k*d << endl; 
			return 0;
	}
	k = k - temp;
	if(k % 2 == 0)
		cout << temp2;
	else
		cout << abs(temp2-d) << endl;
	return 0;
	
}


Measured memory_bytes: 3580
package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
)

type Point struct {
	x int
	y int
}

func main() {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)

	nPoints := scanInt(sc)
	first := Point{
		x: scanInt(sc),
		y: scanInt(sc),
	}
	maxD := abs(first.x) + abs(first.y)
	parity := maxD % 2

	ps := make([]Point, nPoints)
	ps[0] = first
	for i := 1; i < nPoints; i++ {
		p := Point{
			x: scanInt(sc),
			y: scanInt(sc),
		}
		ps[i] = p

		d := abs(p.x) + abs(p.y)

		if parity != d%2 {
			fmt.Println(-1)
			return
		}

		if d > maxD {
			maxD = d
		}
	}

	maxExp := int(math.Floor(math.Log2(float64(maxD))))
	if maxExp < 0 {
		maxExp = 0
	}

	nArms := maxExp + 1
	if parity == 0 {
		nArms += 1
	}

	arms := make([]int, nArms)
	for i := 0; i <= maxExp; i++ {
		arm := 1 << uint(maxExp-i)
		arms[i] = arm
	}
	if parity == 0 {
		arms[len(arms)-1] = 1
	}

	out := bufio.NewWriter(os.Stdout)

	fmt.Fprintln(out, len(arms))
	for _, arm := range arms {
		fmt.Fprintf(out, "%d ", arm)
	}
	fmt.Fprintln(out)

	for _, p := range ps {
		x := p.x
		y := p.y
		for _, arm := range arms {
			if abs(x) > abs(y) {
				if x > 0 {
					fmt.Fprint(out, "R")
					x -= arm
				} else {
					fmt.Fprint(out, "L")
					x += arm
				}
			} else {
				if y > 0 {
					fmt.Fprint(out, "U")
					y -= arm
				} else {
					fmt.Fprint(out, "D")
					y += arm
				}
			}
		}
		fmt.Fprintln(out)
	}
	out.Flush()
}

func abs(n int) int {
	if n < 0 {
		return -n
	}
	return n
}

func scanInt(sc *bufio.Scanner) int {
	sc.Scan()
	v, _ := strconv.Atoi(sc.Text())
	return v
}


Measured memory_bytes: 1152
package main

import (
	"bufio"
	"fmt"
	"os"
)

func main() {
	r := bufio.NewReader(os.Stdin)
	w := bufio.NewWriter(os.Stdout)
	defer w.Flush()

	blueMap := map[string]int{}
	redMap := map[string]int{}

	var n int
	fmt.Fscan(r, &n)
	for i := 0; i < n; i++ {
		var s string
		fmt.Fscan(r, &s)
		v, _ := blueMap[s]
		v++
		blueMap[s] = v
	}

	var m int
	fmt.Fscan(r, &m)
	for i := 0; i < m; i++ {
		var t string
		fmt.Fscan(r, &t)
		v, _ := redMap[t]
		v++
		redMap[t] = v
	}

	var bestScore int
	for key, value := range blueMap {
		tmpScore := value
		redValue, ok := redMap[key]
		if ok {
			tmpScore -= redValue
		}

		if tmpScore > bestScore {
			bestScore = tmpScore
		}
	}

	fmt.Fprintln(w, bestScore)
}


Measured memory_bytes: 1844
// clang-format off
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
#define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
#define rep1(i,n) for(ll i=1, i##_len=(n); i<=i##_len; ++i)
#define rrep(i,n) for(ll i=n-1; i>=0; --i)
#define rrep1(i,n) for(ll i=n; i>0; --i)
#define all(x) (x).begin(),(x).end()
#define SORT(x) sort(all(x))
#define SORT_DESC(x) sort((x).rbegin(),(x).rend())
#define pb push_back
#define mp make_pair
#define coutl cout<<fixed<<setprecision(20)
#define ANS(ans) cout<<ans<<endl;
const ll LINF = (1LL << 62) - 1;
const int INF = (1 << 30) - 1;
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;}
// clang-format on

int main() {
  long long R;
  scanf("%lld", &R);
  coutl << M_PI * R * 2 << endl;
}


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

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

	priority_queue<int> que;
	int tmp;
	Rep(i, N){
		cin >> tmp;
		que.push(tmp);
	}

	Rep(i, M){
		tmp = que.top();
		tmp /= 2;
		que.pop();
		que.push(tmp);
	}

	long long sum = 0;
	Rep(i, N){
		sum += que.top();
		que.pop();
	}

	cout << sum;
	return 0;
}


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

/* 大文字を小文字に変換 */
char tolower(char c) {return (c + 0x20);}
/* 小文字を大文字に変換 */
char toupr(char c) {return (c - 0x20);}

// if('A'<=s[i] && s[i]<='Z') s[i] += 'a'-'A';

/*
string s = "abcdefg"
s.substr(4) "efg"
s.substr(0,3) "abc"
s.substr(2,4) "cdef"
*/

struct Node{
    int key;
    Node *right, *left, *parent;
};

Node *root, *NIL;

void insert(int k){
    Node *y = NIL;
    Node *x = root;
    Node *z;

    // z = malloc(sizeof(struct node));  // node構造体サイズのメモリ領域をとる
    z = (Node *)malloc(sizeof(Node));
    z->key = k;   // ポインタ変数にアクセスする時はアロー演算子
    z->left = NIL;
    z->right = NIL;
    
    while(x != NIL){
        y = x;    // 最終的なzの親を決定する
        if(z->key < x->key) x = x->left;
        else x = x->right;
    }
    z->parent = y;
    if(y == NIL){
        root = z; // 親要素が空であれば、zが根となる
    }else{
        if(z->key < y->key){
            y->left = z;
        }else{
            y->right = z;
        }
    }
}

bool find(int k){
    Node *x = root;
    Node *y = NIL;
    while(x != NIL){
        if(x->key == k){
            return true;     
        }else if(x->key < k){
            x = x->right;
        }else{
            x = x->left;
        }
    }
    return false;
}

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

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

int main()
{
    int n, i, x;
    string com;
    scanf("%d", &n);

    rep(i, n){
        cin >> com;
        if(com == "insert"){
            scanf("%d", &x);
            insert(x);
        }else if(com == "print"){
            inorder(root);
            printf("\n");
            preorder(root);
            printf("\n");
        }else if(com == "find"){
            scanf("%d", &x);
            if(find(x)) cout << "yes" << endl;
            else cout << "no" << endl;
        }
    }
}


Measured memory_bytes: 21948
from collections import deque
def queue():
    h = int(input())
    for i in range(h):
        s.append(s.popleft())

while True:
    s = input()
    if s == "-": break
    s = deque(s)
    m = int(input())
    for i in range(m):
        queue()
    print("{}".format("".join(s)))



Measured memory_bytes: 5996
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main() {
    int N, M;
    cin >> N >> M;
    vector<long long> X(N), Y(N), Z(N);
    for (int i = 0; i < N; i++)
        cin >> X[i] >> Y[i] >> Z[i];
    vector<vector<long long>> C{X, Y, Z};

    long long res = -(1LL << 60);
    for (int i = 0; i < (1 << 3); i++) {
        vector<long long> sums;
        for (int j = 0; j < N; j++) {
            long long sum = 0;
            for (int k = 0; k < 3; k++) {
                if ((i >> k) & 1) {
                    sum += C[k][j];
                } else {
                    sum -= C[k][j];
                }
            }
            sums.push_back(sum);
        }
        sort(sums.begin(), sums.end(), greater<long long>());
        long long sum = 0;
        for (int j = 0; j < M; j++) {
            sum += sums[j];
        }
        res = max(res, sum);
    }

    cout << res << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <cstring>
#include <climits>
#include <iomanip>
#include <bitset>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <list>
#include <map>

using namespace std;

const int N = 100005;
const int mod = (int) 1e9 + 7;

int n, k;
int fact[N];
int arr[N];

inline void add(int &a, int b) {
  a += b;
  if (a >= mod) a -= mod;
}

inline void sub(int &a, int b) {
  a -= b;
  if (a < 0) a += mod;
}

inline int mul(int a, int b) {
  return (int) ((long long) a * b % mod);
}

inline int fp(int a, long long b) {
  int res = 1;
  while (b > 0) {
    if (b & 1) {
      res = mul(res, a);
    }
    a = mul(a, a);
    b >>= 1;
  }
  return res;
}

inline int inv(int x) {
  return fp(x, mod - 2);
}

int comb(int n, int k) {
  if (n <= 0 || k > n) return 0;
  int ans = mul(fact[n], inv(fact[k]));
  ans = mul(ans, inv(fact[n - k]));
  return ans;
}

int main() {
  fact[0] = 1;
  for (int i = 1; i < N; i++) {
    fact[i] = (1ll * fact[i - 1] * i) % mod;
  }
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  sort(arr, arr + n);
  int ans = 0;
  for (int i = 0; i < n; i++) {
    sub(ans, mul(arr[i], comb(n - i - 1, k - 1)));
    add(ans, mul(arr[i], comb(i, k - 1)));
  }
  cout << ans << endl;
  return 0;
}


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

int main(void){
  int i,j;
  long N,t[6],time,min;
  char str[100];
  
  fgets(str,sizeof(str),stdin);
  N=atol(str);
  
  for(i=0;i<6;i++){
    fgets(str,sizeof(str),stdin);
  	t[i]=atol(str);
  }
  
  min=t[0];
  
  for(i=0;i<6;i++){
    if(min>t[i]){
      min=t[i];
    }
  }
  
  if(N%min==0){
    time=(N/min-1)+5;
  }else{
    time=N/min+5;
  }
  
  printf("%ld",time);
  
  return 0;
}

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

int main() {
  string a,b;
  cin>>a>>b;
  if(a.size()>b.size()){
    cout<<"GREATER"<<endl;
  }else if(a.size()<b.size()){
    cout<<"LESS"<<endl;
  }else{
    rep(i,a.size()){
      if(a.at(i)>b.at(i)){
        cout<<"GREATER"<<endl;
        return 0;
      }else if(a.at(i)<b.at(i)){
        cout<<"LESS"<<endl;
        return 0;
      }
      if(a.at(a.size()-1)==b.at(b.size()-1)){
        cout<<"EQUAL"<<endl;
        return 0;
      }
    }
  }
}

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

int main() {
  int N,M;
  cin >> N >> M;
  vector<int> vec(N);
  for(int i = 0;i < M;i++) {
    int A,B;
    cin >> A >> B;
    vec.at(A - 1) = vec.at(A - 1) + 1;
    vec.at(B - 1) = vec.at(B - 1) + 1;
  }
  for(int j = 0;j < N;j++) {
    cout << vec.at(j) << endl;
  }
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int ans = 1000;
        int[] s = new int[m];
        int[] c = new int[m];
        for (int i=0;i<m;i++){
            s[i]=sc.nextInt();
            c[i]=sc.nextInt();
        }
        for (int i=0;i<1000;i++){
            boolean b = true;
            double log = Math.log10(i);
            if (i==0)log=0;
            if ((int)log+1!=n)b=false;
            if (b){
                String st = Integer.toString(i);
                for (int j=0;j<m;j++){
                    if (st.charAt(s[j]-1)-'0'!=c[j])b=false;
                }
            }
            if (b)ans=Math.min(ans,i);
        }
        if (ans==1000)System.out.println(-1);
        else System.out.println(ans);
    }
    static long factorial(long num){
        if (num<2)return 1;
        else return num*factorial(num-1);
    }
    static int arraySum(int[] array){
        int ans = 0;
        for (int value : array) ans += value;
        return ans;
    }
    static long combination(long a, long b){
        long data = 1;
        for (int i=0;i<b;i++){
            data*=a-i;
        }
        return data/factorial(b);
    }
    static double log(double base,double antilogarithm){
        return Math.log(antilogarithm)/Math.log(base);
    }

    static long gcd(long x,long y){
        if (y==0)return x;
        else return gcd(y,x%y);
    }
    static long lcm(long x,long y){
        return x/gcd(x,y)*y;
    }
    static HashMap<Long,Long> factorization(long num){
        HashMap<Long,Long> hash = new HashMap<>();
        long n = num;
        long count = 2;
        while (n>1){
            while (n%count==0){
                n/=count;
                if (hash.containsKey(count))hash.put(count,hash.get(count)+1);
                else hash.put(count,1L);
            }
            count++;
        }
        return hash;
    }

}


Measured memory_bytes: 35732
#56
a,b,k = map(int,input().split())
num = []

if b-a <= k:
    for i in range(a,b+1):
        print(i)
else:
    for i in range(a,a+k):
        num.append(i)
    for i in range(b-k+1,b+1):
        num.append(i)
        
    num = list(set(num))
    num.sort()
    
    for i in num:
        print(i)

Measured memory_bytes: 9036
#include<iostream>
#include<cstdio>
#include<string>
#include<algorithm>
#include<vector>
#include<cmath>
#include<map>
#include<set>
#include<stack>
#include<queue>
#define ll long long
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pb push_back
#define rep(i,n) for(ll i=0;i<n;i++)
#define repr(i,n) for(ll i=n;i>=0;i--)
#define INF 1e9+7
#define LLINF 1e18
using namespace std;
const int MOD = 1e9 +7;



int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll a,b,c;
    cin>>a>>b>>c;
    if(a==b && b==c){
        if(a%2==0){
        cout<<-1<<endl;
        return 0;
        }else{
            cout<<0<<endl;
            return 0;
        }
    }
    ll ans=0;
    while(true){
        if(a%2==0 && b%2==0 && c%2==0){
            ll na=(b+c)/2;
            ll nb=(a+c)/2;
            ll nc=(a+b)/2;
            a=na;b=nb;c=nc;
            ans++;
        }
        else break;
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define COUT(x) cout<<(x)<<endl
#define dump(x)  cout << #x << " = " << (x) << endl;
using ll = long long;
using P = pair<int,int>;
using Graph = vector<vector<int>>;
using M = map<int,int>;
using PQ = priority_queue<int>;
using PQG = priority_queue<int, vector<int>, greater<int>>;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

int main() {
  int a,b,c; cin >> a >> b >> c;
  cout << (a^b^c) << endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include<cmath>
using namespace std;
#define int long long
#define rep(i, n) for (int i = 0; i < n; i++)
const int mo = 1e9 + 7;
struct mint
{
    int n;
    mint(int n = 0) : n(n) {}
};
mint operator+(mint a, mint b) { return (a.n += b.n) >= mo ? a.n - mo : a.n; }
mint operator-(mint a, mint b) { return (a.n -= b.n) < 0 ? a.n + mo : a.n; }
mint operator*(mint a, mint b) { return 1LL * a.n * b.n & mo; }
mint &operator+=(mint &a, mint b) { return a = a + b; }
mint &operator-=(mint &a, mint b) { return a = a - b; }
mint &operator*=(mint &a, mint b) { return a = a * b; }
ostream &operator<<(ostream &o, mint a) { return o << a.n; }

void solve()
{
    int n,h;
    cin>>n>>h;
    int a=0;
    vector<int> b(n);
    rep(i,n)
    {
        int c;
        cin>>c>>b[i];
        a=max(a,c);
    }
    
    sort(begin(b),end(b));
    int ret=0;
    while(h>0&&!b.empty())
    {
        int t=b.back();
        if(t<=a)break;
        ret++;
        h-=t;
        b.pop_back();
    }
    
    if(h>0)ret+=(h+a-1)/a;
    cout<<ret<<endl;
}
main()
{
    cin.tie(0);
    ios::sync_with_stdio(0);
    solve();
    return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
#include <math.h>
#define REP(i, n) for(int i = 0; i < (n); i++)
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1001001001;
const int mINF = -1001001001;


int main() {
double a;
cin >> a;
if((int)a%2==0) {
  cout << "0.5" << endl;
} else {
  cout << (a+1)/(2*a) << endl;
}
return 0;
}


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

#define PB push_back
#define X first
#define Y second
#define ws asdnasdkns
#define LL long long
#define PI acos(-1.0)
const LL mod = 1000 * 1000 * 1000 + 7;
const LL MAX = 200005;

int main()
{
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
   	//freopen("In.txt" , "r" , stdin);
	srand(time(NULL));
	int n , h , w;
	cin >> n >> h >> w;
	cout << (n + 1 - h) * (n + 1 - w);
}

Measured memory_bytes: 256
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author silviase
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BPopularVote solver = new BPopularVote();
        solver.solve(1, in, out);
        out.close();
    }

    static class BPopularVote {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int m = in.nextInt();
            int sum = 0;
            int cnt = 0;
            int[] a = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = in.nextInt();
                sum += a[i];
            }

            int hoge = (sum - 1 + 4 * m) / (4 * m);
            for (int i = 0; i < n; i++) {
                if (a[i] < hoge) {
                    continue;
                }
                cnt++;
            }

            out.println(cnt >= m ? "Yes" : "No");
        }

    }
}



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

int main() {
//#ifndef ONLINE_JUDGE
//	freopen("a.in", "r", stdin);
//	freopen("a.out", "w", stdout);
//#endif
	int n; cin >> n;
	string s; cin >> s;
	int ans = 1;
	for (int i = 1; i < n; ++i)
		if (s[i] != s[i - 1]) ++ans;
	cout << ans; 
	return 0;
}

Measured memory_bytes: 512
import java.io.*;
import java.util.ArrayList;
import java.util.Collections;

class Main{
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String str = br.readLine();
        int A = Integer.parseInt(String.valueOf(str.charAt(0)));
        int B = Integer.parseInt(String.valueOf(str.charAt(1)));
        int C = Integer.parseInt(String.valueOf(str.charAt(2)));
        int D = Integer.parseInt(String.valueOf(str.charAt(3)));
        if (A+B+C+D==7){
            System.out.println(String.format("%d+%d+%d+%d=7", A,B,C,D));
        } else if (A-B+C+D==7){
            System.out.println(String.format("%d-%d+%d+%d=7", A,B,C,D));
        } else if (A+B-C+D==7){
            System.out.println(String.format("%d+%d-%d+%d=7", A,B,C,D));
        } else if (A+B+C-D==7){
            System.out.println(String.format("%d+%d+%d-%d=7", A,B,C,D));
        } else if (A-B-C+D==7){
            System.out.println(String.format("%d-%d-%d+%d=7", A,B,C,D));
        } else if (A-B+C-D==7){
            System.out.println(String.format("%d-%d+%d-%d=7", A,B,C,D));
        } else if (A+B-C-D==7){
            System.out.println(String.format("%d+%d-%d-%d=7", A,B,C,D));
        } else {
            System.out.println(String.format("%d-%d-%d-%d=7", A,B,C,D));
        }
    }
}

Measured memory_bytes: 21204
N, K = list(map(int, input().split()))
d = []
A = []
for i in range(K):
    d.append(int(input()))
    A.append(list(map(int, input().split())))
    
ans = [0 for i in range(N)]
for A_k in A:
    for i in A_k:
        ans[i-1] += 1
    
print(ans.count(0))

Measured memory_bytes: 9188
using System;
using System.Collections.Generic;
using System.Linq;
class Program
{
	static void Main(string[] args)
	{
        int n = int.Parse(Console.ReadLine());
        int[] points = Console.ReadLine().Split(' ').Select(t => int.Parse(t)).ToArray();
        int[] scorings = Console.ReadLine().Split(' ').Select(t => int.Parse(t)).ToArray();

        //出力
        Console.WriteLine($"{CountContests(points, scorings)}");
	}

    static int CountContests(int[] points, int[] scorings)
    {
        int[] cases = new int[3];
        cases[0] = scorings.Where(t => t <= points[0]).Count();
        cases[1] = scorings.Where(t => points[0] < t && t <= points[1]).Count();
        cases[2] = scorings.Where(t => points[1] < t).Count();

        return cases.Min();
    }
}

Measured memory_bytes: 13396
#include<iostream>
#include<algorithm>
#include<functional>
using namespace std;

int main(){
    int N, K;
    int h[100000];

    cin >> N >> K;
    for (int i = 0; i < N; i++){
        cin >> h[i];
    }
    sort(h, h + N, greater<int>());

    int dif[1000000];
    for (int i = 0; i < N - K + 1; i++){
        dif[i] = h[0 + i] - h[K - 1 + i];
    }
    sort(dif, dif + N - K + 1);
    cout << dif[0] << endl;
    return 0;
}

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

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

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

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

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

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

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

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

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

int main() {
	int n;
	cin >> n;
	if (97 <= n && n <= 122) { cout << 2 << endl; }
	else if (65 <= n && n <= 90) { cout << 1 << endl; }
	else { cout << 0 << endl; }
}


Measured memory_bytes: 3112
#if __has_include("debug.h")
    #include "debug.h"
#else  
#include <bits/stdc++.h>
using namespace std;
#define d(...) 2;
#endif

#define int long long int

#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define endl "\n"      

#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
#define ff first
#define ss second
#define eps 1e-10

#define gcd(a,b)            __gcd((a),(b))
#define lcm(a,b)            ((a*b)/gcd(a,b))

void solve();

int32_t main()
{
    #ifdef DEBUG
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
    #endif 

    fast
    
    int t = 1;
	// cin>>t;
	
	while(t--)
	    solve();
	return 0;  
}

void solve()
{
	int i,j;
	int n;
	cin>>n;
	string s;
	cin>>s;

	int cnt=0;

	for(i=0;s[i];i++)
	{
		if(s[i]=='R')
		{
			cnt++;
		}
	}

	int ans=cnt;

	for(i=0;i<cnt;i++)
	{
		if(s[i]=='R')
		{
			ans--;
		}
	}

	cout<<ans<<endl;
	

}

Measured memory_bytes: 3768
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, j, n) for (ll i = j; i < n; i++)
#define all(x) (x).begin(),(x).end()
#define INF (1000000000)
#define MOD (1000000007)
#define MAX (500000)
#define pii pair<int, int>

/////////////////////////////////////////////////////////

class XY{
public:
  ll x, y;
  XY() {x = y = 0;}
  XY(ll u, ll v) {x = u; y = v;}
};

class e{
public:
  ll a, b;
  e() {a = b = -1;}
  e(ll u, ll v) {a = u; b = v;}
};

template<typename T1, typename T2>
void chmin(T1 &a, T2 b) {if(a > b) a = b;}
template<typename T1, typename T2>
void chmax(T1 &a, T2 b) {if(a < b) a = b;}

template<typename T1, typename T2>
ll mypow(T1 a, T2 n){
  if(n == 0) return 1;
  if(n == 1) return a;
  if(n % 2) return a * mypow(a, n - 1);
  ll tmp = mypow(a, n / 2);
  return tmp * tmp;
}

template<typename T>
int BS(vector<T> &V, int left, int right, T key){
  int mid = (left + right) / 2;
  if(V[mid] <= key) left = mid;
  else right = mid;
  if(right - mid == 1) return left;
  else return BS(V, left, right, key);
}

ll comb(ll n, ll r){
	ll res = 1;
  rep(i, 0, r){
    res *= n - i;
    res /= i + 1;
  }
  return res;
}

template<typename T>
T euclid(T a, T b){
  if(b == 0) return a;
  else return euclid(b, a % b);
}

vector<ll> fact(MAX, 0), fact_inv(MAX, 0);

ll pow_mod(ll a, ll b){
	ll res = 1;
	while(b > 0){
		if(b & 1) res = res * a % MOD;
		a = a * a % MOD;
		b >>= 1;
	}
	return res;
}

void prepare_comb_mod(ll n){
	fact[0] = 1LL;
	for(ll i = 0; i < n; i++) fact[i+1] = fact[i] * (i + 1) % MOD;
	fact_inv[n] = pow_mod(fact[n], MOD - 2);
	for(ll i = n - 1; i >= 0; i--) fact_inv[i] = fact_inv[i + 1] * (i + 1) % MOD;
}

ll comb_mod(ll n, ll r){
	return (fact[n] * fact_inv[r]) % MOD * fact_inv[n - r] % MOD;
}

/////////////////////////////////////////////////////////

void Main() {
  int N; cin >> N;
  int A, B; cin >> A >> B;
  int a, b, c;
  a = b = c = 0;
  rep(i, 0, N){
    int tmp; cin >> tmp;
    if(tmp <= A) a++;
    else if(tmp <= B) b++;
    else c++;
  }
  cout << min({a, b, c}) << endl;
}

/////////////////////////////////////////////////////////

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

  Main();
}


Measured memory_bytes: 8064
#include <bits/stdc++.h>
#define INF 2147483647
#define INF_LL 9223372036854775807
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;

int main() {
	int A, B, C, D;
	cin >> A >> B >> C >> D;
	cout << min(A, B) + min(C, D) << endl;
	return 0;
}

Measured memory_bytes: 256
/*
 * main.c
 *
 *  Created on: 2019/07/21
 *      Author: family
 */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

int main()
{
	int N = 0;
	int ans = 0;
	scanf("%d", &N);
	ans = N/2;
	if (N%2 == 0) {
		ans--;
	}
	printf("%d\n",ans);
    return 0;
}


Measured memory_bytes: 128
#include <stdio.h>

void
swap(int *a, int *b)
{
        int tmp;
        tmp = *a;
        *a = *b;
        *b = tmp;
}

int
main(int argc, char *argv[])
{
        int a, b, c;
        int tmp;

        scanf("%d %d %d", &a, &b, &c);
        if (b > c) swap(&b, &c);
        if (a > b) swap(&a, &b);
        if (b > c) swap(&b, &c);
        printf("%d %d %d\n", a, b, c);

        return 0;
}

Measured memory_bytes: 596
#include <stdio.h>
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main(){
  long int H;
  scanf("%ld", &H);

  long int sum=0;
  long int num=1;
  while(H>0){
    //long int num=1;
    sum +=num;
    num *=2;
    H = H/2;
  }
  printf("%ld\n",sum);
  return 0;
}

Measured memory_bytes: 256
from bisect import *
S=input()
T=input()
N=len(S)
M=len(T)
O=ord('a')
X=[[0]*26 for i in range(N+1)]
Y=[[] for i in range(26)]
for i in range(N):
  Y[ord(S[i])-O].append(i)
for i in range(N):
  Y[ord(S[i])-O].append(N+i)
for i in range(M):
  if len(Y[ord(T[i])-O])==0:
    print(-1)
    exit()
for i in range(-1,N):
  for j in range(26):
    if len(Y[j]):
      X[i][j]=Y[j][bisect_right(Y[j],i)]
P=0
Z=-1
for i in range(M):
  P+=X[Z][ord(T[i])-O]-Z
  Z=X[Z][ord(T[i])-O]
  if Z>=N:
    Z-=N
print(P)

Measured memory_bytes: 117456
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
    int k,n;
    cin>>n>>k;
    int arr[n];
    for(int i=0;i<n;i++)
        cin>>arr[i];
    sort(arr,arr+n);
    int ans=0;
    for(int i=0;i<k;i++)
    {
        ans+=arr[i];
    }
    cout<<ans<<"\n";
}


Measured memory_bytes: 3640
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    N = I()
    A = LI()
    if 0 in A:
        print(0)
        return
    cur = 1
    for a in A:
        cur *= a
        if cur > 10**18:
            print(-1)
            return
    print(cur)

main()



Measured memory_bytes: 24216
<?php
$num = trim(fgets(STDIN));
$k = intval(fgets(STDIN));

$dp0 = array_fill(0, strlen($num)+1, array_fill(0, $k+1, 0));//not-max
$dp1 = array_fill(0, strlen($num)+1, array_fill(0, $k+1, 0));//max
$dp1[0][0] = 1;// N桁目 - 0以外の数
for($i = 1; $i <= strlen($num); $i++){
    for($j = 0; $j <= $k; $j++){
        $d = $num[$i-1];
        if($d){
            $dp1[$i][$j] += $dp1[$i-1][$j-1] ?? 0;
        }else{
            $dp1[$i][$j] += $dp1[$i-1][$j];
        }
        $dp0[$i][$j] += ($dp0[$i-1][$j - 1]??0) * 9 + $dp0[$i-1][$j];
        if($d)$dp0[$i][$j] += $dp1[$i-1][$j] + ($dp1[$i-1][$j-1]??0) * ($d-1);
    }
}
echo $dp0[strlen($num)][$k] + $dp1[strlen($num)][$k];



Measured memory_bytes: 4604
s = input()
if s[0] != "A":
    ans = "WA"
elif ord(s[1]) < 91:
    ans = "WA"
elif ord(s[-1]) < 91:
    ans = "WA"
else:
    ans = "AC"
    c = 0
    for i in range(2, len(s) - 1):
        if s[i] == "C":
            c += 1
        elif ord(s[i]) < 91:
            ans = "WA"
            break
    if c != 1:
        ans = "WA"

print(ans)


Measured memory_bytes: 3060
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <list>
#include <queue>
using namespace std;

int inf = (1 << 30);
int mod = 1e9 + 7;
int64_t inf64 = (1LL << 60);

template <typename T>
T gcd(T a, T b) {
    if(b == 0) return a;
    else return gcd(b, a % b);
}

template <typename T>
T lcm(T a, T b) {
    T g = gcd(a, b);
    return a / g * b;
}

bool check(vector<int> a, int index, int key){
    if(a[index] >= key) return true;
    else return false;
}

int lower_bound(vector<int> a, int key){
    int left = -1, right = a.size();
    while(right - left > 1){
        int mid = left + (left + right) / 2;
        if(check(a, mid, key)) right = mid;
        else left = mid;
    }
    return right;
}

int main(){

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

    if(A == B) cout << "Draw" << endl;
    else if(A == 1) cout << "Alice" << endl;
    else if(B == 1) cout << "Bob" << endl;
    else if(A > B) cout << "Alice" << endl;
    else if(A < B) cout << "Bob" << endl;

    return 0;
}

Measured memory_bytes: 256
def count(length, on):
    """Count of possible amida patterns"""
    if length < 0:
        return 1
    if length == 0:
        return 1
    ret = count(length - 1, False)
    if not on:
        ret += count(length - 1, True)
    return ret


# for i in range(1, 9):
#     print(count(i, True) + count(i, False))


if __name__ == '__main__':
    H, W, K = map(int, input().split())

    # Count
    B = [0 for _ in range(W)]
    B[0] = 1
    for j in range(H):
        C = [0 for _ in range(W)]
        for i in range(W):
            left_off = count(i - 1, False)
            left_on = count(i - 1, True)
            right_off = count(W - i - 2, False)
            right_on = count(W - i - 2, True)
            # print(i, left_off, left_on, right_off, right_on)

            if B[i] > 0:
                C[i] += B[i] * (left_off * right_off)

            if i > 0 and B[i - 1] > 0:
                C[i] += B[i - 1] * (left_on * right_off)

            if i < W - 1 and B[i + 1] > 0:
                C[i] += B[i + 1] * (left_off * right_on)

        B = [ci for ci in C]
        # print(B)

    # MOD = 1_000_000_007  # Underscore is not supported until 3.6
    MOD = 1000000007
    ANS = C[K - 1] % MOD
    print(ANS)


Measured memory_bytes: 3064
n=int(input())
a=list(map(int,input().split()))
s=sum(map(abs,a))
m=min(list(map(abs,a)))
z=[]
for i in range(n):
    if a[i]<0:
        z.append(a[i])

if len(z)%2:
    print(s-2*m)
else:
    print(s)

Measured memory_bytes: 14412
N = int(input())
a = [0] + list(map(int, input().split()))
b = [None] * (N+1)
for i in range(N//2+1, N+1):
    b[i] = a[i]
for j in range(1, N//2+1)[::-1]:
    if a[j] == 1:
        t = 0
        for i in range(j+j, N+1, j):
            t ^= b[i]
        if t == 1:
            b[j] = 0
        else:
            b[j] = 1
    else:
        t = 0
        for i in range(j+j, N+1, j):
            t ^= b[i]
        if t:
            b[j] = 1
        else:
            b[j] = 0
for i in range(1, N//2+1):
    t = 0
    for j in range(i, N+1, i):
        t ^= b[j]
    if a[i]^t:
        print(-1)
        quit()
ans = [i for i, v in enumerate(b) if v]
print(len(ans))
if len(ans):
    print(*ans)


Measured memory_bytes: 83176
#include <iostream>
#include <cassert>
#include <queue>

#define INF 922337203685477580
typedef long long ll;
using namespace std;

int cnt = 0;

void merge(ll* A, int left, int mid, int right) {
  int n1 = mid - left;
  int n2 = right - mid;
  ll L[n1 + 10];
  ll R[n2 + 10];

  for (int i = 0; i < n1; i++) {
    L[i] = A[left + i];
  }
  for (int i = 0; i < n2; i++) {
    R[i] = A[mid + i];
  }
  L[n1] = INF;
  R[n2] = INF;

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

void mergeSort(ll* 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() {
  int n;
  cin >> n;

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

  mergeSort(A, 0, n);

  for (int i = 0; i < n; i++) {
    if(i > 0) cout << " ";
    cout << A[i];
  }
  cout << endl;

  cout << cnt << endl;
  return 0;
}

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

typedef struct _Node {
  int key;
  struct _Node *next, *prev;
} Node;

Node *nil;

Node* listSearch(int key) {
  Node *cur = nil->next;
  while(cur != nil && cur->key != key) {
    cur = cur->next;
  }
  return cur;
}

void init(void) {
  nil = (Node *)malloc(sizeof(Node));
  nil->next = nil;
  nil->prev = nil;
}

void printList(void) {
  Node *cur = nil->next;
  int isf = 0;
  while(1) {
    if(cur == nil) break;
    if(isf++>0) printf(" ");
    printf("%d",cur->key);
    cur = cur->next;
  }
  printf("\n");
}

void deleteNode(Node *t) {
  if(t==nil) return;
  t->prev->next = t->next;
  t->next->prev = t->prev;
  free(t);
}

void deleteFirst(void) {
  deleteNode(nil->next);
}

void deleteLast(void) {
  deleteNode(nil->prev);
}

void deleteKey(int key) {
  deleteNode(listSearch(key));
}

void insert(int key) {
  Node *x = (Node *)malloc(sizeof(Node));
  x->key = key;
  x->next = nil->next;
  nil->next->prev = x;
  nil->next = x;
  x->prev = nil;
}

int main(void) {
  int key, n, i;
  int size = 0;
  int np = 0, nd = 0;
  char com[20];
  scanf("%d", &n);
  init();
  for(i=0;i<n;i++) {
    scanf("%s%d",com, &key);
    if (com[0] == 'i') {
      insert(key);
      np++;
      size++;
    } else if(com[0] == 'd') {
      if(strlen(com) > 6) {
        if(com[6] == 'F')
          deleteFirst();
        else if(com[6] == 'L')
          deleteLast();
      } else {
        deleteKey(key);
        nd++;
      }
      size--;
    }
  }
  printList();
  return 0;
}


Measured memory_bytes: 32988
import io.StdIn

object Main extends App {

  val Array(n, m) = StdIn.readLine.split(" ").map(_.toInt)
  val coin = StdIn.readLine.split(" ").map(_.toInt)

  val ans = {
    // val dp = Array.ofDim[Int](m+1)
    val dp = Array.fill[Int](n+1)(Int.MaxValue)
    dp(0) = 0

    for {
      i <- 0 until m
      j <- coin(i) to n
    } dp(j) = math.min(dp(j), dp(j - coin(i)) +1)
    dp(n)
  }

  println(ans)
}


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

int main() {
    fastIO;
    lint a, b;
    cin >> a >> b;
    if (a == 0 || b == 0 || (a <= 0 && 0 <= b)) {
        cout << "Zero";
    } else if (a < 0) {
        if ((-a + b + 1) % 2 == 0) {
            cout << "Positive";
        } else {
            cout << "Negative";
        }
    } else {
        cout << "Positive";
    }
}


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

int main(){
    int N;
    cin >> N;
    if (N % 10 == 3)
    {
        cout << "bon" << "\n";
    }else if (N % 10 == 0 || N % 10 == 1 || N % 10 == 6 || N % 10 == 8){
        cout << "pon" << "\n";
    }else{
        cout << "hon" << "\n";
    }
}

Measured memory_bytes: 3596
function Main(input) {
    const n = parseInt(input,10);
    const a = n % 10;

    if(a === 2 || a === 4 || a === 5 || a ===7 || a ===9){
        console.log('hon');    
    }else if(a === 0 || a === 1 || a === 6 || a ===8){
        console.log('pon');
    }else{
        console.log('bon');
    }
    
}
 
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 29424
#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;
  rep(i,0,S.size()){
    if(S[i]=='7'){
      cout<<"Yes"<<endl;
      return 0;
    }
  }
  cout<<"No"<<endl;
  }


Measured memory_bytes: 3628
#include "bits/stdc++.h"
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;
using V = vector<int>;
using S = string;
using C = char;

const double pi = 3.1415926535;

void Main()
{
	int A, B, M;
	cin >> A >> B >> M;
	vector<int> a(A);
	vector<int> b(B);
	int min = 200000;
	int mia = 100000;
	int mib = 100000;
	rep(i, A) {
		cin >> a[i];
		if (a[i] < mia) {
			mia = a[i];
		}
	}
	rep(i, B) {
		cin >> b[i];
		if (b[i] < mib) {
			mib = b[i];
		}
	}
	vector<int> x(M);
	vector<int> y(M);
	vector<int> c(M);
	rep(i, M) {
		cin >> x[i] >> y[i] >> c[i];
	}
	rep(i, M) {
		if (a[x[i]-1] + b[y[i]-1] - c[i] < min) {
			min = a[x[i]-1] + b[y[i]-1] - c[i];
		}
	}
	if (mia + mib < min) {
		cout << mia + mib << endl;
	} else {
		cout << min << endl;
	}
}

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

Measured memory_bytes: 5324
import math
a,b,C = map(int,input().split())
C=math.radians(C)
S=(a*b*math.sin(C))/2
L=a+b+math.sqrt(a**2+b**2-2*a*b*math.cos(C))
h=b*math.sin(C)
print(f"{S:.8f}")
print(f"{L:.8f}")
print(F"{h:.8f}")


Measured memory_bytes: 5720
s=input()
f=True
if 'W' in s and not 'E' in s:f=False
if 'E' in s and not 'W' in s:f=False
if 'N' in s and not 'S' in s:f=False
if 'S' in s and not 'N' in s:f=False

print(["No","Yes"][f])

Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
typedef long long Long;

Long combinatorio(Long n){
   if(n<2) return 0;
   else return n*(n-1)/2;
}

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

   Long n,m;
   cin >> n >> m;

   cout << combinatorio(n) + combinatorio(m);
   return 0;
}

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

using namespace std;

int main() {
  vector<int> v;
  int n;
  int m;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> m;
    v.push_back(m);
  }
  int c = 0;
  for (int i = 1; i < n-1; i++) {
    if (v[i-1] < v[i] && v[i] < v[i+1]) {
      c++;
    }
    if (v[i-1] > v[i] && v[i] > v[i+1]) {
      c++;
    }
  }
  cout << c << endl;
  return 0;
}


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

long long N, X;

long long f(long long a, long long b) {
    if (a == 0 || b == 0) {
        return 0;
    } else {
        return 2 * (b / a) * a + f(b % a, a) - (b % a == 0 ? a : 0);
    }
}

int main() {

    scanf("%lld%lld", &N, &X);

    printf("%lld\n", N + f(X, N - X));

    return 0;
}

Measured memory_bytes: 256
#![allow(unused_imports)]
    #![allow(dead_code)]
    use std::io::prelude::*;
    use std::cmp::{max, min};
    use std::collections::BinaryHeap;

    const MOD: i64 = 1e9 as i64 + 7; 

    fn main(){
        let n: usize = read();    
        let k: isize = read();    
        let q: isize = read();
        let mut p: Vec<isize> = vec![k - q; n];
        for _ in 0..q{
            let a: usize = read::<usize>() - 1;
            p[a] += 1;
        }
        for i in 0..n{
            println!("{}", if p[i] > 0 {"Yes"} else {"No"});
        }
    }

    fn read<T>() -> T
    where
        T: std::str::FromStr,
    {
        let stdin = std::io::stdin();
        let token: String = stdin
            .lock()
            .bytes()
            .map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect();
        token.parse().ok().unwrap()
    }


Measured memory_bytes: 4732
#include <bits/stdc++.h>
using namespace std;
#define __ <<" "<<
#define ___ <<" "
#define bash push_back
#define ALL(x) x.begin(),x.end()
//#define int long long

struct IoSetup {
    IoSetup() {
        cin.tie(0);
        ios::sync_with_stdio(false);
        cout <<fixed<<setprecision(12);
        cerr <<fixed<<setprecision(12);
    }
}IoSetup;

typedef long long ll;
typedef pair < int , int >  pii;
static constexpr const signed int INF = 0x3f3f3f3f;
static constexpr const signed long long LINF = 0x3f3f3f3f3f3f3f3fLL;
static constexpr const signed int SMOD = 1000000007;
static constexpr const signed int NMOD = 1000000009;
static constexpr const signed int dx[]={1,0,-1,0,1,1,-1,-1};
static constexpr const signed int dy[]={0,-1,0,1,-1,1,-1,1};

bool inside(int x,int y,int w,int h){return (x>=0 && y>=0 && x<w && y<h);}
template<class T>T abs(T &x){return x<0 ? -x : x;}
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
template<class T> T qp(T a,T b,int mo){T ans=1;do{if(b&1)ans=1ll*ans*a%mo;a=1ll*a*a%mo;}while(b>>=1);return ans;}


int n;
vector<int> d;
int l[100005];

constexpr ll MOD = 998244353LL;

signed main() {
    cin >> n;
    d.resize(n);
    int m = 0;
    for(int i = 0;i < n; i++) {
        cin >> d[i];
        if(i==0&&d[i]!=0) {
            cout << 0 << endl;
            return 0;
        }
        l[d[i]]++;
        chmax(m,d[i]);
    }

    ll ans = l[0];
    if(ans!=1) {
        cout << 0 << endl;
        return 0;
    }

    for(int i = 1; i <= m; i++) {
        if(!l[i]) ans = 0;
        ans = ans * qp(l[i-1],l[i],MOD);
        ans %= MOD;
            
    }

    cout << ans << endl;
    

  
    return 0;
}



Measured memory_bytes: 1024