akhauriyash/Code-Regression huggingface dataset:
import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math, std.typecons, std.numeric, std.container;
 
void main()
{
    auto hwk = readln.split.to!(int[]);
    auto H = hwk[0];
    auto W = hwk[1];
    auto K = hwk[2];
    auto xy = readln.split.to!(int[]);
    auto sy = xy[0]-1;
    auto sx = xy[1]-1;
    auto gy = xy[2]-1;
    auto gx = xy[3]-1;
 
    auto MAP = new char[][H];
    foreach (i; 0..H) MAP[i] = readln.chomp.to!(char[]);
 
    auto DP = new int[][](H, W);
    foreach (ref dp; DP) dp[] = int.max;
 
    auto ss = [[sx, sy, 0]];
    while (!ss.empty) {
        auto h = ss[0];
        ss = ss[1..$];
        auto x = h[0];
        auto y = h[1];
        auto c = h[2];
 
        foreach (i, d; [[0, -1], [-1, 0], [0, 1], [1, 0]]) {
            foreach (n; 1..K+1) {
                auto dx = x + n * d[0];
                auto dy = y + n * d[1];
                if (dx < 0 || dx >= W || dy < 0 || dy >= H || MAP[dy][dx] == '@' || DP[dy][dx] < c) break;
                if (DP[dy][dx] == c) continue;
                DP[dy][dx] = c;
 
                if (dx == gx && dy == gy) {
                    writeln(c+1);
                    return;
                }
 
                ss ~= [dx, dy, c+1];
            }
        }
    }
    writeln(-1);
}

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

typedef long long ll;

int x, y, a, b, c;

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

    cin >> x >> y >> a >> b >> c;
    int p[a], q[b], r[c];

    ll sum = 0;
    for (int i = 0; i < a; ++i) {
        cin >> p[i];
    }
    for (int i = 0; i < b; ++i) {
        cin >> q[i];
    }
    for (int i = 0; i < c; ++i) {
        cin >> r[i];
    }
    nth_element(p, p + x - 1, p + a, greater<int>());
    nth_element(q, q + y - 1, q + b, greater<int>());
    vector<int> g(r, r + c);
    for (int i = 0; i < x; ++i) {
        g.push_back(p[i]);
    }
    for (int i = 0; i < y; ++i) {
        g.push_back(q[i]);
    }
    sort(g.begin(), g.end(), greater<int>());
    for (int i = 0; i < x + y; ++i) {
        sum += g[i];
    }

    cout << sum << endl;

    return 0;
}



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

#define pb push_back
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define ll long long
 
const int N=1e5+5,MAX=3e7,MOD=1e9+7;
 
using namespace std;

int p,q,r,n;
int main()
{	

 	
    	
    scanf("%d%d%d",&p,&q,&r);
    printf("%d\n",min(q+r,min(p+q,p+r)));
}

Measured memory_bytes: 256
N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
div = 1000000007
s = 0
ss = 0

for i, a in enumerate(A):
    for j in range(i+1, N):
        if a > A[j]:
            s += 1

for i in A:
    for j in A:
        if i > j:
            ss += 1

print(((s * K) + (ss * K * (K-1) // 2)) % div)


Measured memory_bytes: 3188
#include <iostream>
#include <cstring>
#include <queue>
using namespace std;

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

struct State { int tx, ty, kx, ky, cost; };
int X, Y;
int d[52][52];
bool used[52][52][52][52];

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	while (cin >> X >> Y, X) {
		int tx, ty, kx, ky;
		cin >> tx >> ty >> kx >> ky;
		for (int i=0; i<=Y+1; ++i) {
			for (int j=0; j<=X+1; ++j) {
				if (i==0 || i==Y+1 || j==0 || j==X+1) d[i][j] = 1;
				else cin >> d[i][j];
			}
		}
		memset(used, false, sizeof used);
		queue<State> q;
		q.push((State){tx, ty, kx, ky, 0});
		int res = -1;
		while ( ! q.empty()) {
			State s = q.front(); q.pop();
			if (100 <= s.cost) break;
			if (used[s.tx][s.ty][s.kx][s.ky]) continue;
			used[s.tx][s.ty][s.kx][s.ky] = true;
			if (s.tx == s.kx && s.ty == s.ky) {
				res = s.cost;
				break;
			}
			for (int i=0; i<4; ++i) {
				if (d[s.ty+dy[i]][s.tx+dx[i]] && d[s.ky-dy[i]][s.kx-dx[i]]) continue;
				int tx2 = s.tx, ty2 = s.ty;
				if ( ! d[s.ty+dy[i]][s.tx+dx[i]]) {
					tx2 += dx[i];
					ty2 += dy[i];
				}
				int kx2 = s.kx, ky2 = s.ky;
				if ( ! d[s.ky-dy[i]][s.kx-dx[i]]) {
					kx2 -= dx[i];
					ky2 -= dy[i];
				}
				if ( ! used[tx2][ty2][kx2][ky2]) {
					q.push((State){tx2, ty2, kx2, ky2, s.cost+1});
				}
			}
		}
		if (res < 0) {
			cout << "NA" << endl;
		} else {
			cout << res << endl;
		}
	}
	return 0;
}

Measured memory_bytes: 8868
n = int(input())
l = list(sorted(list(map(int,input().split()))))
ans = 0
for i in range(n-2):
  for j in range(i+1,n-1):
    for k in range(j+1,n):
      if l[i] != l[j] and l[j] != l[k] and l[i] + l[j] > l[k]:
        ans += 1
print(ans)

Measured memory_bytes: 9196
N=int(input())
A=[0]*N
B=[0]*N
ans=0
for i in range(N):
    A[i],B[i]=map(int, input().split())
for i in range(N):
    #print(ans)
    A[N-i-1]+=ans
    if A[N-i-1]%B[N-i-1]!=0:
        ans+=B[N-i-1]-A[N-i-1]%B[N-i-1]
print(ans)


Measured memory_bytes: 14964
#include<stdio.h>
int main()
{
  int n, m, i, j, nm[100][100], m1[100], ans[100] = {0};

  scanf("%d%d", &n, &m);

  for(i = 0; i < n; i++){
    for(j = 0; j < m; j++){
      scanf("%d", &nm[i][j]);
    }
  }

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

  for(i = 0; i < n; i++){
    for(j = 0; j < m; j++){
      ans[i] += nm[i][j] * m1[j];
    }

    printf("%d\n", ans[i]);
    
  }
  
  return 0;

}

Measured memory_bytes: 636
//#pragma GCC optimize("Ofast")
//#pragma GCC target("avx,avx2,fma")
#pragma GCC optimize("O3")
#include<iostream>
#include<algorithm>
#include<string>
#include<cmath>
#include<cstdlib>
#include<set>
#include<vector>
#include<sstream>
#include<queue>
#include <iomanip>
#include<unordered_set>
#include <stack>
#include <unordered_map>
#include <map>
constexpr auto INF = 9223372036854775807;
typedef long long int ll;
typedef unsigned long long int ull;
typedef unsigned long int ul;
#define f(i,a,b) for(ll i=(ll)a;i<(ll)b;i+=1)
#define rf(i,a,b) for(ll i=(ll)a;i>=(ll)b;i-=1)
#define endl '\n'
#define N 1000000007 // prime modulo value 
#define M 998244353
#define all(x) x.begin(),x.end()
using namespace std;
struct custom_hash
{
	static uint64_t splitmix64(uint64_t x)
	{
		// http://xorshift.di.unimi.it/splitmix64.c
		x += 0x9e3779b97f4a7c15;
		x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
		x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
		return x ^ (x >> 31);
	}
};
#define safe_map unordered_map<ll, ll, custom_hash>

inline int mex(unordered_set<int> st)
{
	int m = 0;
	while (st.find(m) != st.end())
	{
		m += 1;
	}
	return m;
}
inline int calculateGrundy(int n)
{
	if (n == 1)
		return 0;
	unordered_set<int> mexi;
	for (int i = 1; i <= sqrt(n); i += 1)
	{
		if (n % i == 0)
		{
			if (n / i != n)
				mexi.insert(calculateGrundy(n / i));
			mexi.insert(calculateGrundy(i));
		}
	}
	return mex(mexi);
}
inline ll gcd(ll a, ll b)
{
	if (b == 0)
		return a;
	return gcd(b, a % b);
}
ll power(ll x, ll y)
{
	ll res = 1;

	x = x % N;
	if (x == 0) return 0;
	while (y > 0)
	{
		if (y & 1)
			res = (res * x) % N;
		y = y >> 1;
		x = (x * x) % N;
	}
	return res;
}
int main()
{
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	ll a, b, c, d;
	cin >> a >> b >> c >> d;
	ll count = 0;
	while (a > 0 && c > 0)
	{
		if (count % 2 == 0)
			c -= b;
		else
			a -= d;
		count += 1;
	}
	if (a <= 0)
		cout << "No";
	else
		cout << "Yes";
	return 0;
}

Measured memory_bytes: 3612
#include <iostream>
#include <vector>
#include <cmath>
#include <iomanip>
#include <algorithm>
#include <queue>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define all(x) (x).begin(), (x).end()

int main() {
    int n;
    cin>>n;
    cout<<n+n*n+n*n*n;
    
	return 0;
}


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

int main(){
    ll n,k;
    cin >> n >> k;
    
    vector<ll> x(n);
    rep(i,n) cin >> x[i];
    
    ll minv = 1e9;
    for(ll i = 0; i < n - (k - 1); i++){
        ll left = x[i];
        ll right = x[i+k-1];
        
        minv = min(minv,abs(left)+abs(left-right));
        minv = min(minv,abs(right)+abs(right-left));
    }
    
    cout << minv << endl;
    
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
typedef long long ll;
int n,m,p[N],per[N],vis[N],ans[N],lop[N],cnt;
ll k,val[N],res[N];
int main() {
  scanf("%d",&n);
  for (int i = 1 ; i <= n ; ++ i)
    scanf("%lld",&val[i]);
  scanf("%d%lld",&m,&k);
  for (int i = 1 ; i <= m ; ++ i)
    scanf("%d",&p[i]);
  for (int i = n ; i >= 1 ; -- i)
    val[i] = val[i] - val[i-1];
  for (int i = 1 ; i <= n ; ++ i)
    per[i] = i;
  for (int i = 1 ; i <= m ; ++ i)
    swap(per[p[i]],per[p[i]+1]);
  for (int i = 1 ; i <= n ; ++ i) {
    if (vis[i]) continue;
    cnt = 0;
    lop[++cnt] = i;
    int pos = per[i];
    while (pos != i) {
      vis[pos] = 1;
      lop[++cnt] = pos;
      pos = per[pos];
    }
    for (int j = 1 ; j <= cnt ; ++ j)
      ans[lop[j]] = lop[(j + k - 1) % cnt + 1];
  }
  for (int i = 1 ; i <= n ; ++ i)
    res[i] = val[ans[i]];
  for (int i = 1 ; i <= n ; ++ i)
    res[i] += res[i-1];
  for (int i = 1 ; i <= n ; ++ i)
    printf("%lld.0\n",res[i]);
  return 0;
}

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

int main() {
	int n;
	int b, f, r, v;
	int count[4][3][10];

		for (int i = 0; i < 4; i++)
			for (int j = 0; j < 3; j++)
				for (int k = 0; k < 10; k++)
					count[i][j][k] = 0;

	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> b >> f >> r >> v;
		count[b-1][f-1][r-1] += v;
	}
	for (int i = 0; i < 4; i++) {
		for (int j = 0; j < 3; j++) {
			for (int k = 0; k < 10; k++) {
				cout << " ";
				cout << count[i][j][k];
			}
			cout << endl;
		}
		if (i < 3) cout << "####################" << endl;
	}
	return 0;
}



Measured memory_bytes: 3080
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef double db;
#define fir first
#define sec second
#define rep(i,a,b) for (int i = (a) ; i <= (b) ; ++ i)
#define rrp(i,a,b) for (int i = (a) ; i >= (b) ; -- i)
#define gc() getchar()
template <typename tp>
inline void read(tp& x) {
  x = 0; char tmp; bool key = 0;
  for (tmp = gc() ; !isdigit(tmp) ; tmp = gc())
    key = (tmp == '-');
  for ( ; isdigit(tmp) ; tmp = gc())
    x = (x << 3) + (x << 1) + (tmp ^ '0');
  if (key) x = -x;
}
template <typename tp>
inline void ckmn(tp& x,tp y) {
  x = x < y ? x : y;
}
template <typename tp>
inline void ckmx(tp& x,tp y) {
  x = x < y ? y : x;
}

const int MOD = (int)(1e9 + 7);
int power(int a,int b) {
  int ret = 1;
  while (b) {
    if (b&1) ret = 1ll * ret * a % MOD;
    a = 1ll * a * a % MOD;
    b >>= 1;
  }
  return ret;
}
inline void Add(int& x,int y) {
  x = x + y >= MOD ? x + y - MOD : x + y;
}
inline void Sub(int& x,int y) {
  x = x - y < 0 ? x - y + MOD : x - y;
}

const int N = 310;
int n, val[N << 1], rec[N << 1], dp[2][N][N], ans, num;
 int main() {
  read(n);
  rep (i, 1, n<<1) read(val[i]);
  rep (i, 1, n<<1) if (val[i] != -1) {
    int t = ((i-1) ^ 1) + 1;
    if (val[t] == -1) rec[val[i]] = 1;
    else rec[val[i]] = -1;
  }
  for (int i = 1 ; i <= (n<<1) ; i += 2)
    if (val[i] == -1 && val[i+1] == -1) ++ num;
  int p = 1;
  dp[0][0][0] = 1;
  rrp (i, n<<1, 1) {
    if (rec[i] == -1) continue;
    memset(dp[p], 0, sizeof dp[p]);
    rep (a, 0, n) rep (b, 0, n) if (dp[p^1][a][b]) {
      if (rec[i] == 1) {
        if (a>0) Add(dp[p][a-1][b], dp[p^1][a][b]);
        Add(dp[p][a][b+1], dp[p^1][a][b]);
      } else {
        if (a>0) Add(dp[p][a-1][b], dp[p^1][a][b]);
        if (b>0) Add(dp[p][a][b-1], 1ll * b * dp[p^1][a][b] % MOD);
        Add(dp[p][a+1][b], dp[p^1][a][b]);
      }
    }
    p ^= 1;
  }
  p ^= 1;
  ans = dp[p][0][0];
  rep (i, 1, num) ans = 1ll * ans * i % MOD;
  printf("%d\n", ans);
  return 0;
}


Measured memory_bytes: 1152
#include<bits/stdc++.h>
using namespace std;
int main(){
  int h,w;
  cin >> h >> w;
  int i,j;
  char s[h+2][w+2];
  for(i=0;i<h+2;i++){
    for(j=0;j<w+2;j++){
      s[i][j]='#';
    }
  }
  for(i=1;i<=h;i++){
    for(j=1;j<=w;j++){
      char t;
      cin >> t;
      s[i][j]=t;
    }
  }
 
  for(i=0;i<h+2;i++){
    for(j=0;j<w+2;j++){
      cout << s[i][j];
    }
    cout << endl;
  }
}

Measured memory_bytes: 384
multiDiv :: Int -> Int -> (Int, Int)
multiDiv n d = helper n 0
  where helper n' i = if n' `mod` d == 0 
          then helper (n' `div` d) (i + 1)
          else (n', i)

factoring' :: Int -> (Int, [Int])
factoring' n = foldr helper (n, []) $ reverse (2:[3,5..m])
  where m = floor . sqrt $ fromIntegral n
        helper a (n', fs) = let (n'', f) = multiDiv n' a
                             in if f == 0 then (n'', fs)
                                          else (n'', f:fs)

factoring :: Int -> [Int]
factoring n = let (n', fs) = factoring' n
              in if n' == 1 then fs else 1:fs

prime :: Int
prime = 1000000007

mul :: Int -> Int -> Int
mul a b = (a * b) `mod` prime

pow :: Int -> Int -> Int
pow b n
  | n == 1 = b
  | n `mod` 2 == 0 = pow (b `mul` b) (n `div` 2)
  | otherwise = pow b (n - 1) `mul` b

reciprocal :: Int -> Int
reciprocal n = pow n (prime - 2)

com :: Int -> Int -> Int
com n k
  | k == 0 = 1
  | n - k < k = com n (n - k)
  | otherwise = let a = foldr1 mul [n - k + 1 .. n]
                    b = foldr1 mul $ map reciprocal [1..k]
                in a `mul` b

main = do
  [n,m] <- map read . words <$> getLine
  let fs = factoring m
      cs = map (\i -> com (n + i - 1) i) fs
      a = foldr mul 1 cs
  print a


Measured memory_bytes: 2044
using System;

namespace atcoderA
{
    class MainClass
    {
        public static void Main(string[] args)
        {
            string[] line = Console.ReadLine().Split(' ');
            string A = line[0];
            string B = line[1];
            string C = line[2];
            if(A[A.Length-1]==B[0] && B[B.Length - 1] == C[0])
            {
                Console.WriteLine("YES");
            }
            else
            {
                Console.WriteLine("NO");
            }
        }
    }
}

Measured memory_bytes: 13140
#include <algorithm>
#include <bitset>
#include <cassert>
#include <climits>
#include <cmath>
#include <ctime>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <memory.h>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <vector>
#include <unordered_map>
#include <unordered_set>
using namespace std;
typedef long double LD;
typedef long long LL;
typedef pair<LL, LL> pll;
typedef pair<int, int> pii;
typedef vector<int> vi;
#ifdef LOCAL
#define DEBUG(x) { cerr << "# " << #x << ": " << x << endl;}
#else
#define DEBUG(x)
#endif
mt19937_64 mt(time(0));
/*---------------------------------------------------------------------------------------------------
　　　　　　　　　　　 ∧＿∧
　　　　　 ∧＿∧ 　（´<_｀ ）　 Welcome to My Coding Space!
　　　　 （ ´_ゝ`）　/　 ⌒i
　　　　／　　　＼　 　  |　|
　　　 /　　 /￣￣￣￣/　　|
　 ＿_(__ﾆつ/　    ＿/ .| .|＿＿＿＿
　 　　　＼/＿＿＿＿/　（u　⊃
---------------------------------------------------------------------------------------------------*/
const int mod = 998244353;
const int MAXN = 333;
int dp[MAXN][MAXN][MAXN];





int main() {
  ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
  cout.precision(10); cout << fixed;
#ifdef LOCAL
  freopen("../test.txt", "r", stdin);
    // freopen("../output.txt", "w", stdout);
#endif
  string s; cin >> s;
  int k; cin >> k;
  vector<int> nums;
  int cur = 0;
  for (char c : s) {
    if (c == '0') {
      nums.push_back(cur);
      cur = 0;
    } else {
      cur++;
    }
  }
  if (cur != 0) nums.push_back(cur);
  int n = nums.size();
  int m = s.size();
  dp[n][0][0] = 1;
  for (int i = n-1; i >= 0; i--) {
    for (int a = 0; a <= m; a++) {
      int tmp = 0;
      for (int b = a; b >= 0; b--) {
        tmp = (tmp + dp[i+1][a][b]) % mod;
        dp[i][a][b] = (tmp + dp[i][a][b]) % mod;
        if (dp[i+1][a][b] == 0) continue;
        for (int c = 1; c <= nums[i]; c++) {
          dp[i][a+c][b+c] = (dp[i][a+c][b+c] + dp[i+1][a][b]) % mod;
        }
      }
    }
  }
  LL ret = 0;
  for (int i = 0; i <= min(k, m); i++) {
    ret = (ret + dp[0][i][0]) % mod;
  }
  cout << ret << '\n';







/*---------------------------------------Coding Space End------------------------------------------*/
#ifdef LOCAL
  cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s." << endl;
#endif
  return 0;
}
/* author:  txingml */
/* picture is from hamayanhamayan(CF handle) */


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

int main(){
 while(1){
 int x,y;
   cin>>x>>y;
   if(x==0&&y==0)
     break;
   else if(x>y)
     cout<<y<<" "<<x<<endl;
     else
 cout<<x<<" "<<y<<endl;
 }
 }


Measured memory_bytes: 2992
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<tuple>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll mod = 1000000007;
const ll INF = (ll)1000000007 * 1000000007;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define Per(i,sta,n) for(int i=n-1;i>=sta;i--)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef long double ld;
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<ll, ll> LP;

int n,m;
vector<int> G[1010];
bool visited[1010]={false};
vector<int> ans;

int dfs(int s,int sta,int k){
    int res=mod;
    
    for(auto t:G[s]){
        //cout << sta << " " << s << " " << t << " " << k << endl;
        if (visited[t]) continue;
        //cout << visited[t] << endl;
        if (t==sta) {
            //cout << "A" << endl;
            return k+1;
        }
        visited[t]=true;
        res=min(res,dfs(t,sta,k+1));
        
    }
    //cout << sta << " " << s << " " << res << endl;
    return res;
}

bool dfs2(int s,int sta,int k,int ma){
    bool res=false;
    if (k>=ma) return false;
    for(auto t:G[s]){
        if (t==sta){
            return true;
        }
        //cout << sta << " " << t  << " " << k << endl;
        if (dfs2(t,sta,k+1,ma)) {
            ans.push_back(t);
            //cout << t << "a" << endl;
            return true;
        }
    }
    return false;
}

void solve(){
    cin >> n >> m;
    rep(i,m){
        int a,b;
        cin >> a >> b;
        G[a-1].push_back(b-1);
    }
    int d=mod,p=-1;
    rep(i,n){
        rep(i,n){
            visited[i]=false;
        }
        //cout << i << endl;
        int l=dfs(i,i,0);
        if (l==mod) continue;
        if (d>l) {
            p=i;
            d=l;
        }
    }
    if (p==-1) {
        cout << -1 << endl;
        return;
    }
    //cout << p << endl;
    cout << d << endl;
    dfs2(p,p,0,d);
    ans.push_back(p);
    rep(i,d){
        cout << ans[d-i-1]+1 << endl;
    }
}

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

Measured memory_bytes: 384
#include<iostream>
#include<algorithm>
#include<climits>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<ctime>
#include<string>
#include<cstring>
#include<vector>
#include<stack>
#include<queue>
#include<set>
#include<bitset>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

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; }

#define mod 1000000007LL
#define eps 0.0001
#define pi acos(-1)
#define INF 10000000000000000

#define rep(i, n) for(int i = 0;i < n;++i)
#define rep1(i, n) for(int i = 1;i < n;++i)
#define pri(x) cout << (x) << "\n"
#define pri2(x, y) cout << (x) << " " << (y) << "\n"
#define pri3(x, y, z) cout << (x) << " " << (y) << " " << (z) << "\n"
#define chmin

    

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    // ---------------------
    // コーディング開始
    // ---------------------
    ll n;
    cin >> n;
    ll t[n],a[n];
    rep(i,n){
        cin >> t[i] >> a[i];
    }
    ll T = 1;
    ll A = 1;
    rep(i,n){
        ll T2 = T/t[i];
        ll A2 = A/a[i];
        if(T%t[i]!=0) T2++;
        if(A%a[i]!=0) A2++;
        ll N = max(T2,A2);
        T = N*t[i];
        A = N*a[i];
    }
    pri(T+A);
    return 0;
}



Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<string>
#include<cstring>
#include<algorithm>
#include<sstream>
#include<complex>
#include<functional>
#include<vector>
#include<map>
#include<queue>
#include<deque>
#include<stack>
#include<set>

using namespace std;
#define endl '\n'
#define eb emplace_back
#define fst first
#define scd second
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define YES(n) cout << ((n) ? "YES" : "NO" ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No" ) << endl

constexpr int MOD = 1000000007;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vector<int>> vii;
typedef vector<ll> vl;

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

// value
ll A, B, C, D;

void solve() {

	cin >> A >> B >> C >> D;

	ll ans = B - A + 1;
	ll no = B / C - (A - 1) / C;
	no += B / D - (A - 1) / D;
	ll g = C * D / gcd(C, D);
	no -= B / g - (A - 1) / g;
	cout << ans - no << endl;

	return;

}

int main() {

	cin.tie(0);
	ios::sync_with_stdio(false);

	solve();

	return 0;

}

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

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

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(int i=m;i<(n);i++)
#define ALL(c) (c).begin(),(c).end()
#define dump(x) cout << #x << " = " << (x) << endl
constexpr ll TEN(int n) { return (n == 0) ? 1 : 10 * TEN(n-1); }

template<class T, class U> void chmin(T& t, const U& u) { if (t > u) t = u; }
template<class T, class U> void chmax(T& t, const U& u) { if (t < u) t = u; }

template<class T, class U>
ostream& operator<<(ostream& os, const pair<T, U>& p) {
	os<<"("<<p.first<<","<<p.second<<")";
	return os;
}

template<class T>
ostream& operator<<(ostream& os, const vector<T>& v) {
	os<<"{";
	rep(i, v.size()) {
		if (i) os<<",";
		os<<v[i];
	}
	os<<"}";
	return os;
}

const int INF = TEN(9) * 2;
const ll MOD = TEN(9) + 7;

int main() {
	int N; cin >> N;
	vi T(N), A(N);
	vi mini(N, 1), maxi(N, INF);

	int la = -1;

	rep(i, N) {
		cin >> T[i];
	}
	rep(i, N) {
		cin >> A[i];
	}

	rep(i, N) {
		if (T[i] != la) {
			chmax(mini[i], T[i]);
			chmin(maxi[i], T[i]);
		} else {
			chmin(maxi[i], T[i]);
		}
		la = T[i];
	}

	la = -1;
	for (int i = N-1; i >= 0; --i) {
		if (A[i] != la) {
			chmax(mini[i], A[i]);
			chmin(maxi[i], A[i]);			
		} else {
			chmin(maxi[i], A[i]);
		}
		la = A[i];
	}

	ll ans = 1;
	rep(i, N) {
		if (mini[i] > maxi[i]) {
			ans = 0;
		} else {
			ans = ans * (maxi[i] - mini[i] + 1) % MOD;
		}
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define rep(i, s, N) for(ll i{s}; i < N; i++)
#define rem(i, N, s) for(ll i{N}; i > s; i--)
using namespace std;using ll = long long int;using ld = long double;using P = pair<ll,ll>;const int MOD = (int)1e9+7;const string rt = "\n";const string sp = " ";/* 最大公約数 */template<typename T> T gcd(T a, T b){return b != 0 ? gcd(b, a % b) : a;}/* UnionFind */template<typename T> struct UnionFind{vector<T> par;UnionFind(T n) : par(n, -1){}void init(T n){par.assign(n, -1);}T root(T x){if (par[x] < 0) return x;else return par[x] = root(par[x]);}bool issame(T x, T y){return root(x) == root(y);}bool merge(T x, T y){x = root(x); y = root(y);if(x == y) return false;if(par[x] > par[y]) swap(x, y);par[x] += par[y];par[y] = x;return true;}int size(int x) {return -par[root(x)];}};/* コンビネーション */template<typename T> ll combpm(T N_, T C_) {const int NUM_=400001;static ll fact[NUM_+1],factr[NUM_+1],inv[NUM_+1];if (fact[0]==0) {inv[1]=fact[0]=factr[0]=1;for (int i=2;i<=NUM_;++i) inv[i] = inv[MOD % i] * (MOD - MOD / i) % MOD;for (int i=1;i<=NUM_;++i) fact[i]=fact[i-1]*i%MOD, factr[i]=factr[i-1]*inv[i]%MOD;}if(C_<0 || C_>N_) return 0;return factr[C_]*fact[N_]%MOD*factr[N_-C_]%MOD;}/* 多次元ベクター */template<class T>vector<T> mvec(size_t a){return vector<T>(a);}template<class T, class... Ts>auto mvec(size_t a, Ts... ts){return vector<decltype(mvec<T>(ts...))>(a, mvec<T>(ts...));}/* テスト関数 */void test(ll n){cout << "test" << n << endl;}/* 小数点以下 */void fixsp(ll n){cout << fixed << setprecision(n);}void defsp(ll n){cout << defaultfloat << setprecision(n);}/* 重み付きUnionFind */struct WUnionFind {vector<int> par;vector<int> rank;WUnionFind(int n = 1) {init(n);}void init(int n = 1) {par.resize(n); rank.resize(n);for (int i = 0; i < n; ++i) par[i] = i, rank[i] = 0;}int root(int x) {if (par[x] == x) {return x;}else {int r = root(par[x]);return par[x] = r;}}bool issame(int x, int y) {return root(x) == root(y);}bool merge(int x, int y) {x = root(x); y = root(y);if (x == y) return false;if (rank[x] < rank[y]) swap(x, y);if (rank[x] == rank[y]) ++rank[x];par[y] = x;return true;}};/* IO高速化 */void fastio(){ios::sync_with_stdio(false);cin.tie(NULL);}
/* ここからコード開始 */

int main(){
  fastio;
  ll A, B, C;
  cin >> A >> B >> C;
  ll K;
  cin >> K;
  ll l, r;
  l = ((K%2 ? -1 : 1) + pow(2,K-1))*2/3;
  r = ((K%2 ? 1 : -1)) + l;
  ll ans = A * l + (B + C) * r - B * l - (C + A) * r;
  if(ans > 1e18) cout << "Unfair" << rt;
  else cout << ans << rt;
}

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

const ll LINF = 1e18;
const int INF = 1e9;
const ll MOD = 1000000007;

int main(){

    int h, w;
    cin >> h >> w;
    vector<string> s(h);
    vector<vector<int>> ans(h, vector<int>(w));
    for(int i = 0; i < h; i++){
        cin >> s[i];
    }

    for(int i = 0; i < h; i++){
        for(int j = 0; j < w; j++){
            if(s[i][j] == '#'){
                ans[i][j] = -1;
                continue;
            }
            int sum = 0;
            for(int dy = -1; dy <= 1; dy++){
                for(int dx = -1; dx <= 1; dx++){
                    if((dx == 0) && (dy == 0)) continue;
                    if((i + dy < 0) || (i + dy >= h)) continue;
                    if((j + dx < 0) || (j + dx >= w)) continue;
                    if(s[i+dy][j+dx] == '#') sum++;
                }
            }
            ans[i][j] = sum;
        }
    }
    for(int i = 0; i < h; i++){
        for(int j = 0; j < w; j++){
            if(ans[i][j] == -1) cout << '#';
            else cout << ans[i][j];
        }
        cout << endl;
    }
    return 0;
}

Measured memory_bytes: 3576
/*input
2000000000 0 0 2000000000
*/

#include <bits/stdc++.h>

using namespace std;
using ll = long long;

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

  ll ans = min(a, k);
  k -= ans;
  if(k > 0) {
  	ll d = min(k, b);
  	k -= d;
  } 
  if(k > 0) {
  	ll d = min(c, k);
  	ans -= d;
  }
  cout << ans;
  return 0;
}

Measured memory_bytes: 3628
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double lld;
ll MOD = (1e9)+7;
const int dr[] = {+1, -1, +0, +0, +1, -1, +1, -1};
const int dc[] = {+0, +0, +1, -1, +1, -1, -1, +1};
const int kx[] = {+1, +2, -1, -2, +1, +2, -1, -2};
const int ky[] = {+2, +1, +2, +1, -2, -1, -2, -1};
//#pragma GCC target ("avx2")
//#pragma GCC optimization ("O3")
//#pragma GCC optimization ("unroll-loops")
inline void fastIO(){
  ios_base::sync_with_stdio(0);cin.tie(0);
}
template<typename T> ostream& operator<<(ostream &os, const vector<T> &v) { os << '{'; string sep; for (const auto &x : v) os << sep << x, sep = ", "; return os << '}'; }
template<typename T, size_t size> ostream& operator<<(ostream &os, const array<T, size> &arr) { os << '{'; string sep; for (const auto &x : arr) os << sep << x, sep = ", "; return os << '}'; }
template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p) { return os << '(' << p.first << ", " << p.second << ')'; }

void debug_out() { cerr << endl; }
template<typename Head, typename... Tail> void debug_out(Head H, Tail... T) { cerr << ' ' << H; debug_out(T...); }

#ifdef LOCAL
#define debug(...) cerr << "(" << #__VA_ARGS__ << "):", debug_out(__VA_ARGS__)
#else
#define debug(...) 47
#endif

int comp(string a,string b){
  int cnt=0;
  for(int i=0;i<a.length();i++){
    if(a[i]!=b[i])cnt++;
  }
  return cnt;
}
int main(){
  fastIO();
  string s,t;
  int ans=1e9;
  cin>>s>>t;
  for(int i=0;i<=(s.length()-t.length());i++){
    ans=min(ans,comp(t,s.substr(i,t.length())));
  }
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 3676
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i,n) for(int i=0;i<(n);++i)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define all(x) (x).begin(), (x).end()
#define PI 3.14159265358979323846264338327950L
using namespace std;
typedef long long ll;
typedef long double ld;
int main() {
    int n,T;
    cin>>n>>T;
    int c,t;
    int tcnt=0,cost=10000;
    rep(i,n){
        cin>>c>>t;
        if(t<=T){
            tcnt++;
            cost=min(cost,c);
        }
    }
    if(tcnt==0) cout<<"TLE";
    else cout<<cost;
}

Measured memory_bytes: 3652
n,m=map(int,input().split())
h = list(map(int,input().split()))
good = [True]*n
for _ in range(m):
    a,b = map(int,input().split())
    a,b = a-1,b-1
    if h[a] <= h[b]: good[a] = False
    if h[b] <= h[a]: good[b] = False

print(sum(good))

Measured memory_bytes: 20104
module Panasonic2020.A

let list = [ 1; 1; 1; 2; 1; 2; 1; 5; 2; 2; 1; 5; 1; 2; 1; 14; 1; 5; 1; 5; 2; 2; 1; 15; 2; 2; 5; 4; 1; 4; 1; 51 ]
let k = stdin.ReadLine() |> int

printf "%d" list.[k - 1]


Measured memory_bytes: 14044
//インクルード(アルファベット順)
#include<algorithm>//sort,二分探索,など
#include<bitset>//固定長bit集合
#include<chrono>//実行時間計測
#include<cmath>//pow,logなど
#include<complex>//複素数
#include<deque>//両端アクセスのキュー
#include<functional>//sortのgreater
#include<iomanip>//setprecision(浮動小数点の出力の誤差)
#include<iostream>//入出力
#include<iterator>//集合演算(積集合,和集合,差集合など)
#include<map>//map(辞書)
#include<numeric>//iota(整数列の生成),gcdとlcm,accumulate
#include<queue>//キュー
#include<set>//集合
#include<stack>//スタック
#include<string>//文字列
#include<unordered_map>//順序保持しないmap
#include<unordered_set>//順序保持しないset
#include<utility>//pair
#include<vector>//可変長配列

using namespace std;
typedef long long ll;

//マクロ
//forループ
//引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか
//Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる
#define REP(i,n) for(ll i=0;i<ll(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=ll(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=ll(b);i--)
//xにはvectorなどのコンテナ
#define ALL(x) x.begin(),x.end() 
#define SIZE(x) ll(x.size()) 
//定数
#define INF 1000000000000 //10^12:∞
#define MOD 1000000007 //10^9+7:合同式の法
#define MAXR 100000 //10^5:配列の最大のrange
//略記
#define PB push_back //挿入
#define MP make_pair //pairのコンストラクタ
#define F first //pairの一つ目の要素
#define S second //pairの二つ目の要素

#define int long long

#define VI vector<int> 
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//ここに関数定義や変数宣言
int n,q;

bool bs(int* S, int key){

int right=n;
int left=0;

while(left<right){

	int middle=(right+left)/2;

	if( S[middle]==key){return true;}
	else if(S[middle]>key){ right=middle; }
	else { left=middle+1; }

}

return false;

}

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
signed main(){
    //入力の高速化用のコード
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

int N;
cin>>N;
int A[N],B[N],C[N];
REP(i,N){cin>>A[i];}
REP(i,N){cin>>B[i];}
REP(i,N){cin>>C[i];}

sort(A,A+N);
sort(B,B+N);
sort(C,C+N);

int ans=0,a,c;

REP(i,N)
{
	if(A[0]<B[i])
	{
		a=  (lower_bound(A,A+N,B[i])-1 ) - A +1;
	}
	else{a=0;}

	if( B[i]< C[N-1] ) //Bが、Cの最大値より小さい時
	{
		c= &(C[N-1])-upper_bound(C,C+N,B[i]) +1;//B[i]より大きいCの数
	}
	else{c=0;}

	ans+=a*c;
}


cout<<ans<<endl;










































}

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

int main() {

  int A, B; cin >> A >> B;
  if (A >= 13) {
    cout << B << endl;
  }
  else if (A >= 6) {
    cout << B / 2 << endl;
  }
  else {
    cout << 0 << endl;
  }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vl = vector<ll>;
using vvl = vector<vl>;
using pl = pair<ll, ll>;
const ll INF = ll(1e18);
const ll mod = ll(1e9 + 7);
const double pi = acos(-1);
#define rep0(i,n) for(ll (i) = 0; (i) < (n); ++(i))
#define rrep0(i,n) for(ll (i) = (n) - 1; (i) >= 0; --(i))
#define rep1(i,n) for(ll (i) = 1; (i) <= (n); ++(i))
#define rrep1(i,n) for(ll (i) = (n); (i) >= 1; --(i))
#define nfor(i,a,b) for(ll (i) = (a); (i) < (b); ++(i))
#define rnfor(i,a,b) for(ll (i) = (b) - 1; (i) >= (a); --(i))
#define pf(x) cout << (x) << endl
#define all(x) (x).begin(),(x).end()
#define yes pf("Yes")
#define no pf("No")
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const int dx[8]={1,0,-1,0,1,1,-1,-1};
const int dy[8]={0,1,0,-1,1,-1,1,-1};

ll gcd(ll a,ll b){
    if(a < b)swap(a, b);
    if(b == 0) return a;
    return gcd(b,a%b);
}

ll lcm(ll a,ll b){
    ll g = gcd(a,b);
    return a / g * b;
}

ll factorial(ll n){
    ll ans = 1;
    rep1(i, n){
        ans *= i;
        ans %= mod;
    }
    return ans;
}

ll power(ll a, ll b){
    ll ans = 1;
    a %= mod;
    while(b) {
        if(b & 1LL) ans = ans * a % mod;
        a = a * a % mod;
        b >>= 1;
    }
    return ans % mod;
}

//modの値の確認をすること
int main(){
    ll n,ans = 0;
    cin >> n;
    vector<ll> a(n);
    rep0(i, n)cin >> a[i];
    sort(all(a),greater<>());
    ans += a[0];
    n -= 2;
    rep0(i, n / 2)ans += a[i + 1] * 2;
    if(n & 1)ans += a[n / 2 + 1];
    pf(ans);
    return 0;
}


Measured memory_bytes: 4844
solve [] v acc  = acc
solve as v acc
  | v < 0 =
    let w = v + (head as) in
      if w <= 0
        then solve (tail as) 1 (1 - w + acc)
        else solve (tail as) w acc
  | v > 0 =
    let w = v + (head as) in
      if w >= 0
        then solve (tail as) (-1) (1 + w + acc)
        else solve (tail as) w acc

main = do
  n <- read <$> getLine :: IO Int
  l <- getLine
  let as = fmap read (words l) :: [Int]
      v = head as
      oddV = if v <= 0
               then solve (tail as) 1 (1 - v)
               else solve (tail as) v 0
      evenV = if v < 0
                then solve (tail as) v 0
                else solve (tail as) (-1) (1 + v) in
    putStrLn (show (min oddV evenV))


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

int main (){
  int N,D,X;
  cin >> N >> D >> X;
  int sum=0;
  
  for(int i=0;i<N;i++){
    int a;
    cin >> a;
    for (int j=0;j<100;j++){
      if(j*a+1 <= D){
        sum++;
      }
      else{
        break;
      }
    }
  }
  
  cout << sum+X << endl;
  
}

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

N = int(input())
def primes(n):
    ass = []
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    for i in range(len(is_prime)):
        if is_prime[i] and i%5==1:
            ass.append(i)
    return ass

table = primes(55555)
print(*table[:N])

Measured memory_bytes: 69052
#include<bits/stdc++.h>
#define INF 1073741824
#define ll long long
#define PI (2*acos(0.0))
#define Hare printf("here\n")
#define fastIO ios_base::sync_with_stdio(false); cin.tie(NULL);
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define pll pair<ll,ll>
#define x first
#define y second
#define on(val,pos) val|(1<<pos)
#define off(val,pos) val&(~(1<<pos))
#define check(val,pos) (val&(1<<pos))

//first four adjacent,second four corner
//int row[8]={0,-1,0,1,1,-1,-1,1};
//int col[8]={-1,0,1,0,-1,-1,1,1};
using namespace std;

int main(){
    ll i,j,k,m,val,t=0,cnt,test,n,w;
    //freopen("000input.txt","r",stdin);
    cin>>n>>w;

    vector<ll> value(n),weight(n);
    ll sum=0;
    for(i=0;i<n;i++){
        scanf("%lld %lld",&weight[i],&value[i]);
        sum+=value[i];
    }
    vector<ll> arr(sum+1,INF);
    arr[0]=0;
    for(i=0;i<n;i++){
        for(ll k=sum;k>=value[i];k--){
            arr[k]=min(arr[k],arr[k-value[i]]+weight[i]);
        }
    }
    ll ans=0;
    for(i=0;i<=sum;i++)if(arr[i]<=w)ans=i;

    printf("%lld\n",ans);
    //free();   //if pointer array
    return 0;
}


Measured memory_bytes: 1024
n = int(input())
lst_blue = [input() for i in range(n)]

m = int(input())
lst_red = [input() for i in range(m)]

ans = 0

for w in lst_blue:
    x = lst_blue.count(w)
    y = lst_red.count(w)
    num = x-y
    if num > ans:
        ans = num
print(ans)

Measured memory_bytes: 3064
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main(void){
    int n, c = 0, mx = 0;
    cin >> n;
    for(int i=0;i<n;i++){
        int a, b;
        cin >> a >> b;
        if(a == b){
            mx = max(mx, ++c);
        }else{
            c = 0;
        }
    }
    if(mx >= 3) puts("Yes");
    else puts("No");
}


Measured memory_bytes: 3116
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
#include <random>
#define _ << " " <<
#define all(v) v.begin(), v.end()
#define sp(n) fixed << setprecision(n)

using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	string s;
	cin >> s;
	cout << (s[0] == s[1] || s[1] == s[2] || s[2] == s[3] ? "Bad" : "Good") << endl;
	return 0;
}

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

int main() {
    double a,b,x;
    std::cin >> a>>b>>x;
    static const double pi = 3.141592653589793;
    if(a*a*b/2.0 <= x){
        double l = 0;
        double r = pi/2.0;
        while(r-l>=0.00000001){
            double m = (l+r)/2.0;
            double topv = ( b-a/tan(m) )*a;
            double botv = a/tan(m)*a/2.0;
            
            // std::cout << topv<<" "<<x/a-botv << std::endl;

            if(topv < x/a-botv){
                l = m;
            }else{
                r = m;
            }
            // std::cout << m*180/pi << std::endl;
            // std::cout << l<<" "<<r << std::endl;
        }
        
        std::cout <<setprecision(20)<<90-l*180/pi << std::endl;
    }else{
        std::cout<<setprecision(20) << 90-atan(x*2.0/a/b/b)*180/pi << std::endl;
    }
}


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

typedef long long ll;

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

typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pii> vpii;
typedef vector<pll> vpll;

#define FOR(i, a, b) for (int i=a; i<(b); i++)
#define F0R(i, a) for (int i=0; i<(a); i++)
#define FORd(i,a,b) for (int i = (b)-1; i >= a; i--)
#define F0Rd(i,a) for (int i = (a)-1; i >= 0; i--)

#define ALL(s) (s).begin(),(s).end()
#define ALLn(s,n) s,s+n
#define F first
#define S second
#define pb push_back
#define tc(t) int t; cin >> t; while(t--)
#define _ ios_base::sync_with_stdio(false); cin.tie(NULL);
#define D1(x) { cerr << " [" << #x << ": " << x << "]\n"; }
#define D2(x) { cerr << " [" << #x << ": "; for(auto it:x) cerr << it << " "; cerr << "]\n"; }

const ll MOD = 1e9 + 7;
const ll MAXN = 1e6 + 7;
const ll INF = LONG_LONG_MAX;

void solve() {

	ll a;
	double b;
	cin>>a>>b;

	cout<<(ll)(a*(ll)round(b*100))/100;
}

int32_t main() {_
	
#ifndef ONLINE_JUDGE
	freopen("in", "r", stdin);
	freopen("out", "w", stdout);
#endif

	// tc(t)
		solve();
}



Measured memory_bytes: 3752
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author
 */


#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <map>
#include <set>
#include <functional>
#include <cmath>
#include <numeric>
#include <iterator>
#include <fstream>
#include <stack>

#define SIZE 100005
#define MOD 1000000007

using namespace std;

class DStringEquivalence {
public:
  static void search(int n, vector<string> &vec) {
    if (n == 0)return;
    search(n + 1, vec);
  }

  static void solve(std::istream &cin, std::ostream &cout) {
    int n;
    cin >> n;
    vector<char> vec = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'};
    vector<string> ans;
//    search(n, ans);
    stack<string> stack;
    stack.push("a");
    if (n == 1) {
      cout << stack.top() << endl;
      return;
    }
    while (!stack.empty()) {
      string now = stack.top();
      stack.pop();
      set<char> s;
      for (const auto &item : now) s.insert(item);
      int index = s.size();
      for (int k = 0; k < index + 1; ++k) {
        string tmp = now + vec[k];
        if (tmp.size() > n)continue;
        else if (tmp.size() == n) ans.emplace_back(tmp);
        stack.push(tmp);
      }
    }
    sort(ans.begin(), ans.end());
    for (const auto &item : ans) {
      cout << item << endl;
    }
  }
};


int main() {
    DStringEquivalence solver;
    std::istream& in(std::cin);
    std::ostream& out(std::cout);
    solver.solve(in, out);
    return 0;
}


Measured memory_bytes: 9588
#include<iostream>
#include<vector>
#include<algorithm>

using namespace std;

const int MAX = 81;
struct data{int indent,R,C,S;};
vector<data> P,Q;

void input(int num, vector<data>& V){
  V.clear();
  data d = (data){0,0,0,0};
  
  
  for(int i = 0; i < num; i++){
    string s;
    getline(cin,s);
    int tmp = 0;
    for(int j = 0; j < s.length() && s[j] == '.'; j++) tmp++;
    for(int j = 0; j < s.length(); j++){
      if(s[j] == '(') d.R++;
      if(s[j] == ')') d.R--;
      if(s[j] == '{') d.C++;
      if(s[j] == '}') d.C--;
      if(s[j] == '[') d.S++;
      if(s[j] == ']') d.S--;
    }
    
    d.indent = tmp;
    V.push_back(d);
  }
  
}

bool isValid(int r, int c, int s){
  for(int i = 1; i < P.size(); i++)
    if(P[i].indent != r*P[i-1].R + c*P[i-1].C + s*P[i-1].S) return false;
  return true;
}


vector<data> getRCS(){
  vector<data> res;
  
  for(int i = 1; i <= 20; i++)
    for(int j = 1; j <= 20; j++)
      for(int k = 1; k <= 20; k++)
        if(isValid(i,j,k)) res.push_back((data){0,i,j,k});
  return res;
}

void solve(const vector<data>& v){
  int ans[MAX];
  fill(ans,ans+MAX,-2);
  ans[0] = 0;
  
  
  for(int pos = 1; pos < Q.size(); pos++){
    for(int i = 0; i < v.size(); i++){
      int cost = v[i].R*Q[pos-1].R+v[i].C*Q[pos-1].C+v[i].S*Q[pos-1].S;
      if(ans[pos] == -2) ans[pos] = cost;
      else if(ans[pos] != cost) ans[pos] = -1;
    }
  }
  for(int i = 0; i < Q.size(); i++){
    if(i) cout << " " ;
    cout << ans[i];
  }
  cout << endl;
}

void print(const vector<data>& v){
  for(int i = 0; i < v.size(); i++)
    cout << v[i].indent << " " << v[i].R << " " << v[i].C << " " << v[i].S << endl;
}

int main(){
  int p,q;
  while(cin >> p >> q && p+q){
    cin.ignore();
    input(p,P);
    input(q,Q);
    
    vector<data> able = getRCS();
    solve(able);
  }
  return 0;
}

Measured memory_bytes: 1360
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

#define f first
#define s second
#define pb push_back
#define all(v) (v).begin(), (v).end()
#define debug(x) cout << #x << " " << x << "\n"

using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;

const ll N = 1e5 + 3;

ll n, a[N], res[N];

ll _abs(ll x) {
	return x < 0 ? -x : x;
}

int main() {
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	
	cin >> n;
	for (ll i = 1; i <= n; ++i) cin >> a[i];
	
	res[1] = 0;
	res[2] = _abs(a[1] - a[2]);
	for (ll i = 3; i <= n; ++i) {
		res[i] = min(res[i-1] + _abs(a[i] - a[i-1]),
					res[i-2] + _abs(a[i] - a[i-2]));
	}
	cout << res[n];
	
	return 0;
}


Measured memory_bytes: 1792
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
const int INF = (1<<30);
const ll INFLL = (1ll<<60);
const ll MOD = (ll)(1e9+7);

#define l_ength size

void mul_mod(ll& a, ll b){
	a *= b;
	a %= MOD;
}

void add_mod(ll& a, ll b){
	a = (a<MOD)?a:(a-MOD);
	b = (b<MOD)?b:(b-MOD);
	a += b;
	a = (a<MOD)?a:(a-MOD);
}

struct edge{
	int to,cap,rev;
};

vector<edge> g[1024];
int a[575],b[575];
bool visited[1024];

void make_edge(int u, int v){
	edge e;
	e.to = v; e.cap = 1; e.rev = g[v].l_ength();
	g[u].push_back(e);
	e.to = u; e.cap = 0; e.rev = g[u].l_ength()-1;
	g[v].push_back(e); 
}

int gcd(int x, int y){
	return ((y)?gcd(y,x%y):x);
}

int dfs(int s, int t, int f){
	int i,ret;
	if(s==t){
		return f;
	}
	visited[s] = true;
	for(i=(g[s].l_ength()-1); i>=0; --i){
		if(visited[g[s][i].to]){
			continue;
		}
		if(!g[s][i].cap){
			continue;
		}
		ret = dfs(g[s][i].to,t,min(f,g[s][i].cap));
		if(ret > 0){
			g[s][i].cap -= ret;
			g[g[s][i].to][g[s][i].rev].cap += ret;
			return ret;
		}
	}
	return 0;
}

int main(void){
	int n,m,i,j,f,ans;
	cin >> n >> m;
	while(n && m){
		ans = 0;
		for(i=0; i<n; ++i){
			make_edge(n+m,i);
			cin >> a[i];
		}
		for(j=0; j<m; ++j){
			make_edge(n+j,n+m+1);
			cin >> b[j];
		}
		for(i=0; i<n; ++i){
			for(j=0; j<m; ++j){
				if(gcd(a[i],b[j])>1){
					make_edge(i,n+j);
				}
			}
		}
		while(true){
			fill(visited,visited+1024,false);
			f = dfs(n+m,n+m+1,INF);
			if(!f){
				break;
			}
			ans += f;
		}
		cout << ans << endl;
		for(i=n+m+1; i>=0; --i){
			g[i].clear();
		}
		cin >> n >> m;
	}
	return 0;
}



Measured memory_bytes: 9428
#include <algorithm>
#include <bitset>
#include <cstdio>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <math.h>
#define REP(i, b, n) for (Int i = b; i < Int(n); i++)
#define rep(i, n) REP(i, 0, n)
using namespace std;
using Int = long long;
Int inf = 1000000000000000001LL;
using vi = vector<Int>;
using vvi = vector<vi>;
using pii = pair<Int,Int>;
using mapis = unordered_map<Int,string>;
using mapii = unordered_map<Int,Int>;

Int GCD(Int a, Int b){
    if(b==0) return a;
    if(a < b) return GCD(b, a);
    unsigned r;
    while ((r=a%b)) {
        a = b;
        b = r;
    }
    return b;
}

Int LCM(Int a, Int b){
    return a*b/GCD(a,b);
}


int main() {
    Int A,B,C;

    cin >> A >> B >> C;

    int now = A;
    while(now<=B*100){
        if(now%B==C){
            cout << "YES" << endl;
            return 0;
        }
        now+=A;
    }



    cout <<  "NO" << endl;


    return 0;
}

Measured memory_bytes: 384