akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define mp make_pair
#define mm(a) memset(a,0,sizeof(a))
#define rep(i,a,b) for(ll i = a; i < b; i++)
#define repn(i,a,b) for(ll i = a; i >= b; i--)
#define pb push_back
#define ff first
#define ss second
#define fto(k,m) for(auto k:m)
#define debug(this) cerr<<"> "<<#this<<" : "<<this<<"\n"
#define sz(a) ll((a).size())
#define pii 3.1415926535897
#define ld long double
#define BRAHAMASTRA ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
ll mult(ll n,ll k)
{
    ll j = n;
    rep(i,0,k)
    {
        j*=2;
    }
    return j;
}
int main()
{
    BRAHAMASTRA
    ll t; t=1;
    // cin >>t;
    while(t--)
    {
        ll a,b,c; cin >>a>>b>>c;
        ll k; cin >>k;
        if(b<=a)
        {
            rep(i,0,k)
            {
                b*=2;
                k--;
                if(b>a)break;
            }
        }
        if(c<=b)
        {
            rep(i,0,k)
            {
                c*=2;
                if(c>b)break;
            }
        }
        debug(b);debug(c);
        if(b>a and c>b)cout<<"Yes\n";
        else cout<<"No\n";
    }
}

Measured memory_bytes: 3544
/*
    Submitted With (^^) by -> Hossam ^_^
     ___     ___
    (^_^)   (^_^)
   /( | )\ /( | )\
     | |     | |
*/
#include <bits/stdc++.h>

using namespace std;

inline void prep()
{
    cin.tie(0);
    cin.sync_with_stdio(0);
}

#define X first
#define Y second
#define ll long long
#define inf (0x7fffffffffffffff)
#define all(x) x.begin(), x.end()

const int mod = (int)1e9 + 7;
const int MX = (int)5e6 + 1;

auto ccw = [](pair<ll, ll> x1, pair<ll, ll> x2, pair<ll, ll> x3) {
    return (x1.X * (x2.Y - x3.Y) + x2.X * (x3.Y - x1.Y) + x3.X * (x1.Y - x2.Y));
};

int main()
{
    prep();

    ll s;
    cin >> s;

    ll sq = sqrtl(s);
    while(sq * sq < s) sq++;

    ll left = sq * sq - s;

    ll x1 = 0;
    ll y1 = 0;
    ll x2 = sq;
    ll y2 = left;
    ll x3 = 1;
    ll y3 = sq;

    ll area2 = ccw({x1, y1}, {x2, y2}, {x3, y3});

    // cout << area2 << endl;
    // assert(area2 == s);

    cout << x1 << " " << y1 << " " << x2 << " " << y2 << " " << x3 << " " << y3 << endl;
    
    return 0;
}   

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i, a, b) for (int i = (a); i < (b); ++i)
using pii = pair<int, int>;
using vi=vector<int>;

signed main() {
    int n,w,h;
    while(cin>>n>>w>>h,n or w or h){
        vi p(n),s(n);
        rep(i,0,n){
            cin>>p[i]>>s[i];
        }
        vector<pii>rects;
        rects.emplace_back(w,h);
        rep(i,0,n){
            pii x=rects[p[i]-1];
            int y=x.first,z=x.second;
            int l=(x.first+x.second)*2;
            s[i]%=l;
            pii a,b;
            if(s[i]<y){
                a=pii (s[i],z);
                b=pii(y-s[i],z);
            }
            else if(s[i]<y+z){
                pii A(y,s[i]-y),B(y,z-(s[i]-y));
                a=A;
                b=B;
            }
            else if(s[i]<2*y+z){
                pii A(s[i]-y-z,z),B(y-(s[i]-y-z),z);
                a=A;
                b=B;
            }
            else {
                pii A(y,s[i]-2*y-z),B(y,z-(s[i]-2*y-z));
                a=A;
                b=B;
            }

            if(a.first*a.second>b.first*b.second){
                swap(a,b);
            }
            rects.erase(rects.begin()+p[i]-1);
            rects.emplace_back(a);
            rects.emplace_back(b);
        }

        sort(rects.begin(),rects.end(),[](pii a,pii b){return a.first*a.second<b.first*b.second;});

        rep(i,0,rects.size()){
            cout<<rects[i].first*rects[i].second<<(i==rects.size()-1?'\n':' ');
        }
    }
}


Measured memory_bytes: 3084
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

def main():
    num = int(input())
    ans = len(str(num))
    for i in range(1, int(num ** 0.5) + 1):
        if num % i == 0:
            # print(i)
            a = i
            b = num // a
            kari = max(len(str(a)), len(str(b)))
            ans = min(ans, kari)

    print(ans)


if __name__ == '__main__':
    main()

Measured memory_bytes: 38896
#include <bits/stdc++.h>
#define INF 1e18
#define int long long
#define Rep(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) Rep(i, 0, n)
#define all(a) (a).begin(), (a).end()
using namespace std;
typedef pair<int, int> P;
typedef pair<int, P> PP;
const int mod = 1000000007;

bool ok(int n)
{
    int digit = 0;
    while (n > 0)
    {
        n /= 10;
        digit++;
    }
    return digit % 2;
}

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

    int n;
    cin >> n;
    int ans = 0;
    for (int i = 1; i <= n; i++)
        if (ok(i))
            ans++;
    cout << ans << endl;
}

Measured memory_bytes: 256
package main

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

////////////////////////////////////////
///        templates                 ///
////////////////////////////////////////

var sc = bufio.NewScanner(os.Stdin)

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

var rdr = bufio.NewReaderSize(os.Stdin, 1000000)

func readBigLine() string {
	buf := make([]byte, 0, 1000000)
	for {
		l, p, e := rdr.ReadLine()
		if e != nil {
			panic(e)
		}
		buf = append(buf, l...)
		if !p {
			break
		}
	}
	return string(buf)
}

func strSprit(str string) []string {
	cols := strings.Split(str, " ")
	return cols
}

func parseInt(str string) int {
	n, _ := strconv.Atoi(str)
	return n
}

func intSprit(str string) []int {
	strs := strSprit(str)
	cols := make([]int, len(strs))
	for i, v := range strs {
		cols[i] = parseInt(v)
	}
	return cols
}

func bitCount(n uint) int {

	x := uint64(n)

	const m = 1<<64 - 1
	const m0 = 0x5555555555555555
	const m1 = 0x3333333333333333
	const m2 = 0x0f0f0f0f0f0f0f0f

	x = x>>1&(m0&m) + x&(m0&m)
	x = x>>2&(m1&m) + x&(m1&m)
	x = (x>>4 + x) & (m2 & m)
	x += x >> 8
	x += x >> 16
	x += x >> 32

	return int(x) & (1<<7 - 1)
}

func bitExist(n, i int) bool {
	return ((n >> uint(i)) & 1) == 1
}

////////////////////////////////////////
///        end templates             ///
////////////////////////////////////////

func main() {
	n := intSprit(nextLine())

	fmt.Println(n[0] * n[1] / 2)
}


Measured memory_bytes: 640
process.stdin.resume();
process.stdin.setEncoding('utf8');

var lines = [];
var reader = require('readline').createInterface({
    input: process.stdin,
    output: process.stdout
});
reader.on('line', (line) => {
    // ここで入力を処理する
    lines.push(line);
});
reader.on('close', () => {
    // ここで出力する
    var n, limit;
    lines[0].split(" ").map(x => Number(x)).forEach((x, index)=> {
      switch(index){
        case 0: n = x; break;
        case 1: limit = x; break;
      }
    });

  	var result = 0;
    lines[1].split(" ").map(x => Number(x)).forEach(x => {
      if(x >= limit) result++;
    });
    console.log(result);
    //for(var i =0; i<lines.length; i++){
    //  console.log(lines[i]);
    //}
});

Measured memory_bytes: 16844
//
// Created by sark2 on 23-10-2019.
//

#include "bits/stdc++.h"

using namespace std;
#define PB push_back
#define IOS cin.sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define CASES int t;cin>>t;while(t--)
#define MP make_pair

using ll = long long;
using ld = long double;

const int mod = 1e9 + 7;
const int nax = 305;

vector<vector<ll>> dp(nax, vector<ll>(nax, mod)),
                dist(nax, vector<ll>(nax, mod));



int main() {
    IOS

    int n, m;
    ll l;
    cin>>n>>m>>l;

    for(int i = 0; i < m; i++){
        int a, b;
        ll c;
        cin>>a>>b>>c;

        dp[a][b] = c;
        dp[b][a] = c;
    }

    for(int i = 1; i <= n; i++){
        dp[i][i] = 0;
        dist[i][i] = 0;
    }

    for(int k = 1; k <= n; k++){
        for(int i = 1; i <= n; i++){
            for(int j = 1; j <= n; j++){
                dp[i][j] = min(dp[i][j], dp[i][k]+dp[k][j]);
            }
        }
    }

    for(int i = 1; i <= n; i++){
        for(int j = 1; j <= n; j++){
                if(i==j)
                    continue;
                if(dp[i][j] <= l)
                    dist[i][j] = min(dist[i][j], 1LL);
        }
    }

    for(int k = 1; k <= n; k++){
        for(int i = 1; i <= n; i++){
            for(int j = 1; j <= n; j++){
                dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j]);
            }
        }
    }


    ll q;
    cin>>q;
    for(int i = 0; i < q; i++){
        ll a,b;
        cin>>a>>b;
        if(dist[a][b] == mod)
            cout<<-1<<"\n";
        else{
           cout<<dist[a][b]-1<<"\n";
        }
    }






}


Measured memory_bytes: 2048
#include<iostream>
#include<string>
#include<vector>
#include<stdio.h>
#include<algorithm>
#include<math.h>
#include<numeric>
#include<iomanip>
#include<deque>
#include<tuple>
#include<queue>
#include<map>
#include <cstdint>
#include <boost/multiprecision/cpp_int.hpp>


#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define vi vector<int>
#define all(x) (x).begin(),(x).end()
#define Endl endl
#define F first
#define S second

namespace mp = boost::multiprecision;

using cpp_int = mp::cpp_int;
using ll = long long;
using namespace std;

int main(){
	int n;
	scanf("%d", &n);
	deque<int>b;
	int flag = true;
	rep(i, n) {
		int a;
		scanf("%d", &a);
		if (flag) {
			b.push_back(a);
			flag = false;
		}
		else {
			b.push_front(a);
			flag = true;
		}
	}
	if (n % 2 != 0) {
		reverse(all(b));
	}
	rep(i, b.size()) {
		printf("%d",b[i]);
		if (i != b.size() - 1) {
			printf(" ");
		}
		else {
			printf("\n");
		}
	}
}

Measured memory_bytes: 2944
#include<cstdio>
int n,g,A,K;
int main(){
	for(scanf("%d",&n);n--;g^=A/K)for(scanf("%d%d",&A,&K);A>K&&A%K;)A-=(1+(A%K-1)/(A/K+1))*(A/K+1);
	puts(g?"Takahashi":"Aoki");
}

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

using namespace std;
typedef long long ll;

#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, a, b) for (int i = (a); i < (b); ++i)
#define all(a) (a).begin(), (a).end()
#define all2(a, b) (a).begin(), (a).begin() + (b)
#define debug(vari) cerr << #vari << " = " << (vari) << endl;

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

    int a, b, c;
    int num10000 = y / 10000, num5000 = y / 5000;
    rep(i, num10000 + 1)
    {
        rep(j, num5000 + 1)
        {
            int num = y / 1000 - 10 * i - 5 * j;
            if (0 <= num && num <= y / 1000 && i + j + num == n)
            {
                printf("%d %d %d\n", i, j, num);
                return 0;
            }
        }
    }

    printf("-1 -1 -1\n");
    return 0;
}


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

#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
#define mem(x,val) memset((x),(val),sizeof(x))
#define all(x) x.begin(),x.end()
#define pb push_back
#define mp make_pair
#define PI acos(-1.0) 
#define MAXN 11111

const int INF = 1 << 29 ;
typedef long long ll ;
typedef pair < int , int > pii ;

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

Measured memory_bytes: 256
program main
  implicit none
  integer(8) :: m = 10 ** 9 + 7
  integer(8) :: n, k, i, g, res
  integer(8), allocatable :: s(:), t(:)
  read *, n, k
  allocate (s(k), t(k))
  do i = 1, k
    t(i) = get_t(i)
  end do
  s(:) = t(:)
  do g = k, 1, -1
    do i = 2, k / g
      s(g) = s(g) - s(i * g)
      s(g) = modulo(s(g), m)
    end do
  end do
  res = 0
  do g = 1, k
    res = res + g * s(g)
    res = modulo(res, m)
  end do
  print "(i0)", res

  contains

  integer(8) function get_t(f)
    integer(8), intent(in) :: f
    integer(8) :: ng
    ng = k / f
    get_t = pow(ng, n)
  end function get_t

  function pow(n, p) result(res)
    integer(8), intent(in) :: n, p
    integer(8) :: res, buf(0:31), i, imax
    buf(0) = modulo(n, m)
    imax = bit_size(p) - leadz(p) - 1
    do i = 1, imax
      buf(i) = modulo(buf(i - 1) ** 2, m)
    end do
    res = 1
    do i = 0, imax
      if (btest(p, i)) then
        res = res * buf(i)
        res = modulo(res, m)
      end if
    end do
  end function pow
end program main


Measured memory_bytes: 4284
#include <iostream>
#include <stdio.h>
#include <fstream>
#include <algorithm>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <limits.h>
#include <math.h>
#include <list>
#define rep(i,n) for (int i = 0; (i) < (n); ++(i))
using namespace std;

int main() {
    list<int> a;
    list<int>::iterator c = a.end();
    int q;
    cin >> q;
    rep(i,q) {
        int t;
        cin >> t;
        switch(t) {
            case 0:
            int x;
            cin >> x;
            c = a.insert(c, x);
            break;
            case 1:
            int d;
            cin >> d;
            if (d > 0) rep(j,d)  c++;
            else       rep(j,-d) c--;
            break;
            case 2: 
            c = a.erase(c);
            break;
        }
    }
    for (list<int>::iterator itr = a.begin(); itr != a.end(); itr++)
        cout << *itr << endl;
    return 0;
}


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

int visit(int n, int s, int x){
    int sum=0;
    if(n==0 && s==0)    return 1;
    if(n>0){
        for(int i=x; i<10; i++){
            if(s-i>=0)  sum+=visit(n-1, s-i, i+1);
        }
    }
    return sum;
}

int main(void){
    int n, s;
    while(cin >> n >> s){
        if(n==0 && s==0)    break;
        cout << visit(n, s, 0) << endl;
    }
    return 0;
}


Measured memory_bytes: 2964
#include <iostream>
#include <string>
#include <queue>
#include <vector>
#include <algorithm>
#include <math.h>
#include <map>
#include <iomanip>
#include <queue>
#include <numeric>


using namespace std;


int main() {
	int a, N, MIN, MAX, free = 0, ans = 0;
	bool color[8];
	
	for (int i = 0; i < 8; i++) {
		color[i] = false;
	}

	cin >> N;

	for (int i = 0; i < N; i++) {
		cin >> a;
		if (a >= 3200) {
			free++;
			continue;
		}

		for (int i = 0; i <8; i++) {
			if (a < 400 * (i + 1)) {
				color[i] = true;
				break;
			}
		}
	}

	for (int i = 0; i < 8; i++) {
		if (color[i]) {
			ans++;
		}
	}

	if (ans == 0) {
		MIN = 1;
		MAX = free;
	}
	else {
		MIN = ans;
		MAX = ans + free;
	}

	cout << MIN << " " << MAX;

	return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<queue>
#include<map>
using namespace std;
#define REP(i, limit) for(int i=0; i< limit; ++i)
#define LINT long long

int main(){
  int N;
  cin>>N;
  int a[N];
  REP(i, N)cin>>a[i];
  if(N==1){
    cout<<a[0]/2<<endl;
    return 0;
  }

  LINT ans=0;
  for(int i=0; i<N-1; ++i){
    ans += a[i]/2;
    if(a[i]%2==1 &&a[i+1]!=0){
      ++ans;
      --a[i+1];
    }
  }
  ans += a[N-1]/2;
  cout<<ans<<endl;


  return 0;
}


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

int main()
{
  int N; cin >> N;
  
  int localmax = 0 , ans;
  for(int i = 1; i <= N; i++){
  	int n = i , count = 0;
    while(n > 0){
      n /= 2;
      count++;
    }
    if( count > localmax ){
      localmax = count;
      ans = i;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
import sys
input = sys.stdin.readline
sys.setrecursionlimit(100000)
def getN():
    return int(input())
def getList():
    return list(map(int, input().split()))

def solve():

    return

def main():
    a, b = getList()
    if a <= 9 and b <= 9:
        print(a*b)
    else:
        print(-1)



if __name__ =="__main__":
    main()

Measured memory_bytes: 38384
#include <bits/stdc++.h>
#define salma ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
typedef long long ll;
typedef long double ld;
const int N=1e5 + 5;
using namespace std;


int main()
{
    salma
    int n , k;
    cin>>n>>k;
    int arr[n];
    for (int i=0 ; i<n;i++)
        cin>>arr[i];

    ll dp[N];
    ll ans;

   for (int r=1 ; r<=k ;r++  )
          dp[r]=abs(arr[0]-arr[r]);



   for (int c = 1 ; c<n; c++)
   {
       for (int r =1 ; r<=k ;r++)
       {
           if (c-r<0) {break; }
           dp[c]=abs(arr[c]-arr[c-r])+dp[c-r];

            if (r==1)
             ans=dp[c];

            else
             ans=min(ans , dp[c]);
       }
    dp[c]=ans;
   }

cout<<dp[n-1];


    return 0;
}

Measured memory_bytes: 1408
#import numpy as np
import sys, math
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial#, gcd
from bisect import bisect_left, bisect_right #bisect_left(list, value)
sys.setrecursionlimit(10**7)
enu = enumerate
MOD = 10**9+7
def input(): return sys.stdin.readline()[:-1]
pl = lambda x: print(*x, sep='\n')

N = int(input())
alphabet = [chr(i) for i in range(97, 97+27)]
tss = [26**i for i in range(1, 12)]

for ind, ts in enu(tss):
    if ts < N:
        N -= ts
    else:
        break
keta = ind + 1
# print('keta', keta)

moji = ''
N -= 1
# print('->', N)
for ket in range(keta):
    N, mod = divmod(N, 26)
    # print(' N, mod', N, mod)
    moji += alphabet[mod]
moji = ''.join(list(reversed(moji)))
print(moji)

Measured memory_bytes: 65648
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define pf push_front
#define ll long long

ll a[10000005];

int main()
{
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    for(ll i=1; i<=10000000; i++){
        for(ll j=i; j<=10000000; j+=i){
            a[j]++;
        }
    }
    ll n,ans=0;
    cin>>n;
    for(ll i=1; i<=n; i++){
        ans += i*a[i];
    }

    cout<<ans<<"\n";

    return 0;
}

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

#define ll long long 
#define pb push_back
#define mem0(a) memset(a,0,sizeof(a))
#define mem1(a) memset(a,-1,sizeof(a))
#define memf(a) memset(a,false,sizeof(a))
#define all(v) v.begin(),v.end()
#define sz(a) (ll)a.size()
#define F first
#define S second
#define INF 2000000000000000000
#define endl "\n"
#define _time_ 1.0 * clock() / CLOCKS_PER_SEC
#define popcount(x) __builtin_popcountll(x)
#define pll pair<ll,ll> 
#define ld long double

const int M=1000000007;
const int MM=998244353;
const long double PI = acos(-1);

ll power(ll b,ll e,ll m)
{
    if(e==0) return 1;
    if(e&1) return b*power(b*b%m,e/2,m)%m;
    return power(b*b%m,e/2,m);
}
ll power( ll b, ll e)
{
    if(e==0) return 1;
    if(e&1) return b*power(b*b,e/2);
    return power(b*b,e/2);
}
template<typename T, typename U> static inline void amin(T &x, U y){ if(y<x) x=y; }
template<typename T, typename U> static inline void amax(T &x, U y){ if(x<y) x=y; }
template<typename T, typename U> ostream& operator<<(ostream &os, const pair<T, U> &p)
{ 
    return os<<'('<<p.F<< ","<<p.S<<')'; 
}

int _runtimeTerror_()
{
    ll n;
    cin>>n;
    ll a[n+1],b[n+1];
    bool ans = false;
    for(int i=1;i<=n;++i)
        cin>>a[i]>>b[i];
    for(int i=1;i<=n-2;++i)
    {
        if(a[i]==b[i] && a[i+1]==b[i+1] && a[i+2]==b[i+2])
            ans = true;
    }
    cout<<(ans?"Yes":"No");
    return 0;
}

int main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    #ifdef runSieve
        sieve();
    #endif
    #ifdef NCR
        initialize();
    #endif
    int TESTS=1;
    //cin>>TESTS;
    while(TESTS--)
        _runtimeTerror_();
    return 0;
}

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

int main(){
  ll N,M;
  cin >> N >> M;
  vector<vector<bool>> graph(N,vector<bool>(N,false));
  for(ll i=0;i<M;i++){
    for(ll j=0;j<M;j++){
      ll a,b;
      cin >> a >> b;
      graph[a-1][b-1]=true;
      graph[b-1][a-1]=true;
    }
  }
  vector<ll> Root(N,0);
  iota(Root.begin(),Root.end(),1);
  ll ans=0;
  do{
    bool flag=true;
    for(ll i=0;i<N-1;i++){
      if(graph[Root[i]-1][Root[i+1]-1]){
        continue;
      }
      else{
        flag=false;
        break;
      }
    }
    if(flag){
      ans++;
    }
  }while(next_permutation(Root.begin()+1,Root.end()));
  cout << ans << endl;
}



Measured memory_bytes: 3648
import scala.io.StdIn.readDouble

object Main extends App {
  var x = 0D;var h = 0D
  while( {x=readDouble;x} != 0D && {h=readDouble;h} != 0D ) {
    val hh = Math.sqrt(h*h+x*x/4)
    println(x*x+2*x*hh)
  }
}

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

int main(){
    int n;
    double i;
    cin>>n;
    if(n%2==0){
        cout<<0.5<<endl;
    }
    else{
       i=(double)(n+1)/2/n;
       printf("%0.10lf",i);
    }

    return 0;
}



Measured memory_bytes: 256
n = int(input())

rlist = []
for _ in range(n):
    rlist.append(int(input()))

ans = rlist[1] - rlist[0]
m = rlist[0]

for i in range(1, n):
    ans = max(ans, rlist[i] - m)
    m = min(m, rlist[i])

print(ans)



Measured memory_bytes: 13592
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int sum = 0;
        for(int i=0;i<M;i++)
        {
            sum = sum + sc.nextInt();
        }
        if(sum>N)
        {
            System.out.println("-1");
        }
        else
        {
            System.out.println(N - sum);
        }
    }
}

Measured memory_bytes: 46244
def test():
    n,m = map(int,input().split())
    if n == 1 and m == 1:
        print(1)
    elif n == 1 and m > 1:
        print(m-2)
    elif n > 1 and m == 1:
        print(n-2)
    else:
        print((m-2)*(n-2))


if __name__ == "__main__":
    test()


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

#define ALL(c) (c).begin(), (c).end()
#define CALL(c) (c).cbegin(), (c).cend()
#define RALL(c) (c).rbegin(), (c).rend()
#define CRALL(c) (c).crbegin(), (c).crend()
#define REP(i, n) for (int i = 0; i < static_cast<int>(n); i++)
#define FOR(i, s, n) for (int i = s; i < static_cast<int>(n); i++)
#define PSORT(s,p,e) partial_sort((s), next((s), (p)), (e))
#define VIEW(v,t) for_each((v).begin(), (v).end(), [](t& a) { cout << a << " "; }); cout << endl;

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

using PII = pair<int, int>;
using LL = long long;
using ULL = unsigned long long;
template<class T> using V = vector<T>;
template<class T> using V2 = vector<vector<T>>;
template<class T, int W=255> using A = array<T, W>;
template<class T, int W=255, int H=255> using A2 = array<array<T, W>, W>;


std::string s;
std::string ans;

int main(){
    std::cin.tie(0);
    std::ios::sync_with_stdio(false);
    cin >> s;
    REP(i,s.size()) {
        if(s[i] == 'A') {
            ans += 'T';
        } else if(s[i] == 'T') {
            ans += 'A';
        } else if(s[i] == 'C') {
            ans += 'G';
        } else {
            ans += 'C';
        }
    }
    cout << ans << "\n";
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <utility>
#include <queue>
#include <string>
#define faster ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

using namespace std;
typedef long long  ll;
const int MAXN = 1e5 + 5;
int h[MAXN];

int main(){
    faster
    int n, m; cin >> n >> m;
    for(int i = 0;i < n;i++) cin >> h[i];
    vector<bool> tr(n, true);
    for(int i = 0;i < m;i++){
        int a, b; cin >> a >> b;
        --a;--b;
        if(h[a] > h[b]) tr[b] = false;
        if(h[a] < h[b]) tr[a] = false;
        if(h[a] == h[b]){
            tr[b] = false;
            tr[a] = false;
        }
        
    }
    int ans = 0;
    for(int i = 0;i < n;i++)
        if(tr[i])ans++;
    cout << ans << "\n";
    return 0;
}



Measured memory_bytes: 3992
#include <bits/stdc++.h>
#define REP(i, s, n) for (int i = s; i < (int)(n); i++)
#define ALL(a) a.begin(), a.end()
#define MOD 1000000007
using namespace std;
using ll = long long;

int main() {
    ll t1, t2, a1, a2, b1, b2; cin >> t1 >> t2 >> a1 >> a2 >> b1 >> b2;
    a1 *= t1;
    b1 *= t1;
    a2 *= t2;
    b2 *= t2;

    if (a1 + a2 == b1 + b2) {
        cout << "infinity" << endl;
        return 0;
    }

    if (a1 + a2 > b1 + b2) {
        if (a1 > b1) {
            cout << 0 << endl;
        } else {
            ll c = abs(a1 - b1);
            ll d = abs((a1 + a2) - (b1 + b2));
            if (c % d == 0) {
                cout << (c + d - 1) / d * 2 << endl;
            } else {
                cout << (c + d - 1) / d * 2 - 1 << endl;
            }
        }
    } else {
        if (b1 > a1) {
            cout << 0 << endl;
        } else {
            ll c = abs(a1 - b1);
            ll d = abs((a1 + a2) - (b1 + b2));
            if (c % d == 0) {
                cout << (c + d - 1) / d * 2 << endl;
            } else {
                cout << (c + d - 1) / d * 2 - 1 << endl;
            }
        }
    }

    return 0;
}

Measured memory_bytes: 3600
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <map>
#include <numeric>
#include <string>
#include <cmath>
#include <queue>

typedef long long ll;
using namespace std;


ll gcd(ll x, ll y) {

    ll r;
    while (y > 0) {
        r = x % y;
        x = y;
        y = r;
    }
    return x;
}


int main() {

    ll A, B, C, D;
    cin >>  A >> B >> C >> D;
    
    ll lcm = C * D / gcd(C, D);

    A--;
    ll cnt_divisor = 0;
    cnt_divisor += B / C;
    cnt_divisor -= A / C;
    cnt_divisor += B / D;
    cnt_divisor -= A / D;
    cnt_divisor -= (B / lcm - A / lcm);

    cout << B - A - cnt_divisor << '\n';
}


Measured memory_bytes: 256
day = str(input())
day = day.upper()
if (day == 'SAT'):
    print('1\n')
elif(day =='SUN'):
    print('7\n')   
elif(day=='MON'):
    print('6\n')    
elif(day=='TUE'):
    print('5\n')    
elif(day=='WED'):
    print('4\n')       
elif(day=='THU'):
    print('3\n')      
elif(day=='FRI'):
    print('2\n')

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

int main(){
	string s,t,u;
	int a,b;
	cin>>s>>t>>a>>b>>u;
	cout<<(s==u?a-1:a)<<" "<<(t==u?b-1:b)<<endl;
}


Measured memory_bytes: 256
"use strict"
let fs = require('fs');
let input = fs.readFileSync("/dev/stdin", "utf8").split(/\s/);

const A = +input[0], B = +input[1], K = +input[2];
let ans: number[] = [];
for(let i=A; i < A+K && i <= B; i++) ans.push(i);
for(let i=B; i > B - K && i >= A; i--) ans.push(i);
ans.sort((a,b) => a - b);
ans = Array.from(new Set(ans));
ans.forEach((val) => console.log(val));

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

int main(){
    string S;
    cin >> S;
    
    bool check = true;
    for(int i = 0;i < 3;i++){
        if(S.at(i) == S.at(i + 1)){
            check = false;
        }
    }
    
    if(check) cout << "Good" << endl;
    else cout << "Bad" << endl;
}


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


void solve(long long A, long long B){
    long long ans;
    if(A==1){
        if(B==2){
            ans = 3;
        }else{
            ans = 2;
        }
    }else if(A == 2){
        if(B==1){
            ans = 3;
        }else{
            ans = 1;
        }
    }else{
        if(B==1){
            ans = 2;
        }else{
            ans = 1;
        }
    }

    cout << ans << endl;
    return;

}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    long long A;
    scanf("%lld",&A);
    long long B;
    scanf("%lld",&B);
    solve(A, B);
    return 0;
}


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



int main() {
int n;
cin>>n;
vector<int>A(n);
for(int i=0;i<n;i++){cin>>A[i];}
vector<int>dp(n);dp[0]=1;
int ans=1;int maxi=A[0];
for(int i=1;i<n;i++)
{
    if(A[i]<=maxi)
    {
        dp[i]=dp[i-1]+1;
        ans=max(ans,dp[i]);
        maxi=A[i];
    }
    else
    {
        dp[i]=dp[i-1];
    }
    
}
cout<<ans;
	return 0;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int k,n;
    cin>>k>>n;
    int a[n];
    for(int i=0; i<n; i++)
        cin>>a[i];
        int sum=0;
    int c[n+1];
    c[0]=a[0];
    for(int i=1; i<n; i++)
    {
        c[i]=a[i]-a[i-1];
    }
    c[n]=k-a[n-1];

    c[0]=c[0]+c[n];

    int m=-1;

    for(int i=0; i<=n; i++)
    {
        m=max(m,c[i]);

    }
    int s=k-m;
    cout<<s<<endl;
}


Measured memory_bytes: 1792
#include<stdio.h>
int main(void){
	int N,T,c,t,i,num=0,min_c=1000;
	scanf("%d %d",&N,&T);
  	for(i=0;i<N;i++){
      scanf("%d",&c);
      scanf("%d",&t);
      if(t<=T){
         if(min_c>=c){
        	min_c=c;
     	 }
       	num=1; 
      }
    }
  	if(num==0){
  		printf("TLE");
    }else{
      printf("%d",min_c);
    }
}

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 <set>
#include <unordered_map>
#include <limits.h>
#define int long long
using namespace std;
using P = pair<int, int>;
using ll = long long;
using prique = priority_queue<int>;
const int MOD = 1000000007;
const int INF = LLONG_MAX/3;
int n,m;
int p[114514];
vector<P> dis[114514];
bool reached[114514]={};
bool ans=true;
void solve(int s){
    reached[s]=true;
    for(int i=0;i<dis[s].size();i++){
        P l=dis[s][i];
        if(reached[l.first]){
            if(p[l.first]-p[s]!=l.second)ans=false;
        }else{
            p[l.first]=p[s]+l.second;
            solve(l.first);
        }
    }
    return;
}
signed main(){
    cin>>n>>m;
    for(int i=0;i<114514;i++)p[i]=INF;
    for(int i=0;i<m;i++){
        int a,b,c;
        cin>>a>>b>>c;
        dis[a-1].push_back(P(b-1,c));
        dis[b-1].push_back(P(a-1,-c));
    }
    for(int i=0;i<n;i++){
        if(!reached[i]){
            p[i]=0;
            solve(i);
        }
    }
    int k=0;
    for(int i=0;i<n;i++){
        if(p[i]<0)k=max(k,abs(p[i]));
    }
    for(int i=0;i<n;i++){
        if(p[i]+k>1000000000&&p[i]!=INF)ans=false;
    }
    if(ans)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    return 0;
}


Measured memory_bytes: 17024
# -*- coding: utf-8 -*-
a,b,ab,x,y = list(map(int, input().split()))
# A、Bそれぞれをそのまま買ったときのコスト
cost=a*x + b*y
# ABだけで済ませた場合のコスト
for i in range(0, max(x, y)+1):
    cost = min(cost, a*max((x-i),0) + b*max((y-i),0) + ab*2*i)

print(cost)

Measured memory_bytes: 3060
#include <iostream>
#include <string>
#include <cstring>

using namespace std;

typedef long long int ll;
const int MOD = 1e9 + 7, N = 50;
ll dp[N][2];

int main(){
	string a, b, c;
	int n, s;
	while(cin >> a){
		fill(dp[0], dp[N], (ll)0);
		if(a[0] == '0') break;
		cin >> b >> c;
		n = a.length();
		for(int i = 0;i < n;++i){
			int idx = n - i - 1;
			for(int j = 0;j < (i == 0 ? 1 : 2);++j){
				int cc = 0, nc = 0;
				for(int x = 0;x < 10;++x){
					if(a[idx] != '?' && (a[idx] - '0') != x) continue;
					if(!idx && !x) continue;
					for(int y = 0;y < 10;++y){
						if(b[idx] != '?' && (b[idx] - '0') != y) continue;
						if(!idx && !y) continue;
						for(int z = 0;z < 10;++z){
							if(c[idx] != '?' && (c[idx] - '0') != z) continue;
							s = x + y + j;
							if(s == z) ++nc;
							else if(s % 10 == z) ++cc;
						}
					}
				}
				if(i){
					dp[i][0] += (nc * dp[i - 1][j]) % MOD;
					dp[i][1] += (cc * dp[i - 1][j]) % MOD;
				}
				else{
					dp[i][0] += nc;
					dp[i][1] += cc;
				}
			}
			dp[i][0] %= MOD;
			dp[i][1] %= MOD;
		}
		/*
		for(int i = 0;i < n;++i){
			cout << dp[i][0] << " " << dp[i][1] << endl;
		}
		*/
		cout << dp[n - 1][0] << endl;
	}
	return 0;
}



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

template<class T> void vin(vector<T>& v, int n) {
    v.resize(n);
    for (int i = 0; i < n; ++i) {
        cin >> v[i];
    }
}

int main() {
    int N, M;
    cin >> N >> M;
    vector<ll> A(N);
    rep(i, N) cin >> A[i];
    vector<pair<ll, ll>> cb(M);
    rep(i, M) {
        ll b, c;
        cin >> b >> c;
        cb[i] = {c, b};
    }
    sort(cb.rbegin(), cb.rend());
    sort(A.begin(), A.end());
    int cur = 0, used = 0;
    rep(i, N) {
        if (cb[cur].second == used) {
            used = 0;
            cur++;
        }
        if (cur < M and A[i] < cb[cur].first) {
            used++;
            A[i] = cb[cur].first;
        }
        else {
            break;
        }
    }

    ll ans = 0;
    rep(i, N) ans += A[i];

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


Measured memory_bytes: 2560
object Main {
	def main(args: Array[String]): Unit = {
		val sc = new java.util.Scanner(System.in)

    	val n: Int = sc.nextInt
        val ax: Array[Int] = Array.fill(3*n)(sc.nextInt).sorted.reverse
        
        var sum: Long = 0
        for (i <- 0 until (ax.length - n) by 2) {
            sum = sum + ax(i+1)
        }
        
        println(sum)
	}
}

Measured memory_bytes: 111848
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.IO.Pipes;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Threading.Tasks;

namespace AtCorders
{
	public class Program
	{
		static void Main(string[] args)
		{
			var abcd = Console.ReadLine();
			for (int i = 0; i < 1 << 3; i++) {
				int val = abcd[0] - '0';
				for (int j = 0; j < 3; j++) {
					if ((i & (1 << j)) != 0) {
						val += abcd[j + 1] - '0';
					} else {
						val -= abcd[j + 1] - '0';
					}
				}

				if (val == 7) {
					var sb = new StringBuilder();
					sb.Append(abcd[0]);
					sb.Append((i & (1 << 0)) != 0 ? '+' : '-');
					sb.Append(abcd[1]);
					sb.Append((i & (1 << 1)) != 0 ? '+' : '-');
					sb.Append(abcd[2]);
					sb.Append((i & (1 << 2)) != 0 ? '+' : '-');
					sb.Append(abcd[3]);
					sb.Append("=7");
					Console.WriteLine(sb.ToString());
					return;
				}
			}
		}
	}
}

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

#define mk make_pair
#define sc second
#define fr first
#define pb emplace_back
#define all(s) s.begin(), s.end()
#define sz(s) ( (int)s.size() )

using namespace std;

const int inf = (int)1e9 + 7;
const int N = (int)3e5 + 7;

int n;
int a[N];
int ans[N];
vector <pair<int,int> > v;

main () {
      cin >> n;

      for (int i = 1; i <= n; i ++) {
            cin >> a[i];
            v.pb(mk(a[i],i));
      }
      sort (v.begin(),v.end());

      int x = v[(n / 2)].fr;
      int y = v[(n / 2) - 1].fr;

      for (int i = 0; i < v.size(); i ++) {
            if (n / 2 > i)
                  ans[v[i].sc] = x;
            else
                  ans[v[i].sc] = y;
      }
      for (int i = 1; i <= n; i ++)
            cout << ans[i] << endl;
}


Measured memory_bytes: 5488
#include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;
int main() {
	int h;
	while (cin >> h, h) {
		vector<int>V[5];
		rep(i, h) {
			rep(j, 5) {
				int d; cin >> d;
				V[j].push_back(d);
			}
		}
		rep(i, 5)reverse(V[i].begin(), V[i].end());
		int ans = 0;bool update;
		do {
			update = 0;
			rep(i, h) {
				rep(j, 3) {
					int k;
					for (k = 0; j + k<5 && V[j + k].size()>i&&V[j][i] == V[j + k][i]; k++);
					if (k >= 3) {
						update = 1;
						ans += V[j][i]*k;
						rep(t, k)V[j + t][i] = 0;
					}
				}
			}
			rep(i, 5) {
				rep(j, V[i].size()) {
					if (!V[i][j]) {
						V[i].erase(V[i].begin() + j);
						j--;
					}
				}
			}
		} while (update);
		cout<<ans<<endl;
	}
}


Measured memory_bytes: 3052
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define ll long long
#define UN unsigned int
#define mod 1000000007
#define F first
#define S second
#define mk make_pair
#define B(v) v.begin(), v.end()
#define BS binary_search
#define int ll
 main()
{
	int n;
	cin>>n;
	vector<string>v[n+10];
	for(int i=0;i<n;i++)
	{
		string s;
		cin>>s;
		v[i].pb(s);
	}
	map<string,int>mp;
	for(int i=0;i<n;i++)
	{
		sort(v[i][0].begin(),v[i][0].end());
		mp[v[i][0]]++;
	}
	int re=0;
	for(auto it:mp)
	{
		re+=(it.S*(it.S-1))/2;
	}
	cout<<re<<endl;
}

Measured memory_bytes: 22912
#include<bits/stdc++.h>
using namespace std;
int bit[200003],n,k;
pair<long long,int>a[200003]; 
int sum(int x){
	int ret=0;
	for(;x>=1;x-=x&(-x))ret+=bit[x];
	return ret;
}
void add(int x){
	for(;x<n+2;x+=x&(-x))bit[x]++; 
}
int main(){
	cin>>n>>k;
	for(int i=1;i<=n;i++)scanf("%lld",&a[i].first),a[i].first-=k,a[i].second=i+1;
	for(int i=0;i<n;i++)a[i+1].first+=a[i].first;
	for(int i=n;i>=0;i--)a[i+1]=a[i];
	a[1].second=1;
	sort(a+1,a+n+2);
	long long ans=0;
	for(int i=1;i<=n+1;i++){
		ans+=sum(a[i].second);
		//cout<<a[i].second<<' '<<sum(a[i].second)<<endl;
		add(a[i].second);
	}
	cout<<ans;
} 

Measured memory_bytes: 4096
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <bitset>    // bitset
#include <cctype>    // isupper, islower, isdigit, toupper, tolower
#include <cstdint>   // int64_t, int*_t
#include <cstdio>    // printf
#include <deque>     // deque
#include <iomanip>   // setprecision
#include <iostream>  // cout, endl, cin
#include <map>       // map
#include <queue>     // queue, priority_queue
#include <set>       // set
#include <stack>     // stack
#include <string>    // string, to_string, stoi
#include <tuple>     // tuple, make_tuple
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <utility>       // pair, make_pair
#include <vector>        // vector
using namespace std;

int gcd(long long a, long long b) { return b != 0 ? gcd(b, a % b) : a; }
// cout << fixed << setprecision(10);

int main() {
    int N, count = 0;
    cin >> N;
    for(int i=1; i<=N; i+=2) {
        int yakusu = 0;
        for(int j=1; j<=sqrt(i); j++){
            yakusu += (i%j == 0) ? 1 : 0;
        }
        count += (yakusu*2 == 8) ? 1 : 0;
    }
    cout << count << endl;
    
}

Measured memory_bytes: 256
/* This code is written by Nemlit */
#include<bits/stdc++.h>
using namespace std;
#define il inline
#define re register
#define debug printf("Now is Line : %d\n",__LINE__)
#define file(a) freopen(#a".in","r",stdin);freopen(#a".out","w",stdout)
#define rep(i, a, b) for(re int i = (a); i <= (b); ++ i)
#define drep(i, a, b) for(re int i = (b); i >= (a); -- i)
#define Next(i, u) for(re int i = head[u]; i; i = e[i].next)
#define mem(k, p) memset(k, p, sizeof(k))
#define int long long
#define D double
#define inf 1023456789
#define mod 1000000007
#define lb(x) (x)&(-(x))
il int read() {
    re int x = 0, f = 1; re char c = getchar();
    while(c < '0' || c > '9') { if(c == '-') f = -1; c = getchar();}
    while(c >= '0' && c <= '9') x = x * 10 + c - 48, c = getchar();
    return x * f;
}
il int Mul(int a, int b) { return 1ll * a * b % mod; }
il int Inc(int a, int b) { return (a += b) >= mod ? a - mod : a; }
il int Dec(int a, int b) { return (a -= b) < 0 ? a + mod : a; }
il int qpow(int a, int b) { int r = 1; while(b) { if(b & 1) r = Mul(r, a); a = Mul(a, a), b >>= 1; } return r; }
#define ls k * 2
#define rs k * 2 + 1
#define maxn 2333
namespace Graph {
	int head[maxn], cnt;
	struct edge { int v, next; }e[maxn << 1];
	il void add(int u, int v) { e[++ cnt] = (edge){v, head[u]}, head[u] = cnt; }
}
//using namespace Graph;
int n, m;
il int check(int x) {
	int pax = n;
	while(x >= 1) {
		if(pax >= x) pax -= x, -- x;
		else -- x;
		if(pax == 0) return 1;
	}
	return 0;
}
signed main() {
	n = read();
	int l = 1, r = 1000000, ans = 0;
	while(l <= r) {
		int mid = (l + r) >> 1;
		if(check(mid)) r = mid - 1, ans = mid;
		else l = mid + 1;
	}
	cout << ans;
	return 0;
}


Measured memory_bytes: 256
A_1 = input().split()
A_2 = input().split()
A_3 = input().split()
A_1 = [int(k) for k in A_1]
A_2 = [int(k) for k in A_2]
A_3 = [int(k) for k in A_3]
A = []
A.append(A_1)
A.append(A_2)
A.append(A_3)

N = int(input())

b = []
for i in range(N):
    b.append(int(input()))

for i in b:
    for j in range(3):
        for k in range(3):
            if A[j][k] == i:
                A[j][k] = -1

if (A[0][0] == A[0][1] and A[0][1] == A[0][2] and A[0][2] == -1):
    print("Yes")
elif (A[1][0] == A[1][1] and A[1][1] == A[1][2] and A[1][2] == -1):
    print("Yes")
elif (A[2][0] == A[2][1] and A[2][1] == A[2][2] and A[2][2] == -1):
    print("Yes")
elif (A[0][0] == A[1][0] and A[1][0] == A[2][0] and A[2][0] == -1):
    print("Yes")
elif (A[0][1] == A[1][1] and A[1][1] == A[2][1] and A[2][1] == -1):
    print("Yes")
elif (A[0][2] == A[1][2] and A[1][2] == A[2][2] and A[2][2] == -1):
    print("Yes")
elif (A[0][0] == A[1][1] and A[1][1] == A[2][2] and A[2][2] == -1):
    print("Yes")
elif (A[0][2] == A[1][1] and A[1][1] == A[2][0] and A[2][0] == -1):
    print("Yes")
else:
    print("No")


Measured memory_bytes: 3192
#include<iostream>
#include<algorithm>
#include<cstring>
#include<vector>
#include<cstdio>
#define ll long long
using namespace std;
ll func(ll num){
	ll A = 1;
	for(int i = num; i >=1; i--){
		A*=i;
		A%=(1000000007);
	}
	return A;
}
int main(){
	ll n, m;
cin >> n >> m;
		if((n-m)>=2||(m-n)>=2){
			cout << 0 << endl;
		}else{
			ll t;
			if(n!=m){
				t = (func(n)*func(m))%(1000000007);
				cout << t << endl; 
			}else{
				t = ((func(n)*2)%(1000000007) *func(n) )%(1000000007);
				cout << t << endl;
			}
		}

	
	return 0;
} 
//A|m n = n!/(n-m)!;
//C|m n = n!/((n-m)!m!);

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/priority_queue.hpp>
#define priority_queue __gnu_pbds::priority_queue
typedef long long LL;
typedef long double LD;
typedef unsigned int ui;
typedef unsigned long long ul;
#define ri register int
#define pb push_back
#define fi first
#define se second
#define mid ((l + r) >> 1)
#define ls (i << 1)
#define rs (i << 1 | 1)
#define enum(i, j, k) for(int i = j; i <= k; i ++)
#define FO(x) { freopen(#x".in", "r", stdin); freopen(#x".out", "w", stdout); }
using namespace std;
typedef pair<int, int> pii;
typedef pair<LL, LL> pll;
typedef pair<int, LL> pil;
typedef pair<LL, int> pli;
typedef vector<int> vi;
#define ae(x) for(node *p = h[x]; p; p = p->nxt)
#define G \
	struct node { int v; node *nxt; } e[maxm], *h[maxn]; int z;\
	void adde(int u, int v) { e[++z].v = v; e[z].nxt = h[u]; h[u] = &e[z]; }\
	void addrev(int u, int v) { adde(u, v); adde(v, u); }
#define W \
	struct node { int v, w; node *nxt; } e[maxm], *h[maxn]; int z;\
	void adde(int u, int v, int w) { e[++z].v = v; e[z].w = w; e[z].nxt = h[u]; h[u] = &e[z]; }\
	void addrev(int u, int v, int w) { adde(u, v, w); adde(v, u, w); }
inline int _() // ret >= 0
{
	int ret = 0; char ch = getchar();
	while(ch < '0' || ch > '9') ch = getchar();
	do { ret = ret * 10 + ch - '0'; ch = getchar(); } while('0' <= ch && ch <= '9');
	return ret;
}
inline void _(int x) // x >= 0
{
	if(x < 10) { putchar(x + '0'); return ; }
	_(x / 10); putchar(x % 10 + '0');
}
void What_are_you_doing_at_the_end_of_the_world_Are_you_busy_Can_you_save_us()
{
	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	cout << fixed << setprecision(16);
}
/* Default Code Ends Here. */

#define maxn 100100
int n;
int a[maxn];
LL b[maxn];

int main()
{
	What_are_you_doing_at_the_end_of_the_world_Are_you_busy_Can_you_save_us();
	
	cin >> n;
	enum(i, 1, n)
		cin >> a[i];
	enum(i, 1, n)
		b[i] = b[i - 1] + a[i];
	LL Ans = b[n];
	LL sum = 0;
	enum(i, 1, n + 1)
	{
		if(a[i] == 0 && a[i - 1] != 0)
		{
			Ans -= sum & 1;
			sum = 0;
		}
		sum += a[i];
	}
	cout << Ans / 2 << endl;	
	return 0;
}


Measured memory_bytes: 1408
#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"
#include "numeric"
#include "cassert"
#include "ctime"

using namespace std;

constexpr long long int MOD = 1000000007;
//constexpr int MOD = 1000000007;
//constexpr int MOD = 998244353;
//constexpr long long int MOD = 998244353;
constexpr double EPS = 1e-8;

//int N, M, K, H, W, L, R;
long long int N, M, K, H, W, L, R;

long long int gcd(long long int a, long long int b) {
	while (b) {
		a %= b;
		swap(a, b);
	}
	return a;
}

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

	cin >> N >> M;
	cout << N * M / gcd(N, M) << endl;
}

Measured memory_bytes: 256
import sys
input = sys.stdin.buffer.readline
from operator import itemgetter

def main():
    N,K = map(int,input().split())
    INF = float('inf')
    dot = []
    for _ in range(N):
        x,y = map(int,input().split())
        dot.append((x,y))
    
    dot.sort(key = itemgetter(0,1))
    ans = INF
    for xdown in range(N):
        for xup in range(N):
            if xup - xdown + 1 < K:
                continue
            else:
                use = dot[xdown:xup+1]
                a,b = use[-1][0],use[0][0]
                use.sort(key = itemgetter(1))
                l = len(use)
                for udown in range(l):
                    for uup in range(l):
                        if uup - udown + 1 == K:
                            two = use[udown:uup+1]
                            c,d = two[-1][1],two[0][1]
                            S = (a-b)*(c-d)
                            ans = min(ans,S)
                            
    print(ans)

if __name__ == "__main__":
    main()

Measured memory_bytes: 3064
#include <stdio.h>

int main() {
    int x, y, z, sum=0;
    
    scanf("%d %d %d", &x, &y, &z);
    
    sum = x + y + z;
    
    if (sum <= 21) {
        printf("win");
    }else {
        printf("bust");
    }
    
    return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <map>
#include <queue>
#include <vector>
#include <cmath>

typedef long long ll;
#define fi first
#define se second

const ll mod = 1000000007;
//				123456789


using namespace std;

const ll base = 100000;

int w;
int h;

int c[112][112][2][2];
int ans;

int main(){
  
  int i;
  int j;
  
  while( scanf("%d %d", &w, &h), w != 0 || h != 0 ){
  	fill( c[0][0][0], c[112][0][0], 0 );
  	c[1][1][0][1] = 1;
  	c[1][1][1][1] = 1;
  	
  	for( i = 1; i <= h; i++ ){
  		for( j = 1; j <= w; j++ ){
  			(c[i+1][j][0][0] += c[i][j][0][0]+c[i][j][0][1])%=base;
  			(c[i+1][j][0][1] += c[i][j][1][0])%=base;
  			(c[i][j+1][1][0] += c[i][j][1][0]+c[i][j][1][1])%=base;
  			(c[i][j+1][1][1] += c[i][j][0][0])%=base;
  		}
  	}
  	

  	
  	ans = 0;
  	
  	for( i = 0; i < 2; i++){
  		for( j = 0; j < 2; j++ ){
  			(ans += c[h][w][i][j])%=base;
  		}
  	}
  	
  	
  	
  	cout<<ans<<endl;
  }
  

  
  
  
  return 0;
}

Measured memory_bytes: 3424
#include <iostream>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <boost/tuple/tuple.hpp>
#include <boost/foreach.hpp>

using std::string;
using std::vector;
using std::cout;
using std::endl;
const vector<string> candidates{"dream","dreamer","erase","eraser"};
string left(const string &s, int length)
{
  if(s.size() < length)
    return s;
  return s.substr(s.size() - length,length);
}
int check(const std::string & s)
{
  BOOST_FOREACH(const string & cand, candidates)
  {
    if(left(s,cand.size()) == cand)
      return cand.size();
  }
  return -1;
}


int main(){
  string s;
  std::cin >> s;
  int tail = -1;
  while(s.size() > 0) {
    tail = check(s);
    if(tail < 0)
      break;
    s = s.substr(0,s.size() - tail);
  }
  if(tail < 0)
    cout<<"NO"<<endl;
  else
    cout<<"YES"<<endl;
    
  return 0;
}


Measured memory_bytes: 512