akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include <iostream>
#include <functional>
#include <vector>
#include <stdio.h>
#include <queue>
#include <string.h>
#include <math.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<=n;i++)
#define rep1(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=a;i>=n;i--)
#define per1(i,a,n) for (int i=a;i>n;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
#define endl "\n"
#define pi 3.14159265358979323846264338327950288419716939937510
#define IOS cin.sync_with_stdio(false);cin.tie(0);cout.tie(0);
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll mod=1000000007;
const int inf=0x3f3f3f3f;
const ll INF=0x3f3f3f3f3f3f3f3f;
ll qpow(ll a,ll b){ll s=1;while(b>0){if(b%2==1){s=s*a;}a=a*a;b=b>>1;}return s;}
ll qpowmod(ll a, ll b, ll c){ll res, t;res=1;t=a%c;while(b){if(b & 1){res=res*t%c;}t=t*t%c;b>>=1;}return res;}
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
inline long long read(){long long k=0,f=1;char ch=getchar();while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}while(ch>='0'&&ch<='9'){k=k*10+ch-'0';ch=getchar();}return k*f;}
inline void write(long long x){if(x<0)x=-x,putchar('-');if(x>9)write(x/10);putchar(x%10+'0');}
// head
char s[15];
int main()
{
    //IOS;
    cin>>s;
    if(s[2]==s[3]&&s[4]==s[5])
    {
        cout<<"Yes"<<endl;
    }
    else
        cout<<"No"<<endl;
    return 0;
}
/*

*/


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

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define ll long long
#define ull unsigned long long
#define F first
#define S second
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}
template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
const int MOD = 1e9 + 7; 
const int N = 1e5+10; 
int main(void) 
{
	
	#ifndef ONLINE_JUDGE
	//freopen("input.txt", "r", stdin);
	#endif
	

	int n, m; 
	cin >> n >> m; 
	if (n==m) puts("Yes"); 
	else puts("No"); 





	return false;   


}


Measured memory_bytes: 256
#include<iostream>

using namespace std;
int main() {
	int n,t;
	cin >> n;
	t = n % 10;
	if (t == 3) cout << "bon" << endl;
	else  if (t == 0 || t == 1 || t == 6 || t == 8)cout << "pon" << endl;
	else cout << "hon" << endl;
	return 0;
}

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

ll len[50], pat[50];

ll patties(int n, ll x) {
	if (n == 0) {
		if (x <= 0) return 0;
		else return 1;
	} else if (x <= 1 + len[n-1]) {
		return patties(n-1, x-1);
	} else {
		return pat[n-1] + 1 + patties(n-1, x - 2 - len[n-1]);
	}
}

int main() {
	
	int N;  ll X; cin >> N >> X;
	len[0] = 1; pat[0] = 1; // because order 0 burger is just "P"
	for (int i = 1; i < N; i++) {
		len[i] = len[i-1] * 2 + 3; // B + order i-1 burger + P + order i-1 burger + B
		pat[i] = pat[i-1] * 2 + 1; // order i-1 burger + P + order i-1 burger
	}

	cout << patties(N, X);
	return 0;
}

Measured memory_bytes: 3620
package main

import "fmt"

func main() {
	var s string
	fmt.Scan(&s)

	xs := make([]byte, 0, len(s))
	for i := 0; i < len(s)-1; i++ {
		if s[i:i+2] == "BC" {
			xs = append(xs, 'D')
			i++
			continue
		}
		xs = append(xs, s[i])
	}

	cnt := 0
	ans := 0
	for i := 0; i < len(xs); i++ {
		switch xs[i] {
		case 'A':
			cnt++
		case 'B', 'C':
			cnt = 0
		case 'D':
			ans += cnt
		}
	}
	fmt.Println(ans)
}


Measured memory_bytes: 2176
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, x, n) for (int i = x; i < (n); i++)
#define all(n) begin(n), end(n)
struct cww
{
    cww()
    {
        ios::sync_with_stdio(false);
        cin.tie(0);
    }
} star;
const long long INF = numeric_limits<long long>::max();
typedef long long ll;
typedef vector<int> vint;
typedef vector<char> vchar;
typedef vector<vector<int>> vvint;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef unsigned long long ull;
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;
}
template <typename T>
vector<T> make_v(size_t a) { return vector<T>(a); }

template <typename T, typename... Ts>
auto make_v(size_t a, Ts... ts)
{
    return vector<decltype(make_v<T>(ts...))>(a, make_v<T>(ts...));
}
template <typename T, typename V>
typename enable_if<is_class<T>::value == 0>::type
fill_v(T &t, const V &v) { t = v; }

template <typename T, typename V>
typename enable_if<is_class<T>::value != 0>::type
fill_v(T &t, const V &v)
{
    for (auto &e : t)
        fill_v(e, v);
}
ll lcm(ll a, ll b)
{
    return a / (__gcd(a, b)) * b;
}
int main()
{
    ll N, M;
    cin >> N >> M;
    vll a(N);
    rep(i, N)
    {
        cin >> a[i];
        a[i] /= 2;
    }
    ll ans = 0;
    ll LCM = a[0];
    rep(i, N)
    {
        LCM = lcm(LCM, a[i]);
    }
    bool flag = true;
    for (int i = 0; i < N; i++)
    {
        if ((LCM / a[i]) % 2 == 0)
        {
            flag = false;
        }
    }
    if (flag)
    {
        ans += ((M / LCM) + 1) / 2;
    }
    cout << ans;
    return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <cmath>
#include <string>
#include <vector>
#include <algorithm>
#include <list>
using namespace std;
typedef long long ll;

int main() {
    int n;
    cin >> n;
    int a[n];
    for(int i=0;i<n;i++) cin >> a[i];

    int cnt[100010] = {0};
    for(int i=0;i<n;i++) cnt[a[i]]++;
    int X[100000] = {0};
    for(int i=1;i<100000;i++) X[i]=cnt[i-1]+cnt[i]+cnt[i+1];
    sort(X,X+100000);
    cout << X[99999] << endl;
}

Measured memory_bytes: 1408
#include <bits/stdc++.h>
using namespace std;
int main(){
	ios::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	int H, W; cin >> H >> W; 
	char C[2010][2010] = {}; 
	for(int i = 0; i < H; i++){
		for(int j = 0; j < W; j++){
			cin >> C[i][j]; 
		}
	}
	int A[2010][2010] = {}; 
	for(int i = 0; i < H-1; i++){
		for(int j = 0; j < W-1; j++){
			if(C[i][j] == '#') A[i][j] ++; 
			if(C[i+1][j] == '#') A[i][j] ++;
			if(C[i][j+1] == '#') A[i][j] ++; 
			if(C[i+1][j+1] == '#') A[i][j] ++;
			A[i][j] %= 2; 
		}
	}
	int B[2010][2010] = {}; 
	for(int i = 0; i < H-1; i++){
		for(int j = 0; j < W-1; j++){
			if(A[i][j]) continue; 
			if(i == 0) B[i][j] = 1; 
			else B[i][j] = B[i-1][j] + 1; 
		}
	}
	int mx = max(H, W); 
	int D[2010][2010] = {}; 
	for(int i = 0; i < H-1; i++){
		int L[2010] = {}; 
		int R[2010] = {}; 
		stack<int> S1, S2; 
		for(int j = 0; j < W-1; j++){
			while(S1.size() && B[i][S1.top()] >= B[i][j]){
				S1.pop(); 
			}
			if(!S1.size()) L[j] = -1; 
			else L[j] = S1.top(); 
			S1.push(j); 
		}
		for(int j = W-2; j >= 0; j--){
			while(S2.size() && B[i][S2.top()] >= B[i][j]){
				S2.pop(); 
			}
			if(!S2.size()) R[j] = W-1; 
			else R[j] = S2.top(); 
			S2.push(j); 
		}
		for(int j = 0; j < W; j++){
			if(!A[i][j]) D[i][j] = (R[j] - L[j]) * (B[i][j] + 1); 
			mx = max(mx, D[i][j]); 
		}
	}
	cout << mx << "\n"; 
}

Measured memory_bytes: 54908
X, Y = [int(_) for _ in input().split()]
mod = 10**9 + 7

#a(1, 2) + b(2, 1) = (X, Y)
a = (2 * Y - X) // 3
b = (2 * X - Y) // 3

if (2 * Y - X) % 3 == (2 * X - Y) % 3 == 0 and a * b >= 0:
    f = [1] * (a + b + 1)
    for i in range(1, a + b + 1):
        f[i] = i * f[i - 1] % mod
    fi = [1] * (a + b + 1)
    fi[-1] = pow(f[-1], mod - 2, mod)
    for i in range(a + b - 1, 1, -1):
        fi[i] = (i + 1) * fi[i + 1] % mod
    print((f[a + b] * fi[a] * fi[b]) % mod)
else:
    print(0)


Measured memory_bytes: 55668
#include<iostream>
#include<math.h>
#include<vector>
#include<set>
#include<algorithm>
#include<ctype.h>
#include<unordered_set>
#include<unordered_map>
#include<string>
#include<iomanip>
#include<queue>
#include<limits>
 
using namespace std;
int gcd(int a, int b) {
	if (b == 0)
		return a;
	return gcd(b, a % b);
}
#define INF 99999999999 
#define pb push_back
#define mt make_tuple
#define ll long long
ll lncr(ll n, ll r)
{
	ll i, ans = 1, k = 0;
	if (r == 0)
		return 1;
	else if (n < r)
		return 0;
	for (i = n; i >= n - r + 1; i--)
	{
		ans *= i;
		ans /= n - i + 1;
	}
 
 
	return ans;
 
}
bool visited[6] = { false };
int n = 6;
vector<int> adj[6];
 
 
void max_heapify(int a[100], int i)
{
	int l, r, largest = i;
	l = 2 * i + 1;
	r = 2 * i + 2;
	if (l<n && a[l]>a[i])
		largest = l;
	if (r<n && a[r]>a[l])
		largest = r;
	if (largest != i)
	{
		int k;
		k = a[i];
		a[i] = a[largest];
		a[largest] = k;
		max_heapify(a, largest);
	}
 
}
int power(ll x, ll y, ll p)
{
	int res = 1;
	x = x % p;
 
	while (y > 0)
	{
 
		if (y & 1)
			//res = (res * x) % p;
 
 
		y = y >> 1;
		x = (x * x) % p;
	}
	return res;
}
 
bool square(ll n)
{
	double x;
	x = sqrt(n);
	if (x == floor(x))
		return true;
	else return false;
}
 
 
bool prime(ll n)
{
	ll i;
	for (i = 2; i * i <= n; i++)
	{
		if (n % i == 0)
			return false;
	}
	return true;
}
void dfs(ll a, ll b, vector<pair<ll, ll>>adj[][1001], bool visited[][1001])
{
	visited[a][b] = true;
	for (auto u : adj[a][b])
	{
		if (!visited[get<0>(u)][get<1>(u)])
		{
			visited[get<0>(u)][get<1>(u)] = true;
			dfs(get<0>(u), get<1>(u), adj, visited);
		}
	}
}
ll day(ll d, ll m, ll y)
{
	static int t[] = { 0, 3, 2, 5, 0, 3,
				   5, 1, 4, 6, 2, 4 };
	y -= m < 3;
	return (y + y / 4 - y / 100 +
		y / 400 + t[m - 1] + d) % 7;
}
bool leap(int year)
{
	if (year % 400 == 0)
		return true;
	if (year % 100 == 0)
		return false;
	if (year % 4 == 0)
		return true;
	return false;
}
int main()
{
	ll n, arr[100001], dp[100001] = { 0 }, i;
	cin >> n;
	for (i = 1; i <= n; i++) {
		cin >> arr[i];
	}
	dp[0] = 0;
	dp[1] = 0;
  	dp[2]=abs(arr[2]-arr[1]);
	for (i = 3; i <= n; i++) {
		dp[i] = min(dp[i - 1] + abs(arr[i] - arr[i - 1]), dp[i - 2] + abs(arr[i] - arr[i - 2]));
		
	}
	//for (i = 1; i <= n; i++) {
	//	cout << dp[i]<<" ";
	//}
	cout << dp[n] << endl;
}

Measured memory_bytes: 1792
#include <iostream>
using namespace std;
int N;
int Array[100005];
bool Ok[100005];
void Solve()
{
    cin >> N;
    for(int i = 1; i <= N; i++)
        cin >> Array[i];
    int ans = 0;
    for(int i = 1; i <= N; i++)
    {
        if(Array[i] == i)
        {
            if(Ok[i - 1] == 0)
                Ok[i] = 1, ans++;
        }
    }
    cout << ans << "\n";
}
int main()
{
    Solve();
    return 0;
}


Measured memory_bytes: 768
#include "bits/stdc++.h"
using namespace std;
#ifdef _DEBUG
#include "dump.hpp"
#else
#define dump(...)
#endif

//#define int long long
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9) + 7;
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 (b < a) { a = b; return true; } return false; }

//??????O(mn) ??????O(m)
int levenshtein_distance(const string &a, const string &b) {
	int m = a.size(), n = b.size();
	int column_start = 1;
	vector<int> column(m + 1);
	iota(column.begin() + column_start, column.begin() + m + 1, column_start);
	for (int x = column_start; x <= n; x++) {
		column[0] = x;
		int last_diagonal = x - column_start;
		for (int y = column_start; y <= m; y++) {
			int old_diagonal = column[y];
			column[y] = min({
				column[y] + 1,
				column[y - 1] + 1,
				last_diagonal + (a[y - 1] != b[x - 1])
			});
			last_diagonal = old_diagonal;
		}
	}
	return column[m];
}

signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	string a, b; cin >> a >> b;
	cout << levenshtein_distance(a, b) << endl;
	return 0;
}

Measured memory_bytes: 3232
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
#define int long long
#define double long double
#define mod 1000000007
#define F first
#define S second
#define P pair<long long,long long>
#define all(a) a.begin(),a.end()
#define INF 10000000000000000
#define endl '\n'
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; }
using namespace std;

//usual power (any type)
template <typename Type>
inline Type pow_any(Type x, int pow){
    if(pow==0) return 1;
    Type a=pow_any(x, pow/2);
    a*=a;
    if(pow%2==1) a*=x;
    return a;
}

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

    int m,k; cin>>m>>k;
    if(m==1){
        if(k==0){
            cout<<"0 0 1 1"<<endl;
        }else{
            cout<<-1<<endl;
        }
    }else{
        if(k>=(1<<m)){
            cout<<-1<<endl;
            return 0;
        }
        deque<int> ans;
        ans.push_back(k);
        rep(i,1<<m){
            if(i!=k){
                ans.push_back(i);
                ans.push_front(i);
            }
        }
        ans.push_back(k);
        rep(i,(1<<(m+1))-1)cout<<ans.at(i)<<' ';
        cout<<ans.back()<<endl;
    }

}

Measured memory_bytes: 3968
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))
sum = 0

for i in range(N):
    sum += B[A[i]-1]

for i in range(N-1):
    if A[i]+1==A[i+1]:
        sum += C[A[i]-1]

print(sum)


Measured memory_bytes: 3064
#include <iostream>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <algorithm>
#include <fstream>
#include <iomanip>

typedef long long ll;
const ll INF = (ll)1e18 + 1;
const ll MOD = 1e9 + 7;

template<class T> T maximum(T head, T tail) { return std::max(head, tail); }
template<class H, class... T> H maximum(H head, T... tail) { return std::max(head, maximum(tail...)); }

template<class T> T minimum(T head, T tail) { return std::min(head, tail); }
template<class H, class... T> H minimum(H head, T... tail) { return std::min(head, minimum(tail...)); }

template<class T> std::ostream& operator << (std::ostream& os, std::vector< T > v)
{
  ll i = 0;
  for (auto x : v) {os << " [" << i++ << "]" << x; if (i % 10 == 0) os << std::endl;}
  return os;
}

template<class T, class S> std::ostream& operator << (std::ostream& os, std::vector< std::pair<T, S> > vp)
{
  ll i = 0;
  for (auto p : vp) {os << " [" << i++ << "]" << p.first << " " << p.second; if (i % 10 == 0) os << std::endl;}
  return os;
}

void print(){ std::cout << std::endl; }
template<typename H> void print(H head) { std::cout << head << std::endl; }
template<typename H, typename... T> void print(H head, T... tail){ std::cout << head << " ", print(tail...); }

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

  std::string s;
  std::cin >> s;

  std::string ans;
  for (ll i = 0; i < (ll)s.size(); i++) {
    ans += s[i];
    if (i == 3) ans += ' ';
  }

  print(ans);
  return 0;
}


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

using namespace std;

#define DUMP(x) std::cerr << (#x) << " = " << (x) << "\n"
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define REP(i, k, n) for (int i = (k); i < (int)(n); ++i)
#define ALL(r) r.begin(), r.end()
#define YES puts("YES")
#define Yes puts("Yes")
#define NO puts("NO")
#define No puts("No")
#define IMP puts("IMPOSSIBLE")
#define Imp puts("Impossible")
#define imp puts("impossible")
#define M1 puts("-1")
#define pb push_back
#define eb emplace_back

template <typename T>
ostream &operator<<(ostream &os, vector<T> &v)
{
    os << "{";
    rep(i, v.size()) os << v[i] << (i == (int)v.size() - 1 ? "" : ", ");
    os << "}";
    return os;
}
template <typename T>
T dup(T x, T y)
{
    return (x + y - 1) / y;
};
template <typename A, size_t N, typename T>
inline void arrayFill(A (&array)[N], const T &val) { std::fill((T *)array, (T *)(array + N), val); }
struct in
{
    const size_t n = 0;
    in() = default;
    in(size_t n) : n(n){};
    template <typename T>
    operator T()
    {
        T ret;
        cin >> ret;
        return ret;
    }
    template <typename T>
    operator vector<T>()
    {
        assert(n != 0);
        vector<T> ret(n);
        for (auto &x : ret)
            cin >> x;
        return ret;
    }
};

using ll = int64_t;
using vint = vector<int32_t>;
using vvint = vector<vint>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pint = pair<int32_t, int32_t>;
using vpint = vector<pint>;
using pll = pair<ll, ll>;
using setint = set<int32_t>;
using setstr = set<string>;
using qint = queue<int32_t>;
using qpint = queue<pint>;

constexpr std::int32_t INF = 1001001001;
constexpr std::int64_t LINF = 1001001001001001001;

void Main()
{
    int n, m;
    cin >> n >> m;
    if (n == m)
        Yes;
    else
        No;
}

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


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

#define rep(l, r) for (int i = (l); i < (r); i++)

typedef long long ll;
 
using namespace std;

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

    cout << (c <= a + b ? "Yes" : "No") << endl;

    return 0;
}


Measured memory_bytes: 256
import std.stdio, std.conv, std.functional, std.string;
import std.algorithm, std.array, std.container, std.range, std.typecons;
import std.numeric, std.math, std.random;
import core.bitop;

string FMT_F = "%.10f";

static string[] s_rd;
T RD(T = long)() { while(!s_rd.length) s_rd = readln.chomp.split; string res = s_rd[0]; s_rd.popFront; return res.to!T; }
string RDR()() { return readln.chomp; }
T[] ARR(T = long)(in string str, T fix = 0) { auto r = str.split.to!(T[]); r[] += fix; return r; }
size_t[] MAKE_IDX(alias less = "a < b", Range)(Range range) { auto idx = new size_t[](range.length); makeIndex!(less)(range, idx); return idx;}
size_t MIN_POS(alias less = "a < b", Range)(Range range) { auto r = minPos!(less)(range); return range.length - r.length; }

bool inside(T)(T x, T b, T e) { return x >= b && x < e; }
long lcm(long x, long y) { return x * y / gcd(x, y); }

long mod = 10^^9 + 7;
//long mod = 998244353;
//long mod = 1_000_003;
void moda(ref long x, long y) { x = (x + y) % mod; }
void mods(ref long x, long y) { x = ((x + mod) - (y % mod)) % mod; }
void modm(ref long x, long y) { x = (x * y) % mod; }

void main()
{
	auto a = RD;
	auto b = RD;
	auto ans = sgn(a) * sgn(b);
	if (ans == 1 && sgn(a) == -1 && (abs(a - b) + 1) % 2 == 0)
		a = 1;
	
	writeln((ans == 1 && sgn(a) == 1) ? "Positive" : ans == 1 && sgn(a) == -1 ? "Negative" : "Zero");
	stdout.flush();
	debug readln();
}


Measured memory_bytes: 256
fun main(args: Array<String>) {
    val S = readLine()!!
    val a = S.take(2).toInt()
    val b = S.takeLast(2).toInt()
    val am = a in (1..12)
    val bm = b in (1..12)
    val ans = when {
        am && bm -> "AMBIGUOUS"
        am -> "MMYY"
        bm -> "YYMM"
        else -> "NA"
    }
    println(ans)
}

Measured memory_bytes: 33732
#include <iostream>
#include <string>
#include <vector>
 
using namespace std;
 
int main() {
    string s1, s2;
    while (cin >> s1) {
        if (s1 == ".") {
            break;
        }
        cin >> s2;
 
        if (s1 == s2) {
            cout << "IDENTICAL" << endl;
        }
        else {
            int s1c = 0;
            vector<string> s11;
            string subs1 = "";
            string kk = "";
            for (int i = 0; i < s1.size(); i++) {
                if (s1[i] == '"') {
                    subs1 += '"';
                    s1c++;
                    if (s1c % 2 == 0) {
                        s11.push_back('"' + kk + '"');
                        kk = "";
                    }
                }
                else if (s1c % 2 != 0) {
                    kk += s1[i];
                }
                else {
                    subs1 += s1[i];
                }
            }
            int s2c = 0;
            vector<string> s22;
            string subs2 = "";
            for (int i = 0; i < s2.size(); i++) {
                if (s2[i] == '"') {
                    subs2 += '"';
                    s2c++;
                    if (s2c % 2 == 0) {
                        s22.push_back('"' + kk + '"');
                        kk = "";
                    }
                }
                else if (s2c % 2 != 0) {
                    kk += s2[i];
                }
                else {
                    subs2 += s2[i];
                }
            }
            if (subs1 == subs2 && s11.size() == s22.size()) {
                int cc = 0;
                for (int i = 0; i < s11.size(); i++) {
                    if (s11[i] != s22[i]) {
                        cc++;
                    }
                }
                if (cc == 1) {
                    cout << "CLOSE" << endl;
                }
                else {
                    cout << "DIFFERENT" << endl;
                }
            }
            else {
                cout << "DIFFERENT" << endl;
            }
        }
 
    }
    return 0;
}


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

const ll p = 1e9+7;
const int MAXN = 1e5+5;

string s;

int main() {
	cin >> s;
	string t = "";
	for (int i = 0; i < 4; ++i)
		t += s[i];
	t += ' ';
	for (int i = 4; i < 12; ++i)
		t += s[i];
	cout << t << endl;
}

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

#define int long long
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<n;++i)
#define exrep(i, a, b) for(ll i = a; i < b; i++)
#define out(x) cout << x << endl
#define EPS (1e-7)
#define gearup ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<pair<int,int> > vpii;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<bool> > vvb;
typedef vector<vector<double> > vvd;
typedef vector<vector<string> > vvs;
typedef vector<ll> vl;
typedef vector<vector<ll> > vvl;
typedef vector<vector<vector<ll> > > vvvl;
ll MOD = 1000000007;
const long long L_INF = 1LL << 60;
const int INF = 2147483647; // 2^31-1
const double PI = acos(-1);
//cout<<fixed<<setprecision(10);

template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}
template<class T> void debug(T v){rep(i,v.size()) cout<<v[i]<<" ";cout<<endl;}
const ll dx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};
//以降 cin の入力元が 'input.txt' になる
//std::ifstream in("input.txt");
//std::cin.rdbuf(in.rdbuf());


signed main()
{
    gearup;
    ll a,b,c; cin >> a >> b >> c;
    if(a<=c && c <= b)out("Yes");
    else out("No");
}

Measured memory_bytes: 3660
#include <iostream>
#include <vector>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)




//// C
int main(){
    int n; cin >> n;
    string s; cin >> s;
    int ans=0;
    rep(i, n-1){
        if(s[i] != s[i+1]) ans++;
    }
    ans++;
    cout << ans;
}

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

const long long mod = 1e9 + 7;

using ll = long long;
using pii  = pair<int, int>;
using pll = pair<ll, ll>;
#define ull unsigned long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define vc vector<char>
#define vs vector<string>
#define vpii vector<pii>
#define vpll vector<pll>

#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; i++)
#define rep1(i, n) for (int i = 1, i##_len = (n); i <= i##_len; i++)
#define repr(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rep1r(i, n) for (int i = ((int)(n)); i >= 1; i--)

#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define RSORT(x) sort(rall(x));
#define pb push_back
#define mp make_pair

#define INF (1e9)
#define PI (acos(-1))
#define EPS (1e-7)

ull gcd(ull a, ull b) { return b ? gcd(b, a % b) : a; }
ull lcm(ull a, ull b) { return a / gcd(a, b) * b; }

int main(){
    int h, w;
    cin >> h >> w;
    vs s(h);
    rep(i, h) cin >> s[i];
    vector<vi> dp(h+1, vi(w+1, INF));
    rep(i, h) rep(j, w) {
        if (i==0 && j==0) dp[i+1][j+1] = (s[i][j]=='.'?0:1);
        else {
            if (i-1<0 || s[i][j]==s[i-1][j]) dp[i+1][j+1] = min(dp[i+1][j+1], dp[i][j+1]);
            else dp[i+1][j+1] = min(dp[i+1][j+1], dp[i][j+1]+1);
            if (j-1<0 || s[i][j]==s[i][j-1]) dp[i+1][j+1] = min(dp[i+1][j+1], dp[i+1][j]);
            else dp[i+1][j+1] = min(dp[i+1][j+1], dp[i+1][j]+1);
        }
    }
    int ans = dp[h][w] + (s[h-1][w-1]=='.'?0:1);
    ans /= 2;
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3712
#include <iostream>
#include <algorithm>
using namespace std;
int main(){
  int w[10];
  int k[10];

  for( int i=0;i<10;i++ )
    cin >> w[i];
  for( int i=0;i<10;i++ )
    cin >> k[i];

  sort(w,w+10);
  sort(k,k+10);

  int sw=0, sk=0;
  for( int i=0;i<3;i++ ){
    sw += w[i+7];
    sk += k[i+7];
  }
  cout << sw << " " << sk << endl;
}

Measured memory_bytes: 1180
#include <stdio.h>
#include <limits.h>

int table[6][2] = {{1500,2244},{1000,1520},{1200,1870},{500,850},{300,550},{200,380}};

int val;

void solve(int depth, int gram, int total) {
	int i;
	
	if(gram == 0) {
		if(val > total) {
			val = total;
			return;
		}
	}

	if(depth > 7) {
		return;
	}
	
	if(gram < 0) return;
	
	for(i=0;i<6;i++) {
		solve(depth+1, gram-table[i][0], total+table[i][1]);
	}
}


int main(void) {
	int i, n, t, value;
	
	while(scanf("%d\n", &n) == 1) {
		if(n == 0) break;
		val = INT_MAX;
		solve(0, n, 0);
		
		printf("%d\n", val);
	}
	
	return 0;
}

Measured memory_bytes: 604
#include<stdio.h>

int main(){
  int n,i,min=300000,j,cnt=0;
  char s[300010];
  scanf("%d",&n);
  scanf("%s",s);
  for(i=1;i<n;i++){
    if(s[i]=='E') cnt++;
  }
  min=cnt;
  for(i=1;i<n;i++){
    if(s[i]=='E') cnt--;
    if(s[i-1]=='W') cnt++;
    if(min>cnt) min=cnt;
  }
  printf("%d\n",min);
}

Measured memory_bytes: 512
#include<stdio.h>
int main(void){
  system("python3 -c \"g=[0,1,3,1,2,1,2,1,1,2,1,2,1];x,y=map(int,input().split());print('YNeos'[g[x]!=g[y]::2])\"");
  return 0;
}

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

typedef long long ll;

const int INF = 1e9;
const int MOD = 1e9+7;
const ll LLINF = 1e18;

#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define FORR(i,a,b) for(int i=(a);i>=(b);i--)

#define ALL(obj) (obj).begin(),(obj).end()

#define pii pair<int,int>

#define pb(a) push_back(a)
#define mp make_pair

int main()
{
	int n,k;
	cin >> n >> k;
	int n1 = n / k;
	ll ans = pow(n1, 3);
	if(k % 2 == 0){
		if(k * n1 + k / 2 <= n)n1++;
		ans += pow(n1, 3);
	}
	cout << ans << "\n";
	return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    int N = scanner.nextInt();
    long[] s = new long[N];
    for (int i = 0; i < N; i++) s[i] = scanner.nextInt();

    long[] u = new long[N];
    long[] v = new long[N];
    for (int i = 1; i < N; i++) {
      long t = s[i] + s[N - i - 1];
      for (int j = 1; (long) j * j <= i; j++) {
        if (i % j == 0) {
          if ((i < N / 2 || (N - 1) % j != 0) && N - i - 1 > j) {
            u[j] += t;
            v[j] = Math.max(v[j], u[j]);
          }
          if (i != j * j) {
            int k = i / j;
            if ((i < N / 2 || (N - 1) % k != 0) && N - i - 1 > k) {
              u[k] += t;
              v[k] = Math.max(v[k], u[k]);
            }
          }
        }
      }
    }
    long max = 0;
    for (int i = 0; i < N; i++) max = Math.max(max, v[i]);
    System.out.println(max);
  }
}


Measured memory_bytes: 58976
//Code is like humor. When you have to explain it, it’s bad.
#define fastio ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
#include <bits/stdc++.h>
#define MOD 1000000007
#define int long long
using namespace std;
#define ss second
#define ff first
int32_t main()
{
    fastio;
    int T,n,m,i,j,k,a,b,c;
    T=1;
    while(T --> 0)
    {
        cin>>a;
        b=(a/500)*1000;
        a=a%500;
        b+=(a/5)*5;
        cout<<b;
    }
    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		try {
			long a = Long.parseLong(sc.next());
			long b = Long.parseLong(sc.next());
			long x = Long.parseLong(sc.next());

			long ans = 0;
			if (a == 0 && b == 0) {
				ans = 1;
			} else if (a == 0) {
				ans = (b / x) + 1;
			} else {
				ans = (b / x) - ((a - 1) / x);
			}

			System.out.println(ans);

		} finally {
			sc.close();
		}
	}
}

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

int main()
{
    long long M;
    cin >> M;
    long long D = 0;
    long long S = 0;
    for(long long i = 0; i < M; i++)
    {
        long long d, c;
        cin >> d >> c;
        D += c;
        S += d*c;
    }
    long long ans = (S-1)/9;
    ans += D-1;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
/*
 ▓█████▄  ▄████▄  ▓██   ██▓ ██▓███   ██░ ██ ▓█████  ██▀███
▒██▀ ██▌▒██▀ ▀█   ▒██  ██▒▓██░  ██▒▓██░ ██▒▓█   ▀ ▓██ ▒ ██▒
 ░██   █▌▒▓█    ▄   ▒██ ██░▓██░ ██▓▒▒██▀▀██░▒███   ▓██ ░▄█ ▒
 ░▓█▄   ▌▒▓▓▄ ▄██▒  ░ ▐██▓░▒██▄█▓▒ ▒░▓█ ░██ ▒▓█  ▄ ▒██▀▀█▄
 ░▒████▓ ▒ ▓███▀ ░  ░ ██▒▓░▒██▒ ░  ░░▓█▒░██▓░▒████▒░██▓ ▒██▒
  ▒▒▓  ▒ ░ ░▒ ▒  ░   ██▒▒▒ ▒▓▒░ ░  ░ ▒ ░░▒░▒░░ ▒░ ░░ ▒▓ ░▒▓░
  ░ ▒  ▒   ░  ▒    ▓██ ░▒░ ░▒ ░      ▒ ░▒░ ░ ░ ░  ░  ░▒ ░ ▒░
  ░ ░  ░ ░         ▒ ▒ ░░  ░░        ░  ░░ ░   ░     ░░   ░
    ░    ░ ░       ░ ░               ░  ░  ░   ░  ░   ░
  ░      ░         ░ ░
*/
//focus less on how much problem you should solve within a fixed time and focus more on getting the problem solved and
//learning something from it
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define rep(i,a,b) for(ll i=a; i<b; i++)
#define per(i,a,b) for(ll i=a; i>=b; i--)
#define ll long long int
#define ld long double
#define vi vector<ll>
#define vii vector <pair<ll,ll> >
#define sedes set <ll, greater <ll> >
#define seasc set <ll>
#define pb push_back
#define mkp make_pair
#define ff first
#define ss second
#define MOD 1000000007
#define prec(n) fixed<<setprecision(n)
#define maxpq priority_queue<int>
#define minpq priority_queue<int, vector<int>, greater<int> >
#define umap unordered_map<ll, ll>
#define map map<ll, ll>
#define autoit(x,it) for(auto it = x.begin(); it != x.end(); it++)
#define mems(a, i) memset(a, i, sizeof(a))
#define endl '\n'
#define all(v) v.begin(),v.end()
#define gcd(a,b) __gcd((a),(b))
#define lcm(a,b) ((a)*(b))/gcd((a),(b))
#define deba(a) cout << #a << " " << a << endl;
int main()
{
	fast;
#ifndef ONLINE_JUDGE
	freopen("/home/kushagra/Desktop/Kushagra/input.txt", "r", stdin);
	freopen("/home/kushagra/Desktop/Kushagra/output.txt", "w", stdout);
#endif
	ll n, k;
	cin >> n >> k;
	string s;
	cin >> s;
	vii a;
	a.pb(mkp(0, 0));
	rep(i, 0, s.length())
	{
		if (s[i] == '1')
		{
			ll j = i;
			while (s[j] == '1')
				j++;
			a.pb(mkp(i, j));
			i = j - 1;
		}
	}
	a.pb(mkp(n, n));

	ll ans = 0;
	rep(i, 0, a.size())
	{
		ll j = min(i + k, (ll)a.size() - 1);
		ll len = a[j].ss - a[i].ff;
		ans = max(ans, len);
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 4428
#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <deque>
#include <queue>
#include <array>
#include <set>
#include <map>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <utility>
#include <tuple>
#include <functional>
#include <bitset>
#include <cstdint>
#include <cassert>
#include <random>

using namespace std;
using i64 = int64_t;
using i32 = int32_t;
template<class T, class U> void init_n(vector<T>& v, size_t n, U x) 
{ v = vector<T>(n, x); }
template<class T> void init_n(vector<T>& v, size_t n) { init_n(v, n, T()); }
template<class T> void read_n(vector<T>& v, size_t n, size_t o = 0) 
{ v = vector<T>(n+o); for (size_t i=o; i<n+o; ++i) cin >> v[i]; }
template<class T> void read_n(T a[], size_t n, size_t o = 0)
{ for (size_t i=o; i<n+o; ++i) cin >> a[i]; }
template<class T> T iabs(const T& x) { return max(x, -x); }
// #define abs gabs

int main() {
    int n, a;
    cin >> n >> a;
    cout << n * n - a << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <math.h>
#include <algorithm>
#include <stdint.h>
#include <queue>
#include <bitset>
#include <iomanip>
#include <set>
#include <map>

using namespace std;

#define PI (3.14159265358979323846)
#define INF (2147483647)
#define INF_LL (9223372036854775807)
#define DIV_NUM (1000000007)
typedef long long ll;

// 配列初期化テンプレ
template<typename A, size_t N, typename T>
void Fill(A(&array)[N], const T& val) {
	std::fill((T*)array, (T*)(array + N), val);
}


int main() {

	ll N, M, K;
	cin >> N >> M >> K;
	
	vector<ll> A(N+1,0);
	for (ll i = 0; i < N; i++) {
		ll tmp;
		cin >> tmp;
		A[i+1] = A[i] + tmp;
	}

	vector<ll> B(M+1,0);
	for (ll i = 0; i < M; i++) {
		ll tmp;
		cin >> tmp;
		B[i + 1] = B[i] + tmp;
	}

	ll ans = 0;
	for (ll i = 0; i < A.size(); i++) {
		ll rest = K - A[i];
		if (rest < 0) break;
		vector<ll>::iterator ite = upper_bound(B.begin(), B.end(), rest);
		ll Bnum = 0;
		if (ite == B.end()) Bnum = B.size()-1;
		else {
			Bnum = ite - B.begin();
			Bnum -= 1;
		}
		ll total_num = i + Bnum;
		ans = max(ans, total_num);
	}

	cout << ans << endl;

	return 0;

}


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

typedef long long lint;
typedef pair<int, int> P;
#define REP(i, x, n) for(lint i = x ; i < n ; i++)
#define rep(i, n) REP(i, 0, n)
#define repr(i, n) for(lint i = n - 1 ; i >= 0 ; i--)
#define SORT(c) sort((c).begin(), (c).end())

const int IINF = 1e9 + 10;
const lint LLINF = (lint)1e18 + 10;
const lint MOD = (lint)1e9 + 7;
const lint inv = MOD - 2;
const int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1};
const int dx8[] = {1, 1, 0, -1, -1, -1, 0, 1}, dy8[] = {0, -1, -1, -1, 0, 1, 1, 1};

int main(){
    int n;
    scanf("%d", &n);
    vector<double> a(n);
    rep(i, n){
        scanf("%lf", &a[i]);
    }
    SORT(a);
    int ans1 = a[n-1], ans2 = a[0];
    double tmp = abs(a[0] - a[n-1]/2.0);
    rep(i, n-1){
        if(tmp > abs(a[i] - a[n-1]/2)){
            ans2 = a[i];
            tmp = abs(a[i] - a[n-1]/2);
        }
    }
    printf("%d %d\n", ans1, ans2);
    return 0;
}

Measured memory_bytes: 1152
#include <iostream>

using namespace std;
using ll = long long;

int main() {
  ll n, d;
  cin >> n >> d;
  ll x, y;
  ll ans = 0;
  while (cin >> x >> y) {
    ans += x * x + y * y <= d * d;
  }
  cout << ans << endl;
}


Measured memory_bytes: 3632
import java.util.Scanner;
 
public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int p = scan.nextInt();
        int n = scan.nextInt();
        int[] ar = new int[n];
        for (int i = 0; i < n; i++) {
            int i1 = scan.nextInt();
            ar[i] = i1;
        }
        int min = Integer.MAX_VALUE;
        for (int i = 0; i < ar.length; i++) {
            int x = i == 0 ? n-1:i-1;
            int y = i+1 == ar.length ? 0:i+1;
            min = Math.min(Math.min(p + (ar[x]-ar[i]),p - ar[y] + ar[i]),min);
        }
 
        System.out.println(Math.min(ar[n-1]-ar[0],min));
    }
}

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

int main()
{
    int n, count=0;
    cin>>n;
    int ar[n];
    
    for(int i = 1;i <= n; i++)
    {
        cin>>ar[i];
        if(ar[i]!=i)
        {
            count++;
        }
    }
    if(count==0 || count==2)
    {
        cout<<"YES"<<endl;
    }
    else
    {
        cout<<"NO"<<endl;
    }
}

Measured memory_bytes: 3608
#include<bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for( int i=a; i<b; i++ )
#define REP(i,n) rep(i,0,n)
#define INF 1000000
using lli = long long int;
using ulli = unsigned long long int;
typedef pair<int, int> P;

struct edge{ int u, v; lli cost; };
struct DirectedGraph
{
  int vertex_num;
  int edge_num;
  vector<edge> edge_list;
  vector< vector<int> > adj_list;
	vector< vector<lli> > distance_matrix;
};


template <typename T>
vector<int> argsort(const vector<T> &v) {

  // initialize original index locations
  vector<int> idx(v.size());
  iota(idx.begin(), idx.end(), 0);

  // sort indexes based on comparing values in v
  sort(idx.begin(), idx.end(),
       [&v](int i1, int i2) {return v[i1] < v[i2];});

  return idx;
}

template<typename T>
void displayVector(vector<T> v)
{
	lli n = v.size();
	REP(i,n){
		cout << v[i] << " " ;
	}
	cout << endl;
}

int count_comb(int a, int b, int c){
  if(a!=b && b!=c){ return 6; }
  else if( a==b && b==c){ return 1; }
  else{ return 3; }
}

string sub(string str, int start, int end){
  // require : start < end
  return str.substr(start, end-start+1);
}

struct C{ int a; int b; };

int main(){
  int n, k; cin >> n;
  vector<lli> val(n);
  vector<int> act(n);
  REP(i,n){ cin >> val[i]; }

  lli money = 1000; lli stock = 0;

  lli next_val = val.at(n-1);
  for(int i=n-2; 0<=i; i-- ){
    if(val[i] < next_val ){ 
      act[i] = 1; next_val = val[i];
    } else if (val[i] > next_val ) { 
      act[i] = -1; next_val = val[i];
    } else{ act[i] = 0; }
  }

  // displayVector(act);

  REP(i, n){
    if( act[i] == 1 ){
      lli tmp =  money / val[i];
      money -= tmp * val[i];
      stock += tmp; 
    } else if( act[i] == -1){
      money += stock * val[i];
      stock = 0;
    }

    if(i==n-1 && stock>0 ){
      money += stock * val[i];
    }
  }


  cout << money << endl;
  return 0;
}

Measured memory_bytes: 3624
fn main() {
    let (r, w) = (std::io::stdin(), std::io::stdout());
    let mut sc = IO::new(r.lock(), w.lock());
    let a: u64 = sc.read();
    let b: u64 = sc.read();
    let n: u64 = sc.read();

    if n >= b - 1 {
        let x = b - 1;
        let ans = a * x / b - a * (x / b);
        println!("{}", ans);
    } else {
        let x = n;
        let ans = a * x / b - a * (x / b);
        println!("{}", ans);
    }
}

pub struct IO<R, W: std::io::Write>(R, std::io::BufWriter<W>);

impl<R: std::io::Read, W: std::io::Write> IO<R, W> {
    pub fn new(r: R, w: W) -> Self {
        Self(r, std::io::BufWriter::new(w))
    }
    pub fn write<S: ToString>(&mut self, s: S) {
        use std::io::Write;
        self.1.write(s.to_string().as_bytes()).unwrap();
    }
    pub fn read<T: std::str::FromStr>(&mut self) -> T {
        use std::io::Read;
        let buf = self
            .0
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b' ' || b == b'\n' || b == b'\r' || b == b'\t')
            .take_while(|&b| b != b' ' && b != b'\n' && b != b'\r' && b != b'\t')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
            .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read()).collect()
    }
    pub fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
}


Measured memory_bytes: 2180
#include <bits/stdc++.h>
#define ll long long int
#define MOD 1000000007
#define INF 1e18
#define PI 3.14159265358979

using namespace std;

int main(void){
  string s;
  cin >> s;
  int n = s.size();
  ll dp[n+1][13] = {};
  dp[0][0] = 1;

  for (int i = 0; i < n; i++){
    if (s[i] == '?'){
      for (int j = 0; j < 10; j++){
        for (int k = 0; k < 13; k++){
          dp[i + 1][(k * 10 + j) % 13] = (dp[i + 1][(k * 10 + j) % 13]  + dp[i][k]) % MOD;
        }
      }
    }
    else {
      for (int k = 0; k < 13; k++){
        dp[i + 1][(k * 10 + (s[i] - '0')) % 13] = (dp[i + 1][(k * 10 + (s[i] - '0')) % 13] + dp[i][k]) % MOD;
      }
    }
  }


  cout << dp[n][5] << endl;


  return 0;
}


Measured memory_bytes: 10624
using System;
using System.Collections.Generic;
using System.Linq;
using static System.Console;
using System.Runtime.CompilerServices;
using static MyUtil;

class MyUtil
{
    public static int[] ReadIntArray()
    {
	return ReadLine().Split().Select(x => int.Parse(x)).ToArray();
    }
}

class Program
{
    public static void Main()
    {
	var tmp = ReadIntArray();
	int n = tmp[0], m = tmp[1], x = tmp[2];
	int[] a = ReadIntArray();
	int lower = 0, upper = 0;
	for (int i = 0; i < m; i++)
	{
	    if      (a[i] > x){ upper++; }
	    else if (a[i] < x){ lower++; }
	}
	WriteLine(Math.Min(lower, upper));
    }
}


Measured memory_bytes: 13268
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <set>
#include <map>

using namespace std;
typedef long long ll;

#define rep(i, n) for (int i = 0; i < n; i++)
#define all(x) x.begin(), x.end()
ll gcd(ll a, ll b) {
    if(a%b) {
        return gcd(b, a%b);
    } else {
        return b;
    }
}
int main(void)
{
    ll x, k, d; cin >> x >> k >> d;
    ll ans;

    x = abs(x);

    ll nc = x/d;
    ll lk = k - nc;
    ll ansa = x - nc*d;
    if (1.0 * x / d < k)
    {
        if(lk%2) {
            ans = abs(ansa - d);
        } else {
            ans = abs(ansa);
        }
    }
    else
    {
        ans = x - k*d;
    }

    cout << ans << endl;
}

Measured memory_bytes: 3592
#include<iostream>
using namespace std;
int main (void){

    int a, b, c, k, max = 0, cnt = 0;
    cin >> a >> b >> c >> k;

    for(int i = 0;i < a;i++){

        max += 1;
        cnt++;
        if(cnt == k)
            break;
    }
    for(int i = 0;i < b;i++){
        
        if(cnt == k)
            break;
        cnt++;
        
    }
    for(int i = 0;i < c;i++){
        
        if(cnt == k)
            break;
        max -= 1;
        cnt++;

    }

    cout << max << endl;

    return 0;
}

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

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

long long MOD = 1000000000 + 7;
long long MAX = 1000000000000000000;

int main(){
  cout << setprecision(10);
  int N;
  cin >> N;

  bool flg = false;

  int set_num = 0;
  for(int i = 0; i < 1000; i++){
    if(N == i * (i-1) / 2){
      flg = true;
      set_num = i;
      break;
    }
  }
  if(!flg){
    cout << "No" << endl;
    return 0;
  }
  
  cout << "Yes" << endl;
  cout << set_num << endl;

  vector<vector<int>> v(set_num);

  int num = 1;
  for(int i = 0; i < set_num -1; i++){
    for(int j = i + 1; j < set_num; j++){
      v[i].push_back(num);
      v[j].push_back(num);
      num++;
    }
  }

  for(int i = 0; i < set_num; i++){
    cout << v[i].size() << " ";
    for(int j = 0; j < v[i].size(); j++){
      if(j == v[i].size() - 1){
        cout << v[i][j] << endl;
      } else { 
        cout << v[i][j] << " ";
      }
    }
  }


}


Measured memory_bytes: 2304
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const ll MOD = 1000000007;
const int IINF = INT_MAX;
#define REP(i, n) for (int i = 0; i < n; i++)


int main() {
    ll n, d[15][15];
    while(cin >> n, n){
        REP(i,15)fill(d[i],d[i]+15,IINF);
        REP(i,n){
            ll a, b, c;
            cin >> a >> b >> c;
            d[a][b] = c;
            d[b][a] = c;
        }
        REP(i,10) d[i][i] = 0;
        REP(k,10)REP(i,10)REP(j,10){
            d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
        }
        ll dmin=IINF, id;
        REP(i,10){
            ll sum = 0;
            REP(j,10){
                if(d[i][j]!=IINF)
                    sum += d[i][j];
            }
            if(sum != 0 && sum < dmin){
                id = i;
                dmin = sum;
            }
        }
        cout << id << " " << dmin << endl;
    }
    return 0;
}


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

int main(void){
  int A, B;
  bool ans = false;
  cin >> A >> B;
  if(A % 3 == 0 || B % 3 == 0 || (A + B) % 3 == 0)
    ans = true;
  if(ans) cout << "Possible" << "\n";
  else cout << "Impossible" << "\n";
  return 0;
}


Measured memory_bytes: 3600
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
const ll MOD = 1000000007;

vector<vector<int>> G;

int dfs(int v, int par){
    int ret = 0;
    for(int to : G[v]){
        if(to == par) continue;
        ret += dfs(to, v);
    }
    // cout << v << " " << ret << endl;
    if(ret == 0){
        return 1;
    }else if(ret == 1){
        return 0;
    }else{
        return 2;
    }
}

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

    G.assign(N, {});
    for(int i=0;i<N-1;i++){
        int a, b;
        cin >> a >> b;
        a--; b--;
        G[a].push_back(b);
        G[b].push_back(a);
    }

    if(dfs(0, -1) >= 2 || dfs(G[0][0], -1) >= 2){
        cout << "First" << endl;
    }else{
        cout << "Second" << endl;
    }

    return 0;
}

Measured memory_bytes: 5888
#include <iostream>
#include <vector>
#include <iomanip>

using namespace std;

int main() {
    double n = 0, m = 0, d = 0;
    cin >> n >> m >> d;
    cout << fixed << setprecision(10);
    if (d == 0) {
        cout << (m-1) / n << endl;
    } else {
        cout << 2 * (n-d) / n / n * (m-1) << endl;
    }
    return 0;
}


Measured memory_bytes: 256
using System;
using System.IO;

class Program
{
    static void Main()
    {
        string str = Console.ReadLine();

        int[] a = new int[4];

        int count = 0;
        for(int i = 0; i < 4; i++)
        {
            a[i] = str[i] - '0';
            if (a[i] == 2) count++;
        }
        //数値変換完了

        Console.WriteLine(count);
    }
}

Measured memory_bytes: 11092