akhauriyash/Code-Regression huggingface dataset:
# include <bits/stdc++.h>
using namespace std;
struct node
{
	int a;
	int b;
}s[1000000];
bool comp (struct node t1,struct node t2)
{
	if (t1.b!=t2.b)
	  return t1.b<t2.b;
	else
	  return  t1.a>t2.a;
}
int main ()
{
  int n;
  cin>>n;
  for (int i=0;i<n;++i)
     	cin>>s[i].a>>s[i].b;
  sort(s,s+n,comp);
  long long ans=0;
  int flag=0;
  for (int i=0;i<n;++i)
     {
        ans=ans+s[i].a;
        if (ans>s[i].b)
          {
          	flag=1;
          	break;
		  }
	 }
    if (flag==0)
      printf ("Yes\n");
    else printf ("No\n");
  return 0;
} 

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

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;

#define fi first
#define se second
#define repl(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define rep(i,n) repl(i,0,n)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl
#define mmax(x,y) (x>y?x:y)
#define mmin(x,y) (x<y?x:y)
#define maxch(x,y) x=mmax(x,y)
#define minch(x,y) x=mmin(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
#define exist(x,y) (find(all(x),y)!=x.end())
#define bcnt __builtin_popcountll

#define INF 1e16
#define mod 1000000007

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

  ll N;
  cin>>N;
  vector<ll> X(N);
  rep(i,N)cin>>X[i];
  ll res=INF;
  rep(x,101){
  	ll sum=0;
  	rep(i,N){
  		sum+=pow((X[i]-x),2);
  	}
  	minch(res,sum);
  }
  cout<<res<<endl;

  return 0;
}


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

class top3hills {
public:
    top3hills();
    // top3hills(const top3hills& old);
    // ~top3hills();
    bool Run();

private:
    bool input();
    bool calc();
    void show() const;
public:
    static const int ReadMax;
    static const int ShowMax;

private:
    std::vector<int> m_mountData;   // List of mount
    std::vector<int> m_top3hills;   // List of top3 hills
};

const int top3hills::ReadMax = 10;
const int top3hills::ShowMax = 3;

top3hills::top3hills()
{

}

bool top3hills::Run()
{
    bool status = false;

    status = input();
    if (!status) {
        std::cerr << "input falure." << std::endl;
    }
    status = calc();
    if (!status) {
        std::cerr << "calc failure." << std::endl;
    }
    show();

    return true;
}

bool top3hills::input()
{
    int mountData = 0;

    for (int i = 0; i < ReadMax; ++i) {
        if (ReadMax <= i || ReadMax < m_mountData.size()) {
            return false;
        }
        std::cin >> mountData;
        m_mountData.push_back(mountData);
    }

    return true;
}

bool top3hills::calc()
{
    // Sort mount data
    std::sort(m_mountData.begin(), m_mountData.end());

    // Reverse mount data
    std::reverse(m_mountData.begin(), m_mountData.end());

    for (int i = 0; i < ShowMax; ++i) {
        if (ShowMax <= i || ShowMax < m_top3hills.size()) {
            return false;
        }
        m_top3hills.push_back(m_mountData.at(i));
    }

    return true;
}

void top3hills::show() const
{
    for (int i = 0; i < ShowMax; ++i) {
        std::cout << m_top3hills.at(i) << std::endl;
    }
}

int main()
{
    top3hills top3;
    top3.Run();
}

Measured memory_bytes: 3144
#define _CRT_SECURE_NO_WARNINGS
#pragma comment(linker, "/stack:16777216")
#include <string>
#include <vector>
#include <map>
#include <list>
#include <iterator>
#include <set>
#include <queue>
#include <iostream>
#include <sstream>
#include <stack>
#include <deque>
#include <cmath>
#include <memory.h>
#include <cstdlib>
#include <cstdio>
#include <cctype>
#include <algorithm>
#include <utility>
#include <time.h>

#include <fstream>
#include <sys/stat.h>
#include <stdlib.h>
#include <stdio.h>
using namespace std;

#define FOR(i, a, b) for(int i=(a);i<(b);i++)
#define RFOR(i, b, a) for(int i=(b)-1;i>=(a);--i)
#define FILL(A,value) memset(A,value,sizeof(A))
#define ALL(V) V.begin(), V.end()
#define SZ(V) (int)V.size()
#define PB push_back
#define MP make_pair
#define Pi 3.14159265358979

typedef long long Int;
typedef unsigned long long UInt;
typedef vector<int> VI;
typedef pair<int, int> PII;

const int INF = 1000000000;
const int MAX = 107;
const int MAX2 = 507;
const int MAXD = 20;
const int BASE = 1000000007;
const int MOD = 1000000007;



int main()
{
    //freopen("in.txt", "r" , stdin);

    string s;

    cin >> s;
    int n = SZ(s);

    int bal = 0;
    int res = 0;

    FOR(i,0,n)
    {
        if (s[i] == 'p')
        {
            if (bal > 0)
            {
                -- bal;
            }
            else
            {
                -- res;
                ++ bal;
            }
        }
        else
        {
            if (bal > 0)
            {
                ++ res;
                -- bal;
            }
            else
            {
                ++ bal;
            }

        }
    }

    cout << res << endl;

    return 0;
}


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

ans = 0

for i in range(1, n - 1):
    if A[i - 1] > A[i] > A[i + 1] or A[i - 1] < A[i] < A[i + 1]:
        ans = ans + 1

print(ans)

Measured memory_bytes: 3060
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
#include <string>
#include <cmath>
#include <queue>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
const int INF = 1<<29;
const double EPS = 1e-8;

typedef complex<double> P;

pair<P, P> circle_circle_intersect(const P& c1, const double& r1, const P& c2, const double& r2) {
  P A = conj(c2-c1), B = (r2*r2-r1*r1-(c2-c1)*conj(c2-c1)), C = r1*r1*(c2-c1);
  P D = B*B-4.0*A*C;
  P z1 = (-B+sqrt(D))/(2.0*A)+c1, z2 = (-B-sqrt(D))/(2.0*A)+c1;
  return pair<P,P>(z1, z2);
}
int main() {
  int n;
  while(scanf("%d",&n), n) {
    if (n<=0) {
      cout << 0 << endl;
      continue;
    }
    P points[n];
    REP(i,n) {
      double x,y;
      scanf("%lf,%lf", &x, &y);
      points[i] = P(x,y);
    }
    vector<P> v;
    REP(i, n-1) {
      for(int j=i+1; j<n; ++j) {
        P p = points[i];
        P q = points[j];

        if (abs(p-q) <= EPS) {
          v.push_back(p+P(1,0));
        } else if (abs(p-q) <= 2 + EPS) {
          pair<P,P> ppp = circle_circle_intersect(p,1,q,1);
          v.push_back(ppp.first);
          v.push_back(ppp.second);
        }
      }
    }
    int res = 1;
    FOR(it, v) {
      int tmp = 0;
//      cout << *it << endl;
      REP(i,n)
        if (abs((*it) - points[i]) <= 1 + EPS) ++tmp;
      res = max(res, tmp);
    }
    cout << res << endl;
  }
}

Measured memory_bytes: 0
n = int(input())
A = [int(i) for i in input().split()]

cnt = 0

flag = 0
while flag != 1:
    for i, a_num in enumerate(A):
        if a_num % 2 == 1:
            flag = 1
            break
        else:
            A[i] = a_num/2
    if flag == 0: cnt += 1

print(cnt)

Measured memory_bytes: 3060
#include <iostream>
#include <iomanip>
#include <cmath>
#include <vector>
#include <string>
#include <limits>
#include <utility>
#include <algorithm>

int main(int argc, char *argv[])
{
    int n;

    std::cin >> n;
    std::vector<int> count(n, 0);

    for (int i = 1; i < n; i++) {
        int a;
        std::cin >> a;
        a--;
        count[a]++;
    }

    for (int i = 0; i < n; i++) {
        std::cout << count[i] << std::endl;
    }

    return 0;
}


Measured memory_bytes: 4052
#include<bits/stdc++.h>
using namespace std;
using Int = long long;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}


struct FastIO{
  FastIO(){
    cin.tie(0);
    ios::sync_with_stdio(0);
  }
}fastio_beet;

//INSERT ABOVE HERE
signed main(){
  const Int MAX = 2e5+100;
  vector<Int> dp(MAX,0);
  dp[0]=1;
  for(Int k=100;k<=105;k++)
    for(Int i=0;i+k<MAX;i++) dp[i+k]|=dp[i];
  Int x;
  cin>>x;
  cout<<dp[x]<<endl;
  return 0;
}


Measured memory_bytes: 1792
from itertools import product

cards = list(map(int, input().split()))
k = int(input())

seed = [0,1,2]
lists = []

cnt = 0

for _ in range(k):
  lists.append(seed)
  
for pattern in product(*lists):
  tmp_cards = cards.copy()
  flag = True
  for choise in pattern:
    tmp_cards[choise]*=2
  if (tmp_cards[1] > tmp_cards[0]) and (tmp_cards[2] > tmp_cards[1]):
    cnt+=1

if cnt==0:
  print('No')
else:
  print('Yes')

Measured memory_bytes: 9200
X, Y = map(int, input().split())
mod = 10**9 + 7


def permute(n, m):
    ret = 1
    while n >= m:
        ret *= n
        # ret %= mod
        n -= 1

    return ret


def count_combinations(n, m):
    fact = [1] * (n + 1)
    inv = [i for i in range(n+1)]
    fact_inv = [1] * (n + 1)

    for i in range(2, n+1):
        fact[i] = fact[i-1] * i % mod
        inv[i] = (-inv[mod%i]*(mod//i))%mod
        # inv[i] = mod - inv[mod % i] * (mod // i) % mod
        fact_inv[i] = fact_inv[i-1] * inv[i] % mod

    ret = (fact[n] * fact_inv[m] * fact_inv[n-m]) % mod

    return ret


def count_comb2(n, m):
    fact = [1, 1]  # fact[n] = (n! mod p)
    factinv = [1, 1]  # factinv[n] = ((n!)^(-1) mod p)
    inv = [0, 1]  # factinv 計算用

    for i in range(2, n + 1):
        fact.append((fact[-1] * i) % mod)
        inv.append((-inv[mod % i] * (mod // i)) % mod)
        factinv.append((factinv[-1] * inv[-1]) % mod)

    if (m < 0) or (n < m):
        return 0
    m = min(m, n - m)
    return fact[n] * factinv[m] * factinv[n-m] % mod

ret = 0
if (X+Y)%3 == 0:
    m = (2*X - Y) // 3
    n = (2*Y - X) // 3

    if m >= 0 and n >= 0:
        ret = count_combinations(n+m, m)
        # ret = count_comb2(n+m, m)

print(ret)


Measured memory_bytes: 88028
#define __mode_debug__
/*   ξ
     ll
   ＿ll＿
 ／  ∞  ＼
│*  Ａ  *│
│*  Ｃ  *│
│*  祈  *│
│*  願  *│
│*      *│
 ￣￣￣￣￣    */
//C++14 (GCC 5.4.1)
#include <bits/stdc++.h>
using namespace std;
#ifdef __mode_debug__
    #define DBG
#else
    #define DBG if(false)
#endif

#define LLINF (1LL<<60)
using ll = long long;
#define mod  1000000007

#define whole(a) (a).begin(),(a).end()
#define rwhole(a) (a).rbegin(),(a).rend()

#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
#define rrepd(i,a,b) for(int i=(a);i>=(b);i--)
#define each(itr,ds) for(auto itr=(ds).begin();itr!=(ds).end();itr++)

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

template < typename T > inline string toString( const T &a ) { ostringstream oss; oss << a; return oss.str(); }

//DUMP
//  ostream vector<T> , vector<vector<T>> , set<T> ,queue<T> , priority_queue<T> , pair<T,U> , map<T,U>
template<class T> ostream& operator<<(ostream&os,vector<T>&vec){os<<"{ ";rep(i,vec.size()) os<<((i==0)?"":", ")<<i<<":"<<vec[i];os<<" }";return os;}
template<class T> ostream& operator<<(ostream&os,vector<vector<T>>&vec){os<<"{"<<endl;rep(i,vec.size())os<<"\t   "<<i<<":"<<vec[i]<<((i==vec.size()-1)? "":",")<<endl;os<<"\t }";return os;}
template<class T> ostream& operator<<(ostream&os,set<T>&p){os<<"{ ";each(itr,p)  os<<((itr==p.begin())?"":", ")<<*itr;os<<" }";return os;}
template<class T> ostream& operator<<(ostream&os,queue<T>&p){queue<T> q(p);os<<"[< "<<(q.empty()?" <]":"");while(!q.empty()){os<<q.front();q.pop();os<< (q.empty() ? " <]" : ", ");}return os;}
template<class T> ostream& operator<<(ostream&os,priority_queue<T>&p){priority_queue<T> q(p);os<<"[< "<<(q.empty()?" <]":"");while(!q.empty()){os<<q.top();q.pop();os<< (q.empty() ? " <]" : ", ");}return os;}
template<class T,class U> ostream& operator<<(ostream&os,pair<T,U>&p){os<<"("<<p.first<<","<<p.second<<")";return os;}
template<class T,class U> ostream& operator<<(ostream&os,map<T,U>&p){os<<"{ ";each(itr,p)os<<((itr==p.begin())?"":", ")<<itr->first<<":"<<itr->second;os<<" }";return os;}
void dump_f(string &nm,char t){cerr<<endl;}
template<class T,class... Ts> void dump_f(string &nm,char t,T &&x,Ts&&... ts){int l=nm.find_first_of(',');string name(nm,0,l),nx(nm,l+1,-1);if(t=='\n') cerr<<"  "<<name<<"\t: "<<x<<t;else cerr << name<<": "<<x<<","<<t;dump_f(nx,t,forward<Ts>(ts)...);}
template<class... Ts> void dump_m(int &&ln,string &&nm,char t,Ts&&... ts){cerr<<"[ln: "<<ln<<"]"<<t;dump_f(nm,t,forward<Ts>(ts)...);}
#define dump(...) DBG dump_m(__LINE__,#__VA_ARGS__,'\n',__VA_ARGS__)
#define dl(...) DBG dump_m(__LINE__,#__VA_ARGS__,'\t',__VA_ARGS__)

#define lower_bound_idx(V,c) distance(V.begin(),lower_bound(whole(V),c))

int main() {
    ios::sync_with_stdio(false);//stdout<=>cout
    cin.tie(nullptr);//cin<=>cout


    double L,ans;
    cin>>L;
    ans=L*L*L/27;
    

    printf("%.9f\n",ans);

    return (0);
}

Measured memory_bytes: 256
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// using namespace __gnu_pbds;
// gp_hash_table<int, int> mapka;

using namespace std;
#define PB push_back
#define MP make_pair
#define LL long long
#define int LL
#define FOR(i,a,b) for(int i = (a); i <= (b); i++)
#define RE(i,n) FOR(i,1,n)
#define REP(i,n) FOR(i,0,(int)(n)-1)
#define R(i,n) REP(i,n)
#define VI vector<int>
#define PII pair<int,int>
#define LD long double
#define FI first
#define SE second
#define st FI
#define nd SE
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())

template<class C> void mini(C &a4, C b4) { a4 = min(a4, b4); }
template<class C> void maxi(C &a4, C b4) { a4 = max(a4, b4); }

template<class TH> void _dbg(const char *sdbg, TH h){ cerr<<sdbg<<'='<<h<<endl; }
template<class TH, class... TA> void _dbg(const char *sdbg, TH h, TA... a) {
  while(*sdbg!=',')cerr<<*sdbg++;
  cerr<<'='<<h<<','; _dbg(sdbg+1, a...);
}

template<class T> ostream &operator<<(ostream& os, vector<T> V) {
  os << "["; for (auto vv : V) os << vv << ","; return os << "]";
}
template<class L, class R> ostream &operator<<(ostream &os, pair<L,R> P) {
  return os << "(" << P.st << "," << P.nd << ")";
}

#ifdef LOCAL
#define debug(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
#else
#define debug(...) (__VA_ARGS__)
#define cerr if(0)cout
#endif

const int MAX = 1001;
int n,m;
string s[MAX];

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

bool vis[MAX][MAX];

int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout << fixed << setprecision(11);
  cerr << fixed << setprecision(6);
  cin >> n >> m;
  vector<PII> s1,s2;
  auto add = [&](int x,int y){
    if(x >= 0 && x < n && y >= 0 && y < m && !vis[x][y]){
      vis[x][y] = 1;
      s2.PB({x,y});
    }
  };
  R(i,n){
    cin >> s[i];
    R(j,m){
      if(s[i][j] == '#'){
        add(i,j);
      }
    }
  }
  int res = 0;
  while(!s2.empty()){
    swap(s1,s2);
    s2.clear();
    res ++;
    debug("-------");
    for(PII el:s1){
      debug(el);
      R(k,4){
        add(el.FI + dx[k], el.SE + dy[k]);
      }
    }
  }
  cout << res - 1 << "\n";
}


Measured memory_bytes: 26852
# 無向グラフ
class Graph
  attr_accessor *(?a..?z).to_a.map(&:to_sym)
  def initialize(n,pairs)
    @n = n
    @g = Array.new(n){ [] }
    pairs.each do |a,b|
      g[a] << b
      g[b] << a
    end
  end

  def [](v)
    g[v]
  end
end

# 有向グラフ
class DiGraph < Graph
  def initialize(n,pairs,root)
    super(n,pairs)
    @root = root
    @h = @g.dup
    @g = Array.new(n){ [] }
    seen = Array.new(n, false)
    que = [root]
    seen[root] = true
    while que.size > 0
      v = que.shift
      h[v].each do |nv|
        next if seen[nv]
        seen[nv] = true
        g[v] << nv
        que << nv
      end
    end
  end

  def dist
    ans = Array.new(n,nil)
    que = [[@root,0]]
    while que.size > 0
      v, depth = que.shift
      ans[v] = depth
      g[v].each do |nv|
        que << [nv, depth+1]
      end
    end
    ans
  end
end

class Problem
  attr_accessor *(?a..?z).to_a.map(&:to_sym)
  def initialize
    @n = gets.to_s.to_i
    @p = Array.new(n-1){ gets.split.map(&:to_i).map{ _1 - 1 } }
  end

  def solve
    fe = DiGraph.new(n,p,0)
    su = DiGraph.new(n,p,n-1)
    rank = fe.dist.zip(su.dist)
    cnt = rank.count{|i,j| i <= j}

    n < cnt * 2
  end

  def show(ans)
    puts ans ? "Fennec" : "Snuke"
  end
end

Problem.new.instance_eval do
  show(solve)
end

Measured memory_bytes: 59760
#include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define inv100 pow_log(100,mod-2)
int n,a,b,c;
long long fact[200005],inv[200005];
long long pow_log(long long x,int y)
{
	if (!y)
	return 1;
	long long ret=pow_log(x,y/2);
	ret=(ret*ret)%mod;
	if (y%2)
	ret=(ret*x)%mod;
	return ret;
}
long long ncr(int n,int r)
{
	return ((fact[n]*inv[r])%mod*inv[n-r])%mod;
}
long long go(int i)
{
	return ((ncr(i-1,n-1)*pow_log(a,n))%mod*pow_log(b,i-n))%mod;
}
int main()
{
	scanf("%d%d%d%d",&n,&a,&b,&c);
	fact[0]=1;
	inv[0]=1;
	for (int i=1;i<2*n;i++)
	{
		fact[i]=(i*fact[i-1])%mod;
		inv[i]=pow_log(fact[i],mod-2);
	}
	a=(a*inv100)%mod;
	b=(b*inv100)%mod;
	c=(c*inv100)%mod;
	long long tmp=pow_log(a+b,mod-2);
	a=(a*tmp)%mod;
	b=(b*tmp)%mod;
	long long nom=0,den=0;
	for (int i=n;i<2*n;i++)
	{
		long long tmp=go(i);
		swap(a,b);
		tmp=(tmp+go(i))%mod;
		swap(a,b);
		nom=(nom+i*tmp)%mod;
		den=(den+tmp)%mod;
	}
	printf("%lld",(nom*pow_log(den*(1-c+mod)%mod,mod-2))%mod);
}

Measured memory_bytes: 6884
import scala.io.StdIn.readLine
import scala.collection.mutable.ArrayBuffer

object Main {
  val daysOfMonth = List(31,29,31,30,31,30,31,31,30,31,30,31)
  val days = Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")

  def getDays(sb:StringBuilder):Unit = {
    val r = readLine.split(" ").map(_.toInt)

    if(r(0)==0 && r(1)==0) print(sb.result)
    else {
      sb.append(days((daysOfMonth.take(r(0)-1).sum + r(1) + 3) % 7) + "\n")
      getDays(sb)
    }
  }

  def main(args:Array[String]) = getDays(new StringBuilder)
}

Measured memory_bytes: 43664
#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <vector>
#include <string>
#include <algorithm>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <limits>
#include <random>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <tuple>
using namespace std;
#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
typedef long long ll;
template <class T> using reversed_priority_queue = priority_queue<T, vector<T>, greater<T> >;

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

    ll ans = 0;
    for (ll A = 1; A <= N; A++) {
        for (ll B = 1; A * B <= N - 1; B++) {
            ans++;
        }
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 3632
import static java.lang.Math.pow;

import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.Scanner;

public class Main {
private static final int A = 0, B = 1, C = 2;
private static final int X = 0;
private static final int Y = 1;

public static void main(String[] args)
{
	Scanner in = new Scanner(System.in);
	for (int i = 0, last = in.nextInt(); i < last; i++) {
		double ax = in.nextDouble();
		double ay = in.nextDouble();
		double bx = in.nextDouble();
		double by = in.nextDouble();
		double cx = in.nextDouble();
		double cy = in.nextDouble();
		double ax2 = pow(ax, 2);
		double ay2 = pow(ay, 2);
		double bx2 = pow(bx, 2);
		double by2 = pow(by, 2);
		double cx2 = pow(cx, 2);
		double cy2 = pow(cy, 2);
		double x_ba = bx - ax;
		double x_ca = cx - ax;
		double y_ba = by - ay;
		double y_ca = cy - ay;
		double x = (
		        (y_ba * (ax2 + ay2 - cx2 - cy2)
		        - y_ca * (ay2 - by2 - bx2 + ax2))
		        / (x_ba * y_ca - x_ca * y_ba)
		        ) / 2;
		double y = (
		        (x_ca * (+ay2 - by2 - bx2 + ax2)
		        - x_ba * (ax2 + ay2 - cx2 - cy2))
		        / (x_ba * y_ca - x_ca * y_ba)) / 2;
		double r = Math
		        .sqrt(pow(x - ax, 2) + pow(y - ay, 2));
		NumberFormat format = DecimalFormat.getInstance();
		format.setMaximumFractionDigits(3);
		format.setMinimumFractionDigits(3);
		System.out.println(format.format(x) + " " + format
		        .format(y) + " " + format.format(r));

	}
}
}

Measured memory_bytes: 0
#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define SZ(x) ((int)x.size())
#define L(i,u) for (register int i=head[u]; i; i=nxt[i])
#define rep(i,a,b) for (register int i=(a); i<=(b); i++)
#define per(i,a,b) for (register int i=(a); i>=(b); i--)
using namespace std;
typedef long long ll;
typedef unsigned int ui;
typedef pair<int,int> Pii;
typedef vector<int> Vi;
inline void read(int &x) {
	x=0; char c=getchar(); int f=1;
	while (!isdigit(c)) {if (c=='-') f=-1; c=getchar();}
	while (isdigit(c)) {x=x*10+c-'0'; c=getchar();} x*=f;
}
inline ui R() {
	static ui seed=416;
	return seed^=seed>>5,seed^=seed<<17,seed^=seed>>13;
}
const int N = 5555;
char s[N];int n,res=555;bool a[N];
int main() {
	scanf("%s",s+1);n=strlen(s+1);
	rep(c,0,25){
		rep(i,1,n)a[i]=s[i]=='a'+c;
		for(int t=0;t<n;t++){
			bool ok=1;rep(i,1,n-t)ok&=a[i];
			if(ok){res=min(res,t);break;}
			rep(i,1,n)a[i]|=a[i+1];
		}
	}
	cout<<res;
	return 0;
}


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

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


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	private static int[][] paper = new int[10][10];

	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in), 64);
		String sLine;
		while ((sLine = reader.readLine()) != null) {
			droppingInk(sLine.charAt(0) & 0x0F, sLine.charAt(2) & 0x0F, sLine.charAt(4) & 0x0F);
		}
		calcResult();
	}

	private static void droppingInk(int x, int y, int size) {
		staining(x, y - 1);
		staining(x - 1, y);
		staining(x, y);
		staining(x + 1, y);
		staining(x, y + 1);
		if (size == 1) {
			return;
		}

		staining(x - 1, y - 1);
		staining(x + 1, y - 1);
		staining(x - 1, y + 1);
		staining(x + 1, y + 1);
		if (size == 2) {
			return;
		}

		staining(x, y - 2);
		staining(x - 2, y);
		staining(x + 2, y);
		staining(x, y + 2);
	}

	private static void staining(int x, int y) {
		if (x >= 0 && x < 10 && y >= 0 && y < 10) {
			paper[x][y]++;
		}
	}

	private static void calcResult() {
		int white = 0;
		int maxnoud = 0;
		for (int[] row : paper) {
			for (int colum : row) {
				if (colum == 0) {
					white++;
				} else if (colum > maxnoud) {
					maxnoud = colum;
				}
			}
		}
		System.out.println(white);
		System.out.println(maxnoud);
	}
}

Measured memory_bytes: 16848
#include <bits/stdc++.h>
#define F first
#define S second
#define ll long long
#define ld long double
#define pb push_back
#define sz size

using namespace std;

string s;

int x;

int main()
{
    cin >> s;
    x+=s[5]-'0';
    x*=10;
    x+=s[6]-'0';
    if (x<=4)
    {
        cout << "Heisei\n";
    }
    else cout << "TBD\n";
    return 0;
}


Measured memory_bytes: 256
import sys

N,M=map(int,input().split())

x=[-1]*N
valid=True
for _ in range(M):
    s,c=map(int,input().split())
    if x[s-1]!=-1 and x[s-1]!=c:
        print(-1)
        sys.exit()
    x[s-1]=c

if N>1 and x[0]==0:
    print(-1)
else:
    ans=0
    for i in range(N):
        if x[i]==-1:
            if i>0 or N==1:
                x[i]=0
            else:
                x[i]=1
        ans=ans*10+x[i]
    print(ans)


Measured memory_bytes: 61900
// dile a la jardinera que traigo flores
 
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
#define pb push_back
#define ff first
#define ss second
#define tm1 ff
#define tm2 ss.ff
#define tm3 ss.ss
#define sz(x) int(x.size())
#define fill(x,v) memset(x,v,sizeof(x))
#define all(v) (v).begin(),(v).end()
#define FER(i,a,b) for(ll i = ll(a); i < ll(b); ++i)
#define IFR(i,a,b) for(ll i = ll(a); i >= ll(b); i--)
#define fastio ios_base::sync_with_stdio(0);cin.tie(0)
#define N 100005
#define M 27
#define N1 150005
#define N2 200005
#define MAXN 4353546332
//#define mod 1000000007
using namespace std;
typedef int ll;
typedef pair<ll,ll> ii;
typedef pair<ll, ii> tri;
typedef vector<ll> vi;
typedef vector<ii> vii;
 
 
#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << endl;}
 
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1<<" | ";
  __f(comma+1, args...);}
#else
#define trace(...)
#endif

int main(){
  fastio;
  ll n; cin>>n;
  map<string, ll> m;
  char last;ll flag=1;
  FER(i,0,n){
    string s; cin>>s;
    m[s]++;
    if(i==0) last=s[sz(s)-1];
    else {
      if(last!=s[0] || m[s]>1) {flag=0; break;}
      else last=s[sz(s)-1];
    }
  }
  flag? cout<<"Yes"<<"\n":cout<<"No"<<"\n";
  return 0;
}

Measured memory_bytes: 256
N = int(input())
X_list = list(map(int, input().split()))

X_list_min = sorted(X_list)

for i in range(N):
    if X_list_min[N//2-1] >= X_list[i]:
        print(X_list_min[N//2])
    else:
        print(X_list_min[N//2-1])

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

#define fio ios_base::sync_with_stdio(false);cin.tie(NULL)
// #define int long long 

using namespace std;

int32_t main()
{
	fio;
	int n,m;
	cin>>n>>m;
	int sum=0;
	for(int i=0;i<m;i++)
	{
		int a;
		cin>>a;
		sum+=a;
	}

	sum=n-sum;
	if(sum>=0)
	{
		cout<<sum<<endl;
	}
	else
	{
		cout<<-1<<endl;
	}
	return 0;
}

Measured memory_bytes: 3660
N = int(input().split()[0])
b_list = list(map(int, input().split()))

a_list = []

for i in range(N):
    if i == 0:
        a = b_list[0]
        a_list.append(a)
        continue
    if i == N - 1:
        a = b_list[i-1]
        a_list.append(a)
        continue

    # BiとBi-1以下である必要がある
    a = min(b_list[i-1], b_list[i])
    a_list.append(a)

ans = sum(a_list)
print(ans)


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

#define pb push_back
#define ll long long int
#define mpi map<int, int>
#define vi vector<int>
#define qi queue<int>
#define si set<int>
#define pii pair<int, int>
#define vpi vector<pii>
#define vs vector<string>
#define pri priority_queue<int>
#define mp make_pair
#define ff first
#define ss second
#define mod 1000000007
#define For(i, n) for (int i = 0; i < n; i++)
#define Ford(i, a, b) for (int i = a; i >= b; i--)
#define Rep(i, x, y) for (int i = x; i <= y; i++)
#define mem(a, b) memset(a, b, sizeof(a))
#define fastio                    \
    ios_base::sync_with_stdio(0); \
    cin.tie(0);                   \
    cout.tie(0)

double tick()
{
    static clock_t oldt, newt = clock();
    double diff = 1.0 * (newt - oldt) / CLOCKS_PER_SEC;
    oldt = newt;
    return diff;
}

ll fastExpo(ll a, ll n)
{
    ll res = 1;
    while (n)
    {
        if (n % 2)
            res = res * a;
        n /= 2;
        a = a * a;
    }
    return res;
}

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

int main()
{
    int n, c = 0;
    cin >> n;

    vi a(n);
    mpi m;

    For(i, n)
    {
        cin >> a[i];
        m[a[i]]++;
    }

    For(i, n)
    {
        m[a[i]]--;
        int f = 0;
        for (int j = 1; j * j <= a[i]; j++)
        {
            if (a[i] % j == 0)

            {
                if (m[j] != 0)
                {
                    f = 1;
                    break;
                }

                if (a[i] / j != j)
                {
                    if (m[a[i] / j] != 0)

                    {
                        f = 1;
                        break;
                    }
                }
            }
        }
        if (!f)
            c++;
        m[a[i]]++;
    }
    cout << c << endl;
    cerr << "execution time is: " << tick() << "\n";
}


Measured memory_bytes: 32896
#include "bits/stdc++.h"
#include "ext/pb_ds/assoc_container.hpp"
#include "ext/pb_ds/tree_policy.hpp"

using namespace std;
using namespace __gnu_pbds;

template <typename T> using order_set = tree <T, null_type, less <T>, rb_tree_tag, tree_order_statistics_node_update>;

#define ll         long long int
#define endl       '\n'
#define pii        pair <int, int>
#define mk         make_pair

static const int maxn = 3e5 + 5;
static const int logn = 19;

signed main()
{
      ios_base::sync_with_stdio(false);
      cin.tie(nullptr);

      int n, m;
      cin >> n >> m;
      vector <int> h(n + 1);
      for (int i = 1; i <= n; i++) {
            cin >> h[i];
      }
      vector < vector <int> > graph(n + 1);
      for (int e = 1; e <= m; e++) {
            int u, v;
            cin >> u >> v;
            graph[u].push_back(v);
            graph[v].push_back(u);
      }
      int ans = 0;
      for (int i = 1; i <= n; i++) {
            int maxi = 0;
            for (int j : graph[i]) {
                  maxi = max(maxi, h[j]);
            }
            if (h[i] > maxi) {
                  ans++;
            }
      }
      cout << ans << endl;
}


Measured memory_bytes: 8704
n, k = gets.split.map &:to_i
h = []

n.times{ 
	h << gets.to_i
}

h = h.sort

min = Float::INFINITY

(0...h.size - k + 1).each{ |i|
	diff = h[i + k - 1] - h[i]
	if diff < min then
		min = diff
	end
}

puts min


Measured memory_bytes: 4528
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int a[55];
ll d[2510], c[2510], w[55], u[55];
int main()
{
	int n, m;
	
	scanf("%d%d", &n, &m);
	for (int i = 0; i < n; i++) {
		scanf("%d", &a[i]);
	}
	sort(a, a + n);
	
	int s = 0;
	for (int i = 0; i < n; i++) {
		if (a[i] == m) s++;
	}
	int i;
	d[0] = 1;
	for (i = 0; a[i] < m && i < n; i++) {
		for (int j = 2500; j >= m - a[i]; j--) {
			if (d[j - m + a[i]]) {
				d[j] += d[j - m + a[i]];
			}
		}
	}
	
	for (; a[i] == m && i < n; i++) {
		;
	}
	c[0] = 1;
	for (; a[i] > m && i < n; i++) {
		for (int j = 2500; j >= a[i] - m; j--) {
			if (c[j - a[i] + m]) {
				c[j] += c[j - a[i] + m];
			}
		}
	}
	ll ans = 0;
	for (int i = 1; i <= 2500; i++) {
		ans = ans + d[i] * c[i];
	}
//	printf("%d %d %d %d %d\n", s, d[1], c[1], c[2], ans);
	ll p = (1ll << s);
	ans = ans * p;
	ans += p - 1;
	printf("%lld\n", ans);
}

Measured memory_bytes: 256
alist = []
for i in range(28):
    a = int(input())
    alist.append(a)
x = sorted(alist)
s=0
for i in range(29):
    if x[s]==i+1:
        s+=1
    else :
        print(i+1)

if x[27]!=30:
    print(30)


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

#define rep2(x,fr,to) for(int x=(fr);x<(to);x++)
#define rep(x,to) for(int x=0;x<(to);x++)
#define repr(x,fr,to) for(int x=(fr);x>=(to);x--)
#define all(c) c.begin(),c.end()
#define sz(v) (int)v.size()

using namespace std;
typedef long long ll; typedef vector<int> VI; typedef pair<int,int> pii;
typedef vector<ll> VL; const int MD = 1e9 + 7;
void dbg(){ cerr << "\n"; } template <typename T,typename ...T2> void dbg(const T& fst, const T2&...rst){ cerr << fst << ": "; dbg(rst...); }

const double PI = acos(-1);
int main()
{
	cin.tie(0); ios_base::sync_with_stdio(false);
	ll a, b;
	cin >>a >>b;
	
	auto f=[](ll z){
		VL rt;
		for(ll i=1; i*i<=z; i++){
			if(z%i) continue;
			rt.push_back(i);
			if(i*i != z) rt.push_back(z/i);
		}
		sort(all(rt));
		return rt;
	};
		

	auto ya = f(a);
	auto yb = f(b);
	int ans = 0;
	for(auto x: ya){
		auto w = f(x);
		if(binary_search(all(yb), x) && sz(w)==2) ans++;
	}
	cout << ans +1 <<"\n";
	return 0;
	
}


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

class Solution
{
    static int h;
    static int w;

    static int Count(char[][] field, int x, int y)
    {
        int count = 0;
        for (int xx = x - 1; xx <= x + 1; xx++)
        {
            for (int yy = y - 1; yy <= y + 1; yy++)
            {
                if (0 <= xx && xx < w && 0 <= yy && yy < h)
                {
                    if (field[yy][xx] == '#')
                    {
                        count++;
                    }
                }
            }
        }
        return count;
    }

    static void Solve(char[][] field)
    {
        for (int y = 0; y < h; y++)
        {
            for (int x = 0; x < w; x++)
            {
                if (field[y][x] == '.')
                {
                    var count = Count(field, x, y);
                    field[y][x] = count.ToString()[0];
                }
            }
        }
    }

    static void Main()
    {
        var vals = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
        h = vals[0];
        w = vals[1];

        var field = new char[h][];
        for (int i = 0; i < h; i++)
        {
            field[i] = Console.ReadLine().ToCharArray();
        }
        Solve(field);

        for (int i = 0; i < h; i++)
        {
            Console.WriteLine(new string(field[i]));
        }
    }
}

Measured memory_bytes: 13396
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

def main():
    N = int(input())
    cnt = 0
    for i in range(1, N+1):
        if i % 3 != 0 and i % 5 != 0:
            cnt += i
    print(cnt)
    return

if __name__ == '__main__':
    main()



Measured memory_bytes: 9168
#include <iostream>
#include <stdio.h>

#include <vector>
#include <cctype>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <string>

using namespace std;

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

	int ans=1;
	int count=0;
	for (int i = 1; i <= n; i++) {
		int number = i;
		int count1 = 0;
		while (number % 2 == 0) {
			count1++;
			number = number / 2;
		}

		if (count < count1) {
			count = count1;
			ans = i;
		}
	}
	
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<vector>
#include<functional>
#include<iomanip>
#include<queue>
#include<cassert>
#include<tuple>
#include<set>
#include<map>
#include<list>
#include<bitset>
#include<utility>
#include<numeric>

#define PB push_back
#define all(a)  (a).begin(),(a).end()
#define ALL(v) begin(v), end(v)
#define DWN(a)  (a).begin(),(a).end(), greater<int>()
#define rep(i, m) for (int i = 0; i < m; i++)
#define REP(i, n, m) for (int i = n; i < m; i++)
#define V vector<int>
#define VV vector<V>
#define VVV vector<VV>

using namespace std;

typedef long long ll;
typedef pair<int, int> P;

const int dx[4] = { 1, 0, -1, 0 };
const int dy[4] = { 0, 1, 0, -1 };
const int inf = (int)1e9;
const ll INF = (ll)1e18;
const ll MOD{ (ll)1e9 + 7 };
const long double EPS = 1e-10;

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

	vector<int> a(n);
	rep(i, n) cin >> a[i];

	a.erase(unique(a.begin(), a.end()), a.end());

	int ans = 1;
	for (int i = 2; i < a.size(); i++) {
		if ((a[i - 2] < a[i - 1] && a[i - 1] > a[i]) ||
			 (a[i - 2] > a[i - 1] && a[i - 1] < a[i])) {

			ans++;
			i++;
		}
	}

	cout << ans << endl;
	return 0;
}

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

using namespace std;

int main(){
    int n;
    int sum=0;
    int sum_i=0;
    cin >> n;
    vector<int> v(n+2);
    for(int i=1;i<n+1;i++){
        cin >> v[i];
        sum+=abs(v[i-1]-v[i]);
    }
    sum+=abs(v[n]-v[n+1]);
    for(int i=1;i<n+1;i++){
        sum_i=sum-abs(v[i-1]-v[i])-abs(v[i]-v[i+1])+abs(v[i-1]-v[i+1]);
        cout << sum_i << endl;
    }
    return 0;
}


Measured memory_bytes: 1664
#include <iostream>
#include <string>
#include <set>
#include <map>
#include <vector>
#include <queue>
#include <algorithm>
#include <bitset>
#include <cstdlib>
#include <cmath>
#define INF 100000000
#define ll long long int
using namespace std;




int main(){

ll cnt = 0;
ll N,M,C;cin>>N>>M>>C;
vector <ll> B(0);

for(int i=0;i<M;i++){
  ll bbb;cin>>bbb;
  B.push_back(bbb);
}

for(int i=0;i<N;i++){
  vector <ll> A(0);
  for(int j=0;j<M;j++){
    ll aaa; cin>>aaa;
    A.push_back(aaa);
  }

  int judge = 0;

  for(int j=0;j<M;j++){

    judge += A[j] * B[j];

  }

  judge += C;
  if(judge > 0) cnt++;
}
cout<<cnt<<endl;
 
return 0;


}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <stdio.h>
#include <math.h>
using namespace std;
using vi = vector<int>;
using vll = vector<long long int>;
using vb = vector<bool>;
using vvi = vector<vector<int>>;
using vvll = vector<vector<long long int>>;
using ll = long long int;

int main(){
    ll S, W; cin >> S >> W;
    if(S<=W){
        cout << "unsafe";
    }
    else{
        cout << "safe";
    }
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)   FOR(i,0,n)
#define ALL(obj)   (obj).begin(),(obj).end()

#define debug(var)  do{std::cout << __LINE__ << "> " << #var << ": ";view(var);}while(0)
template<typename T> void view(T e){std::cout << e << std::endl;}
template<typename T> void view(const std::vector<T>& v){for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void view(const std::vector<std::vector<T> >& vv){ for(const auto& v : vv){ view(v); } }

using namespace std;
using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vector<int>>;
using vvl = vector<vector<ll>>;

vector<long long> divisor(long long n) {
    vector<long long> res;
    for (long long i = 1; i * i <= n; ++i) {
        if (n % i == 0) {
            res.push_back(i);
            if (i != n / i) res.push_back(n / i);
        }
    }
    // sort(res.begin(), res.end());
    return res;
}

int keta(ll v) {
	ll tmp = v;
	int res = 0;
	while (tmp > 0) {
		tmp /= 10;
		++res;
	}
	return res;
}

void Main() {
	ll N; cin >> N;
	vl div = divisor(N);
	int res = 20;
	for (ll num : div) {
		res = min(res, max(keta(num), keta(N / num)));
	}
	cout << res << endl;
}

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


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

using namespace std;

const int N=1e6+3;

const double eps=0.000000001;

#define pb push_back
#define all(x) (x).begin(),(x).end()
typedef long long ll;

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

const int inf=1e9,mod=1e9+7;

int n,m,a[N],b[N],k,q,u,v,x,y,tc,c,l,r,ans;

char s[N];

void IO(){
	ios::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
	#ifndef ONLINE_JUDGE
		freopen("test.txt","r",stdin);
	#endif
}

int main(){
	//IO();
	scanf("%d",&n);
	for(int i=0;i<n;i++)
		scanf("%d",&a[i]);
	ll ans=1e18;
	for(int x=1;x<=100;x++){
		ll curr=0;
		for(int i=0;i<n;i++){
			curr+=(a[i]-x) * (a[i]-x);
		}
		ans=min(ans,curr);
	}
	printf("%lld\n",ans);
}


Measured memory_bytes: 2304
#include <bits/stdc++.h>
using namespace std;
// define #Asukaminato is cute
#define ll long long
#define rep(i, m) for (int i = 0; i < (int)(m); i++)
const int inf = 1000000000; // 10^9 Ten to the power of nine.

int main()
{
	int X,Y,Z;
	cin>>X>>Y>>Z;
    
	cout<<Z<<" "<<X<<" "<<Y<<endl;	
}


Measured memory_bytes: 256
// clang-format off

#include <bits/stdc++.h>

#define int long long int
#define main signed main()
#define bye return 0
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define each(p, v) for (auto p = (v).begin(); p != (v).end(); p++)
#define all(v) (v).begin(), (v).end()
#define prec(n) fixed << setprecision(n)
#define dump(x) cerr << "(L" << __LINE__ << ") " << #x << " = " << (x) << endl
#define clr(x, a) memset(x, a, sizeof(x))

#define sum(v) accumulate(all(v), 0)
#define stlice(from, to) substr(from, (to) - (from) + 1)
#define odd(n) ((n) % 2)
#define even(n) (!odd(n))

#define INF 1000000000
#define MOD 1000000007
#define PI acos(-1)

#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define vi vector<int>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>

using namespace std;

// clang-format on

main {
  int n, m;
  cin >> n >> m;
  cout << n - m - 1 << endl;
  bye;
}

Measured memory_bytes: 3104
#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 <unordered_map>
#include <set>
#include <regex>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include<tuple>

using namespace std;
const int MAX = 3000;
const int a_MAX = 100001;



int main(){
	int N;
	int ans = 0;

	cin >> N;
	for (int i = 0; i < N; i++) {
		int a;
		cin >> a;
		ans += a - 1;
	}

	cout << ans << endl;

	return 0;
}

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

        int main() {
          ll N,A,B;
          cin>> N >> A >> B; 
          if( A+B -1 > N || A*B < N || A > N || B>N || A<1 || B<1 ){
            cout<< -1 <<endl;
          }
          else if(B==1){
            for(ll i=1; i<=N; i++){
              cout<< i <<" "; 
            }
          }
          else{
            ll T = (N - A )/(B-1);
            ll R = (N - A)%(B-1);
            ll X;
            for(ll i=1; i<= T; i++){
              for(ll j=1; j<= B; j++){
                	cout<< B*i+ + 1 -j <<" ";  
              }
              X= B*i; 
            }
            if(R==0){
            	for(ll i=X+1; i<=N; i++){
              	cout<< i <<" ";
                }
            }else{
              for(ll i=X+1; i<= N-R-1; i++){
                cout<< i <<" ";
              }
              for(ll i=N; i>= N-R; i--){
                cout<< i <<" ";
              }
            }
          }
        }

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

using namespace std;

int main() {
    int n;
    string s;

    cin >> n;
    int A = 0, B = 0, AB = 0, ans = 0;
    for (int i=0; i<n; i++) {
        cin >> s;
        for (int j=1; j<s.size(); j++) {
            if (s[j-1] == 'A' && s[j] == 'B') {
                ans++;
            }
        }
        if (s[0] == 'B' && s[s.size()-1] == 'A') {
            AB++;
        }
        else if (s[0] == 'B') {
            B++;
        }
        else if (s[s.size()-1] == 'A') {
            A++;
        }
    }
    
    //cout << A << " " << B << " " << AB << " " << ans << endl;

    if (AB > 0) {
        ans += AB-1;
        if (A > 0) {
            ans++;
            A--;
        }
        if (B > 0) {
            ans++;
            B--;
        }
    }
    ans += min(A, B);


    /* ans += min(A, B);
    if (A != B) {
        ans += min(abs(A-B), AB);
        AB -= abs(A-B);
    }
    cout << ans << endl;
    if (AB > 0) {
        ans += AB/2;
    } */

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
void Caesarcipher(string &s,int c){
  if(c<0) c = 26+c%26;
  else c %= 26;
  for(int i=0;i<s.size();i++){
    if('a' <= s[i] && s[i] <= 'z'){
      s[i] += c;
      if(s[i] > 'z') s[i] -= 26;
      else if(s[i] < 'a') s[i] += 26;
    }
  }
}
int main(){
  string s;int i;
  while(getline(cin,s)){
    for(i=0;i<26;i++){
      Caesarcipher(s,1);
      if(s.find("the") != string::npos || s.find("this") != string::npos || s.find("that") != string::npos){
        cout << s << "\n";
      }
    }
  }
}


Measured memory_bytes: 3160
#include<algorithm>
#include <iostream>
#include<cstdio>
#include<cmath>
#include<iomanip>
#include<string>
using namespace std;
int main(){
   
    int a,b,h;
    cin>>a>>b>>h;
    
    cout<<(a+b)*h/2<<endl;
    
    
    return 0;
   
}






Measured memory_bytes: 256
#include<bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define elif else if
#define INF 1000000007
using namespace std;
int a,b,c;
signed main()
{
	cin>>a>>b>>c;
	if(a+b+c<22){
		cout<<"win";
	}else{
		cout<<"bust";
	}
}

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

int main(){
  int n;
  cin >> n;
  vector<string> s(n);
  for(int i=0; i<n; i++){ 
    cin >> s[i];
    sort(s[i].begin(), s[i].end());
  }
  
  map<string, ll> num{};
  for(int i=0; i<n; i++){
  	num[s[i]]++;
  }
  
  ll ans = 0;
  for(auto p : num){
    ll comb = (p.second) * (p.second -1) / 2;
  	ans += comb;
  }
  cout << ans << endl;
}

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

int main() {
	int n, m; cin >> n >> m;
	vector<pair<int, int>>request(m); for (auto&& x : request)cin >> x.second >> x.first;
	sort(request.begin(), request.end());

	int ans = 1;
	int cutL = 0, cutR = n + 1;
	for (auto&&x:request) {
		if (cutL < x.second)cutL = x.second;
		if (cutR > x.first)cutR = x.first;
		else if (cutR <= x.second || cutL >= x.first) {
			ans++;
			cutR = x.first;
			cutL = x.second;
		}
	}
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 1024
#include<iostream>

using namespace std;

int main(){
    int a, b;
    cin >> a >> b;
    if(a>b){
        cout << "a > b" << endl;
    }else if(a<b){
        cout << "a < b" << endl;
    }else{
        cout << "a == b" << endl;
    }
    return 0;   
}
    

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

using lint = long long int;
using pint = pair<int, int>;
using plint = pair<lint, lint>;
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((lint)(x).size())
#define POW2(n) (1LL << (n))
#define FOR(i, begin, end) for (int i = (begin), i##_end_ = (end); i < i##_end_; i++)
#define IFOR(i, begin, end) for (int i = (end)-1, i##_begin_ = (begin); i >= i##_begin_; i--)
#define REP(i, n) FOR(i, 0, n)
#define IREP(i, n) IFOR(i, 0, n)
#ifdef LOCAL
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
#define eprintf(...) 42
#endif

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s,t;
    cin >> s >> t;
    lint ans, tmp,cnt=0;
    REP(i,SZ(s)-SZ(t)+1){
        lint same = 0;
        REP(j,SZ(t)){
            if(s[i+j]==t[j]){
                same++;
            }
        }
        cnt = max(cnt, same);
    }
    ans = SZ(t) - cnt;
    cout << ans <<"\n";

    return 0;
}

Measured memory_bytes: 3656
#include<cstdio>

long long A,B;

int main()
{
	scanf("%lld%lld",&A,&B);
	long long p=-1LL,q=-1LL;
	for(int i=59;i>=0;i--)
		if((A&(1LL<<i))!=(B&(1LL<<i)))
		{
			p=i;
			break;
		}
	if(p==-1LL)
		puts("1");
	else
	{
		long long L1LL=A&((1LL<<p)-1LL),R1LL=(1LL<<p)+(B&((1LL<<p)-1LL)),L2,R2;
		for(int i=p-1LL;i>=0;i--)
			if(B&(1LL<<i))
			{
				q=i;
				break;
			}
		if(q!=-1LL)
			R1LL=(1LL<<p)+(1LL<<(q+1LL))-1LL;
		L2=(1LL<<p)+(A&((1LL<<p)-1LL));
		R2=(1LL<<(p+1LL))-1LL;
		long long ans;
		if(L2>R1LL)
			ans=R2-L2+1LL+R1LL-L1LL+1LL;
		else
			ans=R2-L1LL+1LL;
		printf("%lld\n",ans);
	}
	
	return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <fstream>
#include <string>
#include <cmath>
#include <cstdio>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <utility>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <unordered_map>
#define MOD 1000000007
#define int long long
using namespace std;
using P = pair<int, int>;
using ll = long long;
using prique = priority_queue<int>;
signed main(){
    int n,m;
    cin>>n>>m;
    bool pass[8][8]={};
    for(int i=0;i<m;i++){
        int a,b;
        cin>>a>>b;
        pass[a-1][b-1]=true;
        pass[b-1][a-1]=true;
    }
    vector<int> p;
    for(int i=1;i<=n;i++)p.push_back(i);
    int ans=0;
    do{
        bool po=true;
        for(int i=0;i<n-1;i++){
            if(pass[p[i]-1][p[i+1]-1]==false){
                po=false;
                break;
            }
        }
        if(po)ans++;
    }while(next_permutation(p.begin()+1, p.end()));
    cout<<ans<<endl;
    return 0;
}



Measured memory_bytes: 256
#include <algorithm>
#include <cassert>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>

#include <limits.h>

using namespace std;

typedef long long ll;

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

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

int main(void) {
    int K, A, B;
    cin >> K >> A >> B;

    int x = B / K * K;
    if (x >= A) {
        cout << "OK" << endl;
    } else {
        cout << "NG" << endl;
    }

    return 0;
}


Measured memory_bytes: 3604