akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <algorithm>
#include <cassert>
#include <vector>
#include <sstream>
#include <cmath>
#include <stdio.h>

using namespace std;

//-------------------------------------------------------------------------
// geometric library
//-------------------------------------------------------------------------
// geometric library

namespace geometry {

#define EPS 1E-10 ///< 0とみなすサイズ。適当

	struct point {
		double x;
		double y;

		point& operator += (const point& rhs) { x += rhs.x; y += rhs.y; return *this; }
		point& operator -= (const point& rhs) { x -= rhs.x; y -= rhs.y; return *this; }
		point& operator /= (double factor) { x /= factor; y /= factor; return *this; }
		point& operator *= (double factor) { x *= factor; y *= factor; return *this; }
		bool operator == (const point& rhs) const { return (std::abs(x - rhs.x) < EPS) && (std::abs(y - rhs.y) < EPS); }
		bool operator != (const point& rhs) const { return !(*this == rhs); }
		bool operator <= (const point& rhs) const { return x < rhs.x || (x == rhs.x && y <= rhs.y); }
		bool operator >= (const point& rhs) const { return x > rhs.x || (x == rhs.x && y >= rhs.y); }
		bool operator < (const point& rhs) const { return !(*this >= rhs); }
		bool operator > (const point& rhs) const { return !(*this <= rhs); }
		double arg() const { return atan2(y, x); }
	};

	struct circle {
		point center;
		double radius;
	};

	struct line {
		// ax + by + c = 0
		double a;
		double b;
		double c;
	};

	enum rotate_dir {
		rotate_None = 0,
		rotate_CW = 1,
		rotate_CCW = -1
	};

	point operator + (const point& p1, const point& p2)
	{
		point p(p1);
		p += p2;
		return p;
	}

	point operator / (const point& p1, double factor)
	{
		point p(p1);
		p /= factor;
		return p;
	}

	point operator * (const point& p1, double factor)
	{
		point p(p1);
		p *= factor;
		return p;
	}

	point operator * (double factor, const point& p1)
	{
		point p(p1);
		p *= factor;
		return p;
	}

	point operator - (const point& p1, const point& p2)
	{
		point p(p1);
		p -= p2;
		return p;
	}

	std::istream& operator >> (std::istream& is, point& p)
	{
		is >> p.x >> p.y;
		return is;
	}

	double get_norm(const point& p)
	{
		return sqrt(p.x * p.x + p.y * p.y);
	}

	double inner_product(const point& p1, const point& p2)
	{
		return p1.x * p2.x + p1.y * p2.y;
	}

} // namespace geometry


//-------------------------------------------------------------------------
// solution

using namespace geometry;

int main(void) {
	point p1, p2, pq, pr;
	string line;

	while (getline(cin, line)) {
		replace(line.begin(), line.end(), ',', ' ');
		istringstream ss(line);
		ss >> p1 >> p2 >> pq;

		p2 -= p1; // p1原点に移動
		pq -= p1;

		double theta = 2 * (pq.arg() - p2.arg());

		pr.x = pq.x * cos(theta) + pq.y * sin(theta);
		pr.y = -pq.x * sin(theta) + pq.y * cos(theta);

		pr += p1; // 元に戻す

		printf("%f %f\n", pr.x, pr.y);
	}

	return 0;
}

Measured memory_bytes: 1332
def xgcd(a, b):
    x0, y0, x1, y1 = 1, 0, 0, 1
    while b != 0:
        q, a, b = a // b, b, a % b
        x0, x1 = x1, x0 - q * x1
        y0, y1 = y1, y0 - q * y1
    return a, x0, y0

def modinv(a, m):
    g, x, y = xgcd(a, m)
    if g != 1:
        raise Exception('modular inverse does not exist')
    else:
        return x % m


def main():
    N = int(input())
    A = list(map(int, input().split()))
    mod = 10**9+7
    norm = 0
    for a in A:
        norm += a**2
        # norm = norm%mod
    ans = ((sum(A))**2 - norm) % mod
    ans = ans * modinv(2, mod)
    print(int(ans%mod))


if __name__ == '__main__':
    main()

Measured memory_bytes: 104220
#define _USE_MATH_DEFINES

#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <cmath>
using namespace std;

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

const ll MOD = 1e9 + 7;


int main(int argc, char* argv[]) {
	
	double r;
	cin >> r;

	cout << setprecision(10) << r * 2 * M_PI << endl;
	




}

Measured memory_bytes: 3752
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define For(i,n,k) for(int i=(n);i<(k);i++)
#define ALL(a)  (a).begin(),(a).end()
void Main(){
    int n,ans = 0;
    cin >> n;
    vector<vector<int>> tree(n);
    vector<int> vec(n,0);
    For(i,0,n-1){
        int a,b;
        cin >> a >> b;
        a--;
        b--;
        tree[a].emplace_back(b);
        tree[b].emplace_back(a);
    }
    priority_queue<int> pque;
    queue<int> que;
    For(i,0,n){
        int c;
        cin >> c;
        pque.push(c);
    }
    int nax = max_element(ALL(tree),[](auto l,auto r){
        return l.size() > r.size();
    }) - tree.begin();

    que.push(nax);
    vec[nax] = pque.top();
    pque.pop();

    while(!que.empty()){
        int now = que.front();
        que.pop();
        for(auto to:tree[now]){
            if(vec[to] > 0) continue;
            que.push(to);
            vec[to] = pque.top();
            pque.pop();
            ans += vec[to];
        }
    }
    cout << ans << endl;
    For(i,0,n) cout << vec[i] << " ";
    cout << endl;
}
int main(){
    Main();
    /*
    東方風神録は神が出てくるので当然神ゲー
    */
    return 0;
}

Measured memory_bytes: 1024
#include<stdio.h>
int main(void)
{
	int l,d,w,x;
	scanf("%d %d",&d,&l);
	w=d/l;
	if(d%l!=0){
		x=d-w*l;
		w=w+x;
	}
	printf("%d\n",w);
	return 0;
}
	


Measured memory_bytes: 2128
#include<iostream>
#include<cstdio>
#include<algorithm>

using namespace std;

const int maxn=105;

int n,ans,s[maxn];

void bubblesort()
{
	int flag=1;
	for(int i=0;flag;i++){
		flag=0;
		for(int j=n-1;j>=i+1;j--){
			if(s[j]<s[j-1]){
				swap(s[j],s[j-1]);
				ans++;
				flag=1;
			}
		}
	}
}

int main()
{
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		scanf("%d",&s[i]);
	}
	bubblesort();
	for(int i=0;i<n;i++){
		if(i!=0){
			printf(" ");
		}
		printf("%d",s[i]);
	}
	printf("\n");
	printf("%d\n",ans);
	return 0;
}
/*
5
5 3 2 4 1
*/


Measured memory_bytes: 3204
#include <bits/stdc++.h>
#define ll long long int
using namespace std;
const int MAX=1e5;
int n;
vector<int> stone(MAX);
vector<int> dp(MAX);
int calc(int ind){
    if(ind>=n-1){
        return 0;
    }
    if(dp[ind]!=-1){
        return dp[ind];
    }
    int ans;
    if(ind==n-2){
        ans=abs(stone[n-1]-stone[n-2]);
    }
    else{
        ans=min(abs(stone[ind+1]-stone[ind])+calc(ind+1),abs(stone[ind+2]-stone[ind])+calc(ind+2));
    }
    return dp[ind]=ans;
}
void solve(){
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>stone[i];
        dp[i]=-1;
    }
    int min_cost=calc(0);
    cout<<min_cost<<'\n';
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    solve();
    return 0;
}


Measured memory_bytes: 3328
#include<iostream>

using namespace std;

int main(void)
{
  int a,b,c,k; cin>>a>>b>>c>>k;
  int sum_a,sum_b,sum_c;
  
  if(k>=a){sum_a=1*a;}
  else{sum_a=1*k; cout<<sum_a<<endl; return 0;}
  
  if((k-a)>=0){sum_b=0*(k-a);}
  else{sum_b=0;}
  
  if((k-a-b)>=0){sum_c=-1*(k-a-b);}
  else{sum_c=0;}
  
  cout<<sum_a+sum_b+sum_c<<endl;
  return 0;
}

Measured memory_bytes: 3652
#include<iostream>
#include<math.h>
#include<stdlib.h>
#include<string>
#include<limits.h>
#include<vector>
#include<tuple>
using namespace std;
typedef long long ll;

const int MAX = 10000000;
int queue1[MAX];
int queue2[MAX];
int tail = 0, head = 0;
void init() {
	head = 0; tail = 0;
}

bool isEmpty() {
	return (head == tail);
}
bool isFull() {
	return (head==(tail+1)%MAX);
}
void enqueue(int v1, int v2) {
	if (isFull()) {
		return;
	}
	
	queue1[tail] = v1;
	queue2[tail] = v2;
	tail++;
	if (tail == MAX)tail = 0;
}
tuple<int ,int> dequeue() {
	if (isEmpty()) {
		return forward_as_tuple(-1,-1);
	}
	int res1 = queue1[head];
	int res2 = queue2[head];
	head++;
	if (head == MAX)head = 0;
	return forward_as_tuple(res1,res2);
}
int main() {
	int H, W;
	cin >> H >> W;
	vector<vector<bool>> s(H, vector<bool>(W, true));
	vector<vector<int>> ho(H, vector<int>(W, INT_MAX));
	int masu = 0;
	for (int i = 0; i < H; i++) {
		for (int j = 0; j < W; j++) {
			char c;
			cin >> c;
			if (c == '.') {
				s[i][j] = true;
				masu++;
			}
			else {
				s[i][j] = false;
			}
		}
	}
	ho[0][0] = 0;
	init();
	enqueue(0, 0);
	while (ho[H - 1][W - 1] == INT_MAX) {
		int a, b;
		if (isEmpty()) {
			cout << -1 << endl;

			return 0;
		}
		tie(a, b) = dequeue();
		
		if (a - 1 >= 0 && ho[a - 1][b] > ho[a][b] + 1&&s[a-1][b]) {
			ho[a - 1][b] = ho[a][b] + 1;
			enqueue(a - 1, b);
		}
		if (a + 1 < H && ho[a + 1][b] > ho[a][b] + 1&&s[a+1][b]) {
			ho[a + 1][b] = ho[a][b] + 1;
			enqueue(a + 1, b);
		}
		if (b - 1 >= 0 && ho[a][b - 1] > ho[a][b] + 1&&s[a][b-1]) {
			ho[a][b - 1] = ho[a][b] + 1;
			enqueue(a, b - 1);
		}
		if (b + 1 < W && ho[a][b + 1] > ho[a][b] + 1&&s[a][b+1]) {
			ho[a][b + 1] = ho[a][b] + 1;
			enqueue(a, b + 1);
		}
	}
	//cout << masu<<endl;
	
	cout << masu - ho[H - 1][W - 1]-1 << endl;
	return 0;
}


Measured memory_bytes: 2304
#include<iostream>
#include<string>
#include<string>
#include<cstdio>
#include<math.h>
#include<map>
#include<set>
#include<queue>
#include<vector>

using namespace std;

int main()
{
	int ans;
	int m_sum = 1;
	int sum = 1;
	int num;
	int n;
	cin >> num;
	for (int i = 0; i < num; i++) {
		cin >> n;
		sum *= 3;
		if (n % 2 == 0) {
			m_sum *= 2;
		}
	}
	ans = sum - m_sum;
	cout << ans << endl;
}

Measured memory_bytes: 256
package main

import "fmt"

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

	ans := 0
	memo := map[int]bool{}
	for i := 0; i < n; i++ {
		var mochi int
		fmt.Scan(&mochi)
		if !memo[mochi] {
			memo[mochi] = true
			ans++
		}
	}

	fmt.Println(ans)
}


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

int main(void) {
  string S;
  cin >> S;
  if (count(S.begin(), S.end(), 'a') != 0 &&
      count(S.begin(), S.end(), 'b') != 0 &&
      count(S.begin(), S.end(), 'c') != 0)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<algorithm>
using namespace std;
int A, B, C;
long long K;
int main() {
	scanf("%d%d%d%lld", &A, &B, &C, &K);
	if (K & 1)printf("%d\n", B - A);
	else printf("%d\n", A - B);
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1e6+5;
const int mod = 1e9+7;

int main(){
    int x;
    cin >> x;
    map < int , int > cnt;
    for(int i = 1; i <= x; i++){
        //I
        int cur_num = i;
        for(int j = 2; j*j <= cur_num; j++){
            while(cur_num % j == 0){
                cur_num /= j;
                cnt[j] ++;
            }
        }
        if(cur_num != 1){
            cnt[cur_num]++;
        }
    }
    ll ans = 1;
    map < int , int > :: iterator it = cnt.begin();
    for(; it != cnt.end(); it++){
        ans = (ans * ((it)->second + 1)) % mod;
        ans %= mod;

    }
    cout << ans << "\n";
}




Measured memory_bytes: 3628
#include<stack>
#include<cstdio>
#include<cstring>
using namespace std;

#define MAXN 200000
int N;
char str[MAXN+5];

int main(){
    scanf("%s",str+1);
    N=strlen(str+1);
    stack<char> S;
    for(int i=1;i<=N;i++){
        if(S.empty()){
            S.push(str[i]);
            continue;
        }
        char tmp=S.top();
        if(tmp=='S'&&str[i]=='T')
            S.pop();
        else
            S.push(str[i]);
    }
    printf("%d",S.size());
}


Measured memory_bytes: 640
import sys
n,yen = map(int,input().split())

for i in range(n + 1):
    for j in range(n + 1):
        k = n - (i + j)
        if 10000 * i + 5000 * j + 1000 * k == yen:
            if k < 0:
                continue
            print("{} {} {}".format(i,j,k))
            sys.exit()
print("-1 -1 -1")

Measured memory_bytes: 3064
(lambda f: f(f))(lambda this, atin=lambda line, yp, ri=lambda l: room.append([{xi: x} for xi, x in enumerate(l)]): [point.__setitem__("x", line.index("@")), point.__setitem__("y", yp), ri(line)] if "@" in line else ri(line), search=lambda xpoint, ypoint, srch, now: [room[ypoint][xpoint].__setitem__(xpoint, "@"), srch(xpoint - 1, ypoint, srch, now) + srch(xpoint + 1, ypoint, srch, now) + srch(xpoint, ypoint + 1, srch, now) + srch(xpoint, ypoint - 1, srch, now) + 1][1] if 0 <= xpoint < wh[0] and 0 <= ypoint < wh[1] and now(xpoint, ypoint) else 0, now=lambda xpoint, ypoint: room[ypoint][xpoint].get(xpoint) is ".": [globals().__setitem__("wh", list(map(int, input().split()))), globals().__setitem__("room", []), globals().__setitem__("point", {"x": None, "y": None}), [atin(input(), ypoint) for ypoint in range(wh[1])], [room[point["y"]][point["x"]].__setitem__(point["x"], "."), print(search(point["x"], point["y"], search, now)), this(this)] if room else None])

Measured memory_bytes: 8492
#include<stdio.h>
int main(void)
{
	int i, s[31],n;

	for (i = 1; i <= 30; i++)
	{
		s[i] = 0;
	}
	for (i = 1; i <= 28; i++)
	{
		scanf("%d", &n);
		s[n] = 1;
	}
	for (i = 1; i <= 30; i++)
	{
		if (s[i] == 0)
		{
			printf("%d\n", i);
		}
	}
return 0;
}

Measured memory_bytes: 1752
function Main(input) {
   
    var N = input[0].trim();

//	console.log("%s",N);

  	var result = N-1;
  	var a = Math.floor(Math.sqrt(N));
//	console.log("a:%s",a);

    
    do{
      
      if(N % a == 0){
         b = N / a;
         result = result > (a+b-2) ? (a+b-2) : result 
//	     console.log("a:%s b:%s result:%s",a,b,result);

//       break;
      }
      a--;

    }while(a>0)

    console.log("%s",result);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8").split("\n"));

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

#define int long long
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; }


signed main(){
	int n;
	cin >> n;

	int ans = 0;

	vector<int> tbl(n+10, 0);
	for(int i = 1;i <= n;i++){
		for(int j = i;j <= n;j+=i){
			tbl[j]++;
		}
	}

	for(int i = 1;i < n;i++){
		ans += tbl[i];
	}

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


Measured memory_bytes: 11040
import java.util.*

fun isInsideRect(W: Int, H: Int, x: Int, y: Int, r: Int) =
    x - r >= 0 && y - r >= 0 && x + r <= W && y + r <= H

fun main(args: Array<String>) {
    val scanner = Scanner(System.`in`)
    val W = scanner.nextInt()
    val H = scanner.nextInt()
    val x = scanner.nextInt()
    val y = scanner.nextInt()
    val r = scanner.nextInt()
    val yesOrNo = if (isInsideRect(W, H, x, y, r)) "Yes" else "No"
    println(yesOrNo)
}



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

int main()
{
    long n; std::cin >> n;
    std::vector<long> vec(n);
    for (long i = 0; i < n; ++i) std::cin >> vec[i];

    long maxdiff = -10000000000;
    long minr = vec[0];

    for (int i = 1; i < n; ++i) {
        maxdiff = std::max(maxdiff, vec[i]-minr);
        minr    = std::min(minr, vec[i]);
    }

    std::cout << maxdiff << std::endl;

    return 0;
}


Measured memory_bytes: 4400
#include<iostream>
using namespace std;
int n;
const int sz=1e5;
bool vis[sz][100];
int suma(int n)
{
    int res=0;
    while(n>0)
    {
        res+=n%10;
        n/=10;
    }
    return res;
}
void dfs(int r,int s)
{
    if(s>=99)return;
    if(vis[r][s])return;
    vis[r][s]=1;
    for(int i=0;i<10;i++)dfs((10*r+i)%n,s+i);
}
main()
{
    cin>>n;
    for(int i=0;i<n;i++)dfs(i,suma(i));
    int res=1e9;
    for(int i=1;i<99;i++)if(vis[0][i])res=min(res,i);
    cout<<res<<endl;
    return 0;
}

Measured memory_bytes: 233344
def readInt():
    return list(map(int, input().split()))
    
n,d = readInt()
ans = 0
for i in range(n):
    x,y = readInt()
    # print(x**2, y**2)
    if d**2 >= x**2+y**2:
        ans += 1
        
print(ans)

Measured memory_bytes: 69856
#include <bits/stdc++.h>
using namespace std;
#define ROUNDUP(divisor,dividend) (divisor + (dividend - 1)) / dividend
int n; double ans;
int main(){
  cin >> n;
  for (size_t i = 0; i < n; i++) {
    double a; string s;
    cin >> a >> s;
    ans += (s == "JPY" ? a : a*380000);
  }
  printf("%.10lf\n",ans);
}


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


int main(){
  int H,R;
  cin >> H >> R;

  if(H + R > 0){
    cout << 1 << endl;
  }else if(H < 0 && H + R == 0){
    cout << 0 << endl;
  }else if(H + R < 0){
    cout << -1 << endl;
  }
  
  return 0;
}



Measured memory_bytes: 3100
#include<iostream>
#include<queue>
#include<cstring>
using namespace std;
int main()
{
  int n;
  for(;cin>>n,n;)
    {
      int edge[n][n];
      int m;
      cin>>m;
      memset(edge,-1,sizeof(edge));
      for(int i=0;i<m;i++)
	{
	  int a,b,road;
	  char buf;
	  cin>>a>>buf>>b>>buf>>road;
	  edge[a][b]=road/100-1;
	  edge[b][a]=road/100-1;
	}
      bool closed[n];
      int cnt=n;
      int ans=0;
      memset(closed,true,sizeof(closed));
      priority_queue<pair<int,int>,vector<pair<int,int> >,greater<pair<int,int> > > qu;
      closed[0]=false;
      for(int i=0;i<n;i++)
	if(edge[0][i]!=-1)
	  {
	    qu.push(make_pair(edge[0][i],i));
	  }
      //      cout<<"start"<<endl;
      for(;!qu.empty();)
	{
	  int node=qu.top().second;
	  int cost=qu.top().first;
	  qu.pop();
	  if(!closed[node])
	    continue;
	  //	  cout<<node<<" "<<cost<<endl;
	  // cout<<cnt<<" "<<ans<<endl;
	  closed[node]=false;
	  ans+=cost;
	  cnt--;
	  if(cnt<=0)
	    break;
	  for(int i=0;i<n;i++)
	    if(edge[node][i]!=-1)
	      qu.push(make_pair(edge[node][i],i));
	}
      cout<<ans<<endl;
    }
  
}

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

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

    int a, b, c; cin >> a >> b >> c;

    if ((a*100 + b*10 + c)%4==0) cout << "YES";
    else cout << "NO";

    cout << "\n";    

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define LOOP(n) for (int _i = 0; _i < (n); _i++)
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define FOR(i, r, n) for (int i = (r); i < (n); ++i)
#define ALL(obj) begin(obj), end(obj)
using namespace std;
using ll = long long;
using ull = unsigned long long;

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

struct Edge {
    long long to;
};
using Graph = vector<vector<Edge>>;

int encode(int i, int j) {
    if (i < j) swap(i, j);
    return i * (i - 1) / 2 + j + 1;
}

int seen[2000000];  // 1:現在探索中のパスで行きがけ 2:探索後の頂点
int d[2000000];     // d[i]:= 始点から i への距離
int dfs(const Graph &G, int now) {
    if (seen[now] == 2) return d[now];
    seen[now] = 1;
    for (auto e : G[now]) {
        if (seen[e.to] == 1) {  // 閉路を検出
            cout << -1 << endl;
            exit(0);
        }
        chmax(d[now], dfs(G, e.to) + 1);
    }
    seen[now] = 2;
    return d[now];
}

int main() {
    long long N;
    cin >> N;
    Graph G(N * (N - 1) / 2 + 1);
    FOR(i, 0, N) {
        int now = 0;
        LOOP(N - 1) {
            int j;
            cin >> j;
            j--;
            int next = encode(i, j);
            G[now].push_back({next});
            now = next;
        }
    }

    cout << dfs(G, 0) << endl;
    return 0;
}


Measured memory_bytes: 33664
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		double n = sc.nextInt();
		sc.close();
		for (double c = 1; c <= 3500; c++) {
			double t1 = 4 * c / n - 1;
			if (t1 <= 0) {
				continue;
			}
			for (double b = 1; b <= 3500; b++) {
				double t2 =b * (4 * c / n - 1) - c ;
				if(t2 <= 0 ) {
					continue;
				}
				double t3 = b * c / (b * (4 * c / n - 1) - c);
				if (t3 < 1) {
					continue;
				}
				int t4 =(int) (b * c / (b * (4 * c / n - 1) - c));
				if (t3 == t4) {
					int a = t4;
					System.out.println(a + " " + (int)b + " " + (int)c);
					return;
				}
			}
		}
	}
}

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

using namespace std;

#define ll       long long
#define PII      pair<int, int>
#define READ(f)  freopen(f, "r", stdin)
#define WRITE(f) freopen(f, "w", stdout)

const int N = 3e5 + 5;
const int MOD = 1e9 + 7;
const double PI = 2 * acos(0.0);

ll lcm(ll a, ll b) {
  return a / __gcd(a, b) * b;
}

int main() {
    ll a, b;
    cin >> a >> b;
    cout << lcm(a, b) << '\n';
    return 0;
}


Measured memory_bytes: 764
import numpy as np

def getNearestValue(list, num):
    idx = np.abs(np.asarray(list) - num).argmin()
    return list[idx]

n = int(input())
t, a = list(map(int, input().split()))
h = list(map(int, input().split()))
tmps = []
for i in range(n):
    ave_t = t - h[i]*0.006
    tmps.append(ave_t)

target = getNearestValue(tmps,a)
print(tmps.index(target) + 1)

Measured memory_bytes: 18056
import Foundation

/*
// 1
let N = Int(readLine()!)!

// 1 2
let split = readLine()!.componentsSeparatedByString(" ")
let N = Int(split[0])!
let S = Int(split[1])!

// 1 2 3 4 5
let array = readLine()!.componentsSeparatedByString(" ").map { Int($0)! }
*/

let split = readLine()!.componentsSeparatedByString(" ")
let N = Int(split[0])!
let K = Int(split[1])!
var i = 0

func pow(_ number: Int, multiplier: Int) -> Int {
  var answer = 1
  for _ in 0 ..< multiplier {
    answer *= number 
  }
  return answer
}

while (true) {
  if N == 1 { print(1); break }
  if N < pow(K, multiplier: i) {
  	print(i)
    break
  }
  i += 1
}

Measured memory_bytes: 7904
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (n); ++i)
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;
}
using namespace std;
using ll = long long;
using P = pair<int, int>;
using Pl = pair<long long, long long>;
using veci = vector<int>;
using vecl = vector<long>;
using vecveci = vector<vector<int>>;
using vecvecl = vector<vector<long long>>;
#define INF 1e+9

vecveci dp(1010,veci(1010,0));

int main() {
    int Q; cin >> Q;
    while(Q--) {
        string S,T;
        cin >> S >> T;
        int n = S.size();
        int m = T.size();
        REP(i,n)REP(j,m) {
            if(S[i] == T[j]) dp[i+1][j+1] = dp[i][j] + 1;
            else dp[i+1][j+1] = max(dp[i+1][j],dp[i][j+1]);
        }
        cout << dp[n][m] << endl;
    }
}



Measured memory_bytes: 6668
#include<stdio.h>
#define N 20
#define Q 200
#define true 1
#define false 0

int A[N];
int n;

int solve(int i, int m){

  int res;

  if(m==0) return true;
  if(i>n) return false;

  res = solve(i+1,m) || solve(i+1,m-A[i]);

  return res;

}

int main(){

  int i,j,q,b,check=0;
  int M[Q];

  scanf("%d",&n);

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

  scanf("%d",&q);

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

  for(j=0;j<q;j++){
    i=0;
    if(solve(i,M[j])==true) {
      check++;
    }
    if(check!=0){
      printf("yes\n");
      check=0;
    }
    else printf("no\n");
  }

  return 0;
  
}




Measured memory_bytes: 2080
#pragma comment(linker, "/stack:20000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx")

#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>

#define se second
#define fi first
#define ss size()
#define pb push_back
#define mp make_pair
#define ins insert
#define ll long long
#define y1 y12313312312
#define endl '\n'
#define gcd __gcd
#define tm tadsadaagsd
#define next nqweqweeqeqe
#define er erase
#define int ll

using namespace std;
//using namespace __gnu_pbds;

//template <typename T> using ordered_set = tree<T, null_type, std::less<T>, rb_tree_tag, tree_order_statistics_node_update>;

const int N = 1e5 + 40, T = 4 * N, logN = (int)log2(N) + 2, inf = 1e9 + 7, sx[4] = {1, -1, 0, 0}, sy[4] = {0, 0, 1, -1};

int n, m, r, l, e, o, z, ts, id, mx, mn = inf, w;
int a, b, c;
ll f;

void freop()
{
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
}

void boos()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
}

int bp (int x, int y) {
	if (y == 0) return 1;
	if (y % 2 == 1) return bp(x, y - 1) * x;
	else
    {
		int asd = bp(x, y / 2);
		return asd * asd;
	}
}

main()
{
    int x, y;
    setprecision(9);
    //freop();
    boos();
    cin >> a >> b >> c;
    cout << c << " " << a << " " << b;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define FOR(i,l,r) for(long long i=(l);i<(r);++i)
#define REP(i,n) FOR(i,0,n)
#define REPS(i,n) FOR(i,1,n+1)
#define RFOR(i,l,r) for(long long i=(l);i>=(r);--i)
#define RREP(i,n) RFOR(i,n-1,0)
#define RREPS(i,n) RFOR(i,n,1)
#define int long long
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define SZ(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
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;
}
const int INF=1e18;
const int MOD=1e9+7;

signed main(){
    int n;cin>>n;
    int spe=2;
    int ans=0;
    REP(i,n){
        int a;cin>>a;
        if(i==0){
            ans+=a-1;
            continue;
        }
        if(a==spe){
            spe++;
            continue;
        }
        ans+=(a%spe!=0?a/spe:a/spe-1);
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 256
//Utkarsh-raj
 
#include<bits/stdc++.h>
 
#define ll long long int
#define vc vector
#define mod 100000000007
#define mp make_pair
#define pb push_back
#define nl cout<<endl;
#define ff first
#define ss second
 
using namespace std;
 
const ll MAX = 1e9+5;
 
int main()
{
    ifstream myFile("task.in");
    if(!myFile.fail())
    {
        assert(freopen("task.in", "r", stdin));
    }
 
    ll n, w;
    cin>>n>>w;
 
    ll max_value = 100000;
 
    vector<ll> dp(max_value+1, MAX);
    dp[0] = 0;
 
    ll cost[n+1], weight[n+1];
    for(ll i=1; i<=n; i++){
        cin>>weight[i]>>cost[i];
    }
 
    for(ll i=1; i<=n; i++){
        vector<ll> v(max_value+1, MAX);
        v[0] = 0;
 
        for(ll j=1; j<=max_value; j++){
            if(cost[i] <= j){
                v[j] = dp[j - cost[i]] + weight[i];
            }
 
            v[j] = min(v[j], dp[j]);
        }
        dp = v;
    }
 
    ll ans = 0;
    for(ll i=1; i<=max_value; i++){
        if(dp[i] <= w){
            ans = max(ans, i);
        }
    }
 
    cout<<ans<<endl;
 
    return 0;
}

Measured memory_bytes: 1792
#include<stdio.h>
 
int main()
{
  int n,i,j,sum,c;
  while(1){
    c=0;
    scanf("%d",&n);
    if(n==0)break;
    for(i=1;i<=n/2;i++){
      sum=0;
      for(j=i;j<=n;j++){
	sum+=j;
	if(sum==n){c++;break;}
      }
    }
    printf("%d\n",c);
  }

  return 0;
}
 

Measured memory_bytes: 600
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.stream.IntStream;
import java.util.stream.Stream;
import java.util.Collection;
import java.util.Scanner;
import java.util.Collections;
import java.util.ArrayList;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int m = in.nextInt();
            ArrayList<Integer> map = new ArrayList<>();
            ArrayList<Integer> sub = new ArrayList<>();
            for (int i = 0; i < m; i++) {
                map.add(in.nextInt());
            }

            Collections.sort(map);
            int ans = 0;
            if (n <= m) {
                for (int i = 0; i < map.size(); i++) {
                    if (i != 0) {
                        sub.add(map.get(i) - map.get(i - 1));
                    }
                }

                Collections.sort(sub);

                ans = sub.stream().mapToInt(Integer::intValue).sum();


                for (int i = 1; i <= n - 1; i++) {
                    ans -= sub.get(sub.size() - i);
                }
            } else {
                ans = 0;
            }

            out.print(ans);
        }

    }
}



Measured memory_bytes: 62068
package main

import (
        "fmt"
)

func solution(a, b, c, x, y int) int {
        d := a*x + b*y
        s := 0
        if x < y {
                s = 2*c*x + ((y - x) * b)
        } else {
                s = 2*c*y + ((x - y) * a)
        }
        p := c * 2 * max(x, y)

        return min(p, min(d, s))
}

func min(x, y int) int {
        if x < y {
                return x
        }
        return y
}
func max(x, y int) int {
        if x > y {
                return x
        }
        return y
}
func main() {
        var a, b, c, x, y int
        fmt.Scan(&a, &b, &c, &x, &y)
        fmt.Println(solution(a, b, c, x, y))
}

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

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

int main(){
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	cout<<setprecision(32);

	// 4, 5, 7, 8, 9
	// 5, 6, 8, 9, 4
	// 6, 7, 9, 4, 5
	// 7, 8, 4, 5, 6
	ll k; cin>>k;
	ll tmp = k%50;
	vector<ll> st(50);
	for(int i = 0; i < 50; i++){
		st[i] = i;
	}
	for(int i = 0; i < tmp; i++){
		st[49 - i]++;
	}
	k /= 50;
	cout<<50<<'\n';
	for(int i = 0; i < 50; i++){
		cout<<st[i] + k<<" ";
	}

	return 0;
}

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

int main() {
	int n;
	cin >> n;
	int ans;
	for(int i = 0; i < n; ++i) {
		int x;
		cin >> x;
		if(i == 0)	
			ans = x;
		else
			ans = __gcd(x, ans);
	}
	cout << ans;
	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		long N = sc.nextInt();
		int K = sc.nextInt();
		long count = K;
		for (int i = 0; i < N - 1; i++) {
			count *= (K - 1);
		}
		System.out.println(count);
		sc.close();
	}
}

Measured memory_bytes: 23764
#include <stdio.h>

int main(void) {
    
    int i;
    int x;
    int n;

    scanf("%d", &n);
    i = 1;

    // CHECK_NUM:
    do {
        if(i % 3 == 0) {
            printf(" %d", i);
            continue;  // goto END_CHECK_NUM;
        }
        x = i;

        // INCLUDE3:
        do {
            if(x % 10 == 3) {
                printf(" %d", i);
                break; // goto END_CHECK_NUM;
            }
            x /= 10;
        }
        while(x);      //goto INCLUDE3

    }
    // END_CHECK_NUM:
    while(++i <= n);   //goto CHECK_NUM

    printf("\n");

    return 0;
}

Measured memory_bytes: 600
H,W = map(int, input().split())
a = ['']*(H+2)
for h in range(H+2):
    if h == 0 or h == H+1:
        a[h] = '#'*(W+2)
    else:
        a[h] = '#' + input() + '#'
    
mod = 10**9+7
dp = [[0] * (W+2) for i in range(H+2)] #dp[h][w]
dp[1][1] = 1
dxy  = ([1,0],[0,1])

for i in range(1,H+1): 
    for j in range(1,W+1):
        for dx,dy in dxy:
            if a[i+dx][j+dy] == '.':
                dp[i+dx][j+dy] += dp[i][j]
                dp[i+dx][j+dy] %= mod

print(dp[H][W])

Measured memory_bytes: 55260
n, d = map(int, input().split())
x = [[int(i) for i in input().split()] for i in range(n)] 
dist2 = 0
count = 0
for i in range(n-1):
    for j in range(i+1,n):
        for k in range(d):
            dist2 += (x[i][k]-x[j][k])**2
        dist = dist2**0.5 
        dist2=0
        if dist.is_integer():
            count += 1 
print(count)

Measured memory_bytes: 3064
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>

#include <numeric>
using namespace std;


int main(){
	long long N;
	int W, a, b,aw,bw;
	cin >> W >> a >> b;
	if (a > b) swap(a, b);
	aw = a + W;
	bw = b + W;
	int ans = (b - aw < 0) ? 0 : b - aw;
	cout << ans << endl;

	
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repr(i, n) for (int i = (n); i >= 0; --i)
#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define FORR(i, m, n) for (int i = (m); i >= (n); --i)
#define equals(a, b) (fabs((a) - (b)) < EPS)
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
const ll mod2 = 998244353;
const ll INF = 1e18;
const long double EPS = 1e-10;
const int MAX = 50;

vector<int> G[MAX];

int n, m;
vector<pair<int, int>> e, p;

vector<int> parent(MAX, -1), d(MAX, 0);

void dfs(int u) {
  for (int v: G[u]) {
    if (parent[v] != -1 || v == 0) continue;
    parent[v] = u;
    d[v] = d[u] + 1;
    dfs(v);
  }
}


int finde(int u, int v) {
  if (u > v) swap(u, v);
  rep(i, n) {
    if (e[i].first == u && e[i].second == v) return i;
  }
  return -1;
}

int main() {
  cin >> n;
  e.resize(n - 1);
  rep(i, n - 1) {
    cin >> e[i].first >> e[i].second;
    e[i].first--, e[i].second--;
    if (e[i].first > e[i].second) swap(e[i].first, e[i].second);
    G[e[i].first].push_back(e[i].second);
    G[e[i].second].push_back(e[i].first);
  }
  cin >> m;
  p.resize(m);
  rep(i, m) {
    cin >> p[i].first >> p[i].second;
    p[i].first--, p[i].second--;
  }

  dfs(0);
  vector<int> es[m];
  rep(i, m) {
    int u = p[i].first, v = p[i].second;
    while (u != v) {
      if (d[u] >= d[v]) {
        es[i].push_back(finde(u, parent[u]));
        u = parent[u];
      }
      else {
        es[i].push_back(finde(v, parent[v]));
        v = parent[v];
      }
    }
  }

  ll ans = 1;
  rep(i, n - 1) ans *= 2;
  FOR(i, 1, (1 << m)) {
    vector<bool> a(n - 1, false);
    int t = i, cnt = 0, cnt2 = 0;
    rep(i, m) {
      if (t & 1) {
        cnt2++;
        rep(j, es[i].size()) {
          if (!a[es[i][j]]) {
            cnt++;
            a[es[i][j]] = true;
          }
        }
      }
      t /= 2;
    }
    ll res = 1;
    rep(i, n - 1 - cnt) res *= 2;
    if (cnt2 & 1) res *= -1;
    ans += res;
  }
  cout << ans << endl;


















  
  return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#define FF first
#define SS second
const int maxL = 3010;
string s, t;
int dp[maxL][maxL];
pair<int, int> path[maxL][maxL];
int main()
{
	cin >> s >> t;
	s = "$" + s;
	t = "$" + t;
	for(int i = 1; i <= s.size() - 1; i++) for(int j = 1; j <= t.size() - 1; j++)
		if(s[i] == t[j])
		{
			dp[i][j] = dp[i - 1][j - 1] + 1;
			path[i][j] = make_pair(i - 1, j - 1);
		}
		else
		{
			if(dp[i - 1][j] > dp[i][j - 1])
			{
				dp[i][j] = dp[i - 1][j];
				path[i][j] = make_pair(i - 1, j);
			}
			else
			{
				dp[i][j] = dp[i][j - 1];
				path[i][j] = make_pair(i, j - 1); 
			}
		}
	int nx = s.size() - 1, ny = t.size() - 1;
//	cout << dp[nx][ny] << " " <<endl;
	vector<char> ans; 
	while(nx && ny)
	{
//		cout << nx << " " << ny << endl;
		if(s[nx] == t[ny]) ans.push_back(s[nx]);
		auto tmp = path[nx][ny];
		nx = tmp.FF;
		ny = tmp.SS;
	}
	reverse(ans.begin(),ans.end());
	for(auto it : ans) cout<<it;
	cout<<endl;
	return 0;
}

Measured memory_bytes: 106368
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	ArrayList<Integer>[] g;
	int[][] dist;

	void run() {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		g = new ArrayList[2 * N - 1];
		dist = new int[2 * N - 1][2 * N - 1];
		for (int i = 0; i < 2 * N - 1; ++i)
			for (int j = 0; j < 2 * N - 1; ++j)
				if (i != j)
					dist[i][j] = Integer.MAX_VALUE / 3;
		for (int i = 0; i < g.length; ++i)
			g[i] = new ArrayList<>();
		for (int i = 0; i < N - 1; ++i) {
			int a = sc.nextInt() - 1;
			int b = sc.nextInt() - 1;
			g[a].add(N + i);
			g[N + i].add(a);
			g[b].add(N + i);
			g[N + i].add(b);
			dist[a][N + i] = 1;
			dist[N + i][a] = 1;
			dist[b][N + i] = 1;
			dist[N + i][b] = 1;
		}
		N = 2 * N - 1;
		for (int k = 0; k < N; ++k)
			for (int i = 0; i < N; ++i)
				for (int j = 0; j < N; ++j)
					dist[i][j] = Math.min(dist[i][j], dist[i][k] + dist[k][j]);

		int A = Integer.MAX_VALUE / 3;
		long B = Long.MAX_VALUE / 3;
		for (int root = 0; root < N; ++root) {
			int R = 0;
			for (int v = 0; v < N; ++v)
				R = Math.max(R, dist[root][v]);
			int a = R / 2 + 1;
			long L = 1;
			for (int dep = 0; dep < R; ++dep) {
				int mx = 0;
				for (int v = 0; v < N; ++v) {
					if (dep != dist[root][v])
						continue;
					mx = Math.max(mx, g[v].size());
				}
				if (dep != 0)
					--mx;
				L *= mx;
			}
			if (A > a || (A == a && L < B)) {
				A = a;
				B = L;
			}
		}
		System.out.println(A + " " + B);

	}

	public static void main(String[] args) {
		new Main().run();
	}

	void tr(Object... objects) {
		System.out.println(Arrays.deepToString(objects));
	}

}


Measured memory_bytes: 25372
#!usr/bin/env python3
def LI(): return list(map(int, input().split()))
def II(): return int(input())
def LS(): return input().split()
def S(): return input()
def LIR(n): return [LI() for i in range(n)]

#A
a,b,c = map(int, input().split())
if a+b >= c:
    ans = b+c
else:
    ans = b*2+a+1
print(ans)

#B

#C

#D

#E

#F

#G

#H

#I

#J

#K

#L

#M

#N

#O

#P

#Q

#R

#S

#T


Measured memory_bytes: 38448
use std::collections::HashSet;

macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        n: u32,
        s: [String; n],
    };

    let uniq: HashSet<&String> = s.iter().collect();
    println!("{}", uniq.len());
}


Measured memory_bytes: 17380
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws Exception {
	    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

	    String line = br.readLine();
	    int n = Integer.parseInt(line);

	    String[] str_x = br.readLine().split(" ");
	    String[] str_y = br.readLine().split(" ");

	    double[] x = new double[n];
	    double[] y = new double[n];

	    double d1 = 0d;
	    double d2 = 0d;
	    double d3 = 0d;
	    double di = 0d;

	    for (int i = 0; i < n; i++) {
	    	x[i] = Double.parseDouble(str_x[i]);
	    	y[i] = Double.parseDouble(str_y[i]);
	    }

	    StringBuilder sb = new StringBuilder();
	    for (int i = 0; i < n; i++) {
		    // p = 1
	    	d1 += Math.abs(x[i] - y[i]);

	    	// p = 2
	    	d2 += Math.pow(Math.abs(x[i] - y[i]), 2);

	    	// p = 3
	    	d3 += Math.pow(Math.abs(x[i] - y[i]), 3);

	    	// p = infinity
	    	if (di < Math.abs(x[i] - y[i])) {
	    		di = Math.abs(x[i] - y[i]);
	    	}
	    }

    	sb.append(d1).append("\n");
    	sb.append(Math.sqrt(d2)).append("\n");
    	sb.append(Math.cbrt(d3)).append("\n");
    	sb.append(di).append("\n");

	    System.out.print(sb.toString());
	}
}

Measured memory_bytes: 24552
import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 19
MOD = 10 ** 19 + 7
EPS = 10 ** -10

N = INT()
if N % 9 == 0:
    Yes()
else:
    No()


Measured memory_bytes: 9788
#include <cstdio>
#include <algorithm>

const int maxn=200000;
const int maxl=28;

long long a[maxn+10],b[maxn+10],ans,c[maxn+10],d[maxn+10];
int n;

int main()
{
  scanf("%d",&n);
  for(register int i=1; i<=n; ++i)
    {
      scanf("%I64d",&a[i]);
    }
  for(register int i=1; i<=n; ++i)
    {
      scanf("%I64d",&b[i]);
    }
  for(register int k=0; k<=maxl; ++k)
    {
      long long t=1<<k,tot=0;
      for(register int i=1; i<=n; ++i)
        {
          c[i]=a[i]%(2*t);
          d[i]=b[i]%(2*t);
        }
      std::sort(c+1,c+n+1);
      std::sort(d+1,d+n+1);
      int w=n,x=n,y=n,z=n;
      for(register int i=1; i<=n; ++i)
        {
          while(w&&(c[i]+d[w]>=t))
            {
              --w;
            }
          while(x&&(c[i]+d[x]>=2*t))
            {
              --x;
            }
          while(y&&(c[i]+d[y]>=3*t))
            {
              --y;
            }
          while(z&&(c[i]+d[z]>=4*t))
            {
              --z;
            }
          tot+=x-w+y-z;
        }
      if(tot&1)
        {
          ans+=t;
        }
    }
  printf("%I64d\n",ans);
  return 0;
}


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

int main () {
  ll N;
  cin >> N;
  
  vector<char> c;
  do {
    if (N % 26 == 0) {
      c.push_back('z');
	  N = N / 26 - 1;
    } else {
      c.push_back((char)(N % 26 + 96));
      N /= 26;
    }
  } while (N > 0);
  reverse(c.begin(), c.end());
  for (char C : c) cout << C;
}

Measured memory_bytes: 3640
#include <iostream>
#include <queue>
#include <vector>

using namespace std;

int main(int argc, char const *argv[])
{
    int N, Q;
    cin >> N >> Q;
    vector<vector<int>> to(N);
    vector<int> score(N, 0);
    for (int i = 1; i < N; i++) {
        int a, b;
        cin >> a >> b;
        a--; b--;
        to[a].push_back(b);
    }
    
    for (int i = 0; i < Q; i++) {
        int p, x;
        cin >> p >> x;
        p--;
        score[p] += x;
    }
    // cout << "store input" << endl;
    queue<int> que;
    que.push(0);
    while (!que.empty()) {
        // cout << "que size: " << que.size() << endl;
        int node = que.front();
        // cout << "node: " << node << endl;
        que.pop();
        // cout << "childs: ";
        for (auto child: to[node]) {
            score[child] += score[node];
            que.push(child);
            // cout << child << ", ";
        }
        // cout << endl;
    }
    for (int i = 0; i < N; i++) {
        cout << score[i];
        if (i != N - 1) {
            cout << " ";
        } else {
            cout << endl;
        }
    }
    return 0;
}


Measured memory_bytes: 14080
#include<iostream>

using namespace std;

int main() {
	int n;
	cin >> n;
	long long ans = 0;
	for (int i = 1;i <= n;i++) {
		for (int j = i;j <= n;j += i) {
			ans += j;
		}
	}
	cout << ans << endl;
}

Measured memory_bytes: 3144
//Bismillahir Rahmanir Rahim
#include<bits/stdc++.h>
#define PI             acos(-1.0)
#define IOS            ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ms(a,b)         memset(a, b, sizeof(a))
#define filein      freopen("input.txt", "r", stdin);
#define fileout     freopen("output.txt", "w", stdout);
#define debug       cout<<"Hello, i am in here."<<endl;
#define bit_cnt(mask) __builtin_popcountll(mask)
#define ll long long int
#define dst(u,v,x,y) sqrt((x*1.0-u*1.0)*(x*1.0-u*1.0)+(y*1.0-v*1.0)*(y*1.0-v*1.0))
template <class T> inline T bigmod(T p,T e,T M){ll ret = 1;for(; e > 0; e >>= 1){if(e & 1) ret = (ret * p) % M;p = (p * p) % M;}return (T)ret;}
template <class T> inline T modinverse(T a,T M){return bigmod(a,M-2,M);}   // M is prime}
template <class T> inline T bpow(T p,T e){ll ret = 1;for(; e > 0; e >>= 1){if(e & 1) ret = (ret * p);p = (p * p);}return (T)ret;}
using namespace std;
const int MOD = (int)1e9+7;
void solve()
{
  ll n;
  ll sum=0;
  cin>>n;
  for(ll i=1;i<=n;i++)
  {
    if(i%3==0)continue;
    else if(i%5==0)continue;
    else sum+=i;
  }
  cout<<sum<<endl;
}
int  main()
{
    IOS
    solve();
    return 0;
}


Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
int main(){
	int n, m; cin >> n >> m;
	vector<int> a(n, 0), q(n, 1);
	a[0] = 1;
	for(int i = 0; i < m; i++){
		int x, y; cin >> x >> y;
		x--; y--;	
		a[y] |= a[x];
		q[x]--;
		q[y]++;
		if(q[x] == 0) a[x] = 0;
	}
	cout << accumulate(a.begin(), a.end(), 0) << endl;
	return 0;
}


Measured memory_bytes: 1024
#include <iostream>


using namespace std;

int main(void) {

	int a, b, c;
	cin >> a >> b >> c;

	int counter = 0;
	for(int i=a;i<=b;i++) {
		if(c % i == 0) {
			counter++;
		}
	}

	cout << counter << endl;

	return 0;
}

Measured memory_bytes: 1160
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#ifdef ENABLE_DEBUG
#define dump(a) cerr<<#a<<"="<<a<<endl
#define dumparr(a,n) cerr<<#a<<"["<<n<<"]="<<a[n]<<endl
#else
#define dump(a) 
#define dumparr(a,n) 
#endif
#define FOR(i, a, b) for(ll i = (ll)a;i < (ll)b;i++)
#define For(i, a) FOR(i, 0, a)
#define REV(i, a, b) for(ll i = (ll)b-1LL;i >= (ll)a;i--)
#define Rev(i, a) REV(i, 0, a)
#define REP(a) For(i, a)
#define SIGN(a) (a==0?0:(a>0?1:-1))

typedef long long int ll;
typedef unsigned long long ull;
typedef unsigned int uint;
typedef pair<ll, ll> pll;
typedef pair<ll,pll> ppll;
typedef vector<ll> vll;
typedef long double ld;
typedef pair<ld,ld> pdd;

const ll INF=(1LL<<60);
#if __cplusplus<201700L
ll gcd(ll a, ll b) {
  a=abs(a);
  b=abs(b);
  if(a==0)return b;
  if(b==0)return a;
  if(a < b) return gcd(b, a);
  ll r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b;
}
#endif
template<class T>
bool chmax(T& a,const T& b){
  if(a<b){
    a=b;
    return true;
  }
  return false;
}
template<class T>
bool chmin(T& a,const T& b){
  if(a>b){
    a=b;
    return true;
  }
  return false;
}
template<class S,class T>
std::ostream& operator<<(std::ostream& os,pair<S,T> a){
  os << "(" << a.first << "," << a.second << ")";
  return os;
}
template<class T>
std::ostream& operator<<(std::ostream& os,vector<T> a){
  os << "[ ";
  REP(a.size()){
    os<< a[i] << " ";
  }
  os<< " ]";
  return os;
}


void solve(long long K, std::string S){
  if(S.size()<=K){
    cout<<S<<endl;
  }else{
    cout<<S.substr(0,K)<<"..."<<endl;
  }
}

int main(){
  cout<<setprecision(1000);
    long long K;
    scanf("%lld",&K);
    std::string S;
    std::cin >> S;
    solve(K, S);
    return 0;
}


Measured memory_bytes: 3688