akhauriyash/Code-Regression huggingface dataset:
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;

internal class Program {
    static void Main() => CustomMain();

    static void Solve() {
        int a, b;
        ReadMulti(out a, out b);

        WriteAnswer((a + b) % 24);
    }


    static void CustomMain() {
#if DEBUG
        // ファイルからテストケースを読み込む
        ChangeStdIn();
        // 時間計測
        var stopwatch = new Stopwatch();
        stopwatch.Start();
#endif
        // 出力高速化
        var streamWriter = new StreamWriter(Console.OpenStandardOutput()) {AutoFlush = false};
        Console.SetOut(streamWriter);
        // 回答
        Solve();
#if DEBUG
        stopwatch.Stop();
        Console.WriteLine(stopwatch.Elapsed);
#endif
        Console.Out.Flush();
    }

    static string ReadString() => Console.ReadLine().Trim();
    static int ReadInt() => int.Parse(ReadString());
    static long ReadLong() => long.Parse(ReadString());
    static float ReadFloat() => float.Parse(ReadString());
    static double ReadDouble => double.Parse(ReadString());

    static string[] ReadStringArray() => ReadString().Split(' ');
    static int[] ReadIntArray() => Array.ConvertAll(ReadString().Split(' '), int.Parse);
    static long[] ReadLongArray() => Array.ConvertAll(ReadString().Split(' '), long.Parse);
    static float[] ReadFloatArray() => Array.ConvertAll(ReadString().Split(' '), float.Parse);
    static double[] ReadDoubleArray() => Array.ConvertAll(ReadString().Split(' '), double.Parse);

    static T TypeConversion<T>(string s) {
        if (typeof(T) == typeof(int)) {
            return (T) Convert.ChangeType(int.Parse(s), typeof(T));
        } else if (typeof(T) == typeof(long)) {
            return (T) Convert.ChangeType(long.Parse(s), typeof(T));
        } else if (typeof(T) == typeof(double)) {
            return (T) Convert.ChangeType(double.Parse(s), typeof(T));
        } else {
            return (T) Convert.ChangeType(s, typeof(T));
        }
    }

    static void ReadMulti<T, U>(out T a, out U b) {
        var str = ReadStringArray();
        a = TypeConversion<T>(str[0]);
        b = TypeConversion<U>(str[1]);
    }

    static void ReadMulti<T, U, V>(out T a, out U b, out V c) {
        var str = ReadStringArray();
        a = TypeConversion<T>(str[0]);
        b = TypeConversion<U>(str[1]);
        c = TypeConversion<V>(str[2]);
    }

    static void WriteAnswer(object ans) => Console.WriteLine(ans);

    static bool IsOdd(long num) {
        return (num & 1) == 1;
    }

    static bool IsEven(long num) {
        return (num & 1) == 0;
    }

    static long GCD(long a, long b) {
        return b != 0 ? GCD(b, a % b) : a;
    }

    static long RoundUp(long a, long b) {
        return (a + b - 1) / b;
    }


    static void ChangeStdIn() {
        var path = "./../../TestCase.txt";
        var exStdIn = new System.IO.StreamReader(path);
        Console.SetIn(exStdIn);
    }
}

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

int main()
{
  int n;
  cin>>n;
  
  vector<string> v;
  string t;
  while(n--)
  {
    cin>>t;
    v.push_back(t);
  }
  int ac=0, wa=0, tle=0, re=0;
  for(auto x:v)
  {
    if(x=="AC")
      ac++;
    else if(x=="WA")
      wa++;
    else if(x=="TLE")
      tle++;
    else if(x=="RE")
      re++;
  }
  cout<<"AC x " <<ac <<endl <<"WA x " <<wa <<endl <<"TLE x " <<tle <<endl <<"RE x " <<re;
}


Measured memory_bytes: 7456
#include <iostream>
#include <math.h>
#include <iomanip>
using namespace std;

int main()
{
	int n;
	double x[1000];
	double y[1000];
	//int i2;
	int i3;
	double D1 = 0;
	double D2 = 0;
	double D3 = 0;
	double D4 = 0;

	cin >> n;

	for (int i = 0; i < n; i++)
	{
		cin >> x[i];
	}
	
	for (int i = 0; i < n; i++)
	{
		cin >> y[i];
	}

	for (int i1 = 0; i1 < n; i1++)
	{
		if (0 <= x[i1]-y[i1])
		{
			D1 = D1 + x[i1] - y[i1];
		}
		else
		{
			D1 = D1 - (x[i1] - y[i1]);
		}
	}

	for (int i2 = 0; i2 < n; i2++)
	{
		D2 = D2 + ((x[i2] - y[i2])*(x[i2] - y[i2]));
	}

	D2 = sqrt(D2);

	for (i3 = 0; i3 < n; i3++)
	{
		if (0 <= x[i3] - y[i3])
		{
			D3 = D3 + ((x[i3] - y[i3])*(x[i3] - y[i3])*(x[i3] - y[i3]));
		}
		else 
		{
			D3 = D3 - ((x[i3] - y[i3])*(x[i3] - y[i3])*(x[i3] - y[i3]));
		}
	}

	D3 = pow(D3,1.0/3.0);


	if (0 <= x[0] - y[0])
	{
		D4 = x[0] - y[0];
	}
	else
	{
		D4 = -(x[0] - y[0]);
	}
	

	for (int i4 = 1; i4 < n; i4++)
	{
		if (D4 < x[i4] - y[i4])
		{
			D4 = x[i4] - y[i4];
		}
		else if (D4< -(x[i4] - y[i4]))
		{
			D4 = -(x[i4] - y[i4]);
		}
	}

	cout << fixed << std::setprecision(6) << D1 << endl;
	cout << fixed << std::setprecision(6) << D2 << endl;
	cout << fixed << std::setprecision(6) << D3 << endl;
	cout << fixed << std::setprecision(6) << D4 << endl;

	return 0;
}

Measured memory_bytes: 3476
using System;
using System.Text;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Threading.Tasks;

class Solve
{
	const int mod = 1000000007;
	static void Main(string[] args)
	{
		int N = int.Parse(Console.ReadLine());
		var A = Console.ReadLine().Split().Select(int.Parse).ToArray();
		var B = Console.ReadLine().Split().Select(int.Parse).ToArray();

		long ans = 0;
        for(int i = 0; i < N; i++)
		{
			if (A[i] >= B[i])
			{
				ans += B[i];
			}
			else
			{
				
				if (B[i] - A[i] <= A[i + 1])
				{
					ans += B[i];
					A[i + 1] -= B[i] - A[i];
				}
				else
				{
					ans += A[i] + A[i + 1];
					A[i + 1] = 0;
				}
			}
		}

		Console.WriteLine(ans);
	}
}


Measured memory_bytes: 36252
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define perl(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define pb push_back
#define ins insert
#define all(x) (x).begin(),(x).end()
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9+10;
const ll INF=4e18;
const ll dy[8]={1,0,-1,0,1,1,-1,-1};
const ll dx[8]={0,-1,0,1,1,-1,1,-1};
using Graph = vector<vector<int>>;
const ll mod=1000000007;
const int MAX_N = 1000;         // n の最大値
 
double nCk(int n, int k) {
double res=1.0;
for(int i=0; i<n; i++){
res*=0.5;}
for(int i=0; i<k; i++){
res*=(double)(n-i);
res/=(double)(k-i);
}
return res;}
 
int main() {
ll n,p; cin>>n;
ll a[n]={};
ll b[n]={};
ll ca=0;
ll cb=0;
ll w=0;
rep(i,n){
cin>>a[i];
ca+=a[i];}
rep(i,n){
cin>>b[i];
cb+=b[i];}
if(ca<cb){
cout << -1 << endl;}
else{
ca=0;
cb=0;
rep(i,n){
if(a[i]<b[i]){
ca+=b[i]-a[i];
w++;}}
ll c[n]={};
ll q=0;
rep(i,n){
if(a[i]>b[i]){
c[q]=a[i]-b[i];
q++;}}
sort(c,c+n);
reverse(c,c+n);
q=0;
cb=0;
while(ca>cb){
cb+=c[q];
q++;}
cout << q+w << endl;}}


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

using namespace std;

int n, arr0[34] = {1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};

int main () {
	ios::sync_with_stdio(0), cin.tie(0);
	cin >> n;
	cout << arr0[n - 1];
}


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

using ll = long long;

bool comparator(const pair<int, int>&a, const pair<int, int>&b){
	return a.first < b.first;
}

int main(){

	int N, D, A;
	cin >> N >> D >> A;
	D += D;
	vector<pair<int, int>>H(N);
	for (int i = 0; i < N; i++)
		cin >> H[i].first >> H[i].second;

	sort(H.begin(), H.end());

	vector<int>imos(N + 1);
	ll ans = 0;

	for (int i = 0; i < N; i++){
		if (imos[i] < H[i].second){
			ll need = (H[i].second - imos[i] + A - 1) / A;

			ll r = H[i].first + D;
			int id = upper_bound(H.begin(), H.end(), make_pair(r,0), comparator) - H.begin();

			imos[i] += A*need;
			imos[id] -= A*need;

			ans += need;
		}
		imos[i + 1] += imos[i];
	}

	cout << ans << endl;

}

Measured memory_bytes: 2560
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <tuple>
#include <vector>

using namespace std;

#define rep(i, n) for (int64_t i = 0; i < (n); i++)
#define irep(i, n) for (int64_t i = 0; i <= (n); i++)
#define rrep(i, n) for (int64_t i = (n)-1; i >= 0; i--)
#define rirep(i, n) for (int64_t i = n; i >= 0; i--)

int main() {
  int a, b;
  cin >> a >> b;

  if (a < b) {
    swap(a, b);
  }

  rep(i, a) { cout << b; }
  cout << endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream> 
#include<vector>
#include<algorithm>
#include<map>
#include<iomanip>
#include<set>
#include<queue>
#include<deque>
#include<iomanip>
#include<sstream>
#include<cmath>
#include<bitset>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define req(i,n) for(int i = 1;i <=  n; i++)
#define rrep(i,n) for(ll i = n-1;i >= 0;i--)
#define ALL(obj) begin(obj), end(obj)
#define RALL(a) rbegin(a),rend(a)
typedef long long int ll;
typedef long double ld;
const ll INF = 1e15;
template<typename A, size_t N, typename T>
void Fill(A(&array)[N], const T & val) {
    std::fill((T*)array, (T*)(array + N), val);
}
const int MAX = 510000;
const int MOD = 1000000007;
int gcd(int a, int b) {
    return b ? gcd(b, a % b) : a;
}
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; }
int main(void) {
    int n; cin >> n;
    vector<int> a(n); int sum = 0;
    rep(i, n) cin >> a[i];
    rep(i, n - 2) {
        for (int j = i + 1; j < n - 1; j++) {
            for (int k = j + 1; k < n; k++) {
                if (a[i] == a[j] || a[i] == a[k] || a[k] == a[j]) continue;
                if (a[i] + a[j] <= a[k] || a[i] + a[k] <= a[j] || a[j] + a[k] <= a[i])continue;
                sum++;
            }
        }
    }cout << sum << endl;
}

Measured memory_bytes: 3632
import sys

fin = sys.stdin.readline

n, k = map(int, fin().split())
v = list(map(int, fin().split()))

# k >= 2*n -> sum(max(0, v))
if all([v_ <= 0 for v_ in v]):
    print(0)
else:
    scores = [0]
    for i in range(1, min(k, n) + 1):  # kことり出す
        for j in range(i + 1):
            poped = v[:j] + v[n - i + j:]
            poped = sorted(poped)
            if k ==i:
                scores.append(sum(poped))
            elif k >= i*2:
                scores.append(sum([max(0, p) for p in poped]))
            elif poped[k - i - 1] < 0:
                scores.append(sum(poped[k - i:]))
            else:
                scores.append(sum([max(0, p) for p in poped]))


    print(max(scores))


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

int main() {
    int a, b;
    cin >> a >> b;
    if(abs(a-b)%2 == 0){
        cout << (a+b)/2 << endl;
    }
    else{
        cout << "IMPOSSIBLE" << endl;
    }
    return 0;
}


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


typedef long long ll;
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef long double ld;

typedef set<int>::iterator sit;
typedef map<int,int>::iterator mit;
typedef vector<int>::iterator vit;

const int INF = 1e9 + 7;
const int MOD = 1e9 + 7;
const int MAXN = 1e6 + 3;

#define _  %  MOD
#define __ %= MOD

#define      each(it,s)        for(auto it = s.begin(); it != s.end(); ++it)
#define      sortA(v)          sort(v.begin(), v.end())
#define      sortD(v)          sort(v.begin(), v.end(), greater<auto>())
#define      fill(a)           memset(a, 0, sizeof (a))

#define      swap(a,b)        {a=a+b;b=a-b;a=a-b;}
#define      rep(i, n)         for(ll i = 0; i < (n); ++i)
#define      repA(i, a, n)     for(ll i = a; i <= (n); ++i)
#define      repD(i, a, n)     for(ll i = a; i >= (n); --i)
#define watch(x) cout << (#x) << " is " << (x) <<endl

#define fi first
#define se second
#define mp make_pair
#define pb push_back

#define fbo find_by_order
#define ook order_of_key

ll gcd(ll a,ll b){if(b==0) return a; else return gcd(b,a%b);}
ll power(ll x,ll y){ll res=1; while(y>0){if(y&1) res=res*x;y=y>>1;x=x*x;}return res;} // modular exponent
double one=1.000000000000;
int main()
{
    ios_base::sync_with_stdio(false); // don't use printf and scanf
    cin.tie(NULL); //
    ll n,k;
    cin>>n>>k;
    double a[n];
    rep(i,n)
    {
      cin>>a[i];
      a[i]=(a[i]+one)/(2);
    }
    double ans=0;
    rep(i,k) ans+=a[i];
    double temp=ans;
    cout<<fixed<<setprecision(10);
    for(ll i=k;i<n;i++)
    {
      temp+=a[i];
      temp-=a[i-k];
      ans=max(ans,temp);
    }
    cout<<ans<<'\n';
    return 0;
}
// JUST ASK YOURSELF DID YOU GIVE YOUR BEST ? ISSE ZYADA
// KUCH KAR BHI NAHI SAKTE !! ENJOY AND GIVE YOUR BEST!!


Measured memory_bytes: 5376
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int s[5];
	for(int i=0;i<3;i++)
		scanf("%d",&s[i]);
	sort(s,s+3);
	if(s[0]+s[1]==s[2])
		puts("Yes");
	else
		puts("No");
	return 0;
}

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

#pragma GCC target("avx2")
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")
void fst()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
#endif
}
int mod = 1e9 + 7;
int binpow(int a, int b)
{
    int res = 1;
    while (b > 0)
    {
        if (b & 1)
        {
            res = res * a;
            res %= mod;
        }
        a = a * a;
        a %= mod;
        b >>= 1;
        b %= mod;
    }
    return res;
}
#define Darr(x)           \
    cerr << #x << " = ";  \
    for (auto i : x)      \
        cerr << i << " "; \
    cerr << "\n";

#define all(a) a.begin(), a.end()
#define pb push_back
#define deb(x) cerr << #x << "=" << x << " ";
#define int long long
#define R(n) for (int i = 0; i < n; i++)
#define Rj(n) for (int j = 0; j < n; j++)
#define F(i, a, n) for (int i = a; i <= n; i++)
#define MN(x, y) x = min(x, y);
#define MX(x, y) x = max(x, y);
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpii;

int32_t main()
{
    int n, d;
    cin >> n >> d;
    int sum = 0;
    while (n--)
    {
        int x, y;
        cin >> x >> y;
            if (x * x + y * y <= d * d)
            {
                sum++;
            }
    }
    cout << sum;
}


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

#define rep(i, n) for(int i = 0, i##_len = (n); i < i##_len; ++i)
#define all(x) (x).begin(), (x).end()
#define clr(ar, val) memset(ar, val, sizeof(ar))
#define sbp(p, n) rep(i, n) { int a, b; scanf("%d %d", &a, &b); p[i] = make_pair(a, b); }
template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; }
int gcd(int a,int b){return b?gcd(b,a%b):a;}
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair <int,int> P;
typedef long double ld;

int main(void)
{
  int n, t, a[200001];
  ll ans = 0;
  cin >> n >> t;
  rep(i, n){
    cin >> a[i];
    ans += t;
    if(i > 0) ans -= max(t - (a[i] - a[i - 1]), 0);
  }
  cout << ans << endl;
  return 0;
}

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

int main() {
  int n;
  string s;
  cin >> n >> s;
  if(n%2 != 0){
    cout << "No" << endl;
    return 0;
  }
  rep(i,0,n/2){
    if(s[i] != s[i+n/2]){
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
}

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

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

int main() {
    int n;
    cin>>n;
    vector<string> s(n);
    rep(i,n) cin>>s[i];

    rep(i,n) sort(s[i].begin(), s[i].end());

    unordered_map<string, long long int> m;

    rep(i, n){
        auto itr = m.find(s[i]);
        if(itr==m.end()){
            m[s[i]] = 1;
        }else{
            m[s[i]] += 1;
        }
    }

    long long int sum = 0;
    for(auto itr=m.begin(); itr!=m.end(); ++itr){
        sum += itr->second*(itr->second-1)/2;
    }
    cout << sum << endl;
}

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

#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)
 
using namespace std;
 
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef vector<vi> vvi;
typedef long long i64;
typedef vector<i64> vi64;
typedef vector<vi64> vvi64;
typedef pair<i64, i64> pi64;
typedef double ld;
 
template<class T> bool uin(T &a, T b) { return a > b ? (a = b, true) : false; }
template<class T> bool uax(T &a, T b) { return a < b ? (a = b, true) : false; }

using namespace std;

const int maxn = 20;
int n, vis[maxn], cnt;
double sum;
struct node {
	int x, y;
}po[maxn];

double dis(int x1, int y1, int x2, int y2) {
	return sqrt( (x1 - x2)*(x1 - x2) + (y1 - y2)*(y1 - y2) );
}
void dfs(int now,int num, double tmp) {
	if (num == n) {
		++cnt;
		sum += tmp;
		return;
	}
	forn(i, n) {
		if (!vis[i]) {
			vis[i] = 1;
			dfs(i, num + 1, tmp + dis(po[now].x, po[now].y, po[i].x, po[i].y));
			vis[i] = 0;
		}
	}
}
void solve() {
	forn(i, n) {
		vis[i] = 1;
		dfs(i, 1, 0);
		vis[i] = 0;
	}
}

int main() {
	ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.precision(10);
    cout << fixed;
#ifdef LOCAL_DEFINE
    freopen("in", "r", stdin);
#endif
	
	sum = 0;
	cnt = 0;
	memset(vis, 0, sizeof(vis));
	scanf("%d", &n);
	forn(i, n) {
		scanf("%d%d", &po[i].x, &po[i].y);
	}
	solve();
	double ans = sum / cnt;
//	ans /= 2;
	printf("%.8f\n", ans);
#ifdef LOCAL_DEFINE
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
	return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<algorithm>
#define ll long long
#define N 200005
#define mod 1000000007
#define rep(i,j,k) for (ll i=j;i<=k;++i)
#define per(i,j,k) for (ll i=j;i>=k;--i)
using namespace std;
inline ll read(){
	char ch=getchar(); ll x=0,f=1;
	while (ch<'0'||ch>'9') { if (ch=='-') f=-1; ch=getchar(); }
	while (ch>='0'&&ch<='9') { x=x*10+ch-'0'; ch=getchar(); }
	return x*f;
}
ll n,sum1,sum2,ans1,ans2,x;
int main(){
	n=read();
	rep(i,1,n){
		sum1+=x=read();
		sum2+=x;
		if (i&1){
			if (sum1<=0) ans1+=1-sum1,sum1=1;
			if (sum2>=0) ans2+=sum2+1,sum2=-1;
		}else{
			if (sum1>=0) ans1+=sum1+1,sum1=-1;
			if (sum2<=0) ans2+=1-sum2,sum2=1;
		}
	}
	printf("%lld",min(ans1,ans2));
}

Measured memory_bytes: 128
#include <stdio.h>

int main(void) {
	int a,b;
	scanf("%d",&a);
	scanf("%d",&b);
	a=a-2*b;
	if(a<0)
	  printf("%d\n",0);
	else
	  printf("%d\n",a);
	  
	
	
	// your code goes here
	return 0;
}


Measured memory_bytes: 128
N,L = list(map(int,input().split()))

taste = []
taste_z = []
taste_f = []
Sum = 0
for i in range(N):
  taste.append(L+i)
  if (L+i)!=0:
    taste_z.append(abs(L+i))
    taste_f.append(int((L+i)/abs(L+i)))
  else:
    taste_z.append(0)
    taste_f.append(0)

for i in range(N):
  Sum += taste[i]

print(Sum-taste[taste.index(taste_f[taste_z.index(min(taste_z))]*min(taste_z))])

Measured memory_bytes: 3064
import java.io.IOException;
import java.io.InputStream;
import java.util.NoSuchElementException;

public class Main implements Runnable {

	public static void main(String[] args) {

		new Thread(null, new Main(), "", 16 * 1024 * 1024).start();

	}

	@Override
	public void run() {
		exec();
	}

	private void exec() {

		FastScanner sc = new FastScanner(System.in);
		int n = sc.nextInt();
		int cnt = 0;
		for(int i = 1 ; i <= n ; i++) {
			if(i % 2 != 0) {
				cnt++;
			}
		}

		System.out.println((double)cnt / (double)n);

	}

}

class FastScanner {

	private final InputStream in;
	private final byte[] buffer = new byte[1024];
	private int ptr = 0;
	private int buflen = 0;

	public FastScanner(InputStream in) {
		this.in = in;
	}

	private boolean hasNextByte() {
		if(ptr < buflen) {
			return true;
		} else {
			ptr = 0;
			try {
				buflen = in.read(buffer);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if(buflen <= 0) {
				return false;
			}
		}
		return true;
	}

	private int readByte() {
		if(hasNextByte()) {
			return buffer[ptr++];
		} else {
			return -1;
		}
	}

	private static boolean isPrintableChar(int c) {
		return 33 <= c && c <= 126;
	}

	public boolean hasNext() {
		while(hasNextByte() && !isPrintableChar(buffer[ptr])) {
			ptr++;
		}
		return hasNextByte();
	}

	public String next() {
		if (!hasNext()) throw new NoSuchElementException();
		StringBuilder sb = new StringBuilder();
		int b = readByte();
		while(isPrintableChar(b)) {
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	public long nextLong() {
		if (!hasNext()) {
			throw new NoSuchElementException();
		}
		long n = 0;
		boolean minus = false;
		int b = readByte();
		if (b == '-') {
			minus = true;
			b = readByte();
		}
		if (b < '0' || '9' < b) {
			throw new NumberFormatException();
		}
		while(true){
			if ('0' <= b && b <= '9') {
				n *= 10;
				n += b - '0';
			}else if(b == -1 || !isPrintableChar(b)){
				return minus ? -n : n;
			}else{
				throw new NumberFormatException();
			}
			b = readByte();
		}
	}

	public int nextInt() {
		long nl = nextLong();
		if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
		return (int) nl;
	}

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

}


Measured memory_bytes: 21332
a = input()
a = list(a)
k = 0
if a[0] == '1':
    for i in range(len(a)-1):
        if (i%2 == 0) & (a[i+1] == '1'):
            k += 1
        elif (i%2 == 1) & (a[i+1] == '0'):
            k += 1
else:
    for j in range(len(a)-1):
        if (j%2 == 0) & (a[j+1] == '0'):
            k += 1
        elif (j%2 == 1) & (a[j+1] == '1'):
            k += 1
print(k)

Measured memory_bytes: 3956
#include <bits/stdc++.h>
#define ll long long int
#define IOS ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define  D2(x)  cout << "[" << #x << ": "; for(auto it:x) cout << it << " "; cout << "]\n"; 
#define  D2p(x)	cout << #x << " ~ [ "; for(auto n: x) cout << n.first << "-" << n.second << " / "; cout << "]" << "\n";
#define vi vector<int> 
#define vll vector<ll> 
#define pb emplace_back
#define all(x) (x).begin(), (x).end()
#define deb(x) cout << #x << " - " << x << endl;
const ll MOD = 1e9 + 7;
const ll INF = 1<<29;
const ll MAX_N = 2e5 + 7;
using namespace std;
int cel(int a,int b) { return ( (a / b) + ((a % b) != 0) ); }

ll bio(int n, int k) { 
	ll res = 1; 
	if (k > n - k) k = n - k;
	for (int i = 0; i < k; ++i) { 
		res *= (n - i); 
		res /= (i + 1); 
	} 
	return res; 
} 

int main() {
    IOS;
    int n; cin >> n;
    vi v(n);
    for(int i=0;i<n;++i) cin >> v[i];
    sort(all(v));
    ll sum = bio(n,3);
    // D2(v);
    for(int i=0;i<n-2;++i){
        for(int j=i+1;j<n-1;++j){
            int temp = v[i]+v[j];
            auto it = lower_bound(all(v),temp) - v.begin();
            sum -= (n - it);
        }
    }
    cout << sum;
}

Measured memory_bytes: 3632
#include <cctype>
#include <cstdio>
#define REP(i, n) for (int i = 0; (i) < (int)(n); ++ (i))

int input() {
    int n = 0;
    for (int c; (c = getchar_unlocked()) != EOF; ) {
        if (not isdigit(c)) break;
        n = n * 10 + c - '0';
    }
    return n;
}
void output(int n) {
    char buf[20];
    int i = 0;
    if (n < 0) {
        buf[i ++] = '-';
        n *= -1;
    }
    for (; n; n /= 10) {
        buf[i ++] = (n % 10) + '0';
    }
    if (i == 0) buf[i ++] = '0';
    while (i) {
        putchar_unlocked(buf[-- i]);
    }
    putchar_unlocked('\n');
}

int main() {
    int a = input();
    int b = input();
    int cnt = 0;
    REP (x, 10) REP (y, 10) REP (z, 10) {
        int n = x * 10000 + y * 1000 + z * 100 + y * 10 + x;
        cnt += (a <= n and n <= b);
    }
    output(cnt);
    return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); i++)
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
#define MOD 1000000007
using namespace std;
typedef long long ll;

int main(){
    char c;
    cin >> c;
    if(c != 'a' && c != 'e' && c != 'i' && c != 'o' && c != 'u') cout << "consonant" << endl;
    else cout << "vowel" <<endl;
    return 0;
}

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

using ll = long long;

int main() {
  int n;
  cin >> n;
  
  vector<ll> a(n);
  for(int i = 0; i < n; i++) cin >> a.at(i);
  
  ll count = 0, keep = 0;
  for(int i = 0; i < n; i++){
    keep += a.at(i);
    if(i % 2 == 0){
      if(keep <= 0){
        count += 1 - keep;
        keep = 1;
      }
    }
    else{
      if(keep >= 0){
        count += keep + 1;
        keep = -1;
      }
    }
  }
  
  ll count2 = 0;
  keep = 0;
  for(int i = 0; i < n; i++){
    keep += a.at(i);
    if(i % 2 == 0){
      if(keep >= 0){
        count2 += keep + 1;
        keep = -1;
      }
    }
    else{
      if(keep <= 0){
        count2 += 1 - keep;
        keep = 1;
      }
    }
  }
  
  cout << min(count, count2) << endl;
}

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

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

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define FOR(i,n,m) for(int i=(n);i<(m);i++)
#define REP(i,n) FOR(i,0,n)
#define REPR(i,n) for(int i=(n);i>=0;i--)
#define all(vec) vec.begin(),vec.end()
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using P=pair<int,int>;
using PP=pair<int,P>;
using Pl=pair<ll,ll>;
using PPl=pair<ll,Pl>;
using vs=vector<string>;
#define fi first
#define se second
#define pb push_back
template<class T>bool chmax(T &a,const T &b){if(a<b){a=b;return true;}return false;}
template<class T>bool chmin(T &a,const T &b){if(a>b){a=b;return true;}return false;}
const ll MOD=1000000007LL;
const int INF=1<<30;
const ll LINF=1LL<<60;
int lg2(int x){
    int res=0;
    while(x){
        res++;
        x/=2;
    }
    return res;
}
struct edge{
    int f,t,c;
};
int main(){
    int X;
    cin>>X;
    int lX=lg2(X);
    vector<edge> ans;
    REP(i,lX-1){
        ans.pb({i+1,i+2,0});
        ans.pb({i+1,i+2,1<<i});
    }
    int x=1<<(lX-1);
    REPR(i,lX-2){
        if(X&(1<<i)){
            ans.pb({i+1,lX,x});
            x+=1<<i;
        }
    }
    cout<<lX<<" "<<ans.size()<<endl;
    REP(i,ans.size()){
        cout<<ans[i].f<<" "<<ans[i].t<<" "<<ans[i].c<<endl;
    }
    return 0;
}

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

int main(int argc, char* argv[])
{
	int K, N;
	int A[2];
	int d, A_0, d_last;
	int d_max = 0;
	scanf("%d %d", &K, &N);
	scanf("%d", &A[0]);
	A_0 = A[0];
	for(int i=0; i<N-1; i++){
		scanf("%d", &A[1]);
		d = A[1] - A[0];
		if(d > d_max){
			d_max = d;
		}
		A[0] = A[1];
	}
	d_last = K - A[0] + A_0;
	if(d_last > d_max){
				d_max = d_last;
		}

	int y = K - d_max;

	printf("%d", y);
	return 0;
}





Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main()
{
	int n,a;
	cin>>n;
	a=n%10;
	if(a==2||a==5||a==7||a==9||a==4)cout<<"hon"<<endl;
	if(a==1||a==6||a==8||a==0)cout<<"pon"<<endl;
	if(a==3)cout<<"bon"<<endl;
	return 0;
}

Measured memory_bytes: 3632
package main

import (
	"fmt"
	"strings"
)

func main() {
	var a string
	fmt.Scanf("%s", &a)
	l := strings.Split(a, "")
	if l[2] == l[3] && l[4] == l[5] {
		fmt.Printf("Yes")
	} else {
		fmt.Printf("No")
	}
}

Measured memory_bytes: 640
#include <iostream>
#include<algorithm>
#include<string>
#include <cmath>
#include <vector>
#include <map>
#include <cstdio>
#include <iomanip>
#include <numeric>
#pragma region Macros
#define int long long
#define double long double
constexpr int MOD = 1000000007;
constexpr double PI = 3.14159265358979323846;
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<=n;i++)
#define LAST(x) x[x.size()-1]
#define ALL(x) (x).begin(),(x).end()
#define swap(a,b) (a += b,b = a - b,a -= b)
#define CEIL(a,b) ((a+b-1)/b)
int FACT(int a) {
	if (a == 0)
		return 1;
	else
		return a * FACT(a - 1);
}
int nPr(int n, int r) {
	int s = n - r + 1;
	int sum = 1;
	for (int i = s; i <= n; i++)
		sum *= i;
	return sum;
}
//int nCr(int n, int r)
int nCr2(int n, int r) {
	return FACT(n) / (FACT(r) * FACT(n - r));
}
int GCD(int a, int b) // assuming a,b >= 1
{
	if (a < b)
		swap(a, b);
	if (b == 0)
		return a;
	if (a % b == 0)
		return b;
	return GCD(b, a % b);
}
int LCM(int a, int b) // assuming a,b >= 1
{
	return  a * b / GCD(a, b);
}
//int NUMOFDIV(int n) 素因数分解して+1してかける奴
int NUMOFDIV2(int n) {
	int ans = 0;
	REP(i, n) {
		if (n % i == 0)
			ans++;
	}
	return ans;
}
double LOG(int a, int b) {
	return log(b) / log(a);
}
inline bool BETWEEN(int x, int min, int max) {
	if (min <= x && x <= max)
		return true;
	else
		return false;
}
inline bool PRIMEOR (int x) {
	if (x ==1)
		return false;
	if (x == 2)
		return true;
	if (x%2==0)
		return false;
	double sqrtx = sqrt(x);
	for (int i = 3; i <= sqrtx; i += 2) {
		if (x % i == 0)
			return false;
	}
	return true;
}
using namespace std;
#pragma endregion
signed main() {
	string w, ans = "Yes";
	map<char, int>m;
	cin >> w;
	rep(i, w.size()) {
		m[w[i]] +=1;
	}
	rep(i, 26) {
		if (m['a'+i] % 2 == 1)
			ans = "No";
	}
	cout << ans;
}

Measured memory_bytes: 256
import sys
 
def solve():
    def dfs(idx, end, value, cost, g):
        if idx == end:
            if cost == 0:
                return

            if value not in g:
                g[value] = cost
            else:
                g[value] = min(g[value], cost)

            return

        a, b, c = table[idx]
        dfs(idx + 1, end, value + b * Ma - a * Mb, cost + c, g)
        dfs(idx + 1, end, value, cost, g)

    N, Ma, Mb = map(int, input().split())
    table = [tuple(map(int, input().split())) for i in range(N)]
 
    g1, g2 = dict(), dict()
    dfs(0, N // 2, 0, 0, g1)
    dfs(N // 2, N, 0, 0, g2)

    inf = 100*40 + 1
    ans = inf
 
    if 0 in g1:
        ans = min(ans, g1[0])
    if 0 in g2:
        ans = min(ans, g2[0])
 
    for v1, c1 in g1.items():
        if -v1 in g2:
            tmp = c1 + g2[-v1]
            ans = min(ans, tmp)
 
    if ans < inf:
        print(ans)
    else:
        print(-1)

        
def debug(x, table):
    for name, val in table.items():
        if x is val:
            print('DEBUG:{} -> {}'.format(name, val), file=sys.stderr)
            return None
 
 
if __name__ == '__main__':
    solve()

Measured memory_bytes: 3188
#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
typedef long long int ll;

using namespace std;

int main(){

	int N,table[200030],a,b,S,tmp;

	for(int i = 0; i < 200030; i++)table[i] = 0;

	scanf("%d",&N);

	for(int loop = 0; loop < N; loop++){
		scanf("%d %d",&a,&b);
		table[a+b]++;
	}

	for(int i = 0; i < 200030; i++){
		if(table[i] != 0){
			tmp = table[i];
			table[i] = 0;
			S = 2;
			for(int k = 0; tmp != 0;k++,tmp /= S){
				if(tmp%S == 1){
					table[i+k]++;
				}
			}
		}
	}

	for(int i = 0; i < 200030; i++){
		if(table[i] != 0){
			printf("%d 0\n",i);
		}
	}

    return 0;
}

Measured memory_bytes: 3528
#include<iostream>
#include<algorithm>
#include<vector>
#include<cmath>
#include<iomanip>
#include<random>
#include<complex>

using namespace std;
typedef long double ld;
typedef complex<ld> P;

ld eps = 0.00000000001;

ld cross(P a, P b) {
	return (a.real() * b.imag()) - (a.imag() * b.real());
}

template <class iter>
std::pair<P, ld> min_ball(iter left, iter right, int seed = 1333) {
	const int n = right - left;

	if (n == 1) {
		return{ *left, ld(0) };
	}

	std::mt19937 mt(seed);
	std::shuffle(left, right, mt);
	// std::random_shuffle(left, right); // simple but deprecated

	iter ps = left;
	using circle = std::pair<P, ld>;

	auto make_circle_3 = [](const P &a, const P &b, const P &c) -> circle {
		ld A = std::norm(b - c), B = std::norm(c - a), C = std::norm(a - b),
			S = cross(b - a, c - a);
		P p = (A * (B + C - A) * a + B * (C + A - B) * b + C * (A + B - C) * c) / (4 * S * S);
		ld r2 = std::norm(p - a);
		return{ p, r2 };
	};

	auto make_circle_2 = [](const P &a, const P &b) -> circle {
		P c = (a + b) / (ld)2;
		ld r2 = std::norm(a - c);
		return{ c, r2 };
	};

	auto in_circle = [](const P &a, const circle &c) -> bool {
		return std::norm(a - c.first) <= c.second + eps;
	};

	circle c = make_circle_2(ps[0], ps[1]);

	// MiniDisc
	for (int i = 2; i < n; ++i) {
		if (!in_circle(ps[i], c)) {
			// MiniDiscWithPoint
			c = make_circle_2(ps[0], ps[i]);
			for (int j = 1; j < i; ++j) {
				if (!in_circle(ps[j], c)) {
					// MiniDiscWith2Points
					c = make_circle_2(ps[i], ps[j]);
					for (int k = 0; k < j; ++k) {
						if (!in_circle(ps[k], c)) {
							c = make_circle_3(ps[i], ps[j], ps[k]);
						}
					}
				}
			}
		}
	}
	return c;
}

int N;
vector<P> p;

int main() {
	cin >> N;
	for (int i = 0; i < N; i++) {
		ld x, y;
		cin >> x >> y;
		p.push_back(P(x, y));
	}
	cout << setprecision(10) << sqrt((min_ball<std::vector<P>::iterator>(p.begin(), p.end(), 114514810)).second) << endl;
	return 0;
}

Measured memory_bytes: 384
#include <iostream>
#include <fstream>
#include <set>
#include <map>
#include <queue>
#include <vector>
#include <algorithm>
#include <cmath>
#include <chrono>

using namespace std;

int main(int argc, const char * argv[]) {
    
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    map<char, int> mp;
    for (int i = 0; i < 4; i++) {
        char c; cin >> c;
        mp[c]++;
    }
    
    if (mp.size() == 2) {
        bool f = 1;
        for (const auto &iter : mp) {
            if (iter.second != 2) f = 0;
        }
        if (f) {
            cout << "Yes" << endl;
            return 0;
        }
    }
    
    cout << "No" << endl;
    
    return 0;
}


Measured memory_bytes: 256
S = input()
ans = True
N = len(S)
for i in range(0,N,2):
    if S[i] == 'L':
        ans = False
for i in range(1,N,2):
    if S[i] == 'R':
        ans = False
if ans:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 3060
N = int(input())
A = list(map(int, input().split()))

odd_num = 0
for A_i in A:
    tmp_odd_num = 0
    while A_i % 2 == 0:
        A_i //= 2
        tmp_odd_num += 1
    odd_num += tmp_odd_num

print(odd_num)

Measured memory_bytes: 4148
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <string>
#include <math.h>
#include <vector>

using namespace std;

int main() {
  int N;
  long int tmp;
  int e_num=0, o_num=0; 
  int i;
  
  cin >> N;
  for(i=0; i<N; i++){
    scanf("%ld",&tmp);
    if(tmp%2) o_num++;
    else e_num++;
  }
  if(o_num%2==0 || N==1){
    cout << "YES" <<endl;
  }else{
    cout << "NO" <<endl;    
  }
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i=0; i<(n); ++i)
using namespace std;
using ll=long long;
int main(){
    string s1,s2;
    cin>>s1>>s2;
    string ans;
    if(s1.length()==s2.length()){
        rep(i,s1.length()){
            ans=ans+s1[i];
            ans=ans+s2[i];
        }
    }
    else{
        rep(i,s2.length()){
            ans=ans+s1[i];
            ans=ans+s2[i];
        }
        ans=ans+s1[s1.length()-1];
    }
    cout<<ans<<endl;
}

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

int main() {
	int D, N;
	cin >> D >> N;
	int count = 1;
	int ans = pow(100, D);
	int memo = 1;
	while (count != N) {
		memo++;
		if (0 != (memo % 100)) {
			count++;
		}
	}
	ans *= memo;
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 3716
#include <bits/stdc++.h>
using namespace std;
#define ALL(x) (x).begin(),(x).end()
#define COUT(x) cout<<(x)<<"\n"
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define REP(i, n) for(int i=0;i<n;i++)
#define YES(x) cout<<(x?"YES":"NO")<<"\n"
#define Yes(x) cout<<(x?"Yes":"No")<<"\n"
#define dump(x) cout<<#x<<" = "<<(x)<<"\n"
#define endl "\n"
using G = vector<vector<int>>;
using M = map<int,int>;
using P = pair<int,int>;
using PQ = priority_queue<int>;
using PQG = priority_queue<int,vector<int>,greater<int>>;
using V = vector<int>;
using ll = long long;
using edge = struct { int to; int cost; };
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

int n;
G g;

void bfs(int start, vector<int> &dist) {
  queue<int> q;
  q.push(start);

  while(!q.empty()) {
    int v = q.front(); q.pop();
    int nd = dist[v]+1;
    for (int nv: g[v]) {
      if (dist[nv] <= nd) continue;
      q.push(nv);
      dist[nv] = nd;
    }
  }

  return;
}

int main() {
  IOS;
  cin >> n;
  g.resize(n);

  REP(i,n-1) {
    int a,b; cin >> a >> b;
    a--; b--;
    g[a].push_back(b);
    g[b].push_back(a);
  }

  vector<int> distA(n,INF), distB(n,INF);
  distA[0] = 0; distB[n-1] = 0;
  bfs(0,distA);
  bfs(n-1,distB);

  int cnt = 0;
  REP(i,n) {
    if (distA[i] <= distB[i]) cnt++;
    else cnt--;
  }

  COUT(cnt > 0 ? "Fennec" : "Snuke");
  return 0;
}

Measured memory_bytes: 9536
#include <iostream>
#include <vector>
#include <list>
#include <forward_list>
#include <cstdio>

#define INF 2000000
#define _for(j,N) for(int i = (j); i < (N);++i)

using namespace std;

struct Edge{
    int t;
    int wt;
    Edge(int ti,int wti):t(ti),wt(wti){;}
};

struct Graph{
    int V;
    int E;
    vector<forward_list<Edge> > adj;
    Graph(int v,int e):V(v),E(e){
        adj.resize(V);
    }
    void addEdge(int s,int t,int w){adj[s].push_front(Edge(t,w));}
    void spfa(int s);
};

void Graph::spfa(int s){
    vector<bool> flag(V,false);
    list<int> que;
    vector<int> ans(V,INF);
    vector<int> cnt(V,0);

    que.push_front(s);
    cnt[s] = 1;
    ans[s] = 0;
    flag[s] = true;
    while(!que.empty()){
        int now = que.front();
        que.erase(que.begin());
        flag[now] = false;

        for(auto a = adj[now].begin();a != adj[now].end();++a){
            if(a->wt + ans[now] < ans[a->t]){
                 ans[a->t] = a->wt + ans[now];
                 if(!flag[a->t]){
                    flag[a->t] = true;
                    if(V == ++cnt[a->t]) {printf("NEGATIVE CYCLE\n");return;}
                    if(!que.empty()&&ans[a->t] < ans[que.front()]){
                        que.push_front(a->t);
                    }
                    else que.push_back(a->t);
                 }
            }
        }
    }
    _for(0,V){
            if(ans[i] == INF) printf("INF\n");
            else printf("%d\n",ans[i]);
        }
}

int main()
{
    int V,E,r;
    int s,t,w;
    scanf("%d %d %d",&V,&E,&r);

    Graph G(V,E);
    _for(0,E){
        scanf("%d %d %d",&s,&t,&w);
        G.addEdge(s,t,w);
    }
    G.spfa(r);
    return 0;
}


Measured memory_bytes: 3288
using System;
using System.Linq;
using System.Collections.Generic;
using static System.Console;
using static System.Math;
 
public class Hello{
    public static void Main(){
//        int kazu = int.Parse(ReadLine());
        string[] reader = ReadLine().Split(' ');
        int monster = int.Parse(reader[0]);
        int wazasu = int.Parse(reader[1]);
        string[] readerhp = ReadLine().Split(' ');
        long total = 0;
        int leng = readerhp.Length;

        int[] hplist = new int[leng];
        for(int i=0;i<leng;i++){
            hplist[i] = int.Parse(readerhp[i]);
        }
        
        Array.Sort(hplist);
        Array.Reverse(hplist);
        
        if(leng >= wazasu){
            for(int i=0;i<wazasu;i++){
                hplist[i] = 0;
            }
            
            for(int i=0;i<leng;i++){
            total += hplist[i];
            }
        }else{
            total = 0;
        }
        
        WriteLine(total);

/*        for(int i=0;i<wazasu;i++){
            total += int.Parse(readerwaza[i]);
        }
        
        if(total >= hp){
            WriteLine("Yes");
        }else{
            WriteLine("No");
        }*/
        
/*        string[] hyokol = ReadLine().Split(' ');
        double minsa = 99999999;
        int titen = 0;
        for(int i=0;i<kazu;i++){
            int hyoko = int.Parse(hyokol[i]);
            double hiku = (double)(hyoko*6)/1000;
            double kionh = (double)kion - hiku;
            double sa = Abs(kionh - (double)moku);
//            WriteLine(kionh);
//            WriteLine(sa);
            if(minsa > sa){
                minsa = sa;
                titen = i+1;
            }
        }
        WriteLine(titen);*/
    }
}

Measured memory_bytes: 32768
#include <stdio.h>
int main(void)
{
	int N, K, X, Y;
	scanf("%d%d%d%d", &N, &K, &X, &Y);

	if (N <= K) {
		printf("%d\n", N*X);
	}
	else {
		printf("%d\n", K*X + (N - K)*Y);
	}
	return 0;
}

Measured memory_bytes: 128
from collections import defaultdict


def main():
    _ = input()
    a = [int(an) for an in input().split()]
    cnt = defaultdict(int)
    for an in a:
        cnt[an - 1] += 1
        cnt[an] += 1
        cnt[an + 1] += 1
    print(max(cnt.values()))


if __name__ == "__main__":
    main()


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

const int INF = 1 << 29;
int N, M, R, r[10];
int d[2010][2010];

int main()
{
    cin >> N >> M >> R;
    for (int i = 0; i < R; i++) cin >> r[i];

    for (int i = 0; i <= N; i++) for (int j = 0; j <= N; j++) d[i][j] = INF;

    for (int i = 0; i < M; i++) {
        int A, B, C;
        cin >> A >> B >> C;
        if (C < d[A][B]) d[A][B] = d[B][A] = C;
    }

    for (int k = 0; k <= N; k++) {
        for (int i = 0; i <= N; i++) {
            for (int j = 0; j <= N; j++) {
                d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
            }
        }
    }

    sort(r, r + R);

    int ans = 1 << 30;
    do {
        int t = 0;
        for (int i = 1; i < R; i++) {
            t += d[r[i]][r[i - 1]];
        }
        ans = min(ans, t);
    } while (next_permutation(r, r + R));

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 1152
package main

import "fmt"

func main() {
	var a, b string
	fmt.Scan(&a, &b)

	ans := ""
	if len(a) > len(b) {
		ans = "GREATER"
	} else if len(a) < len(b) {
		ans = "LESS"
	} else {
		if a == b {
			ans = "EQUAL"
		} else if a > b {
			ans = "GREATER"
		} else {
			ans = "LESS"
		}
	}
	fmt.Println(ans)
}


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

llong f(int n, llong m) {
    if (n == 0) {
        return m;
    }
    return f(n-1, n + m);
}

llong f(int n) {
    return f(n, 0);
}

void solve() {
    int N;
    cin >> N;
    cout << f(N) << endl;;
}

int main() {
    ios::sync_with_stdio(false);
    solve();
}



Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
public class Hello
{
    public static void Main()
    {
        var LRd = Console.ReadLine().Split().Select(e => int.Parse(e)).ToArray();
        var L = LRd[0];
        var R = LRd[1];
        var d = LRd[2];
        var ans = 0;
        for (var num = L; num <= R; num++)
        {
            if (num % d == 0)
            {
                ans++;
            }
        }
        Console.WriteLine(ans);
;    }
}


Measured memory_bytes: 28136
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < n; i++)
#define repr(i, n) for(int i = n; i >= 0; i--)
#define reps(i,a,b) for(int i= a; i < b; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
ll MOD = 1e9+7;

int mod(ll n) {
  n %= MOD;
  if (n < 0) n += MOD;

  return n;
}

int main()
{
  int n;
  cin >> n;
  vector<ll> vec(n);
  rep(i, n) cin >> vec.at(i);
  ll ans = 0;
  vector<ll> culsum(n+1, 0);
  reps(i,1, n+1) {
    culsum.at(i) = vec.at(i-1) + culsum.at(i-1);
    culsum.at(i) %= MOD;
  }
  rep(i, n-1) {
    ans += vec.at(i) * mod(culsum.at(n) - culsum.at(i+1));
    ans %= MOD;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 6432
from collections import deque

def dfs(s, al, nw, used):
	nw[s] = 0
	q = deque([s])
	used.add(s)
	while q:
		h = q.popleft()
		for to, ew in al[h]:
			if to in used:
				if nw[h] + ew != nw[to]:
					return False
				continue
			used.add(to)
			nw[to] = nw[h] + ew
			q.appendleft(to)
	return True

def main():
	N, M = map(int, input().split())
	nw = [-1] * N
	al = [[] for i in range(N)]
	for i in range(M):
		l, r, d = map(int, input().split())
		al[l - 1].append((r - 1, d))
		al[r - 1].append((l - 1, -d))

	used = set()
	for i in range(N):
		if i in used or dfs(i, al, nw, used):
			continue
		print("No")
		break
	else:
		print("Yes")


if __name__ == "__main__":
	main()


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

using namespace std;

typedef vector<int> vi;
typedef pair<int, int> pi;
typedef long long ll;

#define show(x) cerr << #x << " = " << x << endl;
#define all(x) (x).begin(), (x).end()
#define allr(x) (x).rbegin(), (x).rend()

ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}


int main()
{
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);

  char letter;
  cin >> letter;
  if(isupper(letter)){
    cout << "A" << endl;
  }else{
    cout << "a" << endl;
  }

  return 0;
}


Measured memory_bytes: 3648
#include <bits/stdc++.h>
#define For(i, a, b) for(int (i)=(a); (i)<(b); ++(i))
#define rFor(i, a, b) for(int (i)=(a)-1; (i)>=(b); --(i))
#define rep(i, n) For((i), 0, (n))
#define rrep(i, n) rFor((i), (n), 0)
#define fi first
#define se second
using namespace std;
typedef long long lint;
typedef pair<int, int> pii;
typedef pair<int, pii> pip;
typedef pair<lint, lint> pll;
typedef complex<double> xy_t;

const lint mod = 1e9 + 7;

int main(){
    int n, K;
    string s;
    cin >> n >> K >> s;
    int ans = 0;
    rep(i, n){
        if(s[i] == 'L' && i > 0 && s[i-1] == 'L') ++ans;
        if(s[i] == 'R' && i < n-1 && s[i+1] == 'R') ++ans;
    }
    int l = 0;
    while(l < n && K){
        if(s[l] == s[0]){
            ++l;
            continue;
        }
        int r = l;
        while(r < n && s[r] == s[l]) ++r;
        ans += 2;
        --K;
        l = r;
    }
    if(l == n && s[0] != s[n-1]) --ans;
    printf("%d\n", ans);
}

Measured memory_bytes: 512
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <queue>
#include <string>
#include <set>
#define INF 1000000000
#define LLINF 2000000000000000
using namespace std;
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define LOOP(i,N) for(int i=0;i<N;i++)
#define LOOP1(i,N) for(int i=1;i<=N;i++)
typedef pair<int,int> P;
typedef pair<int,pair<int,int> > PP;
// #define int long long

signed main(){
  int a,b,c;
  string s,t;
  cin >> s >> t >> a >> b;
  string u;
  cin >> u;
  if(s==u){
    cout << a-1 << " " << b << endl;
  }else{
    cout << a << " " << b-1 << endl;
  }
}


Measured memory_bytes: 256
a,v=map(int,input().split())
b,w=map(int,input().split())
t=int(input())
if a<b:
    a+=v*t
    b+=w*t
    if a<b:
        print("NO")
    else:
        print("YES")
else:
    a-=v*t
    b-=w*t
    if a>b:
        print("NO")
    else:
        print("YES")
        

Measured memory_bytes: 9204
while True:
    test = list(map(int,input().split()))
    a = int(test[0])+int(test[1])
    if int(test[0]) == -1 and int(test[1]) == -1 and int(test[2]) == -1:
        break
    elif int(test[0])==-1 or int(test[1])==-1:
        print('F')
    elif a>=80:
        print('A')
    elif (a>=65)and(a<80):
        print('B')
    elif (a>=50)and(a<65):
        print('C')
    elif (a>=30)and(a<50):
        if int(test[2])>=50:
            print('C')
        else:
            print('D')
    elif a<30:
        print('F')


Measured memory_bytes: 5596