akhauriyash/Code-Regression huggingface dataset:
package main

import "fmt"

func min(a, b int) int {
	if a >= b {
		return b
	}
	return a
}

func abs(a int) int {
	if a >= 0 {
		return a
	}
	return (-a)
}

func main() {
	var n, k, sum int
	fmt.Scan(&n, &k)
	x := make([]int, n)
	for i := range x {
		fmt.Scan(&x[i])
	}
	for i := 0; i < n; i++ {
		sum += min(x[i]*2, abs(k-x[i])*2)
	}
	fmt.Println(sum)
}


Measured memory_bytes: 512
#include<stdio.h>

int main(void){

    int N,K;
    long A[200001]={};
    int i;

    //input
    scanf("%d %d",&N,&K);
    for(i=1;i<=N;i++){
        scanf("%ld",&A[i]);
    }

    //Yes or No
    for(i=K+1;i<=N;i++){
        if(A[i]>A[i-K]){
            printf("Yes\n");
        }else{
            printf("No\n");
        }
    }    

    return 0;
}

Measured memory_bytes: 3224
#include <iostream>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <string>
#include <cstdlib>

using namespace std;

typedef long long ll;
const int INF = 1e8;

int main() {
    int N;
    cin >> N;
    vector<int> a(N);
    vector<bool> used(N, false);
    for(int i = 0; i < N; i++) {
        cin >> a[i];
        a[i]--;
    }
    int ans = 0;

    for(int i = 0; i < N; i++) {
        if(used[i]) continue;
        if(i == a[a[i]]) {
            ans++;
            used[i] = true;
            used[a[i]] = true;
        }
    }

    cout << ans << endl;
}

Measured memory_bytes: 640
"use strict"
const create = () => {
    const input = require("fs").readFileSync("/dev/stdin", "utf8").trim().split("\n");
    const res = {
        "list": input, "index": 0, "max": input.length,
        "hasNext": function() {return this.index < this.max},
        "next": function() { if (!this.hasNext()) {throw "ArrayIndexOutOfBoundsException";}else{return this.list[this.index++];}}
    };
    return res;
}
const o = create();
const next = () => o.next()
const nextInt = () => parseInt(o.next())
const nextStrArray = () => o.next().split(" ")
const nextIntArray = () => o.next().split(" ").map(el => parseInt(el))
const nextCharArray = () => o.next().split("")
const hasNext = () => o.hasNext()
const myout = (...x) => console.log(...x)
const avg = (n) => (n+1)/2
const Main = () => {
    const [N, K] = nextIntArray()
    let p = nextIntArray()
    let max = 0
    let curr = 0
    for(let i = 0; i<K; i++){
        curr = curr+ avg(p[i])
    }
    max = Math.max(max, curr)
    for(let i = K; i<N; i++){
        curr = curr - avg(p[i-K])
        curr = curr + avg(p[i])
        max = Math.max(max, curr)
    }
    console.log(max)
}
Main()


Measured memory_bytes: 48812
import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String SA = sc.next();
    String SB = sc.next();
    String SC = sc.next();
    
    String result = "";
    int a = 0;
    int b = 0;
    int c = 0;
    char next = 'a';
    while(true){
      if(next == 'a'){
        if(a == SA.length()){
          result = "A";
          break;
        }else{
          next = SA.charAt(a);
          a++;
        }
      }else if(next == 'b'){
        if(b == SB.length()){
          result = "B";
          break;
        }else{
          next = SB.charAt(b);
          b++;
        }
      }else{
        if(c == SC.length()){
          result = "C";
          break;
        }else{
          next = SC.charAt(c);
          c++;
        }
      }
    }
    System.out.println(result);
  }
}

Measured memory_bytes: 35576
#include<stdio.h>
long long R=1,C=1,H[2000010],N[2000010];
//評価関数（いまはMIN）
int hyouka(int a,int b){
  if(C<b)return 1;
  if(C<a||b==0)return 0;
  return N[H[a]]<N[H[b]]?1:0;
}
//挿入関数
void hin(long long a){
  int i=C++;
  for(N[H[0]=R]=a;hyouka(0,i/2);i/=2)H[i]=H[i/2];
  H[i]=R++;
}
//取り出す関数
int hout(){
  int rt=H[1],i,j=2,k=H[--C];
  for(i=1;hyouka(i,C);i=j)H[i]=H[j=i*2+1-hyouka(i*2,i*2+1)];
  H[j/2]=k;
  return rt;
}
int main(){
  long long n,i,a,c[100010],d[100010],r=0,e[100010]={1};
  scanf("%lld",&n);
  for(i=0;i<n;i++){
    scanf("%lld",&a);
    hin(a);
  }
  for(i=0;i<n;i++)d[i]=N[hout()];
  c[r=0]=d[0];
  r=1;
  for(i=1;i<n;i++){
    if(d[i-1]-d[i])c[r++]=d[i];
    e[r-1]++;
  }//printf("%d %d\n",r,e[0]);
  //for(i=0;i<r;i++)printf("%lld %lld\n",c[i],e[i]);
  if(r==1&&c[0]==0)goto Yes;
  //if(n%3)goto END;
  if(r==3&&e[0]==e[1]&&e[0]==e[2]&&(c[0]^c[1])==c[2])goto Yes;
  if(r==2&&e[0]*2==e[1]          &&c[0]==0)goto Yes;
  goto END;    
 Yes:;
  printf("Yes\n");
  return 0;
 END:;
  printf("No\n");
  return 0;
}


Measured memory_bytes: 7296
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int A = in.nextInt();
		int B = in.nextInt();
		int C = in.nextInt();
		int X = in.nextInt();
		int Y = in.nextInt();
		int ans = 0;
		if (A + B > C * 2) {
			int min = Math.min(X, Y);
			ans += (min * C) * 2;
			if (X > min) {
				if (A > C * 2) {
					ans += (X - min) * C * 2;
				} else {
					ans += (X - min) * A;
				}
			} else if (Y > min) {
				if (B > C * 2) {
					ans += (Y - min) * C * 2;
				} else {
					ans += (Y - min) * B;
				}
			}
		} else {
			ans += A * X + B * Y;
		}
		System.out.println(ans);
		in.close();
	}
}

Measured memory_bytes: 22740
using System;
using static System.Console;
using static System.Math;

public class Hello{
    public static void Main(){
        string[] input = ReadLine().Split(' ');
        int studen = int.Parse(input[0]);
        int checkp = int.Parse(input[1]);
        int[,] stuz = new int[studen,2];
        int[,] chez = new int[checkp,2];
        for(int i=0;i<studen;i++){
            string[] temp = ReadLine().Split(' ');
            stuz[i,0] = int.Parse(temp[0]);
            stuz[i,1] = int.Parse(temp[1]);
        }
        
        for(int i=0;i<checkp;i++){
            string[] temp = ReadLine().Split(' ');
            chez[i,0] = int.Parse(temp[0]);
            chez[i,1] = int.Parse(temp[1]);
        }
        
        for(int i=0;i<studen;i++){
            int min = 999999999;
            int ans = 0;
            for(int j=0;j<checkp;j++){
                int leng = Abs(stuz[i,0] - chez[j,0]) + Abs(stuz[i,1] - chez[j,1]);
                if(min > leng){
                    min = leng;
                    ans = j+1;
                }
            }
            WriteLine(ans);
        }
    }
}


Measured memory_bytes: 11220
// I SELL YOU...! 
#include<iostream>
#include<vector>
#include<algorithm>
#include<functional>
#include<queue>
#include<chrono>
#include<iomanip>
#define MAX_H 11000ll
#define INF 1000000000000
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
void init_io(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << setprecision(10);
}
signed main(){
  init_io();
  ll h,n;
  cin >> h >> n;
  vector<ll> dp(MAX_H+1,INF);
  ll a[n],b[n];
  for(int i=0;i<n;i++){
    cin >> a[i] >> b[i];
  }
  dp[0] = 0;
  for(int i=0;i<n;i++){
    for(int j=0;j<=MAX_H;j++){
      ll idx = j+a[i];
      idx = min(idx,MAX_H);
      dp[idx] = min(dp[idx],dp[j]+b[i]);
    }
  }
  ll ans = INF;
  for(int i=h;i<=MAX_H;i++){
    ans = min(ans,dp[i]);
  }
  cout << ans << endl;
}


Measured memory_bytes: 384
#include<cstdio>
#include<algorithm>
using namespace std;
int main(){
  int n,a,sum;
  scanf("%d",&n);

  while(n != 0){
    
    int ma = 0,mi = 500;
    for(int i=0;i<n;i++){
      sum = 0;
      for(int j=0;j<5;j++){
	scanf("%d",&a);
	sum += a;
      }
      ma = max(ma,sum);
      mi = min(mi,sum);
    }
    printf("%d %d\n",ma,mi);
    scanf("%d",&n);
  }

  return (0);
}

Measured memory_bytes: 2680
import bisect
A, B, Q = map(int, input().split())
INF = 10 ** 18
s = [-INF] + [int(input()) for i in range(A)] + [INF]
t = [-INF] + [int(input()) for i in range(B)] + [INF]
for q in range(Q):
    x = int(input())
    b, d = bisect.bisect_right(s, x), bisect.bisect_right(t, x)
    res = INF
    for S in [s[b - 1], s[b]]:
        for T in [t[d - 1], t[d]]:
            d1, d2 = abs(S - x) + abs(T - S), abs(T - x) + abs(S - T)
            res = min(res, d1, d2)
    print(res)

Measured memory_bytes: 12800
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
inline int in() { int x; scanf("%d",&x); return x;}
template<typename T>inline istream& operator>>(istream&i,v(T)&v)
{rep(j,sz(v))i>>v[j];return i;}
template<typename T>string join(const v(T)&v)
{stringstream s;rep(i,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename T>inline ostream& operator<<(ostream&o,const v(T)&v)
{if(sz(v))o<<join(v);return o;}
template<typename T1,typename T2>inline istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
template<typename T1,typename T2>inline ostream& operator<<(ostream&o,const pair<T1,T2>&v)
{return o<<v.fi<<","<<v.se;}
template<typename T>inline ll suma(const v(T)& a) { ll res(0); for (auto&& x : a) res += x; return res;}
const double eps = 1e-10;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
#define dame { puts("-1"); return 0;}
#define yn {puts("Yes");}else{puts("No");}
const int MX = 200005;
#define RET(ans) {cout<<ans<<endl;return 0;} 

    // 二次元ベクターの基本
    /*
    vector<vector<int>> dp; // 宣言
    dp.resize(n); // 1次元めの要素数決定
    dp[i].push_back(int); // プッシュバック
    rep(i,n){
        sort(dp[i].begin(),dp[i].end()); // 二次元めを昇順ソート
    }
    */

    // 整数スキャン（複数）
    /*
    int x,y,z;
    scanf("%d%d%d",&x,&y,&z);

    // n個の整数のスキャン
    /*
    ll a[n] = {};
    rep(i,n){
        scanf("%lld",&a[i]);
    }
    */

    // 文字列スキャン
    /*
    string s; cin >> s;
    */

    // n個の文字列スキャン
    /*
    vector<string> slist;
    rep(i,n){
        string s; cin >> s;
        slist.push_back(s);
    }
    */

int main() {
    ll n,t;
    cin >> n >> t;
    ll a[n] = {};
    rep(i,n){
        scanf("%lld",&a[i]);
    }


    ll ans = 0;

    rep(i,n-1){
        ans += min(t,a[i+1]-a[i]);
    }
    ans += t;
    
    cout << ans << endl;
    return 0;
}
 
 


Measured memory_bytes: 1792
// AOJ1057 Rolling Dice

#include <iostream>
#include <queue>
#include <string.h>

using namespace std;

class Node{
public:
	int x, y, d0, d1, c;
	Node(int x, int y, int d0, int d1, int c) : x(x), y(y), d0(d0), d1(d1), c(c) {}
	bool operator < (const Node &nd) const { return c > nd.c; }
};

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

char dice[6][4] = {
	{5,2,1,4}, {1,1,3,0}, {0,3,2,2},
	{2,5,4,1}, {4,4,0,3}, {3,0,5,5}
};
char side[] = {1,2,4,5};
int dice_color[6] = {1, 4, 2, 6, 3, 5};

int getUpper(int a, int b){
	if(a%3 == 0) return dice_color[a+0];
	if(b%3 == 0) return dice_color[b+1];
	for(int i=0;i<4;i++)
		if(a==side[i]&&b==side[(i+1)%4]) return dice_color[2];
	return dice_color[5];
}

int main(){
	int w, h;
	int cost[10][10];
	while(cin >> h >> w, w){
		for(int i=0;i<h;i++)
			for(int j=0;j<w;j++) cin >> cost[i][j];
		int sx, sy, gx, gy;
		cin >> sx >> sy >> gx >> gy;
		int mem[10][10][6][6];
		memset(mem, -1, sizeof(mem));
		priority_queue<Node> qu; qu.push(Node(sx, sy, 0, 1, 0));
		mem[sx][sy][0][1] = 0;
		while(!qu.empty()){
			Node nd = qu.top(); qu.pop();
			int x = nd.x, y = nd.y, d0 = nd.d0, d1 = nd.d1, c = nd.c;
			if(mem[x][y][d0][d1]!=c) continue;
			if(x==gx&&y==gy){
				cout << mem[x][y][d0][d1] << endl;
				break;
			}
			for(int i=0;i<4;i++){
				int nx = x+dx[i], ny = y+dy[i], nd0 = dice[d0][i], nd1 = dice[d1][i];
				if(nx<0||h<=nx||ny<0||w<=ny) continue;
				if(mem[nx][ny][nd0][nd1]==-1||mem[nx][ny][nd0][nd1]>mem[x][y][d0][d1]+cost[nx][ny]*(7-getUpper(nd0,nd1))){
					qu.push(Node(nx,ny,nd0,nd1,mem[x][y][d0][d1]+cost[nx][ny]*(7-getUpper(nd0,nd1))));
					mem[nx][ny][nd0][nd1] = mem[x][y][d0][d1]+cost[nx][ny]*(7-getUpper(nd0,nd1));
				}
			}
		}
	}
}

Measured memory_bytes: 944
#!/usr/bin/env python3

import sys
from collections import defaultdict
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

N, K = map(int, readline().split())
A = list(map(int, readline().split()))
A = [a-1 for a in A]


seen = defaultdict(list)
count = 0
pos = 0
seen[pos].append(count)

while True:
    pos = A[pos]
    count += 1
    seen[pos].append(count)
    if len(seen[pos]) == 2:
        head = seen[pos][0]
        loop = count - head
        break


if K < head:
    pos = 0
    for i in range(K):
        pos = A[pos]
    print(pos+1)


else:
    K = K - head
    res = K % loop
    for i in range(res):
        pos = A[pos]

    print(pos+1)




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


ll n;
const ll mod = 1e9 + 7;

struct M{
	vector<vector<ll>> t;
	M(){
		t.resize(n, vector<ll>(n));
	}

	M operator* (const M& b) const{
		M c = M();
		for(int i=0;i<n;i++)
			for(int j=0;j<n;j++)
				for(int k=0;k<n;k++)
					c.t[i][k] = (c.t[i][k] + (t[i][j]*b.t[j][k])%mod)%mod;
		return c;
	}
};

int main(){
	ll k;
	cin >> n >> k;
	M m = M();
	for(int i=0;i<n;i++)
		for(int j=0;j<n;j++)
			cin >> m.t[i][j];

	M answer = M();
	for(int i=0;i<n;i++)
		answer.t[i][i] = 1;

	while(k>0){
		if(k%2==1)
			answer = answer*m;
		m = m*m;
		k/=2;
	}

	ll total = 0;
	for(int i=0;i<n;i++){
		for(int j=0;j<n;j++){
			total = (total+answer.t[i][j])%mod;
		}
	}

	cout<< total << endl; 
}

Measured memory_bytes: 256
N = int(input())
height = list(map(int, input().split(" ")))
dp = [0]*N
 
for i in range(1,N):
  if i <= 2:
    dp[i] = abs(height[i]-height[0])
  else:
    dp[i] = min(dp[i-1] + abs(height[i]-height[i-1]), dp[i-2] + abs(height[i]-height[i-2]))

print(dp[N-1])

Measured memory_bytes: 20592
# import numpy as np
# import math
# import copy
# from collections import deque
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(10000)


def main():
    N,M = map(int,input().split())
    A = [input().rstrip() for i in range(N)]
    B = [input().rstrip() for i in range(M)]

    res = 'No'

    for i in range(N-M+1):
        for j in range(N-M+1):
            for k in range(M):
                if A[j+k][i:i+M] != B[k]:
                    break
                if k == M - 1:
                    res = 'Yes'

    print(res)



main()


Measured memory_bytes: 3064
#include "bits/stdc++.h"
// Begin Header {{{
#define all(x) (x).begin(), (x).end()
#define rep(i, s, n) for (i64 i = (s), i##_limit = (n); i < i##_limit; ++i)
#define repr(i, s, t) for (i64 i = (s), i##_limit = (t); i >= i##_limit; --i)
#define var(type, ...) \
    type __VA_ARGS__;  \
    read(__VA_ARGS__);
#ifndef DBG
#define dump(...)
#endif
using namespace std;
using i64 = int_fast64_t;
using pii = pair<i64, i64>;
template <class T, class U>
inline bool chmax(T &a, const U &b) {
    return b > a && (a = b, true);
}
template <class T, class U>
inline bool chmin(T &a, const U &b) {
    return b < a && (a = b, true);
}
constexpr int INF = 0x3f3f3f3f;
constexpr i64 LINF = 0x3f3f3f3f3f3f3f3fLL;

template <class T>
inline vector<T> makeV(const T &initValue, size_t sz) {
    return vector<T>(sz, initValue);
}

template <class T, class... Args>
inline auto makeV(const T &initValue, size_t sz, Args... args) {
    return vector<decltype(makeV<T>(initValue, args...))>(
        sz, makeV<T>(initValue, args...));
}

template <class T>
inline istream &operator>>(istream &is, vector<T> &vec) {
    for (auto &e : vec) is >> e;
    return is;
}

inline void read() {}

template <class Head, class... Tail>
inline void read(Head &head, Tail &... tail) {
    cin >> head;
    read(tail...);
}

inline void print() { cout << "\n"; }

template <class Head, class... Tail>
inline void print(Head &&head, Tail &&... tail) {
    cout << head;
    if (sizeof...(tail)) cout << ' ';
    print(forward<Tail>(tail)...);
}

template <class T>
inline ostream &operator<<(ostream &os, const vector<T> &vec) {
    static constexpr const char *delim[] = {" ", ""};
    for (const auto &e : vec) os << e << delim[&e == &vec.back()];
    return os;
}

template <class Container>
struct Rev {
    Container &x_;
    inline Rev(Container &x) : x_(x) {}
    inline auto begin() { return rbegin(x_); }
    inline auto end() { return rend(x_); }
};

template <typename Container>
auto reversed(Container &x) {
    return Rev<Container>(x);
}
// }}} End Header

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

    var(i64, N, M);
    vector<i64> a(N);
    read(a);
    sort(all(a));

    const auto f = [&](i64 X) {
        i64 cnt = 0;
        for (const i64 e : a) {
            cnt += end(a) - lower_bound(all(a), X - e);
        }
        return cnt;
    };

    i64 ok = 0;
    i64 ng = INF;
    while (ng - ok > 1) {
        const i64 mid = (ok + ng) / 2;
        if (f(mid) >= M)
            ok = mid;
        else
            ng = mid;
    }

    vector<i64> cum(N + 1);
    repr(i, N - 1, 0) { cum[i] = cum[i + 1] + a[i]; }

    i64 ans = 0;
    i64 cnt = 0;
    for (const i64 e : reversed(a)) {
        const int p = lower_bound(all(a), ok - e + 1) - begin(a);
        assert(cnt + (N - p) <= M);
        ans += cum[p] + e * (N - p);
        cnt += N - p;
    }

    ans += ok * (M - cnt);

    print(ans);

    return 0;
}


Measured memory_bytes: 1792
#include<iostream>
using namespace std;
int main(){
	long long n,k,a,b,c,ans=0;
	cin>>n>>k;
	if(k%2==0){
		long long s=0;
		for(int i=1;i<=n;i++){
			if(i%k==k/2){
				s++;
			}
		}
		ans=(n/k)*(n/k)*(n/k)+s*s*s;
	}
	else{
		ans=(n/k)*(n/k)*(n/k);
	}
	cout<<ans;
	return 0;
}

Measured memory_bytes: 256
//هوالحق
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

int main(){
    int X, Y, x, y;
    cin >> X >> Y >>x >> y;
    ll S = ll(X) * Y;
    cout << S/2 << (S%2?".5":".0") << "00000000 " << ((2*x == X && 2 *y == Y)?1:0);
}


Measured memory_bytes: 256
/*
ID: anonymo14
TASK: wormhole
LANG: C++                 
*/
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<pair<int,int>> vpii;

#define F first
#define S second
#define PU push
#define PUF push_front
#define PUB push_back
#define PO pop
#define POF pop_front
#define POB pop_back

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

#define MOD 1000000007

void solve(int test_case) {//239///F.Sugoroku
	int n;
	cin>>n;
	vi sol(n);
	REP(i,1,n) {
		int val;
		cin>>val;
		sol[val-1]=i;
	}
	REP(i,0,n-1) cout<<sol[i]<<" ";
}

int main() {
	
	////// FILE BASED IO////
	//freopen("wormhole.in", "r", stdin);
	//freopen("wormhole.out", "w", stdout);
	///////////////
	
	ios::sync_with_stdio(0);
	cin.tie(0);
	int t=1;
	//cin>>t;
	REP(i,1,t) {
		solve(i);
	}
	return 0;
}	


Measured memory_bytes: 3688
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <cmath>
#include <stack>
#include <set>
#include <map>
typedef long long ll;
typedef unsigned int uint;
using namespace std;

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

    int ax, ay, bx, by, cx, cy;
    cin >> ax >> ay >> bx >> by >> cx >> cy;

    double a = hypot(ax - bx, ay - by);
    double b = hypot(bx - cx, by - cy);
    double c = hypot(cx - ax, cy - ay);

    double p = (a + b + c) / 2;
    double S = sqrt(p * (p - a) * (p - b) * (p - c));
    double r = S / p;
    double mx = max({a, b, c});
    cout << fixed << setprecision(12) << mx * r / (2 * r + mx) << "\n";
    return 0;
}

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

bool isOk (string s) {
  string t = s;
  reverse(t.begin(), t.end());
  return s == t;
}

int main() {
  string s;
  cin >> s;
  if (isOk(s) && isOk(s.substr(0, s.size() / 2))) {
    cout << "Yes" << endl;
    return 0;
  }
  cout << "No" << endl;
  return 0;
}

Measured memory_bytes: 256
package main

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

func main() {
	N := nextInt64()
	n := N

	if N == 1 {
		fmt.Println(0)
		return
	}

	c := 0

	for i := int64(2); i*i <= N; i++ {
		e := 0
		for n%i == 0 {
			e++
			n /= i
		}
		for x := 1; x <= e; x++ {
			c++
			e -= x
		}
	}
	if n != 1 {
		c++
	}
	fmt.Println(c)
}

var stdin = initStdin()

func initStdin() *bufio.Scanner {
	bufsize := 1 * 1024 * 1024 // 1 MB
	var stdin = bufio.NewScanner(os.Stdin)
	stdin.Buffer(make([]byte, bufsize), bufsize)
	stdin.Split(bufio.ScanWords)
	return stdin
}

func nextString() string {
	stdin.Scan()
	return stdin.Text()
}

func nextInt64() int64 {
	i, _ := strconv.ParseInt(nextString(), 10, 64)
	return i
}


Measured memory_bytes: 1808
//----------BHAVIK DIWANI(PICT_COMP)---------------
#include<bits/stdc++.h>
#define test ll t; cin>>t; while(t--)
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define mod 1000000007
#define ll long long
#define int long long
#define ull unsigned long long
#define MAX 1000005
#define pb push_back
#define mkp make_pair
#define vi vector<int>
#define pii pair<int,int>
#define endl '\n'
#define vs vector<string>
#define mii map<int,int>
#define msi map<string,int>
#define vpii vector< pair<int, int > >
#define vpsi vector< pair< string ,int > >
#define forci(p,q) for(int i=p;i<q;i++)
ll gcd(ll a,ll b){ if(b==0) return a;    return gcd(b,a%b);}
ll lcm(ll a,ll b) { return (a/gcd(a,b)*b);}
ull power(ull a, ull b) {a %= mod;  ull res = 1;  while (b > 0) { if (b & 1) res = res * a % mod;  a = a * a % mod;  b >>= 1; }  return res%mod; }
ll modmul(ll x, ll y){return (x*y)%mod;}
ll modadd(ll x, ll y){return (x+y)%mod;}
ll modsub(ll x, ll y){return (x-y+mod)%mod;}
ll fact[1000007]={0};
void facto() {fact[0]=1;fact[1]=1;for(int i=2;i<1000007;i++)fact[i]=(fact[i-1]*i)%mod;}
ll ncr(ll n,ll r) {ll res=1; res=fact[n]; res=(res*(power(fact[r],mod-2)))%mod; res=(res*(power(fact[n-r],mod-2)))%mod; return res;}
ll npr(ll n,ll r) {ll res=1; res=fact[n]; res=(res*(power(fact[n-r],mod-2)))%mod; return res;}
inline long long toint(const std::string &s) {std::stringstream ss; ss << s; long long x; ss >> x; return x;}
inline std::string tostring(long long number) {std::stringstream ss; ss << number; return ss.str();}
inline std::string tobin(long long x) {return std::bitset<63>(x).to_string();}
/*bool prime[MAX];
ull sieve(){memset(prime,true,sizeof(prime));for(ull p=2;p*p<MAX;p++){if(prime[p]==true){for(ull i=2*p;i<MAX;i+=p){prime[i]=false;}}}prime[0]=0;prime[1]=0;
}*/
/*int inv[1000001]={0};
void findinverse(){inv[1] = 1;for(int i = 2; i <=1e6 ; ++i)	inv[i] = (mod - (mod/i) * inv[mod%i] % mod) % mod;}
*/
using namespace std;
int solve()
{	
	string t,s;
	cin>>s>>t;
	string ans=t+s;
	cout<<ans;
	return 0;
}
signed main()
{
	fastio;
//	test
		solve();
}







Measured memory_bytes: 3640
#include <bits/stdc++.h>
using namespace std;
typedef long long int LL;
const int MAXN = 100005;

int n, m, a[MAXN], b[MAXN];
LL cur, ans;

int main(){
	int i, p;
	scanf("%d%d", &n, &m);
	for(i = 1; i <= n; ++ i){
		scanf("%d%d", &a[i], &b[i]);
		if((a[i] & m) == a[i])
			ans += b[i];
	}
	for(p = 1; p <= m; p <<= 1){
		if(m & p){
			m ^= p, cur = 0;
			for(i = 1; i <= n; ++ i)
				if((a[i] & m) == a[i])
					cur += b[i];
			if(cur > ans) ans = cur;
		} m ^= p;
	} cout << ans << endl;
	return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
 
 
int main (){
    int N;
    cin>>N;
    bool t=false;
    for(int i=1; i<10; i++){
        if(N%i==0&&N/i<10){
            t=true;
            break;
        }
    }
    cout<<(t?"Yes":"No")<<endl;
}

Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <functional>
#include <utility>
#include <tuple>
#include <cctype>
#include <bitset>
#include <complex>
#include <cmath>
#include <array>
#include <numeric>
using namespace std;
#define INF 0x3f3f3f3f
#define INFLL 0x3f3f3f3f3f3f3f3fLL
#define MOD 998244353
//#define MOD 1000000007
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define eb emplace_back
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pint;
typedef pair<ll,ll> pll;
typedef tuple<int,int,int> tint;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<ull> vull;
typedef vector<pint> vpint;
typedef vector<tint> vtint;
typedef vector<vint> vvint;
int dx[8]={0,0,-1,1,1,1,-1,-1};
int dy[8]={-1,1,0,0,1,-1,1,-1};
const int SIZE=3050;
//↑templete
signed main(){

    int N, S;
    cin>>N>>S;
    ll A[SIZE]={};
    for(int i=0;i<N;i++)
        cin>>A[i];
    static ll DP[SIZE][SIZE]={};
    for(int i=0;i<N;i++){
        (DP[i][0]+=1LL)%=MOD;
        for(int s=0;s<=S;s++){
            (DP[i+1][s]+=DP[i][s])%=MOD;
            (DP[i+1][s+A[i]>S?S+1:s+A[i]]+=DP[i][s])%=MOD;
        }
    }
    ll ans=0;
    for(int i=1;i<=N;i++)
        (ans+=DP[i][S])%=MOD;
    cout<<ans<<endl;

    return 0;
}


Measured memory_bytes: 71936
using System;
using System.Linq;

namespace C
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int[] H = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
            int ans = 0;
            int active = 0;
            for(int i = 0; i < n; i++)
            {
                if (H[i] > active) ans += H[i] - active;
                active = H[i];
            }
            Console.WriteLine(ans);
        }
    }
}
//AC
//namespace C
//{
//    class Program
//    {
//        static void Main(string[] args)
//        {
//            int n = int.Parse(Console.ReadLine());
//            int[] H = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
//            int cnt = 0;
//            while (true)
//            {
//                if (H.Max() == 0) break;
//                //前の数が0だとtrue
//                bool flag = true;
//                for(int i = 0; i < n; i++)
//                {
//                    if (H[i] == 0) flag = true;
//                    if (H[i] > 0)
//                    {
//                        if (flag) cnt++;
//                        H[i]--;
//                        flag = false;
//                    }
//                }
//            }
//            Console.WriteLine(cnt);
//        }
//    }
//}


Measured memory_bytes: 28192
'use strict'

const main = input => {
	const args = input.split('\n').map(arg => arg.split(' '))
	const n = parseInt(args[0][0], 10)
	const m = parseInt(args[0][1], 10)
	console.log((n - 1) * (m - 1))
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'))


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

using namespace std;
using llong = long long;
using ldbl = long double;
using P = pair<llong, llong>;

#define BE(x) x.begin(), x.end()

const llong inf = llong(1e18)+7;
const llong mod = 1e9+7;

int main(){
	int N;
	cin >> N;
	int S = N*(N-1)/2;
	if(N&1^1)
		S--;

	vector<P> ans;
	vector<int> num(N+1,S);
	for(int i = N; i >= 2; i--){
		if(num[i] == 0)
			continue;

		int maxi = i*(i-1)/2;
		int exc = maxi - num[i];
		cerr << i << " " << maxi << " " << exc << endl;
		for(int j = 1; j < i; j++)
			if(j != exc){
				num[i] -= j, num[j] -= i;
				ans.push_back(P(i,j));
			}
	}

	cout << ans.size() << endl;
	for(auto x : ans)
		cout << x.first << " " << x.second << endl;

	return 0;
}

/*
少なくともS > N
辺の本数はN*(N-1) → 完全グラフまで

Nに1~N-1を接続した時。頂点Nのスコアは(1+N-1)*(N-1)/2 = N(N-1)/2
その他はN

他の頂点をつなげてN(N-1)/2 - N = N(N-3)/2 = (N^2-3N)/2 をつくりたい
*/

Measured memory_bytes: 512
#include <iostream>
#include <cstdint>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <cassert>
#include <climits>
#include <string>
#include <bitset>
#include <cfloat>
#include <unordered_set>
#pragma GCC optimize("Ofast")
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef vector<pair<int, int>> vpii;
typedef vector<vector<int>> vvi;
typedef vector<vector<char>> vvc;
typedef vector<vector<string>> vvs;
typedef vector<vector<ll>> vvll;

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define irep(it, stl) for (auto it = stl.begin(); it != stl.end(); it++)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define mes(a) cout << (a) << endl
#define dmes(a, b) cout << (a) << " " << (b) << endl
#define re0 return 0
#define mp(p, q) make_pair(p, q)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define Sort(a) sort(a.begin(), a.end())
#define rSort(a) sort(a.rbegin(), a.rend())
#define MATHPI acos(-1)
#define itn int
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
template <class T>
inline bool chmax(T &a, T b)
{
    if (a < b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
inline bool chmin(T &a, T b)
{
    if (a > b)
    {
        a = b;
        return 1;
    }
    return 0;
}
struct io
{
    io()
    {
        ios::sync_with_stdio(false);
        cin.tie(0);
    }
};
const int INF = INT_MAX;
const ll LLINF = 1LL << 60;
const ll MOD = 1000000007;
const double EPS = 1e-19;




signed main() {
    ll n;
    cin >> n;
    
    vll p(n);
    vll not10;
    ll n10c = 0;
    
    ll sum = 0;
    
    rep(i, n) {
        cin >> p[i];
        sum += p[i];
        
        if (p[i] % 10 != 0) {
            not10.pb(p[i]);
            n10c ++;
        }
    }
    
    Sort(not10);
    
    if (sum % 10 == 0 && n10c != 0) {
        sum -= not10[0];
    }
    
    if (sum % 10 == 0) sum = 0;
    
    

    mes(sum);
    
    
    
}


Measured memory_bytes: 3580
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cstdio>
#include <queue>
#include <stack>
#include <map>
#include <cstdlib>

#define rep(i, n) for(int i = 0; i < n; i++)
#define FOR(i, a, b) for(int i = a; i < b; i++)
#define all(v) (v).begin(), (v).end()
#define MP make_pair

using namespace std;

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> P;
typedef vector<P> vp;

void pp(vi v){
	rep(i, v.size()){
		cout << v[i] << ' ';
	}
	cout << endl;
}

void pp(vector<string> v){
	rep(i, v.size()){
		cout << v[i] << endl;
	}
}

void pp(int (*v)[20], int size = 20){
	rep(i, size){
		rep(j, size){
			cout << v[i][j] << ' ';
		}
		cout << endl;
	}
}

void pp(char (*v)[80], int size = 30){
	rep(i, size){
		rep(j, size){
			cout << v[i][j];
		}
		cout << endl;
	}
}


int check(vector<string> vs, string s){
	rep(i, vs.size()){
		if(vs[i] == s)return i;
	}
	return -1;
}


int main(){
	int a, L;
	char buf[100];
//	freopen( "b.out", "w", stdout);
	
	while(cin >> a >> L){
		if(!a && !L)break;
		sprintf(buf, "%d", a);
		string s = buf;
		while(s.size() < L){ // 先頭を0埋め
			s = '0' + s;
		}
		vector<string> v;

		v.push_back(s); // sortして
		while(true){
			sort(all(s));	// 最小
			string t = s;
			reverse(all(t));	// 最大
			sprintf(buf, "%d", atoi(t.c_str())-atoi(s.c_str()));
			s = buf;	// 最大-最小
			while(s.size() < L){ // 先頭を0埋め
				s = '0' + s;
			}
			int i = check(v, s);
			if( i != -1){// 過去に出てきてないかチェック
//				cout << "***";
				cout << i << ' ' <<  atoi(s.c_str()) << ' ' << v.size()-i << endl;
				break;
			}
			v.push_back(s);
		}
	}


	return 0;
}

Measured memory_bytes: 1280
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include <algorithm>
#include <string>

using namespace std;


int main(void){

	double d;
	while( scanf("%lf", &d) != EOF ) {
		if( d <= 48.00 ) {
			cout << "light fly" << endl;
		} else if( d <= 51.00 ) {
			cout << "fly" << endl;
		} else if( d <= 54.00 ) {
			cout << "bantam" << endl;
		} else if( d <= 57.00 ) {
			cout << "feather" << endl;
		} else if( d <= 60.00 ) {
			cout << "light" << endl;
		} else if( d <= 64.00 ) {
			cout << "light welter" << endl;
		} else if( d <= 69.00 ) {
			cout << "welter" << endl;
		} else if( d <= 75.00 ) {
			cout << "light middle" << endl;
		} else if( d <= 81.00 ) {
			cout << "middle" << endl;
		} else if( d <= 91.00 ) {
			cout << "light heavy" << endl;
		} else {
			cout << "heavy" << endl;
		}
	}

    return 0;
}

Measured memory_bytes: 1228
import java.util.*;

class Main{
	public static void main(String args[]){
		int H, W;
		Scanner scan = new Scanner(System.in);

		while(true){
			H = scan.nextInt();
			W = scan.nextInt();
			
			if(H == 0 && W == 0){break;}

			for(int i=0; i<H; i++){
				for(int k=0; k<W; k++){
					if(i % 2 == 0){
						//??¶??°????????????
						if(k % 2 ==0){
							System.out.print("#");
						}
						else{
							System.out.print(".");
						}
					}
					else{
						//?\???°????????????
						if(k % 2 ==0){
							System.out.print(".");
						}
						else{
							System.out.print("#");
						}
					}
				}
				System.out.println("");
			}
			System.out.println("");
		}
	}
}

Measured memory_bytes: 33024
def main():
    a, b, k = map(int, input().split())

    ans = set()

    # for i in range(a, b + 1):
    #     ans.add(i)

    for i in range(k):
        x = a + i
        if x <= b:
            ans.add(x)

        y = b - i
        if a <= y:
            ans.add(y)

    for i in sorted(list(ans)):
        print(i)


if __name__ == '__main__':
    main()


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

public class Main
{

  public static void main(String[] args) throws IOException
  {
    BufferedReader r = new BufferedReader(new InputStreamReader(System.in), 1);
    String s = r.readLine();
    String[] sl = s.split("[\\s]+");
    int n = Integer.parseInt(sl[0]);
    int a = Integer.parseInt(sl[1]);
    int b = Integer.parseInt(sl[2]);

    System.out.println((b - a) % 2 == 0 ? "Alice" : "Borys");


  }

}


Measured memory_bytes: 21076
#include<bits/stdc++.h>
using namespace std;
int main(){
  string S, T;
  cin >> S >> T;
  int cnt = 0;
  for(int i=0; i<S.size(); i++){
    if(S[i] != T[i]){
      cnt++;
    }
  }
  cout << cnt << endl;
}

Measured memory_bytes: 3848
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <string>

using namespace std;

int main() {
    string s;
    int k;
    cin >> s >> k;
    map<string, int> m;
    vector<string> c;
    vector<pair<string, int>> f;
    for(int i = 0; i < s.size(); i++)
    {
        string temp = s.substr(i, s.size() - i);
        f.push_back({temp, i});
    }
    sort(f.begin(), f.end());
    int index = 0;
    for(int i = 0; i < f.size(); i++)
    {
        for(int j = 0; j < f[i].first.size(); j++)
        {
            string temp = f[i].first.substr(0, j + 1);
            if(!m.count(temp))
            {
                m[temp] = 1;
                k--;
            }
            if(k == 0)
            {
                cout << temp << endl;
                return 0;
            }
        }
    }
    return 0;
}


Measured memory_bytes: 16128
def main():
    s = input().rstrip()
    k = int(input())
    for i in range(len(s)):
        x = ord("z") - ord(s[i]) + 1
        if k >= x and x != 26:
            k -= x
            s = s[:i] + "a" + s[i+1:]
        if i == len(s)-1:
            s = s[:i] + (chr(ord(s[i]) + (k%26)))
    print(s)

if __name__ == "__main__":
    main()


Measured memory_bytes: 3468
import sys
input = sys.stdin.buffer.readline
sys.setrecursionlimit(1000000000)

int1 = lambda x: int(x) - 1

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

to_point = [[] for _ in range(N)]

for _ in range(M):
    x, y = map(int1, input().split())
    to_point[x].append(y)

dp_memo = [-1]*N
for x in range(N):
    if len(to_point[x]) == 0:
        dp_memo[x] = 0

# 点i始点のLongest Pathの長さ
def dp(i):
    if dp_memo[i] >= 0:
        return dp_memo[i]
    lp = 0
    for j in to_point[i]:
        lp = max(lp, dp(j)+1)
    dp_memo[i] = lp
    return lp

for i in range(N):
    dp(i)

print(max(dp_memo))

Measured memory_bytes: 153308
#include <bits/stdc++.h>
using namespace std;
const int N=1e5+10;
int  a[N],flag[N];
int main()
{
	cin.tie(0);cout.tie(0);ios::sync_with_stdio(0);
	long long n,sum=0;
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		if(i%3!=0&&i%5!=0)sum+=i;
	}
	cout<<sum;
}


Measured memory_bytes: 3524
#include <iostream>
#include <string>
#include <string.h>
#include <algorithm>
#include <vector>
#include <list>
#include <math.h>
#include <iomanip>
#include <map>
#include <cstdlib>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;


int static const N_MAX = 1000 * 1000;
int static const K_MAX = 100;
int static const H_MAX = 1000 * 1000;
int N,K;
int h[H_MAX];
int dp[N_MAX];

int main(){

  int INF = 1000 * 1000 * 1000;
  cin>>N>>K;
  rep(i,N){
    cin>>h[i];
    dp[i] = INF;
  }
  rep(i,K * 5){
    dp[N + i] = INF;
  }

  dp[0] = 0;
  rep(i,N){
    for(int j=1;j<=K;j++){
      dp[i+j] = min(dp[i] + abs(h[i+j]-h[i]), dp[i+j]);
    }
  }
  cout<< dp[N-1] << endl;

}

Measured memory_bytes: 4736
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++)

int main(){
    string s[3];
    rep(i, 0, 3) cin >> s[i];
    queue<ll> que[3];
    rep(i, 0, 3){
        for(auto e : s[i]) que[i].push(e);
    }
    ll i = 0;
    while(true){
        cerr << i << endl;
        if(que[i].empty()){
            cout << (char)('A'+i) << endl;
            break;
        }
        ll j = que[i].front();
        que[i].pop();
        i = j-'a';
    }
    return 0;
}

Measured memory_bytes: 3636
#include<bits/stdc++.h>
#define mod 1000000007
using namespace std;
int dy[4]={1,0,-1,0};
int dx[4]={0,1,0,-1};
vector<vector<int>> graph;

bool sort_sec(const pair<int,int> &a,const pair<int,int> &b){
   if(a.second<b.second){
      return true;
   }
   return false;
}

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

int gcd(int a,int b){
   if(a%b==0) return b;
   return gcd(b,a%b);
}
int digit(int num){
   int cnt=0;
   while(num!=0){
      cnt+=num%10;
      num=num/10;
   }
   return cnt;
}
int main(void){
   int N;
   cin>>N;
   long long x;
   cin>>x;
   vector<long long> a(N);
   for(int i=0;i<N;i++){
      cin>>a[i];
   }
   sort(a.begin(),a.end());
   long long sum=0;
   int ans=0;
   for(int i=0;i<N;i++){
      sum+=a[i];
      if(sum<=x) ans++;
      else break;
   }
   if(sum<x) ans--;
   cout<<ans<<endl;
   return 0;
}


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

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

struct Box { double x, y, r; };

const double EPS = 1e-9;

void solve(int n) {
	vector< double > h, w;
	vector< Box > vb;
	
	for_(i,0,n) {
		double x, y, r;
		cin >> x >> y >> r;
		vb.push_back(Box{x, y, r});
		h.push_back(y - r);
		h.push_back(y + r);
		w.push_back(x - r);
		w.push_back(x + r);
	}
	
	sort(h.begin(), h.end());
	sort(w.begin(), w.end());
	
	h.erase(unique(h.begin(), h.end()), h.end());
	w.erase(unique(w.begin(), w.end()), w.end());
	
	int H = h.size(), W = w.size();
	double ans = 0;
	
	for_(i,0,H-1) for_(j,0,W-1) {
		double lx = w[j], rx = w[j + 1];
		double ly = h[i], ry = h[i + 1];
		
		for_(k,0,n) {
			Box b = vb[k];
			
			if (b.x - b.r < lx + EPS &&
				b.y - b.r < ly + EPS &&
				b.x + b.r > rx - EPS &&
				b.y + b.r > ry - EPS) {
				ans += (rx - lx) * (ry - ly);
				break;
			}
		}
	}
	
	cout << setprecision(2) << setiosflags(ios::fixed) << ans << endl;
}

int main() {
	int case_number = 0, n;
	
	while (cin >> n, n) {
		++case_number;
		cout << case_number << " ";
		solve(n);
	}
}

Measured memory_bytes: 1324
//mOzis_
/////*31022618*/////
//****//MONU KUMAR\****//
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ull unsigned long long
#define lp(i,l,r) for (long long int i = l; i < r; i++)
#define mem(a,x) memset(a,x,sizeof(a))              //set elements of array to some value
#define pi 3.1415926535897932384626
#define mod 1000000007
#define pb(x) push_back(x)
#define ff first
#define ss second
#define siz 256                        //characters are stored using 8 bit and there can be
bool anagram(char *s1, char *s2)     //256 possible characters only in lowercase alphabet
{
	ll count[siz];
    mem(count,0) ;
    ll i;
    for (i = 0; s1[i] && s2[i];  i++)
    {
        count[s1[i]]++;
        count[s2[i]]--;
    }
    if (s1[i] || s2[i])
    {
      return false;
    }
    lp(i,0,siz)
    {
    	 if (count[i])
    	 {
    	 	 return false;
    	 }
    }
     return true;

}
int main()
{
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);

	string s;
	cin>>s;
	ll s2=0,s3=0;
	ll ss=stoi(s);
	s2+=ss%10;
	ss/=10;
	s2+=(ss%10)*10;
	ss/=10;
	s3=ss;
	ll s1=12;
	if (s2<=s1 && s3<=s1 )
	{
        if(s2>0 && s3==0)
        {
           cout<<"YYMM"<<"\n";
        }
        else if(s3>0 && s2==0)
        {
            cout<<"MMYY"<<"\n";
        }
        else if(s3==0 && s2==0)
        {
            cout<<"NA"<<"\n";
        }
        else
        {
            cout<<"AMBIGUOUS"<<"\n";
        }

	}
	else if (s2<=s1 && s3>s1 && s2>0 )
	{
		cout<<"YYMM"<<"\n";
	}
	else if (s2>s1 && s3<=s1 && s3>0)
	{
		cout<<"MMYY"<<"\n";
	}
	else

	{
		cout<<"NA"<<"\n";
	}


	return 0;
}
//////////*********************end of program*********************//////////



Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <typeinfo>
#include <cmath>
#include <vector>
#define rep(i,n) for(int i=0;i<n;i++)
#define ll long long int
#define ii pair<int,int>
#define MAX 1000000007
using namespace std;


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

	int num[26],cur[26];
	rep(i,26){
		num[i] = 0;
		cur[i] = 0;
	}
	rep(i,n)num[s[i]-'0'-49]++;

	int ans = 0;
	for(int i=0;i<n-1;i++){
		int tmp = 0;
		cur[s[i]-'0'-49]++;
		/*rep(j,5)cout << cur[j] << " ";
		cout << endl;
		rep(j,5)cout << num[j]-cur[j] << " ";
		cout << endl;*/
		rep(j,26){
			if(num[j]-cur[j] > 0 && cur[j] > 0)tmp++;
		}
		//cout << tmp << endl;
		if(ans < tmp)ans = tmp;
	}

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

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n,k,count=0;
    cin>>n>>k;
  int ar[n];
  for(int i=0;i<n;i++)
  {
    cin>>ar[i];
  }
 
  for(int i=0;i<n;i++)
  {
    if(ar[i]>=k)
      count++;
  }
  cout<<count;
  return 0;
}

Measured memory_bytes: 640
import java.io.*;
import java.util.*;

public class Main {

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tok;

        public InputReader(InputStream inputStream) {
            reader = new BufferedReader(new InputStreamReader(inputStream));
            tok = null;
        }

        public InputReader(String inputFile) throws FileNotFoundException {
            reader = new BufferedReader(new FileReader(inputFile));
            tok = null;
        }

        public String nextLine() {
            String c = "";
            try {
                c = reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }

            return c;
        }

        public String next() {
            while (tok == null || !tok.hasMoreTokens()) {
                try {
                    tok = new StringTokenizer(nextLine());
                } catch (Exception e) {
                    throw new RuntimeException(e);
                }
            }

            return tok.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble(){
            return Double.parseDouble(next());
        }
    }

    public static void main(String args[]) {
        InputStream inputstream = System.in;
        OutputStream outputstream = System.out;
        InputReader in = new InputReader(inputstream);
        PrintWriter out = new PrintWriter(outputstream);
        Task solver = new Task();
        solver.solve(in, out);
        out.flush();
    }

    static class Task {
        public void solve(InputReader in, PrintWriter out) {
            String s=in.next();
            char lastWord=s.charAt(s.length()-1);
            if(lastWord=='s')
            out.println(s+"es");
            else
            out.println(s+"s");
        }
    }
}

Measured memory_bytes: 36536
package main

import (
	"fmt"
	"math"
	"strconv"
	"strings"
)

func main() {
	nums := scanNums(2)
	k := nums[0]
	x := nums[1]

	var results []string
	for i := x - (k-1); i <= x + (k-1); i++ {
		results = append(results, strconv.Itoa(i))
	}

	fmt.Println(strings.Join(results, " "))
}

func scanNums(len int) (nums []int) {
	var num int
	for i := 0; i < len; i++ {
		fmt.Scan(&num)
		nums = append(nums, num)
	}
	return
}

func scanStrings(len int) (strings []string) {
	var str string
	for i := 0; i < len; i++ {
		fmt.Scanf("%s", &str)
		strings = append(strings, str)
	}
	return
}

func abs(a int) int {
	return int(math.Abs(float64(a)))
}

func pow(p, q int) int {
	return int(math.Pow(float64(p), float64(q)))
}

func min(nums ...int) int {
	if len(nums) == 0 {
		panic("funciton min() requires at least one argument.")
	}
	res := nums[0]
	for i := 0; i < len(nums); i++ {
		res = int(math.Min(float64(res), float64(nums[i])))
	}
	return res
}

func max(nums ...int) int {
	if len(nums) == 0 {
		panic("funciton max() requires at least one argument.")
	}
	res := nums[0]
	for i := 0; i < len(nums); i++ {
		res = int(math.Max(float64(res), float64(nums[i])))
	}
	return res
}

func strSearch(a []string, b string) bool {
	for i := 0; i < len(a); i++ {
		if a[i] == b {
			return true
		}
	}
	return false
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,w;
	cin>>n>>w;
	int a[n][2];
	for(int i=1;i<=n;i++){
		cin>>a[i][0]>>a[i][1];
	}
	long long int d[n+1][w+1];
	for(int i=0;i<=n;i++){
		for(int j=0;j<=w;j++){
			if(i==0||j==0){
				d[i][j]=0;
			}
			else if(j>=a[i][0]){
				d[i][j]=max(a[i][1]+d[i-1][j-a[i][0]],d[i-1][j]);
			}
			else{
				d[i][j]=d[i-1][j];
			}
		}
	}
	cout<<d[n][w];
}

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

#define MIN(a, b) ((a) < (b) ? (a) : (b))

int main (int argc, char **argv)
{
  long long l = 0;
  long long r = 0;
  long long i = 0;
  long long j = 0;
  int mod_min = -1;

  scanf("%lld %lld", &l, &r);

  for(i = l; (mod_min != 0) && (i < MIN(l + 2019, r)); i++)
  {
    for(j = i + 1; (mod_min != 0) && (j < MIN(i + 1 + 2019, (r + 1))); j++)
    {
      int mod = (i * j) % 2019;
      if((mod_min > mod) || (mod_min < 0))
      {
        mod_min = mod;
      }
    }
  }

  printf("%d", mod_min);

  return 0;
}


Measured memory_bytes: 128
import std.string;
import std.range;
import std.conv;
import std.stdio;
import std.algorithm;
import std.traits;
import std.math;
import std.container;
import std.bigint;
import std.numeric;
import std.typecons;
import std.uni;
import std.ascii;
import std.bitmanip;

void main()
{
	auto ip = readln.split.to!(int[]), H = ip[0], W = ip[1];
	'#'.repeat(W+2).writeln;
	for(int i = 0; i < H; i++) {
		auto str = readln.chomp;
		writefln("#%s#", str);
	}
	'#'.repeat(W+2).writeln;
}

Measured memory_bytes: 256