akhauriyash/Code-Regression huggingface dataset:
#include "algorithm"
#include "functional"
#include "iostream"
#include "map"
#include "string"
#include "vector"
#define rep(i, to) for (ll i = 0; i < (to); ++i)
using namespace std;
typedef long long ll;

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

  ll N, A, B;
  cin >> N >> A >> B;

  if ((B - A) % 2 == 0) {
    cout << ((B - A) / 2) << endl;
    return 0;
  }

  if (N - A < B - 1) {
    ll res = min(N - A, N - B + (B - A + 1) / 2);
    cout << res << endl;

  } else {
    ll res = min(B - 1, A - 1 + (B - A + 1) / 2);
    cout << res << endl;
  }

  return 0;
}


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

int main() {
	
	int h,w,k;
	cin >> h >> w >> k;
	vector<vector<char>> s(h+1,vector<char>(w+1));
	for(int i=1; i<=h; i++) for(int j=1; j<=w; j++) cin >> s.at(i).at(j);
	vector<vector<int>> sum(h+1,vector<int>(w+1));
	for(int i=1; i<=h; i++){
		for(int j=1; j<=w; j++){
			sum.at(i).at(j) = sum.at(i).at(j-1)+sum.at(i-1).at(j)-sum.at(i-1).at(j-1)+(s.at(i).at(j)=='1');
		}
	}
	int mcnt = 1e9;
	for(int i=0; i<(1<<h-1); i++){
		int cnt{};
		queue<int>q;
		q.push(0);
		for(int j=0; j<h-1; j++) {
			if(i&(1<<j)){
					cnt++;
					q.push(j+1);
			}
		}
		
		int hi{}, nhi{};
		for(int l=1; l<=w; l++){
			hi = nhi;
			auto q1 = q;
			bool flg1=0, flg2=0;
			while(!q1.empty()){
				int a = q1.front();
				q1.pop();
				int b;
				if(q1.empty()) b = h;
				else b = q1.front();
				int c = (sum.at(b).at(l-1)-sum.at(a).at(l-1)) - (sum.at(b).at(hi)-sum.at(a).at(hi));
				int d = sum.at(b).at(l) - sum.at(b).at(l-1) - sum.at(a).at(l) + sum.at(a).at(l-1);
				if(d > k) {
					flg1=1;
					break;
				}
				if(c+d>k){
					flg2=1;
					nhi = l-1;
				}
			}
			
			if(flg1) {
				cnt = 1e9;
				break;
			}
			if(flg2) cnt++;
		}
		
		mcnt = min(mcnt,cnt);
	}
	cout << mcnt << endl;
}

Measured memory_bytes: 256
import java.util.*;
public class Main {
  public static void main(String...args) {
	final Scanner sc = new Scanner(System.in);
    final int K = sc.nextInt();
    final int[] A = new int[K];
    for(int i = 0; i < K; i++)
      A[i] = Integer.parseInt(sc.next());
    long lo = 2;
    long hi = 2;
    for(int i = K - 1; i >= 0; i--) {
      long newLo = lo / A[i] * A[i];
      if(newLo < lo)
        newLo += A[i];
      final long newHi = hi / A[i] * A[i] + A[i] - 1;
      if(newLo > newHi) {
      	System.out.println(-1);
        return;
      }
      lo = newLo;
      hi = newHi;
    } 
    System.out.println(lo + " " + hi);
  }
}

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

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            string input = Console.ReadLine();
            string[] words = input.Split(' ');
            int n1 = int.Parse(words[0]);
            int n2 = int.Parse(words[1]);

            if (n1 % n2 == 0)
            {
                Console.WriteLine(-1);
                return;
            }

            int i = 1;
            bool flg = false;
            int num = 0;

            while(num < 1000000000000000000)
            {
                num = n1 * i;
                if (num % n2 != 0)
                {
                    Console.WriteLine(num);
                    flg = true;
                    break;
                }
                i++;
            }

            if (flg == false) {
                Console.WriteLine(-1);
            }
            
        }
        }
}


Measured memory_bytes: 13140
#include <stdio.h>
int main(void)
{
  int i, flg;
  char s[4];
  char c;

  // 標準入力からの値取得
  scanf("%s\n", s);

  // 計算
  flg = 0;
  for (i = 0; i < 3; i++) {
    if (i == 0) {
      c = s[0];
    } else if (c != s[i]) {
        flg = 1;
    }
  }

  // 出力
  if (flg == 1)
    printf("Yes\n");
  else
    printf("No\n");
  return 0;
}

Measured memory_bytes: 256
import math
term = input().split()
a = int(term[0])
b = int(term[1])
c = int(term[2])

sin = math.sin(math.radians(c))
cos = math.cos(math.radians(c))
print('{}'.format(a*b*sin/2))
print('{}'.format(a+b+math.sqrt(a**2 + b**2 - 2*a*b*cos)))
print('{}'.format(b*sin))



Measured memory_bytes: 5704
#include <bits/stdc++.h>
using namespace std;
 
int main() {

  int N;
  cin >> N;

  int i;
  
  for(i = 0; i < N; i++){
    char S;
    cin >> S;
    	if(S == 'Y'){
    	  cout << "Four"<< endl;
    	  break;
  		  }
    	if(i == N-1){
          cout << "Three"<<endl;
        }
    }
}

Measured memory_bytes: 256
#include<stdio.h>
int main(){
    int a[3]={0,0,0},i,j,p=0;

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

    for(i=0;i<3;i++){
        for(j=2;j>i;j--){
            if(a[j]<a[j-1]){
                p=a[j-1];
                a[j-1]=a[j];
                a[j]=p;
            }
        }
    }

        printf("%d %d %d\n",a[0],a[1],a[2]);

    return 0;
}

Measured memory_bytes: 596
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(v) v.begin(), v.end()
typedef long long ll;

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

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



int main(){
  ll a;
  double b;
  cin>>a>>b;
  
  ll c=100*b+0.5;
  
  cout<<a*c/100<<endl;

  return 0;
}

Measured memory_bytes: 3664
#![allow(non_snake_case)]
#![allow(dead_code)]
#![allow(unused_macros)]
#![allow(unused_imports)]

use std::str::FromStr;
use std::io::*;
use std::collections::*;
use std::cmp::*;

struct Scanner<I: Iterator<Item = char>> {
    iter: std::iter::Peekable<I>,
}

macro_rules! exit {
    () => {{
        exit!(0)
    }};
    ($code:expr) => {{
        if cfg!(local) {
            writeln!(std::io::stderr(), "===== Terminated =====")
                .expect("failed printing to stderr");
        }
        std::process::exit($code);
    }}
}

impl<I: Iterator<Item = char>> Scanner<I> {
    pub fn new(iter: I) -> Scanner<I> {
        Scanner {
            iter: iter.peekable(),
        }
    }

    pub fn safe_get_token(&mut self) -> Option<String> {
        let token = self.iter
            .by_ref()
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect::<String>();
        if token.is_empty() {
            None
        } else {
            Some(token)
        }
    }

    pub fn token(&mut self) -> String {
        self.safe_get_token().unwrap_or_else(|| exit!())
    }

    pub fn get<T: FromStr>(&mut self) -> T {
        self.token().parse::<T>().unwrap_or_else(|_| exit!())
    }

    pub fn vec<T: FromStr>(&mut self, len: usize) -> Vec<T> {
        (0..len).map(|_| self.get()).collect()
    }

    pub fn mat<T: FromStr>(&mut self, row: usize, col: usize) -> Vec<Vec<T>> {
        (0..row).map(|_| self.vec(col)).collect()
    }

    pub fn char(&mut self) -> char {
        self.iter.next().unwrap_or_else(|| exit!())
    }

    pub fn chars(&mut self) -> Vec<char> {
        self.get::<String>().chars().collect()
    }

    pub fn mat_chars(&mut self, row: usize) -> Vec<Vec<char>> {
        (0..row).map(|_| self.chars()).collect()
    }

    pub fn line(&mut self) -> String {
        if self.peek().is_some() {
            self.iter
                .by_ref()
                .take_while(|&c| !(c == '\n' || c == '\r'))
                .collect::<String>()
        } else {
            exit!();
        }
    }

    pub fn peek(&mut self) -> Option<&char> {
        self.iter.peek()
    }
}

fn main() {
    let cin = stdin();
    let cin = cin.lock();
    let mut sc = Scanner::new(cin.bytes().map(|c| c.unwrap() as char));
    let s = sc.chars();
    let mut ans = 0;
    let mut l = 0;
    let mut r = s.len() - 1;
    while l < r {
        if s[l] != s[r] {
            ans += 1;
            if s[l] == 'x' {
                l += 1;
            } else if s[r] == 'x' {
                r -= 1;
            } else {
                println!("-1");
                return;
            }
        } else {
            r -= 1;
            l += 1;
        }
    }
    println!("{}", ans);
}


Measured memory_bytes: 4352
import math
n, k = map(int, raw_input().split())
p = 0.0
for i in range(1,n+1):
    if i < k:
        x = math.ceil(math.log((float(k) / float(i)), 2))
        p += (float(1) / float(n)) * ((0.5) ** x)
    else:
        p += (float(1) / float(n))

print p


Measured memory_bytes: 5764
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
n, k = map(int, input().split())
s = input().rstrip()

def count(s):
    cnt = 0
    for i in range(n):
        if i+1 < len(s) and s[i] == 'R' and s[i+1] == 'R':
            cnt += 1
        elif i-1 >= 0 and s[i] == 'L' and s[i-1] == 'L':
            cnt += 1
    return cnt


print(min(count(s)+2*k, n-1))


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

int main(){
  int N, L;
  cin >> N >> L;
  int total = 0;
  for(int i = 1; i <= N; i++){
    total += i + L - 1;
  }
  int total2 = total;
  int ans = 999999;
  for(int i = 1; i <= N; i++){
    total2 -= i + L - 1;
    ans = min(ans, abs(total - total2));
    total2 = total;
  }
  if(total >= 0) cout << total - ans << endl;
  else cout << total + ans << endl;
}
           

Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<iostream>
using namespace std;
int main()
{
    long long int N,M,s,sum;
    while(scanf("%lld%lld",&N,&M)!=EOF)
    {
        if(N<M)
        {
        s=M-N*2;
        sum=N+s/4;
        cout<<sum<<endl;
        }
        else
            cout<<M/2<<endl;
    }
   
}


Measured memory_bytes: 256
/**
 *   Author:  Wasi Ur Rahman
 *   FROM RMSTU
**/
#include <bits/stdc++.h>
#define ll         		long long
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define dourao       		ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define min3(a,b,c)    		min(a,min(b,c))
#define min4(a,b,c,d)  		min(d,min3(a,b,c))
#define max3(a,b,c)    		max(a,max(b,c))
#define max4(a,b,c,d)  		max(d,max3(a,b,c))
#define all(v)         		v.begin(),v.end()
#define revall(v)      		v.rbegin(),v.rend()
#define pb             		push_back
#define eb             		emplace_back
#define setbits(x)     		__builtin_popcountll(x)
#define zrobits(x)     		__builtin_ctzll(x)
#define si(x)               scanf("%d", &x)
#define sii(x, y)           scanf("%d %d", &x, &y)
#define siii(x, y, z)       scanf("%d %d %d", &x, &y, &z)
#define sl(x)               scanf("%lld", &x)
#define sll(x, y)           scanf("%lld %lld", &x, &y)
#define slll(x, y, z)       scanf("%lld %lld %lld", &x, &y, &z)
#define poro                freopen("input.txt","r",stdin)
#define lekho               freopen("output.txt","w",stdout)
#define println()           cout << endl
#define printi(x)           printf("%d\n")
#define printii(x,y)        printf("%d %d\n")
#define printiii(x,y,z)     printf("%d %d %d\n")
#define printl(x)           printf("%lld\n")
#define printll(x,y)        printf("%lld %lld\n")
#define printlll(x,y,z)     printf("%lld %lld %lld\n") 
using namespace __gnu_pbds;
using namespace std;
/*************************************
**          A S S E M B L E         **
**************************************/
bool isPrime(ll n){if(n <= 1)return false;for (ll i = 2; i * i < n; i++)if (n % i == 0)return false;return true;}
ll fact(ll n){ll res = 1;for(ll i = n;i>=1;i--)res *= i;return res;}
ll nCr(ll n,ll r){return (fact(n)/(fact(r)*fact(n-r)));}
ll nPr(ll n,ll r){return fact(n)/fact(n-r);}
ll modpow(ll a, ll n, ll mod){ll res=1;while(n>0){if(n&1) res=res*a%mod;a=a*a%mod;n>>=1;}return res;}
const int mod=998244353;
inline int add(int a,int b){if((a+=b)>=mod)a-=mod;return a;}
inline int dec(int a,int b){if((a-=b)<0)a+=mod;return a;}
inline int mult(int a,int b){long long t=1ll*a*b;if(t>=mod)t%=mod;return t;}
inline int power(int a,int b){int out=1;while(b){if(b&1)out=mult(out,a);a=mult(a,a);b>>=1;}return out;} 
/*************************************
**  E N D    G A M E   S T A R T S  **
**************************************/
int main(){
	dourao;
	char ch;
	string str;
	ll n;
	cin >> n;
	while(n){
		n--;
		str += 'a' + (n % 26);
		n /= 26;
	}
	reverse(revall(str));
	cout << str << endl;
	return 0;
}

Measured memory_bytes: 3660
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pr;
typedef vector<ll> vc;
#define pb push_back
#define rep(i,a,b) for(ll i=a;i<=b;i++)
#define repr(i,a,b) for(ll i=a;i>=b;i--)
#define reps(i,v) for(ll i=0;i<v.size();i++)
const ll mod = 1e9+7;
long long powmod(long long px, long long py, long long pmod){
	if(py == 0) return 1;
	if(py % 2 == 0) return powmod((px * px) % pmod, py / 2, pmod);
	else return (px * powmod(px, py - 1, pmod)) % pmod;
} 

int main() {
    // your code goes here
    ll n,k,dp[100005],ans=0;
    vc ps[100005];
    cin >> n >> k;
    rep(i,1,k){
        for(ll j=2;i*j<=k;j++){
            ps[i].pb(i*j);
        }
    }
    dp[k]=1;
    repr(i,k-1,1){
        dp[i]=powmod(k/i,n,mod);
        reps(j,ps[i]) dp[i]=(dp[i]+mod-dp[ps[i][j]])%mod;
    }
    rep(i,1,k) ans=(ans+i*dp[i]%mod)%mod;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 17480
#include<stdio.h>
#include<math.h>
#include<stdlib.h>
#define N 105
int main()
{
	int n,k;
	int a[105];
	int sum=0;
	while(scanf("%d%d",&n,&k)!=EOF)
	{
	for(int i=0;i<n;i++)
		scanf("%d",&a[i]);
	
	for(int i=0;i<n;i++)
	{	
		if(a[i]>abs(k-a[i]))
		sum+=abs(k-a[i]);
		else
		sum+=a[i];	
	}
	printf("%d\n",2*sum);
	return 0;
	}
}

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

int main(void){
  int N,M,X,Y;
  cin>>N>>M>>X>>Y;
  vector<int> x(N);
  vector<int> y(M);
  for (int i=0;i<N;i++) cin>>x[i];
  for (int i=0;i<M;i++) cin>>y[i];
  x.push_back(X);
  y.push_back(Y);
  sort(x.begin(),x.end());
  reverse(x.begin(),x.end());
  sort(y.begin(),y.end());
  if (x[0]<y[0]) cout<<"No War"<<endl;
  else cout<<"War"<<endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <functional>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <string>
#include <numeric>
#include <cmath>

#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
using P = pair<ll, ll>;

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

const ll MOD = 1000000007;
const int INF = 1<<30;
//const ll INF = (ll)1e18 + 1;

vector<int> Zalgo(const string &S) {
    int N = (int)S.size();
    vector<int> res(N);
    res[0] = N;
    int i = 1, j = 0;
    while (i < N) {
        while (i+j < N && S[j] == S[i+j]) ++j;
        res[i] = j;
        if (j == 0) {++i; continue;}
        int k = 1;
        while (i+k < N && k+res[k] < j) res[i+k] = res[k], ++k;
        i += k, j -= k;
    }
    return res;
}

int main(){
  int N; cin >> N;
  string S; cin >> S;

  int ans = 0;
  for (int i = 0; i < N; ++i){
    string T = S.substr(i);
    auto lcp = Zalgo(T);

    for (int j = 0; j < T.size(); ++j){
      int l = min(lcp[j], j); //2つに分けたいので
      ans = max(ans, l);
    }
  }
  cout << ans << endl;
}


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

#define jaldi ios_base::sync_with_stdio(false)
#define fr(i,j,n) for(i=j;i<n;i++)
#define si(x) scanf("%d",&x)
#define sl(x) scanf("%ld",&x)
#define sll(x) scanf("%lld",&x)
#define sc(x) scanf("%c",&x)
#define ss(x) scanf("%s",x)
#define pi(x) printf("%d",x)
#define pl(x) printf("%ld",x)
#define pll(x) printf("%lld",x)
#define pc(x) printf("%c",x)
#define ps(x) printf("%s",x)
#define vi vector<int> 
#define vl vector<long> 
#define vll vector<long long>
#define vc vector<char>  
#define vs vector<string>
#define vvi vector<vector<int>> 
#define vvll vector<vector<long long>> 
#define F first
#define S second
#define ll long long
#define pb push_back
#define ppii pair<int,int> 
#define ppll pair<long long,long long>
#define ppcc pair<char,char>
#define ppss pair<string,string> 
#define vpll vector<pair<long long,long long>>
#define PI 3.1415926535897932384626
#define precision(x) cout<<fixed<<setprecision(x) 
#define mod 1000000007

int x_d[8] = {-1,1,0,0,-1,-1,1,1};
int y_d[8] = {0,0,-1,1,-1,1,-1,1};

ll power(ll b,ll e)
{
    if(b==0)
        return 0;
    
    ll r=1;
    while(e>0)
    {
        if(e%2)
            r=(r*b)%mod;
        b=(b*b)%mod;
        e/=2;
    }
    return r;
}

bool comp(pair<ll,pair<ll,pair<ll,ll>>> p,pair<ll,pair<ll,pair<ll,ll>>> q)
{
    if(p.F>q.F)
        return true;
    else if(p.F<q.F)
        return false;
    
    ll a = p.S.S.F;
    ll b = p.S.S.S;

    ll a1 = q.S.S.F;
    ll b1 = q.S.S.S;

    if(abs(a-b)>=abs(a1-b1))
        return true;
    return false;

}

int main()
{
    jaldi;
    precision(20);
    ll i,j;

    ll a,b,n;
    cin>>a>>b>>n;

    ll x=min(b-1,n);

    cout<<(a*x)/b;



    return 0;
}

Measured memory_bytes: 3620
var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var Arr=(input.trim()).split("\n");
var n = Arr[0];
Arr.shift();

for(var i = 0;i < n;++i){
    var nums = Arr[i].split(" ").map(Number);
    // なぜかparallelが通らなかった
    var k1 = (nums[3] - nums[1]) / (nums[2] - nums[0]);
    var k2 = (nums[7] - nums[5]) / (nums[6] - nums[4]);
    if(k1.toFixed(6) == k2.toFixed(6)){
        console.log("YES");
    }
    else{
        console.log("NO");
    }
}


Measured memory_bytes: 16076
#include<stdio.h>
#include<string.h>
int main()
{
          char str[1000];
          int i,j,k=0,l,m,n;
          while(1)
          {
                    scanf("%s",&str);
          l=strlen(str);
          if(l==1&&str[0]=='0')
          {
                    return 0;
          }
          for(i=0;i<l;i++)
          {
               k=k+str[i]-'0';
          }
          printf("%d\n",k);
          k=0;
          }
          return 0;
}



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

#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
typedef pair<int, int> pii;
typedef vector<int> vi;
using ll = long long;

const int INF = (int) 1e9 + 9;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    string s;
    cin >> s;
    rep(i, 0, sz(s)) {
        if (i & 1)
            if (s[i] == 'R') {cout << "No" << '\n'; return 0; }
        if (!(i & 1))
            if (s[i] == 'L') {cout << "No" << '\n'; return 0; }
    }
    cout << "Yes" << '\n';
    return 0;
}


Measured memory_bytes: 256
package main

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

var sc = bufio.NewScanner(os.Stdin)

func line() string {
	sc.Scan()
	return sc.Text()
}

func main() {
	input := strings.Split(line(), " ")
	a, _ := strconv.Atoi(input[0])
	b, _ := strconv.Atoi(input[1])
	c, _ := strconv.Atoi(input[2])

	var ay []int

	for i := 1; i < 101; i++ {
		if a%i == 0 && b%i == 0 && a >= i && b >= i {
			ay = append(ay, i)
		}
	}

	fmt.Printf("%d\n", ay[len(ay)-c])
}


Measured memory_bytes: 640
#include <iostream>

typedef long long ll;

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

#define debug(x) cout << #x << "=" << x << endl;

using namespace std;

int main(void){

  int n;
  cin >> n;
  int F[n][10];
  int P[n][11];
  
  REP(i,n){
    REP(k,10){
      cin >> F[i][k];
    }
  } 
  REP(i,n){
    REP(k,11){
      cin >> P[i][k];
    }
  }

  ll ans = INT64_MIN;

  FOR(k,1,1<<10){
    ll res = 0;
    REP(i,n){
      int cnt = 0;
      REP(j,10){
        if((k>>j&1) && F[i][j]) cnt++;
      }
      res += P[i][cnt];
    }
    ans = max(ans,res);
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
use proconio::{fastout, input, marker::Bytes};

#[fastout]
fn main() {
    input! {
        n: Bytes,
    }

    let ans = n.into_iter().map(|c| u64::from(c - b'0')).sum::<u64>() % 9 == 0;
    println!("{}", if ans { "Yes"} else { "No" });
}


Measured memory_bytes: 2368
while True:
    m,f,r=map(int,input().split())
    if m==-1 and f==-1 and r==-1:
        break

    if m==-1 or f==-1:
        print('F')
    elif(m+f)>=80:
        print('A')
    elif(m+f)>=65:
        print('B')
    elif(m+f)>=50:
        print('C')
    elif(m+f)>=30 and r>=50:
        print('C')
    elif(m+f)>=30:
        print('D')
    else:
        print('F')


Measured memory_bytes: 5592
// #include {{{
#include <iostream>
#include <cassert>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <ctime>
#include <queue>
#include <set>
#include <map>
#include <stack>
#include <string>
#include <bitset>
#include <vector>
#include <complex>
#include <algorithm>
using namespace std;
// }}}
// #define {{{
typedef long long ll;
typedef double db;
typedef pair<int,int> pii;
typedef vector<int> vi;
#define de(x) cout << #x << "=" << x << endl
#define rep(i,a,b) for(int i=a;i<(b);++i)
#define per(i,a,b) for(int i=(b)-1;i>=(a);--i)
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define fi first
#define se second
// }}}

const int N = 5005;
const ll inf = 1e18;
int n , l[N] , r[N];
ll dp[2][N][2];
inline void Update(ll &x,ll d) {
  if(x > d) x = d;
}

int main(){
  cin >> n;
  rep(i,0,n) cin >> l[i] >> r[i];
  vector<pair<ll,int> > seg;
  rep(i,0,n) seg.pb(mp(l[i] + r[i] , i));
  sort(all(seg));
  reverse(all(seg));
  rep(i,0,2) rep(j,0,N) rep(k,0,2) dp[i][j][k] = inf;
  auto f = dp[0] , g = dp[1];
  f[0][0] = 0;
  int goleft = n / 2 , goright = n - 1 - goleft;
  rep(i,0,n) {
    int s = seg[i].se;
    rep(j,0,i+2) rep(k,0,2) g[j][k] = inf;
    rep(j,0,i+1) {
      if(f[j][0] != inf) {
        Update(g[j][0] , f[j][0] + ll(l[s] + r[s]) * (i - j) + l[s]);
        Update(g[j+1][0] , f[j][0] + ll(l[s] + r[s]) * j + r[s]);
        Update(g[j][1] , f[j][0] + ll(goleft) * l[s] + ll(goright) * r[s]);
      }
      if(f[j][1] != inf) {
        Update(g[j][1] , f[j][1] + ll(l[s] + r[s]) * (i - 1 - j) + l[s]);
        Update(g[j+1][1] , f[j][1] + ll(l[s] + r[s]) * j + r[s]);
      }
    }
    swap(f , g);
  }
  cout << f[goleft][1] << endl;
  return 0;
}


Measured memory_bytes: 640
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007

#A
def A():
    n = II()
    a = n // 2
    b = n - a
    print(a*b)
    return

#B
def B():
    x1, y1, x2, y2 = LI()
    a = x2 - x1
    b = y2 - y1
    print(x2 - b, y2 + a, x1 - b, y1 + a)
    return

#C
def C():
    n, k = LI()
    if k % 2:
        print((n // k)** 3)
    else:
        print(int((n//k)**3 + ((n-k/2)//k+1)**3))
        
    return

#D
def D():
    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#Solve
if __name__ == '__main__':
    A()


Measured memory_bytes: 38512
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {

        Scanner scan = new Scanner(System.in);
		
      	String S = scan.next();
		String[] tenki = {"Sunny", "Cloudy", "Rainy"};

      	String rlt = "";      
      	if(S.equals(tenki[0])){
          rlt = tenki[1];
        }
        if(S.equals(tenki[1])){
          rlt = tenki[2];
        }
        if(S.equals(tenki[2])){
          rlt = tenki[0];
        }
     	System.out.println(rlt);
    }
}


Measured memory_bytes: 19796
#include "bits/stdc++.h"
#define ll long long
#define rep2(i,a,b) for(int i=(a);i<=(b);++i)
#define rep(i,n) for(int i=0;i<n;i++)
#define pii pair<int,int>
#define ti3 tuple<int,int,int>
#define pq priority_queue<int>
#define pqg priority_queue<int,vector<int>,greater<int>>
ll int MOD=1e9+7;
#define N 200000
 
using namespace std;
string alphabet("abcdefghijklmnopqrstuvwxyz");

int par[N],rrank[N];
void init(int n){
    rep(i,n){
        par[i]=i;
        rrank[i]=0;
    }
}
int root(int x){
    return par[x]==x?x:par[x]=root(par[x]);
}
bool same(int x,int y){
    return root(x)==root(y);
}
void unite(int x,int y){
    x=root(x); y=root(y);
    if(x==y)return;
    if(rrank[x]<rrank[y]){
        par[x]=y;
    }
    else{
        par[y]=x;
        if(rrank[x]==rrank[y]) rrank[x]++;
    }
}
main(){
    int n;
    vector<pii> v1,v2;
    cin>>n;
    rep(i,n){
        int a,b;
        scanf("%d %d",&a,&b);
        v1.push_back({a,i}); v2.push_back({b,i});
    }
    sort(v1.begin(),v1.end()); sort(v2.begin(),v2.end());
    vector<pair<int,pii>> v;
    rep(i,n-1){
        v.push_back({v1[i+1].first-v1[i].first,{v1[i].second,v1[i+1].second}});
        v.push_back({v2[i+1].first-v2[i].first,{v2[i].second,v2[i+1].second}});
    }
    sort(v.begin(),v.end());
    init(n+1);
    ll int ans=0; int uf=1;
    for(int i;uf<n;i++){
        int a=v[i].second.first,b=v[i].second.second;
        if(same(a,b)) continue;
        unite(a,b);
        uf++;
        ans+=v[i].first;
    }
    cout<<ans;
    return 0;
}

Measured memory_bytes: 7144
// Problem : A - Range Flip Find Route
// Contest : AtCoder - AtCoder Grand Contest 043
// URL : https://atcoder.jp/contests/agc043/tasks/agc043_a
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define db long double
#define pb push_back
#define pii pair<int,int>
#define vi vector<int>
#define vl vector<ll>
#define vii vector<pii>
#define mi map<int,int>
#define ml map<ll,ll>
#define mii map<pii,int>
#define fi first
#define se second
#define all(a) (a).begin(),(a).end()
#define sz(x) (int)x.size()
#define mod 1000000007
#define MAX 4294967295
#define EPS 1e-9
#define io ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define MAXN 15000005
#define inf 1e10
#define PI acos(-1.0)
#define int long long

int n,m,a[101][101];

signed main(){
    io;
    //freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
    cin>>n>>m;
    for(int i=1;i<=n;i++){
        for(int j=1;j<=m;j++){
            char c;
            cin>>c;
            a[i][j] = c=='.'?0:1;
        }
    }
    int dp[n+1][m+1];
    dp[1][1] = a[1][1];
    for(int i=1;i<=n;i++){
        for(int j=1;j<=m;j++){
            if(i==1 && j==1) continue;
            if(i==1) dp[i][j] = dp[i][j-1] + (a[i][j-1]?0:a[i][j]);
            else if(j==1) dp[i][j] = dp[i-1][j] + (a[i-1][j]?0:a[i][j]);
            else dp[i][j] = min(dp[i-1][j] + (a[i-1][j]?0:a[i][j]) ,dp[i][j-1] + (a[i][j-1]?0:a[i][j]));
        }
    }
    cout<<dp[n][m]<<endl;
    return 0;
}


Measured memory_bytes: 384
#include<stdio.h>
int main(void){
int a,b,c;
scanf("%d%d%d",&a,&b,&c);
if(a < b) {if(b < c) printf("%d %d %d\n",a,b,c);
else if(a > c)printf("%d %d %d\n",c,a,b);
else printf("%d %d %d\n",a,c,b);}
else if(a > c){ if(b > c) printf("%d %d %d\n",c,b,a);
else printf("%d %d %d\n",b,c,a);}
else printf("%d %d %d\n",b,a,c);
return 0;}

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

using namespace std;

#define REP(var, n)  for (decltype(n) var = 0; var < (n); var++)
#define RREP(var, n)  for (auto var = n - 1; var != static_cast<decltype(var)>(-1); var--)
#define FOR(var, a, b)  for (auto var = (a); var < (b); var++)
#define RFOR(var, a, b)  for (auto var = b - 1; var != a; var--)

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;

#define all(c) begin(c),end(c)

template<typename T>
std::ostream &operator<<(std::ostream &out, const std::vector<T> &v) {
    if (!v.empty()) {
        out << '[';
        std::copy(v.begin(), v.end(), std::ostream_iterator<T>(out, ", "));
        out << "\b\b]";
    }
    return out;
}

const int INF = 1 << 29;

int solve() {
    int N, K;
    cin >> N >> K;
    vi a(N);
    for (auto &&e: a) {
        cin >> e;
        e--;
    }

    if (K == 1) {
        return count_if(all(a), [](int e) { return e != 0; });
    }

    vi dp(N);
    copy(all(a), begin(dp));
    if (dp[0] != 0) {
        dp[0] = 0;
    }

    vi depth(N, INF);
    vector<vi> edges(N);
    REP(i, N) {
        edges[dp[i]].push_back(i);
    }
    vector<bool> ignorance(N, false);
    ignorance[0] = true;
    function<void(int, int)> dfs = [&](int n, int d) {
        depth[n] = d;
        for (auto &&e:edges[n]) {
            if (!ignorance[e])
                dfs(e, d + 1);
        }
    };
    dfs(0, 0);

    priority_queue<pair<int, int>> que;
    REP(i, N) {
        que.push(make_pair(depth[i], i));
    }
    while(!que.empty()) {
        pair<int,int> top = que.top();
        que.pop();

        int d = top.first;
        int n = top.second;

        if(d <= K) break;
        if(d > depth[n]) {
            que.push(make_pair(depth[n], n));
            continue;
        }

        REP(i, K-1) {
            n = dp[n];
        }

        dp[n] = 0;
        dfs(n, 1);
        ignorance[n] = true;
    }

    int res = 0;
    REP(i,N) {
        if(a[i] != dp[i])res++;
    }
    return res;
}


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

    cout << solve() << endl;
//    solve();
    return 0;
}


Measured memory_bytes: 14328
#include <iostream>
#include <algorithm>
#include <math.h>
#include <stdio.h>
using namespace std;

int main(){
    int a, b;
    cin>>a>>b;
    if(a==1 || a== 3 || a== 7 || a==8 || a==10 || a==12 || a==5){
        if(b==1 || b== 3 || b== 7 || b==8 || b==10 || b==12|| b ==5){
            cout<<"Yes"<<endl;
        }
        else{
            cout<<"No"<<endl;
        }
    }

    else if(a==4 || a==6 || a==9 || a== 11){
        if(b==4 || b==6 || b==9 || b== 11){
            cout<<"Yes"<<endl;
        }
        else{
            cout<<"No"<<endl;
        }
    }
    else{
        if(b==2){
            cout<<"Yes"<<endl;
        }
        else{
            cout<<"No"<<endl;
        }
    }
    return 0;
}


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

#define trace(...) __f( #__VA_ARGS__ , __VA_ARGS__ )
template <typename Arg1>
void __f( const char* name , Arg1&& arg1 ) {
        cerr << name << " : " << arg1 << "\n";
}
template <typename Arg1, typename... Args>
void __f( const char* na , Arg1&& arg1 , Args&&... args ) {
        const char* c = strchr( na + 1 , ',' );
        cerr.write( na , c - na ) << " : " << arg1 << " , ";
        __f( c + 1 , args... );
}
#define endl "\n"
#define all(V) V.begin(),V.end()
#define Unique(V) sort(all(V)),V.erase(unique(all(V)),V.end())
#define IO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
typedef long long int LL;
typedef pair <int,int> pii;
const int MOD = 1e9 + 7;
const int inf = 1e9;
const double EPS = 1e-9;
const double PI = acos(-1.0);
const long long INF = 1e18;
const int N = 1e5 + 5;

int main( ) {
        IO;
        #ifdef LOCAL
            //freopen( "input.txt" , "r" , stdin );
        #endif // LOCAL
        int n;
        cin >> n;
        string s;
        cin >> s;
        if( n%2 == 1 ) return cout << "No" << endl,0;
        string a = s.substr( 0 , n/2 );
        string b = s.substr( n/2 , n/2 );
        //cout << a << " " << b << endl;
        if( a == b ) cout << "Yes" << endl;
        else cout << "No" << endl;
        return 0;
}











Measured memory_bytes: 256
table = {
  "I" => 1,
  "V" => 5,
  "X" => 10,
  "L" => 50,
  "C" => 100,
  "D" => 500,
  "M" => 1000
}

romans = "IVXLCDM"
last_index = romans.length - 1
regexp = romans.chars.map.with_index do |roman, index|
  next if index == last_index

  "#{roman}[#{romans[(index + 1)..-1]}]"
end.compact.join('|')

while input = gets
  input.chomp!
  sum = 0

  loop do
    replaced = input.sub!(/(#{regexp})/o) do |romans|
      sum += table[romans[1]] - table[romans[0]]
      nil
    end

    break unless replaced
  end

  input.each_char do |roman|
    sum += table[roman]
  end

  puts sum
end

Measured memory_bytes: 8584
#include<bits/stdc++.h>
#define INF 2000000000
#define int long long int
#define MOD 1000000007
#define pb push_back
#define cin1(n) (cin >> n)
#define cin2(a,b) (cin >> a >> b)
#define cin3(a,b,c) (cin >> a >> b >> c)
#define cout(n) (cout << n << endl)
#define for_(i,a,b) for(int i=(a);i<(b);++i)
#define fr first 
#define sc second 
#define EPS (1e-10)

using namespace std;

typedef vector<int> vi;
typedef vector< vector<int> > vvi;
typedef vector<pair<int,int>> vpii;
typedef vector<string> vs;
typedef vector<vector<string>> vss;
typedef pair<int,int> pii;

int dx[] = {1,-1,0,0};
int dy[] = {0,0,1,-1};
int n,m;
int a,b;
int p,q;


signed main() {
	cin2(n,m);
	vs str(n);

	for_(i,0,n) {
		cin1(str[i]);
	}

	for_(i,0,m+2) {
		cout << '#';
	}
	cout << endl;

	for_(i,0,n) {
		cout << '#' << str[i] << '#' << endl;
	}

	for_(i,0,m+2) {
		cout << '#';
	}
	cout << endl;

	

	return 0;
}





Measured memory_bytes: 256
from math import gcd

N = int(input())
A = list(map(int, input().split()))

A = [0] + A + [0]

#Left side
L = [A[1]]
tempL = A[1]
for i in range(1, N):
    tempL = gcd(tempL, A[i+1])
    L.append(tempL)
L = [0] + L
    
#Right side
R = [A[-2]]
tempR = A[-2]
for i in range(1, N):
    tempR = gcd(tempR, A[-i-2])
    R.append(tempR)
R = list(reversed(R)) + [0]

ans = []
for i in range(N):
    result = gcd(L[i], R[i+1])
    ans.append(result)

print(max(ans))


Measured memory_bytes: 25364
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<iostream>
using namespace std;
char a[100010];
int main() 
{
	cin >> a;
	int x = a[strlen(a) - 1] - '0';
	if (x == 3)
	{
		cout << "bon" << endl;
	}
	else if (x == 0 || x == 1 || x == 6 || x == 8)
	{
		cout << "pon" << endl;
	}
	else
		cout << "hon" << endl;

}


Measured memory_bytes: 3632
#include <bits/stdc++.h>
#define inf INFINITY
#define file freopen( "input.txt" , "r" , stdin) ; freopen( "output.txt" , "w" , stdout) ;
#define Gamed ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define _3102_ main()
#define endl '\n'
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
using namespace std;
const int N = 1e5 + 100;
const ll MX = 1e9;
const ll mod = 1e9 + 7;
const double eps = 1e-9 ;

ll n, tot,  w[N] , v[N] , dp[150][N]  ;

ll solve( int i , int j ){
	if ( i <= 0 || j <= 0 ) return 0 ;
	ll &ret = dp[i][j] ;
	if ( ret != -1) return ret ;
	ret = solve( i - 1 , j ) ; // leave
	if ( j >= w[i]){
		ret = max ( ret , solve( i - 1 , j - w[i]) + v[i]) ;
	}
	return ret ;
}

int _3102_{
	Gamed
	cin >> n >> tot ;
	for ( int i = 1 ; i <= n ; i ++){
		cin >> w[i] >> v[i] ;
	}
	memset ( dp , -1 , sizeof dp ) ;
	cout << solve ( n , tot ) << endl ;
	return 0;
}



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


int main () {
    int H, N;
    cin >> H >> N;
    int A[N];

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

    for (int i = 0; i < N; i++) {
        H -= A[i];
    }

    cout << ((0 < H) ? "No" : "Yes") << endl;   
}



Measured memory_bytes: 640
#pragma GCC optimize("O3")
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
using namespace std;

using ll = long long;
using P = pair<int, int>;
using T = tuple<int, int, int>;

template <class T> inline T chmax(T &a, const T b) {return a = (a < b) ? b : a;}
template <class T> inline T chmin(T &a, const T b) {return a = (a > b) ? b : a;}

constexpr int MOD = 1e9 + 7;
constexpr int inf = 1e9;
constexpr long long INF = 1e18;
constexpr double pi = acos(-1);
constexpr double EPS = 1e-10;

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

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

    int h, w; cin>>h>>w;
    vector<string> a(h);
    for(int i=0; i<h; i++) cin>>a[i];

    vector<vector<char>> red(h, vector<char>(w, '.'));
    for(int i=0; i<h; i++){
        red[i][0] = '#';

        if(i % 2 == 0){
            for(int j=0; j<w-1; j++){
                red[i][j] = '#';
            }
        }
    }

    vector<vector<char>> blue(h, vector<char>(w, '.'));
    for(int i=0; i<h; i++){
        blue[i][w-1] = '#';

        if(i % 2 == 1){
            for(int j=1; j<w; j++){
                blue[i][j] = '#';
            }
        }
    }

    for(int i=0; i<h; i++){
        for(int j=0; j<w; j++){
            if(a[i][j] == '#'){
                red[i][j] = '#';
                blue[i][j] = '#';
            }
        }
    }

    for(int i=0; i<h; i++){
        for(int j=0; j<w; j++){
            cout << red[i][j];
        }
        cout << endl;
    }
    cout << endl;

    for(int i=0; i<h; i++){
        for(int j=0; j<w; j++){
            cout << blue[i][j];
        }
        cout << endl;
    }
}

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


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

int main() {
	int A, B, C, D, E, F;
	cin >> A >> B >> C >> D >> E >> F;
	double S = -1;
	int ans1 = 100 * A, ans2 = 0;
	REP(i, 100) {
		REP(j, 100) {
			REP(k, 100) {
				REP(l, 100) {
					int X = 100 * A * i + 100 * B * j;
					int Y = C * k + D * l;
					if(X * E < Y * 100) continue;
					if(X + Y > F) continue;
					if(X + Y == 0) continue;
					if(X * E >= Y * 100 && X + Y <= F && X + Y > 0) {
						double t = 100.*Y / (X + Y);
						// cout<<t<<endl;
						if(t > S) {
							ans1 = X + Y;
							ans2 = Y;
							S = t;
						}
					}
				}
			}
		}
	}
	cout << ans1 << " " << ans2 << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
#include <cstdio>
using namespace std;

#define EPS (1e-10)
#define equal(a,b) (fabs((a)-(b)) < EPS)

class Point{
public:
  double x,y;
  
  Point(double x = 0, double y = 0): x(x),y(y){}
 
  Point operator + (Point p){
    return Point( x+p.x , y+p.y );
  }
  Point operator - (Point p){
    return Point( x-p.x , y-p.y );
  }
  Point operator * (double a){
    return Point( a*x , a*y );
  }
 
  double abs(){
    return sqrt(norm());
  }
  double norm(){
    return x*x+y*y;
  }
 
  bool operator < (const Point &p)const{
    return x != p.x ? x < p.x : y < p.y;
  }
 
  bool operator == (const Point &p)const{
    return equal( x,p.x )&& equal( y,p.y );
  }
};

typedef Point Vector;
 
double dot(Vector a,Vector b){
  return a.x*b.x + a.y*b.y;
}
 
double cross(Vector a,Vector b){
  return a.x*b.y - b.x*a.y;
}
 
static const int COUNTER_CLOCKWISE = 1;
static const int CLOCKWISE = -1;
static const int ONLINE_BACK = 2;
static const int ONLINE_FRONT = -2;
static const int ON_SEGMENT = 0;
 
int ccw( Point p0 , Point p1 , Point p2 ){
  Vector a = p1 - p0;
  Vector b = p2 - p0;
  if( cross(a,b) > EPS ) return COUNTER_CLOCKWISE;
  if( cross(a,b) < -EPS ) return CLOCKWISE;
  if( dot(a,b) < -EPS ) return ONLINE_BACK;
  if( a.norm() < b.norm() ) return ONLINE_FRONT;
  return ON_SEGMENT;
}

typedef vector<Point> Polygon;

Polygon andrewScan(Polygon s){
  Polygon u,l;

  if(s.size() < 3) return s;
  sort(s.begin(),s.end());

  u.push_back(s[0]);
  u.push_back(s[1]);
  l.push_back(s[s.size()-1]);
  l.push_back(s[s.size()-2]);

  for(int i = 2 ; i < s.size() ; i++){
    for(int n = u.size() ; n >=2 && ccw(u[n-2],u[n-1],s[i]) != CLOCKWISE; n--){
      u.pop_back();
    }
    u.push_back(s[i]);
  }

  for(int i = s.size()-3 ; i >= 0 ; i--){
    for(int n = l.size() ; n >=2 && ccw(l[n-2],l[n-1],s[i]) != CLOCKWISE; n--){
      l.pop_back();
    }
    l.push_back(s[i]);
  }

  reverse(l.begin(),l.end());

  for(int i = u.size() -2 ; i >= 1 ; i--){
    l.push_back(u[i]);
  }

  return l;
}

int main(){
  int n;
 
  while(cin >> n ,n){
    Polygon pp;
    double a,b;
    for(int i = 0 ; i < n ; i++){
      scanf("%lf,%lf" ,&a,&b);
      pp.push_back(Point(a,b));
    }
    cout << n - andrewScan(pp).size() << endl;
  }

  return 0;
}

Measured memory_bytes: 1280
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define IOS ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define endl "\n"
#define REP(i,n) for(int i=0;i<n;i++)
#define REPJ(j,n) for(int j=0;j<n;j++)
#define PER(i,n) for(int i=n;i>0;i--)
#define REP1(i,n) for(int i=1;i<=n;i++)
#define REPJ1(j,n) for(int j=1;j<=n;j++)
#define ull unsigned long long int
#define ld long double
#define prec(n) fixed<<setprecision(n)
#define test ll t; cin>>t; while(t--)
#define re return 0
#define pb push_back()
int main()
{
	IOS;
//	test{
		ll n,d;
		cin>>n>>d;
        ll q=0;
        while(n--){
            ll x,y,p=0;
            cin>>x>>y;
//            p=sqrt(d-x*x);
            if(x*x+y*y<=d*d){
                q++;
            }
        }
        cout<<q<<"\n";
//	}
	re;
}


Measured memory_bytes: 3620
#include <iostream>
#include<iomanip>
#include <algorithm>
#include <vector>
#include <string>
#include <utility>
#include <queue>
#define INF 1e9+7
#define rep(i,m,n) for(int i=m;i<n;i++)
#define mrep(i,m,n) for(int i=m;i>n;i--)
#define NO cout<<"NO"<<endl;
#define YES cout << "YES"<<endl;
#define No cout << "No"<<endl;
#define Yes cout << "Yes"<<endl;
#define all(a) a.begin(),a.end()
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;


//(int)'a'は97 (int)'A'は65 (int)'1'は49
//おまじない

int main() {

	int n;
	cin >> n;

	string ans = "";

	while (n != 0) {
		if (n % 2 != 0) {
			n = n - 1;
			ans = "1" + ans;
		}
		else {
			ans = "0" + ans;
		}
		n = n / (-2);
	}
	
	if (ans == "") {
		cout << 0 << endl;
	}
	else {
		cout << ans << endl;
	}

	return 0;
}



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

#define int long long

#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,a,b) for(int i=(a);i<(b);i++)
#define pb push_back
#define eb emplace_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second

using vint=vector<int>;
using pint=pair<int,int>;
using vpint=vector<pint>;

template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

template<class A,class B>
ostream& operator<<(ostream& ost,const pair<A,B>&p){
	ost<<"{"<<p.first<<","<<p.second<<"}";
	return ost;
}

template<class T>
ostream& operator<<(ostream& ost,const vector<T>&v){
	ost<<"{";
	for(int i=0;i<v.size();i++){
		if(i)ost<<",";
		ost<<v[i];
	}
	ost<<"}";
	return ost;
}

template<uint32_t mod>
struct ModInt{
	uint32_t a;
	ModInt& s(uint32_t vv){
		a=vv<mod?vv:vv-mod;
		return *this;
	}

	ModInt(int64_t x=0){s(x%mod+mod);}

	ModInt& operator+=(const ModInt &x){return s(a+x.a);}
	ModInt& operator-=(const ModInt &x){return s(a+mod-x.a);}
	ModInt& operator*=(const ModInt &x){
		a=uint64_t(a)*x.a%mod;
		return *this;
	}
	ModInt& operator/=(const ModInt &x){
		*this*=x.inv();
		return *this;
	}

	ModInt operator+(const ModInt &x)const{return ModInt(*this)+=x;}
	ModInt operator-(const ModInt &x)const{return ModInt(*this)-=x;}
	ModInt operator*(const ModInt &x)const{return ModInt(*this)*=x;}
	ModInt operator/(const ModInt &x)const{return ModInt(*this)/=x;}
	bool operator==(const ModInt &x)const{return a==x.a;}
	bool operator!=(const ModInt &x)const{return a!=x.a;}
	bool operator<(const ModInt &x)const{return a<x.a;}

	ModInt operator-()const{return ModInt()-*this;}
	ModInt pow(int64_t n)const{
		ModInt res(1),x(*this);
		while(n){
			if(n&1)res*=x;
			x*=x;
			n>>=1;
		}
		return res;
	}

	ModInt inv()const{return pow(mod-2);}
};

template<uint32_t mod>
istream& operator>>(istream& in,ModInt<mod>& a){
	return (in>>a.a);
}
template<uint32_t mod>
ostream& operator<<(ostream& out,const ModInt<mod>& a){
	return (out<<a.a);
}
using mint=ModInt<998244353>;

int N;
int A[333];
mint dp[2][300*600+1];
signed main(){
	cin>>N;
	rep(i,N)cin>>A[i];
	
	dp[0][0]=1;
	rep(i,N){
		for(int j=0;j<=300*600;j++){
			if(dp[i&1][j]==0)continue;
			dp[(i+1)&1][j+A[i]+300]+=dp[i&1][j];
			dp[(i+1)&1][j+300-A[i]]+=dp[i&1][j]*2;
			dp[i&1][j]=0;
		}
	}

	mint ans=0;
	for(int i=N*300;i<=300*600;i++)ans+=dp[N&1][i];

	fill_n(*dp,2*(300*600+1),0);
	dp[0][0]=1;	
	rep(i,N){
		for(int j=0;j<=300*600;j++){
			if(dp[i&1][j]==0)continue;
			dp[(i+1)&1][j+A[i]+300]+=dp[i&1][j];
			dp[(i+1)&1][j+300-A[i]]+=dp[i&1][j];
			dp[i&1][j]=0;
		}
	}
	ans-=dp[N&1][N*300];


	
	ans*=3;
	ans=mint(3).pow(N)-ans;
	cout<<ans<<endl;
	return 0;
}

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

#define rep(i,a,b) for(int (i) = (a) ; (i) < (b) ; (i) ++)
#define scin(a) scanf("%d",&a);
#define scdo(a) scanf("%lf",&a);
#define scch(a) scanf("%s",a);
#define anin(a) printf("%d\n",a);
#define ando(a) printf("%lf\n",a);
#define anch(a) printf("%s\n",a);

int asc(const void *a, const void *b) {
  return *(int *)a - *(int *)b;
}

int main(void){
	int A,B,i;
	scanf("%d %d",&A,&B);
	for(i = 0 ; ; i ++){
		if(B <= A * i - (i - 1)) break ;
	}
	anin(i)
	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using Graph=vector<vector<int>>;
#define MOD 1000000007
#define INF 1000000000000

vector<int> parent;
int find(int x){
  int y=parent.at(x);
  if(y!=x){
    y=find(y);
  }
  return parent.at(x)=y;
}

void unite(int a,int b){
  int x=find(a);
  int y=find(b);
  if(x!=y){
    parent.at(x)=y;
  }
}

int main(){
  int N,M;
  cin>>N>>M;
  vector<int> p(N);
  for(int i=0;i<N;i++){
    cin>>p.at(i);
  }
  parent.resize(N);
  for(int i=0;i<N;i++){
    parent.at(i)=i;
  }
  for(int i=0;i<M;i++){
    int a,b;
    cin>>a>>b;
    a--,b--;
    unite(a,b);
  }

  int ans=0;
  for(int i=0;i<N;i++){
    if(find(p.at(i)-1)==find(i)){
      ans++;
    }
  }
  cout<<ans<<endl;
}


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

using namespace std;

int main(){
    string a[4];
    int count1 = 0;
    int count2 = 0;
    string S;
    cin >> S;
    for(int i = 1 ; i < 4; i++){
        if (S[0] == S[i]){
            count1++;
        }else{
            a[count2] = S[i];
            count2++;
        }
    }
    if(count1 == 1 and a[0] == a[1]){
        cout << "Yes";
    }else{
        cout << "No";
    }
    return 0;
}

Measured memory_bytes: 256
def partition(a, p, r):
    x = a[r]
    i = p - 1
    for j in range(p, r):
        if a[j] <= x:
            i = i + 1
            a[i], a[j] = a[j], a[i]
    a[i+1], a[r] = a[r], a[i+1]
    return i+1

n = int(input())
a = list(map(int, input().split()))
m = partition(a, 0, n-1)
a = list(map(str, a))
a[m] = "[%s]"%(a[m])
print(" ".join(a))

Measured memory_bytes: 18432
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define REPLL(i, n) for (ll i = 0; i < (ll)(n); i++)
using namespace std;
template<class T>inline bool chmax(T &a, const T &b){if(a < b){a = b; return 1;}return 0;}
template<class T>inline bool chmin(T &a, const T &b){if(a > b){a = b; return 1;}return 0;}
typedef long long ll;

// ABC147 A - Blackjack
// 2020.06.19

int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  int A1, A2, A3; cin >> A1 >> A2 >> A3;
  if(A1+A2+A3 >= 22){
    cout << "bust" << endl;
  }else{
    cout << "win" << endl;
  }
}

Measured memory_bytes: 3652