akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>

#define debug(x) cout <<"DEBUG"<<" "<< #x << ":" << x << '\n'
#define rep(i,n) for(int_fast32_t i = 0; i < ((int_fast32_t)(n)); i++)   // 0-indexed昇順
#define rep1(i,n) for(int_fast32_t i = 1; i <= ((int_fast32_t)(n)); i++) // 1-indexed昇順
#define rrep(i,n) for(int_fast32_t i = ((int_fast32_t)(n)-1); i >= 0; i--)  // 0-indexed降順
#define rrep1(i,n) for(int_fast32_t i = ((int_fast32_t)(n)); i >= 1; i--)   // 1-indexed降順
#define all(x) (x).begin(),(x).end()

using namespace std;

template<typename T>
using vec = vector<T>;
using i32 = int_fast32_t;
using i64 = int_fast64_t;
using u32 = uint_fast32_t;
using u64 = uint_fast64_t;
using ll = long long;
using ld = long double;
using vi = vec<int_fast32_t>;
using vl = vec<int_fast64_t>;
using vld = vec<ld>;
using vii = vec<vi>;  // 2次元配列
using PII = pair<int_fast32_t, int_fast32_t>;

template<class T>
using maxheap = std::priority_queue<T>;
template<class T>
using minheap = std::priority_queue<T, std::vector<T>, std::greater<T>>;

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

const ld Pi = std::acos(-1.0L);
constexpr ll infll = (1LL<<62)-1;
constexpr int inf = (1<<30)-1;
const int mod = 1000000007;
// const int mod = 998244353;

const i32 D = (80*160+5);
const i32 D2 = D * 2;
using bs = bitset<D2>;  // (Dで下駄を履かせる), 取りうる値のbitが立つようにする
bs dp[85][85];  // dp[row][col]
/*FUNCs=================================================*/

// 解説放送の写経
// 実装がうまい...

/*MAIN==================================================*/
signed main(){
    int START_TIME = clock();
    cin.tie(nullptr);
    ios::sync_with_stdio(false);   //cin cout 高速化
//    cout << fixed << setprecision(15);

    i32 h,w; cin >> h >> w;

    // 差の"絶対値"を最小化するので、各マスについてa-b, b-aをとってその合計の絶対値の最小化を考えてよい
    vii grid(h, vi(w)), a(h, vi(w)), b(h, vi(w));
    rep(i,h)rep(j,w) cin >> a[i][j];
    rep(i,h)rep(j,w) cin >> b[i][j];
    rep(i,h)rep(j,w) grid[i][j] = abs(a[i][j] - b[i][j]);

    // init
    dp[0][0][D-grid[0][0]] = 1;  // Dは下駄
    dp[0][0][D+grid[0][0]] = 1;

    rep(i,h) rep(j,w) {
        if (i) {
            dp[i][j] |= dp[i-1][j]<<grid[i][j];  // Bit-Shiftで加算を表現
            dp[i][j] |= dp[i-1][j]>>grid[i][j];  // Bit-Shiftで減算を表現
        }
        if (j) {
            dp[i][j] |= dp[i][j-1]<<grid[i][j];  // Bit-Shiftで加算を表現
            dp[i][j] |= dp[i][j-1]>>grid[i][j];  // Bit-Shiftで減算を表現
        }
    }
    i32 answer = inf;
    rep(i,D2) if(dp[h-1][w-1][i]) {
        chmin(answer, abs(i-D));  // 下駄を履かせていたので-Dで補正する
    }

    cout << answer << '\n';

    // printf("ExecutionTime: %d /ms\n",1000*(int)((clock()-START_TIME)/CLOCKS_PER_SEC));
}


Measured memory_bytes: 22912
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();

		int S = Integer.parseInt(line);
		int h = S / 3600;
		int m = S / 60 - h * 60;
		int s = S % 60;

		System.out.println(h + ":" + m + ":" + s);
	}

}

Measured memory_bytes: 26100
#include <bits/stdc++.h>
using namespace std;
#define dump(x) cout << (x) << endl
typedef long long ll;
typedef vector<int> V;

int main() {
  int k;
  cin >> k;
  if (k%2 == 0) dump((k/2)*(k/2));
  else dump((k/2)*(k/2+1));
  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

typedef long long int type;

typedef struct array{
	type *a;
	long long int length;
} array;

array ar_init(int n){
	array a;
	a.a = calloc(sizeof(type),n);
	return a;
}
void ar_push(array* a,type x){
	a->a[a->length++] = x;
}
type ar_pop(array* a){
	return a->a[a->length--];
}
type ar_get(array* a,int n){
	return a->a[n];
}
void ar_set(array* a,int n,type x){
	a->a[n] = x;
}

int main(void){
	long long int n;
	long long int x;
	long long int sum = 0;
	long long int i;
	int mod = 0;
	array a;
	scanf("%lld",&n);
	a = ar_init(n+1);
	for(i=0;i<n;i++){
		scanf("%lld",&x);
		ar_push(&a,x);
		sum += x;
	}
	for(i=0;i<n;i++){
		if(ar_get(&a,i) % 2){
			if(ar_get(&a,i+1)){
				ar_set(&a,i+1,ar_get(&a,i+1)-1);
			}else{
				mod++;
			}
		}
	}
	printf("%lld\n", (sum-mod)/2);
	return 0;
}

Measured memory_bytes: 896
#include "bits/stdc++.h"

using namespace std;

//using Matrix = vector< vector<int> >;
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1 << 30;
int dx[5] = {0, 0, 1, -1, 0}, dy[5] = {1, -1, 0, 0, 0};
bool cmp(P a, P b) { return a.second < b.second; } //End sort (Interval scheduling problem)


const ll MOD = 1e9 + 7LL;
const int MAX = 510000;


ll fac[MAX], finv[MAX], inv[MAX];

void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < MAX; i++) {
		fac[i] = fac[i - 1] * i % MOD;
		inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
		finv[i] = finv[i - 1] * inv[i] % MOD;
	}
}

ll COM(int n, int k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

ll n, m;
map<ll, ll> pf;

void prime_factors(ll n) {
	ll cnt = 2;
	while (n != 1 && cnt * cnt <= n) {
		while (n % cnt == 0) {
			pf[cnt]++;
			n /= cnt;
		}
		cnt++;
	}
	if (n != 1) pf[n] = 1;
}

int main(void){
	cin>>n>>m;
	COMinit();
	prime_factors(m);

	ll res = 1;
	for (auto ite = pf.begin(); ite != pf.end(); ++ite) {
		res *= COM(ite->second + n - 1, n - 1);
		res %= MOD;
	}

	cout<< res <<endl;
	
	return 0;
}

Measured memory_bytes: 12160
#include<iostream>
using namespace std;
main(){
	int n,k,x,y,w;
	cin>>n>>k;
	while(k--){
		cin>>x>>y;
		cout<<(min(min(x,y),min(n-x+1,n-y+1))-1)%3+1<<endl;
	
	}
	return 0;
}

Measured memory_bytes: 0
#pragma region header
#include <bits/stdc++.h>
using namespace std;

#define CPP_CAT(x,y) CPP_CAT_I(x,y)
#define CPP_CAT_I(x,y) x ## y
//#define CPP_STR(x) CPP_STR_I(x)
//#define CPP_STR_I(args...) #args
//#define ASSERT(expr...) assert((expr))

using i8 = int8_t;
using u8 = uint8_t;
using i16 = int16_t;
using u16 = uint16_t;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;
using f32 = float;
using f64 = double;
//using f80 = __float80;

constexpr i64 INF = 1'010'000'000'000'000'017LL;
constexpr i64 MOD = 1'000'000'007LL;
constexpr f64 EPS = 1e-12;
constexpr f64 PI = 3.14159265358979323846;
constexpr char EL[] = "\n";

#define FOR(i, start, end) for(i64 i = (start), CPP_CAT(i,xxxx_end)=(end); i < CPP_CAT(i,xxxx_end); ++i)
#define REP(i, n) FOR(i, 0, n)
#define all(x) (x).begin(),(x).end()
#define ALL(f,c,...) (([&](decltype((c)) cccc) { return (f)(std::begin(cccc), std::end(cccc), ## __VA_ARGS__); })(c))
#define UNIQUE(x) (x).erase(unique(all(x)), (x).end());
#define REPIT(x) for(auto it=(x).begin(), end=(x).end(); it!=end; ++it)
#define perm(c) sort(all(c)); for(bool c##p=1;c##p;c##p=next_permutation(all(c)))

template<typename T = i64>
T IN() { T x; cin >> x; return (x); }

template<typename C>
i64 SIZE(const C& c) { return static_cast<i64>(c.size()); }
template<typename T, size_t N>
i64 SIZE(const T(&)[N]) { return static_cast<i64>(N); }

template<typename T, typename U, typename Comp = less<>>
bool chmax(T& xmax, const U& x, Comp comp = {}) {
	if (comp(xmax, x)) {
		xmax = x;
		return true;
	}
	return false;
}
template<typename T, typename U, typename Comp = less<>>
bool chmin(T& xmin, const U& x, Comp comp = {}) {
	if (comp(x, xmin)) {
		xmin = x;
		return true;
	}
	return false;
}

void print() {
  cout << EL;
}
template <class Head, class... Tail>
void print(Head&& head, Tail&&... tail) {
  cout << head;
  if (sizeof...(tail) != 0) cout << " ";
  print(forward<Tail>(tail)...);
}
template <class T>
void print(vector<T> &vec) {
  for (auto& a : vec) {
	cout << a;
	if (&a != &vec.back()) cout << " ";
  }
  cout << EL;
}
template <class T>
void print(vector<vector<T>> &df) {
  for (auto& vec : df) {
	print(vec);
  }
}

struct ProconInit {
	static constexpr int IOS_PREC = 15;
	static constexpr bool AUTOFLUSH = false;

	ProconInit() {
		cin.tie(nullptr);
		ios::sync_with_stdio(false);
		cout << fixed << setprecision(IOS_PREC);
		if (AUTOFLUSH)
			cout << unitbuf;
	}
} PROCON_INIT;
#pragma endregion

signed solve()
{
	char x, y;
	cin >> x >> y;
	print(x < y ? '<' : x > y ? '>' : '=');
	return 0;
}

#ifndef LOCALCODE
signed main()
{
	return solve();
}
#endif


Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
#include<cstring>
#include<cstdlib>
#include<iomanip>
#include<utility>
#include<vector>
#include<queue>
#include<algorithm>
#include<set>
#include<map>
#include<string>
#include<cctype>
#include<cmath>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<ll> vl;
typedef queue<int> qi;
typedef queue<ll> ql;
typedef pair<ll,ll> pll;
typedef pair<int,ll> pil;
typedef pair<ll,int> pli;
#define pq priority_queue
#define rep(i,n) for (int i=0;i<n;i++)
#define mp make_pair
#define pb push_back
#define pf push_front
#define F first
#define S second
#define INF 2000000000009
#define init(x) memset(x,0,sizeof(x))
int n,m;
ll a[1005][3],s[1005],cur,ans=-1;
int main()
{
	ios::sync_with_stdio(false);
	cin>>n>>m;
	for (int i=0;i<n;++i) cin>>a[i][0]>>a[i][1]>>a[i][2];//  1 1 1
	for (int i=0;i<n;++i) s[i]=a[i][0]+a[i][1]+a[i][2];
	sort(s,s+n);reverse(s,s+n);
	cur=0;
	for (int i=0;i<m;++i) cur+=s[i];
	ans=max(ans,cur);
	
	for (int i=0;i<n;++i){a[i][0]=-a[i][0];}//  -1 1 1
	for (int i=0;i<n;++i) s[i]=a[i][0]+a[i][1]+a[i][2];
	sort(s,s+n);reverse(s,s+n);
	cur=0;
	for (int i=0;i<m;++i) cur+=s[i];
	ans=max(ans,cur);
	for (int i=0;i<n;++i){a[i][0]=-a[i][0];a[i][1]=-a[i][1];}//  1 -1 1
	for (int i=0;i<n;++i) s[i]=a[i][0]+a[i][1]+a[i][2];
	sort(s,s+n);reverse(s,s+n);
	cur=0;
	for (int i=0;i<m;++i) cur+=s[i];
	ans=max(ans,cur);
	for (int i=0;i<n;++i){a[i][1]=-a[i][1];a[i][2]=-a[i][2];}//  1 1 -1
	for (int i=0;i<n;++i) s[i]=a[i][0]+a[i][1]+a[i][2];
	sort(s,s+n);reverse(s,s+n);
	cur=0;
	for (int i=0;i<m;++i) cur+=s[i];
	ans=max(ans,cur);
	for (int i=0;i<n;++i){a[i][0]=-a[i][0];}//  -1 1 -1
	for (int i=0;i<n;++i) s[i]=a[i][0]+a[i][1]+a[i][2];
	sort(s,s+n);reverse(s,s+n);
	cur=0;
	for (int i=0;i<m;++i) cur+=s[i];
	ans=max(ans,cur);
	for (int i=0;i<n;++i){a[i][1]=-a[i][1];}//  -1 -1 -1
	for (int i=0;i<n;++i) s[i]=a[i][0]+a[i][1]+a[i][2];
	sort(s,s+n);reverse(s,s+n);
	cur=0;
	for (int i=0;i<m;++i) cur+=s[i];
	ans=max(ans,cur);
	for (int i=0;i<n;++i){a[i][0]=-a[i][0];}//  1 -1 -1
	for (int i=0;i<n;++i) s[i]=a[i][0]+a[i][1]+a[i][2];
	sort(s,s+n);reverse(s,s+n);
	cur=0;
	for (int i=0;i<m;++i) cur+=s[i];
	ans=max(ans,cur);
	for (int i=0;i<n;++i){a[i][1]=-a[i][1];a[i][2]=-a[i][2];}//  -1 -1 1
	for (int i=0;i<n;++i) s[i]=a[i][0]+a[i][1]+a[i][2];
	sort(s,s+n);reverse(s,s+n);
	cur=0;
	for (int i=0;i<m;++i) cur+=s[i];
	ans=max(ans,cur);
	
	cout<<ans;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define WHOLE(v) (v).begin(), (v).end()
#define REV_WHOLE(v) (v).rbegin(), (v).rend()
using i64 = int64_t;
using namespace std;
template <size_t I, class H, class... T> struct TupleReaderWriter{static tuple<H,T...> r(istream&i){H v;i>>v;return tuple_cat(tuple<H>(v),TupleReaderWriter<sizeof...(T)-1,T...>::r(i));}static void w(ostream&o,tuple<H,T...>&t,string d){TupleReaderWriter<I-1,H,T...>::w(o,t,d);o<<d<<get<I>(t);}};
template <class H, class... T> struct TupleReaderWriter<0,H,T...>{static tuple<H,T...> r(istream&i){H v;i>>v;return tuple<H>(v);}static void w(ostream&o,tuple<H,T...>&t,string d){o<<get<0>(t);}};
template <class... T> istream& operator>>(istream&i,tuple<T...>& t) { t = TupleReaderWriter<sizeof...(T), T...>::r(i); return i; }
template <class... T> ostream& operator<<(ostream& o, tuple<T...>& t) { string delim = " "; TupleReaderWriter<sizeof...(T) - 1, T...>::w(o, t, delim); return o; }
template<typename T> using rev_priority_queue = priority_queue<T, vector<T>, greater<T>>;
template<typename T> using vector2d = vector<vector<T>>;
void R_YESNO(bool p) { cout << (p ? "YES" : "NO") << endl; }
void R_YesNo(bool p) { cout << (p ? "Yes" : "No") << endl; }
int main() {
    int a, b;
    cin >> a >> b;
    if(a < 10 && b < 10) {
        cout << a * b << endl;
    } else {
        cout << -1 << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
using namespace std;
const ll mod = 998244353;
ll dp[3010] = {0};
int main(){
	int n, m;
	scanf("%d%d", &n, &m);
	dp[0] = 1;
	for (int i = 1; i <= n; i++) {
		int x;
		scanf("%d", &x);
		for (int j = m; j >= 0; j--){
			dp[j] = dp[j]*2%mod;
			if (j-x >= 0) dp[j] = (dp[j]+dp[j-x])%mod;
		}
		
	}
	printf("%lld\n", dp[m]);
	return 0;
}

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

using namespace std;
long long mod=1e9+7;
vector<long long>tree[100005];
long long dp[100005][2];
long long ways(long long src,long long par,long long constraint){
	
    long long  ans=0;
    long long w1=1;
    if(dp[src][constraint]!=-1)
    return dp[src][constraint];
	 for(auto j:tree[src])
	 {
	 	 if(j!=par)
	 	 {
	 	   w1=(w1*ways(j,src,0))%mod;
	 	 }
	 }
	  ans=(ans+w1)%mod;
	 if(constraint==0)
	 {
	 	int w2=1;
	 	for(auto j:tree[src])
	 	{
	 		if(j!=par)
	 		{
	 			w2=(w2*ways(j,src,1))%mod;
	 		}
	 	}
	 	ans=(ans+w2)%mod;
	 }
	return dp[src][constraint]=ans;
}
int main()
{
	 ios_base::sync_with_stdio(false);
	 cin.tie(NULL);
	 memset(dp,-1,sizeof(dp));
	 long long n;
	 cin>>n;
	 for(int i=1;i<=n-1;i++)
	 {
	 	long long x,y;
	 	cin>>x>>y;
	 	tree[x].push_back(y);
	 	tree[y].push_back(x);
	 }
	 cout<<ways(1,-1,0)<<endl;
	 
	 return 0;
}

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

int main(){

  int N,K,Q;
  cin >> N >> K >> Q;
  vector<int> points(N,K-Q);
  for(int i=0;i<Q;++i){
    int seikai;
    cin >> seikai;
    points[seikai-1]++;
  }
  for(int i=0;i<N;++i){
    if(points[i]>0) cout << "Yes" << endl;
    else cout << "No" << endl;
  }

  return 0;
}


Measured memory_bytes: 1024
#include "bits/stdc++.h"

#define REP(i,num) for(ll i=0;i<(num);++i)
#define FOR(i,c,num) for(ll (i)=(c);(i)<(num);++(i))
#define LOOP(i) while(i--)
#define ALL(c) c.begin(),c.end()
#define PRINTALL(c) for(auto pitr=c.begin();pitr!=c.end();++pitr){cout<<*pitr;if(next(pitr,1)!=c.end())cout<<' ';}cout<<endl;
#define PAIRCOMP(c,comp) [](const pair<ll,ll>& lhs,const pair<ll,ll>& rhs){return lhs.c comp rhs.c;}

using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;

constexpr ll atcoder_mod = 1e9+7;

template<typename T=ll>
T in(){T x; cin >> x; return (x);}
template<typename T=ll,typename C=vector<T>>
C vecin(int N){C x(N);REP(i,N){x[i]=in<T>();}return move(x);}

void vout(){cout << endl;}
template<typename Head,typename... Tail>
void vout(Head&& h,Tail&&... t){cout << ' ' << h;vout(forward<Tail>(t)...);}
void out(){cout << endl;}
template<typename Head,typename... Tail>
void out(Head&& h,Tail&&... t){cout << h;vout(forward<Tail>(t)...);}

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

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout<<fixed<<setprecision(10);

	auto N=in(),M=in();
	string S=in<string>();
	reverse(ALL(S));

	int P=0;
	vll C;
	while(P<N){
		bool exist = false;
		REP(i,M){
			if(P+M-i<=N && S[P+M-i]=='0'){
				P+=M-i;
				C.push_back(M-i);
				exist = true;
				break;
			}
		}
		if(!exist){
			out(-1);
			return 0;
		}
	}
	reverse(ALL(C));

	PRINTALL(C);
	return 0;
}


Measured memory_bytes: 1480
#pragma region RegionDefs
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#include "boost/multi_array.hpp"
#define rep(i,n) for(int i=0,i##_len=(n);i<i##_len;++i)
#define reps(i,j,n) for(int i=(j),i##_len=(n);i<i##_len;++i)
#define repr(i,n) for(int i=(n);i>=0;--i)
#define all(x) begin(x),end(x)
using namespace std;
template<class T=int> using P  = pair<T, T>;
template<class T=int> using V  = vector<T>;
template<class T=int> using PQ = priority_queue<T>;
template<class T=int> using PQG = priority_queue<T, V<T>, greater<T>>;
typedef long long ll;
const int INF = 1e9;
const ll MOD = 1000000007LL;
void in() {}
template<class Head, class... Tail>
void in(Head&& head, Tail&&... tail)
{
    cin >> head;
    in(move(tail)...);
}
#define IN(...) int __VA_ARGS__; in(__VA_ARGS__)
//オーバーフロー対策
#define INL(...) ll __VA_ARGS__; in(__VA_ARGS__)
#define INS(T, ...) T __VA_ARGS__; in(__VA_ARGS__)
#define VIN(T, v, n) V<T> v(n); for(auto& _elem:v)cin>>_elem
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 (a>b) {a=b; return 1;} return 0;}
#define y0 y__0
#define y1 y__1
#define j0 j__0
#define j1 j__1
#pragma endregion RegionDefs

#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>
using Bint = boost::multiprecision::checked_cpp_int;
Bint modpow(Bint a, Bint n, Bint mod)
{
    Bint res = 1;
    while (n > 0)
    {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

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

int main()
{
    cin.tie(0); cout.tie(0);
    ios::sync_with_stdio(false);
    cout << setprecision(numeric_limits<double>::max_digits10);

    solve();

    return 0;
}

Measured memory_bytes: 256
package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)

	scanner.Scan()
	n, _ := strconv.Atoi(scanner.Text())

	repdigitCount := 0

	for i := 0; i < n; i++ {
		scanner.Scan()
		dices := strings.Split(scanner.Text(), " ")

		dice1 := dices[0]
		dice2 := dices[1]

		if dice1 == dice2 {
			repdigitCount++
		} else if dice1 != dice2 {
			repdigitCount = 0
		}

		if repdigitCount == 3 {
			break
		}
	}

	if repdigitCount == 3 {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}


Measured memory_bytes: 1776
#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    int n,ans=0;
    cin>>n;
    int d[n];
    for(int i=0; i<n; i++){
        cin>>d[i];
    }
    for(int i=0; i<n-1; i++){
        for(int j=i+1; j<n; j++){
            ans+=d[i]*d[j];
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
    using namespace std;
    
    int main(){
        long a , b , c;
        cin >> a >> b >> c;
        if( a <= c && b >= c){
            cout << "Yes" << endl;
        }else{
            cout << "No" << endl;
        }
        
        return 0;
    }

Measured memory_bytes: 256
#include<stdio.h>


int main(void)
{
  int n,k;
  scanf("%d %d",&n,&k);
  int d[20];
  int count=0;


  for(int i=0;i<k;i++){
    scanf("%d",&d[i]);
  }

  int len=0;
  int another_n=n;
  while(another_n>0){
    another_n/=10;
    len++;
  }



  for(int i=n;i<100000;i++){
    int tmp=i;
    count=0;
    while(tmp!=0){
      for(int j=0;j<k;j++){
        //printf("%d\n",i%10);
        if(tmp%10==d[j]){
          count++;
        }
      }
      tmp/=10;
    }
    if(count==0){
      printf("%d\n",i);
      return 0;
    }
  }



  return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
#define ft first
#define sc second
#define pt(sth) cout << sth << "\n"
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;
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;}
static const ll INF=1e18;
static const ll MAX=101010;
//static const ll MOD=1e9+7;
static const ll MOD=998244353;
//for(i=0; i<N; i++) cin >> a[i];

struct mll {
  ll val;
  mll(ll val=0):val((val%MOD+MOD)%MOD){}
  
  mll pow(ll t) const {
    if (!t) return 1;
    mll a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }
  mll inv() const { return pow(MOD-2); }
  
  mll operator-() const { return mll(-val);}
  mll& operator+=(const mll a) {
    if ((val += a.val) >= MOD) val -= MOD;
    return *this;
  }
  mll& operator-=(const mll a) {
    if ((val += MOD-a.val) >= MOD) val -= MOD;
    return *this;
  }
  mll& operator*=(const mll a) {
    (val *= a.val%MOD) %= MOD;
    return *this;
  }
  mll& operator/=(const mll a) {
    return (*this) *= a.inv();
  }
  
  mll operator+(const mll a) const {
    mll res(*this);
    return res+=a;
  }
  mll operator-(const mll a) const {
    mll res(*this);
    return res-=a;
  }
  mll operator*(const mll a) const {
    mll res(*this);
    return res*=a;
  }
  mll operator/(const mll a) const {
    mll res(*this);
    return res/=a;
  }
  
  mll& operator++(   ) { val++; return *this; }
  mll  operator++(int) { mll res(*this); val++; return res; }
  mll& operator--(   ) { val--; return *this; }
  mll  operator--(int) { mll res(*this); val--; return res; }
  
  bool operator< (const mll a) const { return val< a.val; }
  bool operator<=(const mll a) const { return val<=a.val; }
  bool operator> (const mll a) const { return val> a.val; }
  bool operator>=(const mll a) const { return val>=a.val; }
  bool operator==(const mll a) const { return val==a.val; }
  
  friend istream& operator>>(istream &input, mll &a) {
    input >> a.val;
    return input;
  }
  
  friend ostream& operator<<(ostream &output, mll &a) {
    output << a.val;
    return output;;
  }
  
};

mll fa[MAX*2], rf[MAX*2];

mll C(ll n, ll k) {
  if(n<k||n<0||k<0) return 0;
  if(k==0) return 1;
  if(n==k) return 1;
  return fa[n]*rf[k]*rf[n-k];
}

int main(void) {
  ll i, j, k;
  
  ll N, M, K;
  cin >> N >> M >> K;
  
  fa[0]=rf[0]=1;
  for(i=1; i<MAX*2; i++) {
    fa[i]=fa[i-1]*i;
    rf[i]=fa[i].inv();
  }
  
  mll ans=0;
  for(k=0; k<=K; k++) {
    ans+=C(N-1, k)*M*mll(M-1).pow(N-1-k);
    
  }
  pt(ans);
  
}




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

void main() {
    auto s = readln.split.map!(to!int);
    auto H = s[0];
    auto W = s[1];
    auto N = s[2];
    auto P = new int[][](W);
    foreach (_; 0..N) {
        s = readln.split.map!(to!int);
        P[s[1]-1] ~= s[0]-1;
    }
    foreach (j; 0..W) {
        P[j] ~= H;
        P[j].sort();
    }

    int r = 0;
    int c = 0;
    int t = 0;
    int ans = 1 << 29;

    while (c < W) {
        auto rr = P[c].assumeSorted.upperBound(r).front;
        ans = min(ans, t + rr - r);
        if (rr == r + 1) {
            break;
        }
        r += 1;
        t += 1;
        if (c + 1 < W && P[c+1].assumeSorted.upperBound(r-1).front != r) {
            c += 1;
        }
    }

    ans.writeln;
}


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

namespace AtCoder
{
    class Program
    {
        static List<List<int>> tree = new List<List<int>>();

        static void Main(string[] args)
        {
            MainStream();
        }
        static void MainStream()
        {
            Scan sc = new Scan();
            write wr = new write();

            int n = sc.intarr[0];
            int[] a = sc.intarr;
            int[] b = sc.intarr;
            int[] c = sc.intarr;

            int sum = 0;

            for(int i=1; i<=n; i++)
            {
                for(int j=0; j<n; j++)
                {
                    if(i==a[j])
                    {
                        sum += b[j];
                        if(j!=0 && a[j] - a[j-1] == 1)
                        {
                            sum += c[a[j-1]-1];
                        }
                        break;
                    }
                    
                }
            }

            wr.wri(sum);
   
        }

        static void judge(int now, int point)
        {
            for (int i=0; i<tree.Count; i++)
            {
                if(tree[i][1] == now)
                {
                    tree[i][2] += point;
                    judge(tree[i][1], point);
                }
            }
            return;
        }


    }

    class Scan
    {
        public string str => Console.ReadLine();

        public string[] strarr => str.Split(' ');

        public long[] longarr => strarr.Select(long.Parse).ToArray();
        public int[] intarr => strarr.Select(int.Parse).ToArray();
        public char[] chararr => str.ToArray();


    }



    class write
    {
        public void wri<Type>(Type x)
        {
            Console.WriteLine(x);
        }
    }

    class Method
    {
        static public int max(params int[] nums)
        {

            int maxx = nums[0];
            for (int i = 1; i < nums.Length; i++)
            {
                maxx = Math.Max(maxx, nums[i]);
            }
            return maxx;
        }
    }
}


Measured memory_bytes: 13268
cntlist = [0] * 102

while 1:
    try:
        a, b = map(int, input().split())
    except:
        break

    cntlist[a] += 1
    cntlist[b] += 1
    if a == 0 and b == 0:
        for cnt in cntlist[3:]:
            if cnt % 2 == 1:
                print("NG")
                break
        else:
            print("OK" if cntlist[1] & 1 and cntlist[2] & 1 else "NG")
        cntlist = [0] * 102


Measured memory_bytes: 5608
#include <iostream>
#include <stdio.h>
#include <string>
#include <vector>
#include <algorithm>
#include <limits.h>
using namespace std; 
int main(int argc,char const* argv[])
{
  int n,oddtimes=0,eventimes=0;
  cin >> n;
  long long a;
  for(int i=0;i<n;i++)
    {
      cin >> a;
      if(a % 2 == 0) eventimes++;
      else oddtimes++;
    }
  if(oddtimes % 2 !=0)
    {
      cout << "NO" << endl;
      return 0;
    }
  else if(oddtimes % 2 ==0)
    {
      cout << "YES" << endl;
      return 0;
    }
}


Measured memory_bytes: 256
#include <cstdio>
const int mo=1000000007;
int x[100005];
struct Matrix{
	long long a[3][3];
}I=(Matrix){1,0,0,0,1,0,0,0,1};
Matrix operator *(Matrix A,Matrix B){
	Matrix C;
	for (int i=0;i<3;i++)
		for (int j=0;j<3;j++){
			C.a[i][j]=0;
			for (int k=0;k<3;k++)
				C.a[i][j]+=A.a[i][k]*B.a[k][j];
			C.a[i][j]%=mo;
		}
	return C;
}
Matrix operator ^(Matrix A,int B){
	Matrix C=I;
	for (;B;B>>=1,A=A*A)
		if (B&1) C=C*A;
	return C;
}
int main(){
	Matrix P=(Matrix){1,2,1,0,1,1,1,2,2},Q={1,2,1,0,1,1,0,0,1};
	Matrix ans=(Matrix){1,0,0,0,0,0,0,0,0};
	int n,m;
	scanf("%d%d",&n,&m);x[0]=-1;
	for (int i=1;i<=m;i++){
		scanf("%d",&x[i]);
		ans=ans*(P^(x[i]-x[i-1]-1))*Q;
	}
	ans=ans*(P^(n-x[m]-1));
	printf("%lld\n",ans.a[0][2]);
}

Measured memory_bytes: 512
#include <iostream>
#include <stdio.h>
using namespace std;

int main()
{
  double n;

  while( scanf("%lf",&n) != EOF ){


  if(n<=48){
    printf("light fly");
  }else if(n<=51){
    printf("fly");
  }else if(n<=54){
    printf("bantam");
  }else if(n<=57){
    printf("feather");
  }else if(n<=60){
    printf("light");
  }else if(n<=64){
    printf("light welter");
  }else if(n<=69){
    printf("welter");
  }else if(n<=75){
    printf("light middle");
  }else if(n<=81){
    printf("middle");
  }else if(n<=91){
    printf("light heavy");
  }else{
    printf("heavy");
  }
  printf("\n");
  }

}

Measured memory_bytes: 1200
package main

import "fmt"

func main() {
	var n int
	fmt.Scan(&n)

	a := make([]int, n+1)
	a[1]++
	for i := range a[2:] {
		a[i+2] = 2
	}

	for i := 2; i <= n/2; i++ {
		for j := i * 2; j <= n; j += i {
			a[j]++
		}
	}

	var sum int
	for i, v := range a {
		sum += i * v
	}

	fmt.Println(sum)
}


Measured memory_bytes: 82556
#include <iostream>
#include <algorithm>
#include <functional>
#include <vector>
#include <string>
#include <array>
#include <cmath>
#include <queue>
#include <stack>
#include <numeric>

using namespace std;


int main() {
	int n;

	cin >> n ;
	if (n % 1000 == 0)cout << 0;
	else cout << 1000 - (n % 1000);

	 
}

Measured memory_bytes: 3628
using System;

namespace AtCoder.Problems
{
    public class ProblemC
    {
        public static void Main(string[] args)
        {
            var s = new SolveC();
            s.Solve();
        }

        public class Scanner
        {
            private string[] _s;
            private int _i;
            private readonly char[] _separators = new char[] { ' ' };

            public Scanner()
            {
                _s = new string[0];
                _i = 0;
            }

            public string Next()
            {
                if (_i < _s.Length) return _s[_i++];
                string st = Console.ReadLine();
                while (st == "") st = Console.ReadLine();
                _s = st.Split(_separators, StringSplitOptions.RemoveEmptyEntries);
                if (_s.Length == 0) return Next();
                _i = 0;
                return _s[_i++];
            }

            public int NextInt() => int.Parse(Next());
            public long NextLong() => long.Parse(Next());
            public ulong NextULong() => ulong.Parse(Next());
            public double NextDouble() => double.Parse(Next());

            public int[] GetIntArray(int n, int add = 0)
            {
                int[] array = new int[n];
                for (int i = 0; i < n; i++)
                {
                    array[i] = NextInt() + add;
                }
                return array;
            }

            public long[] GetLongArray(int n, long add = 0)
            {
                long[] array = new long[n];
                for (int i = 0; i < n; i++)
                {
                    array[i] = NextLong() + add;
                }
                return array;
            }

            public double[] GetDoubleArray(int n, double add = 0)
            {
                double[] array = new double[n];
                for (int i = 0; i < n; i++)
                {
                    array[i] = NextDouble() + add;
                }
                return array;
            }
        }
    }

    public class SolveC
    {
        public void Solve()
        {
            var cin = new ProblemC.Scanner();
            var n = cin.NextInt();
            var a = cin.GetIntArray(n - 1);

            var result = GetAnswer(n, a);
            for (int i = 0; i < result.Length; i++)
            {
                Console.WriteLine(result[i]);
            }
        }

        public long[] GetAnswer(int n, int[] a)
        {
            var answer = new long[n];
            for (int i = 0; i < a.Length; i++)
            {
                var ai = a[i];
                answer[ai - 1]++;
            }
            return answer;
        }
    }
}


Measured memory_bytes: 43596
class Team():

    def __init__(self, a, b):
        self.name = a
        self.score = b

flag = False
while True:
    N = int(input())
    if N == 0:
        break

    if flag:
        print("")
    else:
        flag = True

    teams = []
    for l in range(N):
        a,b,c,d = input().split()
        team = Team(a, int(b)*3 + int(d))
        teams.append(team)

    teams = sorted(teams, key=lambda u: u.score, reverse = True)
    for l in range(len(teams)):
        print(teams[l].name,end="")
        print(",",end="")
        print(teams[l].score)




Measured memory_bytes: 5596
import java.util.Scanner;

/**
 * Created by oka on 2018/06/23.
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String str = String.valueOf(n);
        int s_n = 0;
        for (char c: str.toCharArray()) {
            s_n += Character.getNumericValue(c);
        }

        if (n % s_n == 0) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
}


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

#define DEBUG 0

#if DEBUG
  #define DLOG(...) fprintf(stderr, __VA_ARGS__)
  #define DFUNC(fname, ...) fname(__VA_ARGS__)
#else
  #define DLOG(...)
  #define DFUNC(fname, ...)
#endif

// sieve(upto) returns the list of prime numbers up to upto.
vector<ll> sieve(ll upto) {
  vector<ll> res;
  vector<bool> tbl(upto+1);
  ll lim = (ll)(sqrt((double)upto)) + 1;
  for (ll x = 2; x <= upto; x++) {
    if (tbl.at(x))  continue;
    res.push_back(x);
    if (x > lim)  continue;
    for (ll y = x * 2; y <= upto; y += x) tbl.at(y) = true;
  }
  return res;
}


// prime factorization
//      primes should contain prime numbers at least up to sqrt(n)
vector<pair<ll, ll>> prfac(ll n, const vector<ll>& primes) {
  vector<pair<ll, ll>> res;
  ll x = n;
  for (ll p : primes) {
    if (x == 1)  break;
    if (p * p > x)  break;
    if (x % p != 0)  continue;
    ll c = 1;
    x /= p;
    while (x % p == 0) {
      c += 1;
      x /= p;
    }
    res.push_back(make_pair(p, c));
  }
  if (x != 1)  res.push_back(make_pair(x, 1));
  return res;
}

ll N;

ll sum = 0;

void calc(auto prf, ll idx, ll acc) {
  if (idx == (ll) prf.size()) {
    ll opp = N / acc;
    if (opp >= acc + 2)  sum += (opp-1);
    return;
  }
  if (acc * acc > N)  return;
  ll p = prf.at(idx).first;
  ll r = prf.at(idx).second;
  ll pr = 1;
  for (ll x = 0; x <= r; x++) {
    calc(prf, idx+1, acc*pr);
    pr *= p;
  }
}

int main() {
#if !DEBUG
  ios_base::sync_with_stdio(false);
#endif

  cin >> N;
  ll lim = (ll)(sqrt(N)) + 2;
  auto primes = sieve(lim);
  auto prf = prfac(N, primes);
  
  sum = 0;
  calc(prf, 0, 1);
  cout << sum << endl;

  return 0;
}



Measured memory_bytes: 1528
#include <iostream>
#include <cmath>
#include <vector>
#include <set>
#include <algorithm>
using namespace std;


int main() {
  //配列がn=2で7, 21だとするとsumは28
  //何回操作をしても和が28であることは不変
  //a, bのgcdは(a+b)%gdd==0となる
  int n, k, b;
  cin >> n >> k;
  vector<int> a;
  long long sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> b;
    a.push_back(b);
    sum += b;
  }
  sort(a.begin(), a.end());
  set<long long> candidates;

  for (int i = 1; i*i <= sum; i++) {
    if (sum%i == 0) {
      candidates.insert(i);
      candidates.insert(sum/i);
    }
  }
  long long ans = 1;
  for (long long x : candidates) {
    //cout << x << " "  << endl;
    long long need;
    {//calc need
      vector<long long > remainder(n);
      for (int i = 0; i < n; i++) {
        remainder[i] = a[i]%x;
      }
      sort(remainder.begin(), remainder.end());
      long long right_sum = 0;
      long long left_sum = 0;

      for (int i = 0; i < n; i++) {
        left_sum += x - remainder[i];      }

      need = 1e18;
      for (int i = 0; i < n; i++) {
        left_sum -= x - remainder[i];
        right_sum += remainder[i];
        need = min(need, max(left_sum, right_sum));
      }
    }
    if (need <= k) {
      ans = max(ans, x);
    }
  }
  cout  << ans << endl;
  return 0;
}


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

int main() {
  std::string s, t;
  std::cin >> s;
  std::cin >> t;

  for (int i = 0; i < s.size(); i++) {
    if (s == t) {
      std::cout << "Yes" << std::endl;
      return 0;
    }
    const auto p = t.back();
    t.pop_back();
    t = p + t;
  }

  std::cout << "No" << std::endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <utility>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <cmath>
#include <queue>
#include <map>
using namespace std;
typedef long long ll;
const int INF = 1<<30; 
const int MOD = 1e9 + 7;
const int dy[] = {1, 0, -1, 0};
const int dx[] = {0, 1, 0, -1};
int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    int num[100] = {};
    num[a]++;
    num[b]++;
    num[c]++;
    num[d]++;
    if(num[1] == 1 && num[7] == 1 && num[9] == 1 && num[4] == 1) cout << "YES" << endl;
    else cout << "NO" << endl; 
	return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <cstring>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <string>
#include <map>
#include <stack>
#include <queue>
#include <vector>
#define inf 0x3f3f3f3f
#define met(a,b) memset(a,b,sizeof a)
#define pb push_back
#define mp make_pair
typedef long long ll;
using namespace std;
const int N = 3e5+10;
const int M = 1e6+10;
int n,m,k,tot=0;
ll ans=0;
int head[N],vis[15],l[N],r[N];
int a[N],b[N];
char str[N];
int main() {
    int T;
    scanf("%d",&n);
    for(int i=0;i<3*n;i++){
        scanf("%d",&a[i]);
    }
    sort(a,a+3*n);
    for(int i=3*n-2;i>=0;i-=2){
        tot++;
        ans+=a[i];
        if(tot==n)break;
    }
    printf("%lld\n",ans);
    return 0;
}


Measured memory_bytes: 2816
#include <stdio.h>

int main(){
	int a, b, c, t;
	
	scanf("%d %d %d", &a, &b, &c);
	
	if(b < a){
		t = b;
		b = a;
		a = t;
		}
	if(c < b){
		t = c;
		c = b;
		b = t;
	}
	if(b < a){
		t = b;
		b = a;
		a = t;
	}
	
	printf("%d %d %d\n", a, b, c);
	return 0;
}

Measured memory_bytes: 596
#pragma GCC optimize("O3")

#define _GLIBCXX_DEBUG
#include <iostream>
#include <vector>
#include <string>
#include <string_view>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <cassert>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
using namespace std;

/*----------macros----------*/

//output================
#define endl '\n'
#define fcout(a) cout << fixed << setprecision((int)(a))

//typedef===============
typedef long long       ll;
typedef long double     ld;
typedef vector<int>     Vi;
typedef vector<ll>      Vl;
typedef pair<int, int>  Pii;
typedef pair<ll, ll>    Pll;

//const number==========
constexpr ll INF9   = (ll)1e9 + 1;
constexpr ll INF18  = (ll)1e18 + 1;
constexpr ll MOD1    = 1000000007;
constexpr ll MOD2   = 998244353;
constexpr ld PI     = 3.141592653589793L;

//member================
#define psb push_back
#define epb emplace_back
#define psf push_front
#define mkp make_pair
#define fst first
#define scd second

//others================
#define all(x)          (x).begin(), (x).end()
#define rall(x)         (x).rbegin(), (x).rend()
#define rep(i, n)       for(int i = 0; (i) < (n); ++(i))
#define reps(i, n)      for(int i = 1; (i) <= (n); ++(i))
#define rrep(i, n)      for(int i = n - 1; (i) >= 0 ; --(i))
#define repbit(bit, n)  for(int bit = 0; (bit) < (1 << (n)); ++(bit))
#define ifbit(bit, i)   if((bit) & (1 << (i)))
#define CtoI(c)         int((c)) - int('0')
#define ItoC(c)         char((c) + '0')

//functions=============
template<typename T1, typename T2>
inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }

template<typename T1, typename T2>
inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }

//vector<int> dx = {1, 0, -1, 0}, dy = {0, 1, 0, -1};
//vector<int> dx2 = { 1,1,0,-1,-1,-1,0,1 }, dy2 = { 0,1,1,1,0,-1,-1,-1 };

/*--------additional--------*/



/*----------main------------*/

int main() {
/*----------fastio----------*/
    std::cin.tie(nullptr);
    std::cout.tie(nullptr);
    std::ios::sync_with_stdio(false);
/*----------solve-----------*/

    int n; cin >> n;
    int max_a = 0;
    Vi a(n), d(n);
    rep(i, n){
        cin >> a[i];
        d[i] = a[i];
    }

    sort(rall(d));
        rep(i, n){
            if(a[i] == d[0])
                cout << d[1] << endl;
            else cout << d[0] << endl;
        }

return 0;
}

Measured memory_bytes: 4824
#include<iostream>
using namespace std;
int main(){
    int a, b, c, k;
    cin >> a >> b >> c >> k;
    int sum = 0;
    int an = 1;
    int bn = 0;
    int cn = -1;
    int after_a = k - a;
    int after_b = after_a - b;
    if(a > k){
        sum += k * an;
    }
    if(a <= k){
        sum += a * an;
    }
    if(after_a > 0){
        sum += after_a * bn;
    }
    if(after_b > 0){
        sum += after_b * cn;
    }
    cout << sum << endl;
    return 0;
}

Measured memory_bytes: 3624
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define fi first
#define se second
#define pb push_back
#define pr pair<int,int>
#define mod 1000000007
#define endl "\n"
int X = 1e12;

int power(int a,int b,int m=mod)
{
	if(b==0)	return 1;
	if(b==1)	return a;
	int res=power(a,b/2,m);
	res=(res*res)%m;
	if(b&1)	res=(res*a)%m;
	return res;
}
int modinv(int a,int m=mod){ return power(a,m-2,m);}
int add(int a,int b,int m=mod){	return (a+b)%m;}
int sub(int a,int b,int m=mod){	return (a-b+m)%m;}
int mul(int a,int b,int m=mod){	return (a*b)%m;}



void solve()
{
	int a,b,n,ans=0;
	cin>>a>>b>>n;
	int x=min(n,b-1);
	cout<<((a*x)/b-a*(x/b))<<endl;
}

int32_t main()
{
	ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
	int t=1;//cin>>t;
	while(t--)	solve();
	return 0;
}

Measured memory_bytes: 3660
#include <bits/stdc++.h>
using namespace std;
#define pie 3.141592653589793238462643383279
#define int long long
#define mod 1000000007
#define INF LLONG_MAX/5
#define all(v) v.begin(),v.end()
#define P pair<int,int>
#define S second
#define F first
#define f(i,n) for(int i=0;i<n;i++)
int x[1010][1010],y[1010];
bool bo[1010];
signed main(){
	int n,cnt=0,ans=0;
	cin>>n;
	f(i,n){
		f(j,n-1)cin>>x[i][j];
	}
	while(cnt<n){
		ans++;
		bool boo=false;
		f(i,n)bo[i]=false;
		f(i,n){
			if(y[i]==n-1)continue;
			int z=x[i][y[i]]-1;
			if(y[z]!=n-1&&x[z][y[z]]==i+1&&!bo[i]&&!bo[z]){
				y[i]++;
				y[z]++;
				bo[i]=true;
				bo[z]=true;
				if(y[i]==n-1)cnt++;
				if(y[z]==n-1)cnt++;
				boo=true;
			}
		}
		if(!boo){
			puts("-1");
			return 0;
		}
	}
	cout<<ans<<endl;
}


Measured memory_bytes: 8192
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define lvector vector<ll> 
#define lque queue<ll>
#define lpque priority_queue<ll>
#define dlpque priority_queue<ll,lvector,greater<ll>>
#define P pair<ll,ll>
#define ALL(a) (a).begin(),(a).end()
#define rep(i,n) for(ll (i)=0; (i)<(n); ++(i))
#define print(a) cout << (a) << endl

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  string s;cin>>s;
  ll n=s.length(),ans=0,mod=2019,digit=1,val=0;
  lvector mods(2019,0);
  for(ll pos=n-1;pos>-1;pos--) {
    val=(val+(s[pos]-'0')*digit)%mod;
    digit=(digit*10)%mod;
    mods[val]++;
  }
  ans+=mods[0];
  for(ll i:mods) ans+=i*(i-1)/2;
  print(ans);
  return 0;
}

Measured memory_bytes: 3764
#include <iostream>
#include<string>
#include<cmath>
#include<algorithm>
#include<cctype>
#include<queue>
#include<stack>
#include<stdio.h>
#include<vector>
#include<set>
#include<map>
#include<iomanip>
#define rep(i,n) for(int long long i=0;i<n;i++)
typedef int long long ll;
using namespace std;
int main(){
    ll n;
    cin>>n;
    vector<ll> suu;
    rep(i,n){
        ll x;
        cin>>x;
        suu.push_back(x);
    }
    sort(suu.begin(),suu.end());
    ll ans=0;
    for(ll i=0;i<suu.size();){
        ll y=suu[i];
        i++;
        ll po=1;
        while(true){
            if(suu[i]==y&&i<suu.size()){
                po++;
                i++;
            }else if(suu[i]!=y||i==suu.size()){
                if(y>po){
                    ans+=po;
                }else if(y<po){
                    ans+=po-y;
                }
                break;
            }
            
        }
    }
    cout<<ans<<endl;
    
    
    
    return 0;
}


Measured memory_bytes: 1400
object Main {
  def main(args: Array[String]) {
    val sc = new java.util.Scanner(System.in)
    val w, h, x, y, r = sc.nextInt
    if (r <= x && r <= y  &&  (x <= ( w - r )) && ( y <= ( h - r ))) println("Yes")
      else println("No")

  }

}

Measured memory_bytes: 45076
#include <bits/stdc++.h>
using namespace std;
         
#define fast { ios :: sync_with_stdio(false); cin.tie(0); cout.tie(0); }
#define pb push_back
#define ll long long
#define ld long double
#define vll vector<ll>
#define infl LONG_LONG_MAX
#define infd LDBL_MAX
#define F first
#define S second
#define pll pair<ll,ll> 
#define G(a,b) get<a>(b)
#define ALL(v) v.begin(),v.end()
#define MP make_pair
#define MT make_tuple
#define f(i,a,b) for(ll i=a;i<b;i++)
#define fi(i,a,b) for(ll i=(b-1);i>=a;i--)    
#define endl "\n"
#define nl cout<<"\n";
#define pr(x) cout<<x;
#define pr1(x) cout<<x<<" ";
#define pr2(x,y) cout<<x<<" "<<y;
#define sz(x) (ll)x.size() 
#define ara cout<<"ara-ara\n"; 
const ld pi=3.141592653589793238;


void func()
{
  ll n,d;
  cin>>n>>d;
  ll cnt=0,x,y;
  f(i,1,n+1)
  {
    cin>>x>>y;
    if(x*x+y*y<=d*d) cnt++;
  }

  cout<<cnt<<"\n";
}   
     
     
     
int main() 
{
    fast
    //#ifndef ONLINE_JUDGE
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    //#endif // ONLINE_JUDGE
     
    ll ntc=1;
    //cin>>ntc;
     
    f(i,1,ntc+1)
    {
       //cout<<"Case #"<<i<<": ";
       //cout<<"\n";
       func();
    }
     
    return 0;
}


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

using ll = long long;
using vi = vector<ll>;
using vvi = vector<vi>;

ll INF = 1ll << 60;

void chmin(ll &a, ll b){
  if(a > b)
    a = b;
}
void chmax(ll &a, ll b){
  if(a < b)
    a = b;
}

int main(){
  int n;
  cin >> n;
  vvi happy(n, vi(3));
  for(int i = 0; i < n; i++){
    for(int j = 0; j < 3; j++)
      cin >> happy[i][j];
  }
  
  vvi sum(110000, vi(3, 0));
  
  for(int i = 0; i < 3; i++)
    sum[0][i] = happy[0][i];
  
  for(int i = 1; i < n; i++){
    for(int j = 0; j < 3; j++){
      for(int k = 0; k < 3; k++){
        if(j == k)
          continue;
        chmax(sum[i][k], (sum[i-1][j] + happy[i][k]));
      }
    }
  }
  
  ll ans = 0;
  
  for(int i = 0; i < 3; i++)
    chmax(ans, sum[n-1][i]);
  
  cout << ans << endl;
  
  return 0;
  
}

Measured memory_bytes: 18304
#include<stdio.h>
#include<math.h>
int main(void){
    int a,b,d,r;
    double f;
    scanf("%d %d",&a,&b);
    d=a/b;
    r=a%b;
    f=1.0*a/b;
    printf("%d %d %f",d,r,f);
}


Measured memory_bytes: 2760
#include<stdio.h>

void trace(int A[],int N){
	int i;
	for(i=0;i<N;i++){
		if(i>0)printf(" ");
		printf("%d",A[i]);
	}
	printf("\n");
}

void insertionSort(int A[],int N){
	int j,i,v;
	for(i=1;i<N;i++){
		v=A[i];
		j=i-1;
		while(j>=0&&A[j]>v){
			A[j+1]=A[j];
			j--;
		}
		A[j+1]=v;
		trace(A,N);
	}
}

int main(){
	int A[100],i,N,j;
	
	scanf("%d",&N);
	for(i=0;i<N;i++)scanf("%d",&A[i]);
	
	trace(A,N);
	insertionSort(A,N);
	
	return 0;
}

Measured memory_bytes: 604
#include<bits/stdc++.h>
#define s scanf("%d",
int n,r,i,j,a[100];
main(){
s&n);
for(;i<n;s&a[i++]));
for(i=0;i<n;i++){
for(j=0;j<i;){
if(a[i]<a[j++])r++;
}
}
std::sort(a,a+n);
for(i=0;i<n;printf("%d",a[i++]))if(i)printf(" ");
printf("\n%d\n",r);
}

Measured memory_bytes: 3260
#include<bits/stdc++.h>
using namespace std;
#define int long long int
#define until(x) while(!(x))
#define unless(x) if(!(x))
#define all(x) (x).begin(),(x).end()
#define F first
#define S second
#define pc __builtin_popcount

int ar[105];

int32_t main(){
	int n;
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>ar[i];
	}
	int mn = 1e15;
	for(int i=1;i<=100;i++){
		int cur = 0;
		for(int j=1;j<=n;j++){
			cur += (ar[j]-i)*(ar[j]-i);
		}
		mn = min(cur,mn);
	}
	cout<<mn;
}


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

int main() {
    int R,C,K; cin>>R>>C>>K;
    map<int,int> item;
    for (int i = 0; i < K; i++){
        int r,c,v; cin>>r>>c>>v;
        item[r*C+c]=v;
    }
    vector<vector<ll>> dp(R+1,vector<ll>(C+1,0));
    for (int i = 1; i <= R; i++){
        vector<ll> chosen(3,0);
        for (int j = 1; j <= C; j++){
            int pos=i*C+j;
            vector<ll> chosen_next(3,0);
            int val=0;
            if(item.count(pos))val=item.at(pos);
            chosen_next[0]=max(dp[i-1][j]+val,chosen[0]);
            chosen_next[1]=max(chosen[0]+val,chosen[1]);
            chosen_next[2]=max(chosen[1]+val,chosen[2]);
            chosen=chosen_next;
            dp[i][j]=max(max(chosen[0],chosen[1]),chosen[2]);
        }
    }
    cout<<dp[R][C]<<endl;
}

Measured memory_bytes: 83180