akhauriyash/Code-Regression huggingface dataset:
def main():
    N=int(input())
    flag=0
    tmp=0
    a=0
    for tmp in range(1,1000):
        if tmp*(tmp-1)//2==N:
            flag=1
            break
    if flag==0:
        print('No')
        exit()
    else:
        print('Yes')
        print(tmp)
    lst=[[]]*tmp
    for i in range(1,tmp):
        for j in range(i):
            a+=1
            lst[i]=lst[i]+[str(a)]
            lst[j]=lst[j]+[str(a)]
    for i in range(tmp):
        print(tmp-1, " ".join(lst[i]))

main()


Measured memory_bytes: 17012
//おまじない
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <utility>
#define INF 1e9+7
#define rep(i,m,n) for(int i=m;i<n;i++)
#define mrep(i,m,n) for(int i=m;i>n;i--)
#define NO cout<<"NO"<<endl;
#define YES cout << "YES"<<endl;
#define No cout << "No"<<endl;
#define Yes cout << "Yes"<<endl;
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;


//(int)'a'は97 (int)'A'は65 (int)'1'は49
//おまじない

int main(){

	const int  MAX = 200000;
	int n;
	vector<string> a;
	vector<string> b(MAX);

	cin >> n;

	rep(i, 0, n) {
		string c;
		cin >> c;
		a.push_back(c);
	}

	rep(i, 0, n / 2) {
		b[i] = a[n - 1 - (i * 2)];
	}
	rep(i, 0, n / 2) {
		b[n - 1 - i ] = a[n - 2 - (i * 2)];
	}

	

	if (n % 2 == 1)b[n / 2] = a[0];

	rep(i, 0, n) {
		cout << b[i];
		if (i != n - 1) {
			cout << ' ';
		}
	}

	cout << endl;

	return 0;
}

Measured memory_bytes: 17520
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
import java.util.stream.Collectors;

public class Main {

    public static void main(String[] args) throws Exception {
        Scanner sn = new Scanner(System.in);
        Input input = InputParser.perse(sn, 1);
        sn.close();

        Integer n = input.getInt(1, 1);
        Integer m = input.getInt(1, 2);

        String out = n == m ? "Yes" : "No";
        System.out.println(out);
    }

    private static class InputParser {
        static Input perse(Scanner sn, int line) {
            Input result = new Input();
            while (line-- > 0) {
                String[] args = sn.nextLine().split(" ");
                result.addAll(args);
            }
            return result;
        }
    }

    private static class Input {
        private Map<Integer, Map<Integer, String>> inputs;
        private int now = 1;
        private int innerNext = 1;

        Input() {
            inputs = new HashMap<>();
            inputs.put(now, new HashMap<>());
        }

        void addAll(String[] args) {
            for (String str : args) {
                add(str);
            }
            next();
        }

        void add(String str) {
            inputs.get(now).put(innerNext++, str);
        }

        void next() {
            inputs.put(++now, new HashMap<>());
            innerNext = 1;
        }

        String getString(int i, int j) {
            return inputs.get(i).get(j);
        }

        int getInt(int i, int j) {
            return Integer.parseInt(getString(i, j));
        }

        double getDouble(int i, int j) {
            return Double.parseDouble(getString(i, j));
        }

        List<Integer> getIntLine(int i) {
            return inputs.get(i).entrySet().stream().map(e -> Integer.parseInt(e.getValue()))
                    .collect(Collectors.toList());
        }

        List<Integer> getIntVerticalLine(int line, int start, int size) {
            List<Integer> list = new ArrayList<>();
            for(int i = start; i < start + size; i++) {
                list.add(getInt(i, line));
            }
            return list;
        }
    }
}


Measured memory_bytes: 21844
#include<bits/stdc++.h>
#define SIZE 100005
using namespace std;
typedef long long ll;
typedef pair<int,int> P;

int n,s[105];

int main(){
	while(1){
		cin >> n;
		int sum=0;
		if(n==0) break;
		for(int i=0;i<n;i++) cin>>s[i];
		sort(s,s+n);
		for(int i=1;i<n-1;i++) sum+=s[i];
		cout << sum/(n-2) <<endl;
	}
	return 0;
}


Measured memory_bytes: 3160
#include<iostream>
#include<string>
#include<vector>
#include<queue>
#include<algorithm>
using namespace std;
int main(void){
	while(1){
int n;
cin>>n;
if(n==0)break;
int ans=0,w=0;
for(int i=1;i<n/2+1;i++){
	w=0;
	for(int j=i;j<n;j++){
	w+=j;
	if(w==n)ans++;
	if(w>=n){
		w=0;
		break;
	}
	}


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



Measured memory_bytes: 3000
#include<cstdio>
#include<cstring>
#include<cmath>
#include<bitset>
#include<iostream>
#include<algorithm>
#include<string>
#include<utility>
#include<tuple>
#include<vector>
#include<list>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<numeric>
#include<functional>
#include<iomanip>
#include<random>

#define IOS ios::sync_with_stdio(false),cin.tie(0)
#define REP(i,n) for(int i = 0;i < n;i++)
#define FOR(i,a,b) for(int i = a;i < b;i++)
#define MEM(a,b) memset(a,b,sizeof(a))
#define ALL(x) (x).begin(),(x).end()
#define LMAX 9223372036854775807
#define LMIN -9223372036854775808

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef pair<ull, ull> UP;
typedef tuple<int, int, int> T;

struct UnionFind {
	vector<int> data;
	UnionFind(int size) : data(size, -1) {}
	void unionSet(int x, int y) {
		x = root(x), y = root(y);
		if (x != y) {
			if (data[y] < data[x])swap(x, y);
			data[x] += data[y]; data[y] = x;
		}
	}
	bool findSet(int x, int y) {
		return root(x) == root(y);
	}
	int root(int x) {
		return data[x] < 0 ? x : data[x] = root(data[x]);
	}
	int size(int x) {
		return -data[root(x)];
	}
};

int gcd(int a, int b) {
	if (a < b)swap(a, b);
	int k = a % b;
	if (k == 1)return 1;
	if (k == 0)return b;
	int ans = gcd(b, k);
	return ans;
}
int digisum(ll a) {
	int sum = 0;
	while (a) {
		sum += a % 10;
		a /= 10;
	}
	return sum;
}


int main() {
	int n;
	cin >> n;
	bool w = false;

	REP(i, n) {
		char a;
		cin >> a;
		if (a == 'Y')w = true;
	}
	cout << (w ? "Four" : "Three") << endl;
}



Measured memory_bytes: 256
object Main extends App {

  def move(i: Int)(c: Char): Char =
    if (c == ' ' || c == '.') c
    else ((c.toInt + i - 97) % 26 + 97).toChar

  def decryption(line: String) =
    (0 until 26)
      .map(i => line.map(move(i)).toString)
      .filter(l => Set("this", "that", "the").exists(l.contains))
      .head

  Stream
    .continually(readLine)
    .takeWhile(_ != null)
    .map(decryption)
    .foreach(println)
}


Measured memory_bytes: 44232
import sys
sys.setrecursionlimit(1000000)

nVertices = int(input())
edges = [[] for _ in range(nVertices + 1)]
length = {}
for _ in range(nVertices - 1):
    u, v, l = map(int, input().split())
    edges[u].append(v)
    edges[v].append(u)
    if u > v:
        u, v = v, u
    length[(u, v)] = l
color = [None] * (nVertices + 1)
color[1] = 0

def dfs(par, v):
    for child in edges[v]:
        if child != par:
            key = (min(v, child), max(v, child))
            if length[key] & 1 == 0:
                color[child] = color[v]
            else:
                color[child] = color[v] ^ 1
            dfs(v, child)

dfs(0, 1)
print('\n'.join(map(str, color[1:])))

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

int main() {
  string s;
  cin >> s;
  sort(s.begin(), s.end());
  string uni_s = s;

  uni_s.erase(unique(uni_s.begin(),uni_s.end()), uni_s.end());

  if(uni_s.size() == s.size()) {
    cout << "yes" << endl;
  } else {
    cout << "no" << endl;
  }
}

Measured memory_bytes: 3628
#include <bits/stdc++.h>
#include <cstddef>
#include <type_traits>

// lib/pow2.hpp
#ifndef POW2_HPP
#define POW2_HPP

/*
usage:

tools::pow2(5) => 32
*/


namespace tools {
  template <typename T, typename std::enable_if<std::is_unsigned<T>::value, std::nullptr_t>::type = nullptr>
  constexpr T pow2(const T x) {
    return static_cast<T>(1) << x;
  }

  template <typename T, typename std::enable_if<std::is_signed<T>::value, std::nullptr_t>::type = nullptr>
  constexpr T pow2(const T x) {
    return static_cast<T>(static_cast<typename std::make_unsigned<T>::type>(1) << static_cast<typename std::make_unsigned<T>::type>(x));
  }
}

#endif

// main.cpp

constexpr std::int_fast64_t layer_count(const std::int_fast64_t level) {
  return tools::pow2(level + 2) - 3;
}
constexpr std::int_fast64_t patty_count(const std::int_fast64_t level) {
  return tools::pow2(level + 1) - 1;
}
std::int_fast64_t patty_count(const std::int_fast64_t level, std::int_fast64_t x) {
  if (level == 0) return x;
  if (x <= 1) return 0;
  --x;
  if (x <= layer_count(level - 1)) return patty_count(level - 1, x);
  x -= layer_count(level - 1);
  if (x <= 1) return patty_count(level - 1) + 1;
  --x;
  if (x <= layer_count(level - 1)) return patty_count(level - 1) + 1 + patty_count(level - 1, x);
  return patty_count(level);
}

int main() {
  std::int_fast64_t n, x;
  std::cin >> n >> x;
  std::cout << patty_count(n, x) << std::endl;
  return 0;
}

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

#define FOR(x,to) for(int x=0;x<(to);x++)
#define F0R(x,in,to) for(int x=(in);x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))

typedef long long ll;
using namespace std;
ll MOD = 998244353;

typedef pair<int,int> ii;
typedef struct {int a,b,c;}iii;
typedef vector<int> vi;

void mosA(vector<ll> a){
	for(int i=0; i<a.size(); i++) printf("%lld ",a[i]);
	printf("\n");
}
void mosP(vector<ii> a){
	for(int i=0; i<a.size(); i++) printf("%d %d\n",a[i].first,a[i].second);
	printf("\n");
}

ll min_especial(ll a, ll b){
  if(a!=-1 && b!=-1) return min(a,b);
  else return max(a,b);
}
/*
bool ord(ii a, ii b){
	if(a.first == b.first){
		return a.second < b.second;
	}
	return a.first < b.first;
}*/

bool ord(ll a, ll b){
	return a>b;
}

ll ans = 0;
int a,n,w,t,k,m,z,q,l,r,x,b;
ll A[200005];
char S[200005];



int main(){
	scanf("%d%d%s",&n,&k,S);
	S[k-1] = tolower(S[k-1]);
	printf("%s\n", S); 
}




// REVISATE ESTO:
// - memset(A,-1,SIZEOF()*n)
// - (x-y+MOD)%MOD
// - int o ll?

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define LOOP(i,x,n) for(int i=x;i<n;i++)
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define MP make_pair
#define FR first
#define SC second
#define int long long
using namespace std;

signed main(){
  int n;
  while(cin>>n,n){
    int w,h;
    cin>>w>>h;
    int M[h][w]={};
    REP(i,n){
      int x,y;
      cin>>x>>y;
      x--;y--;
      M[y][x]=1;
    }
    int s,t;
    cin>>s>>t;
    int ans=0;
    for(int i=0;i<=h-t;i++){
      for(int j=0;j<=w-s;j++){
        int tmp=0;
        for(int y=i;y<i+t;y++){
          for(int x=j;x<j+s;x++){
            if(M[y][x]==1)tmp++;
          }
        }
        ans=max(ans,tmp);
      }
    }
    cout<<ans<<endl;
  }
  return 0;
}



Measured memory_bytes: 3192
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>

struct node{
	struct node *left;
	struct node *right;
	struct node *parent;
	int key;
};
typedef struct node * Node;
#define NIL NULL

Node root;

Node treeSearch(Node u, int k){//kに一致するノードを探す
	if (u == NIL){return NIL;}//なかた
	if (u->key == k){ return u; }//あた
	else if (u->key > k){
		return treeSearch(u->left, k);
	}
	else{
		return treeSearch(u->right, k);
	}
}

void treeDelete(Node z){
	Node tmp;

	if (z->left == NIL && z->right == NIL){//子なし
		if (z->parent->left == z){//zが親の左側に属していたら
			z->parent->left = NIL;
		}
		else{
			z->parent->right = NIL;
		}
		//free(z);
	}
	else if (z->left != NIL && z->right != NIL){//子2人
		tmp = z->right;//右側から最少を探す
		while (tmp->left != NIL){
			tmp = tmp->left;
		}
		z->key = tmp->key;
		treeDelete(tmp);		
	}
	else{//子1人
		if (z->left!=NIL){//左に子がいたら
			if (z->parent->left == z){//zが親の左側にいたら
				z->parent->left = z->left;
				z->left->parent = z->parent;
			}
			else{//zが親の右側にいたら
				z->parent->right = z->left;
				z->left->parent = z->parent;
			}
		}
		else{//右に子がいたら
			if (z->parent->left == z){//zが親の左側にいたら
				z->parent->left = z->right;
				z->right->parent = z->parent;
				free(z);
			}
			else{//zが親の右側にいたら
				z->parent->right = z->right;
				z->right->parent = z->parent;
			}
		}
	}
}

Node sss(int k, Node x){
	if (x == NIL){ return x; }//root
	if (k < x->key){
		if (x->left != NIL){
			return sss(k, x->left);
		}
		else{
			return x;
		}
	}
	else{
		if (x->right != NIL){
			return sss(k, x->right);
		}
		else{
			return x;
		}
	}
}

void insert(int k){
	Node y = sss(k,root);//入れるべき場所の親探し
	Node z;

	z = malloc(sizeof(struct node));
	z->key = k;
	z->left = NIL;
	z->right = NIL;
	z->parent = y;

	if (y == NIL){ root=z; }
	else if (y->key < k){//kが親キーより大きい
		y->right = z;
	}
	else{
		y->left = z;
	}
}

void inorder(Node u){
	if (u->left != NIL)
		inorder(u->left);
	printf(" %d", u->key);
	if (u->right != NIL)
		inorder(u->right);	
}
void preorder(Node u){
	printf(" %d", u->key);
	if (u->left != NIL)
		preorder(u->left);
	if (u->right != NIL)
		preorder(u->right);
}

int main(){
	int n, i, x;
	char com[20];
	scanf("%d", &n);

	for (i = 0; i < n; i++){
		scanf("%s", com);
		if (com[0] == 'f'){
			scanf("%d", &x);
			Node t = treeSearch(root, x);
			if (t != NIL) printf("yes\n");
			else printf("no\n");
		}
		else if (com[0] == 'i'){
			scanf("%d", &x);
			insert(x);
		}
		else if (com[0] == 'p'){
			inorder(root);
			printf("\n");
			preorder(root);
			printf("\n");
		}
		else if (com[0] == 'd'){
			scanf("%d", &x);
			treeDelete(treeSearch(root, x));
		}
	}

	return 0;
}

Measured memory_bytes: 19364
#include<bits/stdc++.h>
using namespace std;
typedef long long int64;
const int mod = 1e9 + 7;
int main(){
	int64 n, k; cin >> n >> k;
	int64 ans = 0;
    for(int64 x = k; x <= n + 1; x++){
    	int64 l = x * (x - 1) / 2;
        int64 r = x * (2 * (n) + (x - 1) * (-1)) / 2;
        ans = (ans + r - l + 1) % mod;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3636
n, k = map(int, input().split())
a = list(map(lambda x: int(x) - 1, input().split()))
visited = [-1 for _ in range(n)]
visited[0] = 0
l = [0]
for i in range(k):
    nex = a[l[i]]
    if visited[nex] != -1:
        res = visited[nex]
        cyc = i + 1 - visited[nex]
        break
    else:
        l += [nex]
        visited[nex] = i + 1
else:
    res = k + 1
print(l[res + (k - res) % cyc] + 1 if k > res else l[k] + 1)


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

using namespace std;

using ll = long long;
using ld = long double;

const double PI = 3.1415926535897932384626433832795;
const ll MOD = 1000000007;

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

int gcd(int x, int y) { return y ? gcd(y, x % y) : abs(x); }
ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : abs(x); }
int lcm(int x, int y) { return x / gcd(x, y) * y; }
ll lcm(ll x, ll y) { return x / gcd(x, y) * y; }

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

	int n, k;
	string s;
	cin >> n >> k >> s;

	int score = 0;
	for (int i = 0; i < n - 1; i++) {
		score += s[i] == s[i + 1];
	}

	int ans = min(score + 2 * k, n - 1);
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 512
#include<iostream>
#include<cstdio>
#include<cmath>
#include<string>
#include<algorithm>

using namespace std;


    int main(){
        int price=0,money[6]={500,100,50,10,5,1},ret=0,cnt;
        while(1){
        cnt=0;
        cin>>price;
        ret=1000-price;
        if(price==0)break;
        for(int i=0;i<6;i++){
                while(1){
                    if(ret<money[i])break;
                    ret-=money[i];
                    cnt++;

                }
            }

        cout<<cnt<<endl;
    }
    return 0;
}

Measured memory_bytes: 1160
#include <bits/stdc++.h>
#include <stdio.h>
#define ll long long
#define fr(i,p,n) for(ll i=p;i<n;i++)
#define fr1(i,p,n) for(ll i=p;i>=n;i--)
#define FAST ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define all(v) v.begin(),v.end()
#define PI 3.14159265358979323846
#define MOD 1000000007
#define MOD1 998244353
#define INF 1e9
#define precise cout << std::setprecision(10) << std::fixed;
#define endl "\n"
using namespace std;

int main()
{
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    FAST
    int t=1;
    //cin>>t;
    while(t--)
    {
        ll a,v,b,w,t;
        cin>>a>>v>>b>>w>>t;
        ll sp=v-w;
        if(sp<=0) cout<<"NO"<<endl;
        else
        {
            ll dist=abs(a-b);
            ll time=dist/sp + (dist%sp!=0);
            if(time<=t) cout<<"YES"<<endl;
            else cout<<"NO"<<endl;
        }
    }
    return 0;
}


Measured memory_bytes: 3660
/*
本宝的程序外人别想看！！

name: [夏宝宝]
run time：[] ms
compilation time: [] ms
output memory: [] MiB
where: []
state: []
*/
#include<bits/stdc++.h>
using namespace std;

int main()
{
	//freopen(".in", "r", stdin);
	//freopen(".out", "w", stdout);
	
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	int n;
	
	cin>>n;
	
	int a[n+1];
	
	for(int i=1; i<=n; i++)
	{
		cin>>a[i];
	}
	
	for(int i=1; i<=n; i++)
	{
		if(a[i]%2==0)
		{
			if(a[i]%3==0 || a[i]%5==0)
			{
				
			}
			else
			{
				cout<<"DENIED"<<endl;
				
				return 0;
			}
		}
	}
	
	cout<<"APPROVED"<<endl;
	
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
const ll mod = 1000000007;

int main() {
    ll n, k;
    cin >> n >> k;

    vector<ll> rui(n+1);
    rep(i, n) {
        ll a;
        cin >> a;
        a--;
        rui[i+1] = (rui[i] + a)%k;
    }

    map<ll, ll> mp;
    queue<ll> Q;
    ll ans = 0;
    rep(i, n+1) {
        ans += mp[rui[i]];
        mp[rui[i]]++;
        Q.push(rui[i]);
        if(Q.size() == k) {
            mp[Q.front()]--;
            Q.pop();
        }
    }

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

Measured memory_bytes: 16000
package main

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

const (
	initialBufSize = 1e4
	maxBufSize     = 1e6 + 7
)

var buf []byte = make([]byte, maxBufSize)
var sc = bufio.NewScanner(os.Stdin)

func init() {
	sc.Split(bufio.ScanWords)
	sc.Buffer(buf, maxBufSize)
}

func main() {
	X, N := nextInt(), nextInt()
	if N == 0 {
		fmt.Println(X)
		return
	}
	pn := make(map[int]bool)
	for i := 0; i < N; i++ {
		pn[nextInt()] = true
	}
	// fmt.Println(pn)
	for i := 0; i <= 100; i++ {
		var pl, mi bool
		if _, e := pn[X-i]; e {
			mi = true
		}
		if _, e := pn[X+i]; e {
			pl = true
		}
		// fmt.Println(i, X-i, X+i)
		if pl && mi {
			continue
		}
		if !mi {
			fmt.Println(X - i)
			return
		}
		if !pl {
			fmt.Println(X + i)
			return
		}
	}
	// fmt.Println(pn, dn)
}

func nextLine() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func abs(a int) int {
	if a > 0 {
		return a
	} else {
		return -a
	}
}

func pow(p, q int) int {
	res := p
	if q == 0 {
		return 1
	}
	for i := 0; i < q-1; i++ {
		res *= p
	}
	return res
}

func MinOf(vars ...int) int {
	min := vars[0]
	for _, i := range vars {
		if min > i {
			min = i
		}
	}
	return min
}

func MaxOf(vars ...int) int {
	max := vars[0]
	for _, i := range vars {
		if max < i {
			max = i
		}
	}
	return max
}

func gcdof2numbers(a int, b int) int {
	if b == 0 {
		return a
	}
	return gcdof2numbers(b, a%b)
}

func lcmof2numbers(a int, b int) int {
	return a / gcdof2numbers(a, b) * b
}

// マイナスの場合は考慮していない
func fuctorial(a int) int {
	if a == 1 || a == 0 {
		return 1
	} else {
		return fuctorial(a-1) * a
	}
}

func NextPermutation(x sort.Interface) bool {
	n := x.Len() - 1
	if n < 1 {
		return false
	}
	j := n - 1
	for ; !x.Less(j, j+1); j-- {
		if j == 0 {
			return false
		}
	}
	l := n
	for !x.Less(j, l) {
		l--
	}
	x.Swap(j, l)
	for k, l := j+1, n; k < l; {
		x.Swap(k, l)
		k++
		l--
	}
	return true
}

// 素因数分解したmapを返す
func primeFuctorize(n int) map[int]int {
	pf := map[int]int{}
	for i := 2; i*i <= n; i++ {
		for n%i == 0 {
			pf[i]++
			n /= i
		}
	}
	if n != 1 {
		pf[n]++
	}
	return pf
}


Measured memory_bytes: 1820
import java.util.*;
public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int N =sc.nextInt();
		char [] S = sc.next().toCharArray();
		//char s ='Z'; A→65
		for(int i=0;i<S.length;i++) {
			
			int t = (int)S[i] + N;
			while(t>90) {
				t = t - 26;
			}
			System.out.print((char)t);	
			
		}	
	}
}
	

Measured memory_bytes: 25428
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<cstdlib>
#include<iomanip>
#include<queue>
#include<set>

using namespace std;

void Solution();

int main()
{
    Solution();
    return 0;
}

void Solution()
{
    string s,devideStr;
    
    while(cin>>s)
    {
        devideStr = s;
        
        bool flag = true;
        
        for(int i = 0; i < 10; i++)
        {
            for(int j = 0; j < (int)s.size(); j++)
            {
                if(s[j] == 'X') // the number which we want to get
                {
                    devideStr[j] = i+'0'; //give the string data to array
                }
                else
                {
                    devideStr[j] = s[j];
                }
            }
            
            string a,b,c,d;
            
            int addOperator = devideStr.find('+');
            int equOperator = devideStr.find('=');
            
            a = devideStr.substr(0,addOperator); /// the first number in the equation
            b = devideStr.substr(addOperator + 1, equOperator - addOperator - 1); // the second number
            c = devideStr.substr(equOperator + 1, devideStr.size());
            
            int as = a.size(), bs = b.size();
            int alls = max(as,bs);
            
            int x = 0;
            
            for(int j = 0; j < alls; j++)
            {
                if(j < as && j < bs)
                {
                    x += a[as - j - 1] + b[bs - j - 1] - '0' * 2;
                }
                else if(j < as)
                {
                    x += a[as - j - 1] - '0';
                }
                else if(j < bs)
                {
                    x += b[bs - j - 1] - '0';
                }
                
                d = (char)(x % 10 + '0') + d;
                x /= 10;
            }
            
            if(x)
            {
                d = (char)(x%10+'0')+d;
            }
            
            if(d == c)
            {
                cout <<i<<endl;
                
                flag = false;
                break;
            }
        }
        
        if(flag)
        {
            cout <<"NA"<<endl;
        }
    }
}

Measured memory_bytes: 1196
from itertools import combinations

def make_01(H, W, C):
    ban = [[0 for j in range(W)] for i in range(H)]
    for h in range(H):
        S = C[h]
        for w in range(W):
            if S[w] == '.':
                ban[h][w] = 0
            else:
                ban[h][w] = 1
    return ban

def countban(H, W, hc, wc, ban):
    # print(hc, wc)
    # print(ban)
    for h in hc:
        for w in range(W):
            ban[h][w] = 0
    for w in wc:
        for h in range(H):
            ban[h][w] = 0
    # print(ban)
    val = sum(map(sum, ban))
    # print(val)
    # input()
    return val

def ban_copy(H, W, ban):
    bancopy = [[0 for j in range(W)] for i in range(H)]
    for h in range(H):
        for w in range(W):
            bancopy[h][w] = ban[h][w]
    return bancopy

def main():
    H, W, K = map(int, input().split())
    C = [input() for i in range(H)]
    ban = make_01(H, W, C)
    # print(ban)
    cnt = 0
    for n in range(H + 1):
        for hc in combinations(range(H), n):
            for m in range(W + 1):
                for wc in combinations(range(W), m):
                    tmpc = ban_copy(H, W, ban)
                    if K == countban(H, W, hc, wc, tmpc):
                        cnt += 1
    return cnt

if __name__ == '__main__':
    print(main())
    
    


Measured memory_bytes: 69712
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;
#define rep(i, begin, n) for (int i = begin; i < n; i++)
#define repe(i, begin, n) for (int i = begin; i <= n; i++)
#define repr(i, begin, n) for (int i = begin; i > begin - n; i--)
#define repre(i, begin, end) for (int i = begin; i >= end; i--)

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

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

const int inf = 1000000007;
const int MOD = 1000000007;
const long long INF = 1000000000000000007;

// -------------------------------------------------------

int N, X, T;

int main() {
  //
  cin >> N >> X >> T;
  cout << (N + X - 1) / X * T;
}


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

#include <iostream>
#include <fstream>

#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define mod1 1000000007
#define mod2 1000000009
int getTheAnswer() {
    return 42;
}

using namespace std;
using ll=long long;
int v[1000005];
class ECoprime {
public:
	void solve(std::istream& cin, std::ostream& cout) {
        for (ll i=2;i<1000005;i++){
            if (v[i]==0){
                for (ll j=i;j<1000005;j+=i){
                    if (v[j]==0)
                        v[j]=i;
                }
            }
        }
        int n;
        cin>>n;
        int a[n];
        for (int i=0;i<n;i++)
            cin>>a[i];
        int hcf=a[0];
        for (int i=1;i<n;i++)
            hcf=__gcd(hcf,a[i]);
        map<int,int> m;
        int flag=0;
        for (int i=0;i<n;i++){
            while(a[i]!=1){
                int div=v[a[i]];
                m[div]++;
                if (m[div]>1){
                    flag=1;
                    break;
                }
                while (a[i]%div==0){
                    a[i]/=div;
                }
            }
        }
        if (!flag)
            cout<<"pairwise coprime";
        else if (hcf==1)
            cout<<"setwise coprime";
        else cout<<"not coprime";
	}
};


int main() {
	ECoprime solver;
	std::ios::sync_with_stdio(false);
	std::cin.tie(NULL);
	std::cout.tie(NULL);
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


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

typedef long long int ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef vector<string>vst;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;
typedef map<int,int> dct;

#define fastio ios_base::sync_with_stdio(false);cin.tie(0)
#define all(ct) ct.begin() , ct.end()
#define endl "\n"
#define fr(i,a) for(auto i:a)
#define f(i,a,b) for(int i=a;i<b;++i)
#define fd(i,a,b) for(int i=a;i>=b;--i)
#define pb push_back
#define in(d,v) d.find(v)!=d.end()
#define mp make_pair
#define pi 3.14159265

bool compare(pll a, pll b){
    return a.first*b.second<a.second*b.first;
}

const int mod = 1e9+7;
const ll inf = ll(1e18);

ll modexp(ll x,ll n){
    if(n==0)return 1;
    if(n%2==0)return modexp((x*x)%mod,n/2);
    return (x*modexp((x*x)%mod,n/2))%mod;
}

int main(){
    //clock_t tm = clock();
    fastio;
    int h,w;string s;
    cin>>h>>w;
    vvi a(h,vi(w,0)),b(h,vi(w,0));
    int c=0;
    f(i,0,h){
        cin>>s;
        f(j,0,w){
            b[i][j]=c;
            if(s[j]=='.')
                a[i][j]=1;
            c++;
        }
    }
    int n=h*w,ans=0;
    vvi d(n,vi(n,100000000));
    f(i,0,h){
        f(j,0,w){
            if(a[i][j]==0)
                continue;
            d[b[i][j]][b[i][j]]=0;
            if(i>0 and a[i-1][j]==1){
                d[b[i][j]][b[i-1][j]]=1;
            }
            if(i<h-1 and a[i+1][j]==1){
                d[b[i][j]][b[i+1][j]]=1;
            }
            if(j>0 and a[i][j-1]==1){
                d[b[i][j]][b[i][j-1]]=1;
            }
            if(j<w and a[i][j+1]==1){
                d[b[i][j]][b[i][j+1]]=1;
            }
        }
    }
    f(k,0,n) {
        if(a[k/w][k%w]==0)
            continue;
        f(i,0,n){
            if(a[i/w][i%w]==0)
                continue;
            f(j,0,n){
                if(a[j/w][j%w]==0)
                    continue;
                d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
            }
        }
    }
    f(i,0,n){
        f(j,0,n){
            if(d[i][j]>=1e8 or a[i/w][i%w]==0 or a[j/w][j%w]==0)
                continue;
            ans=max(ans,d[i][j]);
        }
    }
    cout<<ans<<endl;
    //cout<<((clock()-tm)*1.0)/CLOCKS_PER_SEC<<endl;
}

Measured memory_bytes: 896
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define fi first
#define se second
long long mo = 1000000007;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> Pii;
typedef pair<ll,ll> Pll;
typedef pair<ll,Pll> PlP;
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
template<class A>void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<<a[i];}cout << "\n";}
ld PI=3.14159265358979323846;

struct UnionFind {
    vector<int> par; // par[i]:iの親の番号　(例) par[3] = 2 : 3の親が2
    vector<int> size;
    UnionFind(int N): par(N),size(N) {

         //最初は全てが根であるとして初期化
        for(int i = 0; i < N; i++){
            par[i] = i;
            size[i] = -1;
        }
            
    }
    int root(int x) { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
        if (par[x] == x) return x;
        return par[x] = root(par[x]);
    }

    void unite(int x, int y) { // xとyの木を併合
        int rx = root(x); //xの根をrx
        int ry = root(y); //yの根をry
        if (rx == ry) return; //xとyの根が同じ(=同じ木にある)時はそのまま
        par[rx] = ry; //xとyの根が同じでない(=同じ木にない)時：xの根rxをyの根ryにつける
        size[ry] += size[rx];
    }

    bool same(int x, int y) { // 2つのデータx, yが属する木が同じならtrueを返す
        int rx = root(x);
        int ry = root(y);
        return rx == ry;
    }
    int getsize(int x){
        return -size[root(x)];
    }
    int getNunion(){//これちょっと遅い sameと組み合わせて順次数えていけば早くなりそう。
        map<int,int> m;
        rep(i,par.size()){
            m[this->root(i)]++;
        }
        return int(m.size());
    }
};

int main(){
    ll N;
    cin >> N;
    vector<Pll> x(N), y(N);
    rep(i,N){
        cin >> x[i].fi >> y[i].fi;
        x[i].se = i;
        y[i].se = i;
    }
    sort(x.begin(),x.end());
    sort(y.begin(),y.end());
    UnionFind tr(N);
    vector<PlP> edge;
    rep(i,N-1){
        edge.push_back({{x[i+1].fi - x[i].fi},{x[i+1].se, x[i].se}});
        edge.push_back({{y[i+1].fi - y[i].fi},{y[i+1].se, y[i].se}});
    }
    sort(edge.begin(), edge.end());
    ll M = edge.size();
    ll ans = 0;
    rep(i,M){
        ll c = edge[i].fi;
        ll v = edge[i].se.fi;
        ll u = edge[i].se.se;
        if(tr.same(v,u)){
            continue;
        }else{
            tr.unite(v,u);
            ans += c;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 13456
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int K,S;
  cin >> K >> S;
  int c=0;
  for(int i=0;i<=K;i++){
    for(int j=0;j<=K;j++){
      if(S-i-j<=K&&S-i-j>=0)
        c++;
    }
  }
  cout << c << endl;
}

Measured memory_bytes: 384
// use std::collections::HashMap;
// use std::collections::HashSet;


fn main() {
    let cin = stdin();
    let cin = cin.lock();
    let mut sc = Scanner::new(cin);

    let n = sc.read();
    let m = sc.read();
    let mut ps = Vec::new();
    for _ in 0..n {
        let p: usize = sc.read();
        ps.push(p - 1);
    }
    let ps = ps;

    let mut uf = UnionFind::new(n);

    for _ in 0..m {
        let x = sc.read::<usize>() - 1;
        let y = sc.read::<usize>() - 1;

        uf.merge(x, y);
        // xs.push(x);
        // ys.push(y);
    }

    let mut ans = 0;
    for i in 0..n {
        if uf.class(i) == uf.class(ps[i]) {
            ans += 1;
        }
    }
    println!("{}", ans);
}


struct UnionFind {
    parent_or_size: Vec<isize>,
}


impl UnionFind {
    fn new(size: usize) -> UnionFind {
        UnionFind { parent_or_size: vec![-1; size] }
    }

    fn class(&self, index: usize) -> usize {
        let mut index = index;
        while self.parent_or_size[index] >= 0 {
            index = self.parent_or_size[index] as usize;
        }
        index
    }

    fn merge(&mut self, index0: usize, index1: usize) -> bool {
        let a = self.class(index0);
        let b = self.class(index1);
        if a == b {
            false
        } else {
            if self.parent_or_size[a] < self.parent_or_size[b] {
                self.parent_or_size[a] += self.parent_or_size[b];
                self.parent_or_size[b] = a as isize;
            } else {
                self.parent_or_size[b] += self.parent_or_size[a];
                self.parent_or_size[a] = b as isize;
            }
            true
        }
    }
}


// thanks, ir5
use std::io::{stdin, Read, StdinLock};
use std::str::FromStr;

struct Scanner<'a> {
    cin: StdinLock<'a>,
}

impl<'a> Scanner<'a> {
    fn new(cin: StdinLock<'a>) -> Scanner<'a> {
        Scanner { cin: cin }
    }

    fn read1<T: FromStr>(&mut self) -> Option<T> {
        let token = self.cin
            .by_ref()
            .bytes()
            .map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect::<String>();
        token.parse::<T>().ok()
    }

    fn read<T: FromStr>(&mut self) -> T {
        self.read1().unwrap()
    }
}


Measured memory_bytes: 6396
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <queue>
#include <string>
#include <algorithm>
#include <cstdio>
#include <stack>
#include <vector>
#include <map>
#include <ctime>
#include <cmath>
#include <string.h>
#define inf 0x7fffffff
using namespace std;
struct P
{
    int x,y;

    bool operator<(const P &a)const{
       // if(y!=a.y)
       // return y>a.y;
       return x>a.x;
//        return z>a.z;
    }
};
vector<int> v[120056];

int a,b,c,i,k,o[100002],n,m,d,e,dy[15]={0,0,-1,1,-1,1,-1,1},dx[15]={-1,1,0,0,1,1,-1,-1};
int l[50005];
long long x,y,z[5],v1,v2;
P u[200600];
int j[6000000];
queue<P> q,q1;
stack<int> s;
//queue<P> q;

//deque<int> d;
//'1'==49;
//'A'==65;
//'a'==97;
map<int, int > p;
string r,r1,r2;
//char r[5000];

bool as(int a,int b)
{
     return a>b;

}

//2147483647
int main()
{
    scanf("%d %d",&a,&b);
    for(int t=1;t<=b;t++)
    {
        scanf("%d %d",&c,&d);
        v[c].push_back(d);
        v[d].push_back(c);
    }
    q.push({1,1});
    for(;q.size();q.pop())
    for(int h=0;h<v[q.front().x].size();h++)
        if((q.front().y&o[v[q.front().x][h]])==0)
    {
        o[v[q.front().x][h]]+=q.front().y;
        int i;
        if(q.front().y==1) i=2;
        else i=1;
        q.push({v[q.front().x][h],i});
    }
    for(int t=1;t<=a;t++)
    if(o[t]==1) z[1]++;
    else if(o[t]==2) z[2]++;
    else if(o[t]==3) z[3]++;
    printf("%lld",z[1]*(z[2]+z[3])+z[2]*(z[3])+z[3]*(z[3]-1)/2-b);
}


Measured memory_bytes: 7680
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0,i##_len=int(n);i<i##_len;++i)
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
#define All(x) (x).begin(),(x).end()
#define rAll(x) (x).rbegin(),(x).rend()
using namespace std;
using ll = long long;

int main(){
    int N;cin>>N;
    vector<pair<int,int>> w(N);
    REP(i,N) cin>>w[i].second>>w[i].first;
    sort(All(w));
    ll t=0;
    REP(i,N){
        t+=w[i].second;
        if(t>w[i].first){
            cout<<"No"<<endl;
            return 0;
        }
    }
    cout<<"Yes"<<endl;
}


Measured memory_bytes: 1792
#include <bits/stdc++.h> 
using namespace std; 
typedef long long int lli;
typedef vector<vector<lli> > vlli;
lli N, K;
lli MOD = 1e9 +7;

vlli multiply(vlli A, vlli B){
	vlli C(N, vector<lli> (N,0));
	for (lli i = 0; i < N; ++i)
	{
		for (lli j = 0; j < N; ++j)
		{
			for (lli k = 0; k < N; ++k)
			{
				C[i][j] += (A[i][k]*B[k][j])%MOD;
				C[i][j]%=MOD;
			}
		}
	}
	return C;

}
vlli pow(vlli M, lli K){
	if(K==1) return M;
	vlli t = pow(M, K/2);
	if(K%2==0){
		return multiply(t,t);
	}
	return multiply(M, multiply(t,t));
}
lli SUM(vlli M){
	lli ans=0;
	for (int i = 0; i < N; ++i)
	{
		for (int j = 0; j < N; ++j)
		{
			ans+=M[i][j];
			ans%=MOD;
		}
	}
	return ans;
}

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

    vlli M(N, vector<lli> (N));
    for (lli i = 0; i < N; ++i)
    {
    	for (lli j = 0; j < N; ++j)
    	{
    		cin>>M[i][j];
    	}
    }

    cout<<SUM(pow(M, K));
    return 0; 
}

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

int main() {
	int n, ans;
	while (cin >> n) {
		ans = 0;
		for (int i = 0; i < 10; i++)
		for (int j = 0; j < 10; j++)
		for (int k = 0; k < 10; k++)
		for (int l = 0; l < 10; l++)
			ans += i + j + k + l == n;
		cout << ans << endl;
	}
	return 0;
}


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

using namespace std;
typedef long long ll;

int main() {
  int N, x;
  cin >> N >> x;
  vector<int> a(N);
  ll ans = 0;
  cin >> a[0];
  if (a[0] > x) {
    ans += a[0] - x;
    a[0] = x;
  }
  for (int i = 0; i < N - 1; ++i) {
    cin >> a[i + 1];
    if (a[i] + a[i + 1] > x) {
      ans += a[i + 1] - (x - a[i]);
      a[i + 1] -= a[i + 1] - (x - a[i]);
    }
  }
  cout << ans << endl;
  return 0;
}



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

int main(){

  while(1){

    int n,m;

    cin >> n >> m;

    if(n==0 && m == 0) break;

    char ch[n];

    for(int i=0;i<n;i++){
      ch[i] = '#';
    }

    for(int k=0;k<m;k++){
      char c;

      cin >> c;

      if(c=='A'){
        for(int i=0;i<n;i++){
          if(ch[i]=='#'){
            ch[i] = 'A';
            break;
          }
        }
      }
      else if(c == 'B'){
        bool flag = true;
        for(int i=n-1;i!=0;i--){
          if(ch[i]=='#'){
            if(i == n-1 && ch[i-1]!='A'){
              ch[i] = 'B';
              flag = false;
              break;
            }
            else if(i == 0 && ch[i+1]!='A'){
              ch[i] = 'B';
              flag = false;
              break;
            }
            if((ch[i+1]!='A') && (ch[i-1]!='A')){
              ch[i] = 'B';
              flag = false;
              break;
            }
          }
        }
        if(flag){
          for(int i=0;i<n;i++){
            if(ch[i]=='#'){
              ch[i] = 'B';
              break;
            }
          }
        }
      }
      else if(c == 'C'){
        if(k==0){
          if(n%2==0){
            ch[n/2+1-1] = 'C';
          }
          else{
            ch[(n+1)/2 -1] = 'C';
          }
        }
        else{
          for(int i=0;i<n;i++){
            if(ch[i]!='#'){
              if(ch[i+1]=='#'){
                ch[i+1] = 'C';
                break;
              }
              else if(i!=0 && ch[i-1]=='#'){
                ch[i-1] = 'C';
                break;
              }
              else{
                for(int j=i;j<n;j++){
                  if(ch[j]=='#'){
                    ch[j] = 'C';
                    break;
                  }
                }
                break;
              }
            }
          }
        }
      }
      else{
        int dis[n];
        int mdis = 0,pos = 0;
        if(k==0){
          ch[0] = 'D';
        }
        else{
          for(int i=0;i<n;i++){
            if(ch[i]!='#'){
              dis[0] = i;
              break;
            }
          }
          for(int i=1;i<n;i++){
            if(ch[i] != '#'){
              dis[i] = 0;
              continue;
            }
            dis[i] = dis[i-1] + 1;
            for(int j=i+1;j<n;j++){
              if(ch[j] != '#'){
                dis[i] = min(dis[i],j-i);
              }
            }
          }
          for(int i=0;i<n;i++){
            if(dis[i] > mdis){
              mdis = dis[i];
              pos = i;
            }
          }
          ch[pos] = 'D';
        }
      }
    }

    for(int i=0;i<n;i++){
      cout << ch[i];
    }
    cout << endl;

  }
}

Measured memory_bytes: 3052
#include"bits/stdc++.h"
using namespace std;
typedef long long ll;

int main() {
	ll x,k,d;
	cin >> x>>k>>d;
	if (x<0) {
		x *= -1;
	}

	if (x/d>k) {
		cout << x - k * d;
	}

	else {
		ll m;
		while (x>=0) {
			m = x;
			x -= d;
			k--;
		}
		if (k % 2 == 0) {
			cout << abs(x);
		}
		else {
			cout << abs(m);
		}
	}


	return 0;
}

Measured memory_bytes: 3608
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <cstring>
#define rep(i, N) for (int i = 0; i < (int)N; i++)
using namespace std;
typedef long long ll;
const ll INF = 9223372036854775807/2;
const int MOD = 1000000007;
const int N_MAX = pow(10,5);

int main() {
  int N, K; cin >> N >> K;
  int h[N]; rep(i, N) cin >> h[i];
  ll dp[N_MAX]; fill_n(dp, N_MAX, INF); dp[0] = 0;
  for (int i=1; i<=N; i++) for(int j=1; j<=K; j++) {
    if (i>=j) dp[i] = min(dp[i], dp[i-j]+abs(h[i]-h[i-j]));
  }
  // rep(i, N) cout << dp[i] << endl;
  cout << dp[N-1] << endl;
  return 0;
}

Measured memory_bytes: 1408
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <functional>
#include <stack>
#include <queue>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <list>
#include <set>
using namespace std;
typedef long long ll;


int main(int argc, char *args[]) {
	int A, B;
	cin >> A >> B;
	if (A*B % 2 == 0) {
		cout << "No" << endl;
	}
	else {
		cout << "Yes" << endl;
	}

}

Measured memory_bytes: 256
n = int(input())
a = list(map(int, input().split()))

# 0 3 5 -1  0
# 0 3 5 11 12
#cum 0 3 8 14 15
# 0   5 11 12
# 0 3    7  8
# 0 3 5    10

# (cumi+1)-(cumi-1) - (i+1 - i-1)
# 8-0 - 5-0
# 14-3 - 7-3
# 2 6 8
# 3 2 5

a.insert(0,0)
a.append(0)
def cumulative_sum(collection):
    result = [0]
    for i in range(1, len(collection)):
        item = abs(collection[i] - collection[i-1])
        result.append(result[-1] + item)
    return result
cuma = cumulative_sum(a)

lp=cuma[-1]

for i in range(n):
    gap=abs(cuma[i+2]-cuma[i])-abs(a[i+2]-a[i])
    print(lp-gap, flush=True)


Measured memory_bytes: 20500
#include <stdio.h>
#include <string.h>
int MIN(int a,int b){
    return a<b?a:b;
}
int main()
{   char s[100001];
    scanf("%s",s);
    int l=strlen(s),a[l];
    for(int i=0;i<l;i++){
        if(s[i]=='1')a[i]=1;
        else a[i]=0;
    }
    int bs=0,ws=0;
    for(int i=0;i<l;i++){
        if(i%2==0&&a[i]==0){
            bs++;
        }else if(i%2==0&&a[i]==1){
            ws++;
        }else if(i%2==1&&a[i]==0){
            ws++;
        }else if(i%2==1&&a[i]==1){
            bs++;
        }
    }
    printf("%d",MIN(bs,ws));

    return 0;
}


Measured memory_bytes: 640
#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<iostream>
#include<queue>
#include<vector>
#include <bitset>
#include<math.h>
#include<map>
#include<set>
using namespace std;
#define INF 11000000000
#define MOD 1000000007
typedef long long ll;
typedef pair<ll,ll> P;

int num[110000];

int main(){
  int x[4],y[4];
  cin>>x[0]>>y[0]>>x[1]>>y[1];

  x[2]=x[1]-(y[1]-y[0]);
  y[2]=y[1]+(x[1]-x[0]);
  x[3]=x[0]-(y[1]-y[0]);
  y[3]=y[0]+(x[1]-x[0]);

  cout<<x[2]<<" "<<y[2]<<" "<<x[3]<<" "<<y[3]<<endl;
}


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

using namespace std;

int n,l,r,a[maxn];

int main()
{
    scanf("%d",&n);
    for (int i=1;i<=n;i++) scanf("%d",&a[i]);
    l=1; for (int i=1;i<=n;i++) if (abs(a[i])>abs(a[l])) l=i;
    printf("%d\n",n*2-2);
    for (int i=1;i<=n;i++) if (i!=l) printf("%d %d\n",l,i);
    if (a[l]>0) for (int i=1;i<n;i++) printf("%d %d\n",i,i+1);
    else for (int i=n;i>1;i--) printf("%d %d\n",i,i-1);
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long int 
#define fastio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int gcd(int a,int b){
	return (b==0)?a:gcd(b,a%b);
}
int main(){
	#ifndef ONLINE_JUDGE
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif
	int n;
	cin>>n;
	int sum=0;
	for(int i=1;i<=n;++i){
		for(int j=1;j<=n;++j){
			for(int k=1;k<=n;++k){
				sum+=gcd(i,gcd(j,k));
				//cout<<i<<" "<<j<<" "<<k<<'\n';
			}
		}
	}
	cout<<sum;
	return 0;
}


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

#define FAST ios_base::sync_with_stdio(false); cin.tie(0);
#define pb push_back
#define eb emplace_back
#define ins insert
#define f first
#define s second
#define cbr cerr<<"hi\n"
#define mmst(x, v) memset((x), v, sizeof ((x)))
#define siz(x) ll(x.size())
#define all(x) (x).begin(), (x).end()
#define lbd(x,y) (lower_bound(all(x),y)-x.begin())
#define ubd(x,y) (upper_bound(all(x),y)-x.begin())
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());    //can be used by calling rng() or shuffle(A, A+n, rng)
inline long long rand(long long x, long long y) { return rng() % (y+1-x) + x; } //inclusivesss
string inline to_string(char c) {string s(1,c);return s;} template<typename T> inline T gcd(T a,T b){ return a==0?llabs(b):gcd(b%a,a); }

using ll=long long; 
using ld=long double;
#define FOR(i,s,e) for(ll i=s;i<=ll(e);++i)
#define DEC(i,s,e) for(ll i=s;i>=ll(e);--i)
using pi=pair<ll,ll>; using spi=pair<ll,pi>; using dpi=pair<pi,pi>; 

#define LLINF ((long long)1e18)
#define INF int(1e9+1e6)
#define MAXN (300006)
ll n, dp[2006], mod=1e9+7;
int main(){
	FAST
	cin>>n;
	dp[0]=1;
	FOR(i,1,n){
		FOR(j,0,i - 3){
			dp[i] += dp[j], dp[i] %= mod;
		}
	}
	cout<<dp[n]<<'\n';
}


Measured memory_bytes: 3672
#include <bits/stdc++.h>
using namespace std;
using pii=pair<int,int>;
using ll=long long;
using pll=pair<ll,ll>;

#define fi first
#define se second
#define pb push_back
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define MOD 1000000007

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

int main() {
	int G[3][3];
	rep(i,3) rep(j,3) cin >> G[i][j];
	int A[3], B[3];
	A[0] = 0;
	rep(i,3) B[i] = G[0][i] - A[0];
	for(int i=1; i<3; i++) A[i] = G[i][0] - B[0];
	rep(i,3) rep(j,3) {
		if(A[i]+B[j] != G[i][j]) {
			cout << "No" << endl;
			return 0;
		}
	}
	cout << "Yes" << endl;
	return 0;
	/*int sum1=0,sum2=0;
	rep(i,3)rep(j,3) {
		cin >> G[i][j];
		if(i==j) sum1 += G[i][j];
		sum2 += G[i][j];
	}
	if(3*sum1 == sum2) {
		cout << "Yes" << endl;
	}
	else cout << "No" << endl;*/

  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<iomanip>//小数点以下表示
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const long long INF = 1LL << 60;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)


int main(){
    int n;
    cin>>n;
    vector<int> a(n);
    rep(i,n){
        cin>>a.at(i);
    }
    bool b=true;
    sort(a.begin(),a.end());
    rep(i,n-1){
        if(a.at(i)==a.at(i+1)){
            b=false;
            break;
        }
    }
    if(b){
        cout<<"YES"<<endl;
    }
    else{
        cout<<"NO"<<endl;
    }
}

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

int main() {

    int n;
    cin >> n;

    for (int i = 0; i < (100 / 7); i++) {
        for (int j = 0; j < (100 / 4); j++) {
            
            if ((i * 7) + (j * 4) == n) {
                cout << "Yes" << endl;
                return 0;
            }

        }
    }

    cout << "No" << endl;
    
    return 0;

}

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

#include <cmath>
using namespace std;
int main()
{

const double PI = 3.141592653589793;
   float n;
    cin>>n;
    n=2*PI*n;
    cout<<fixed<<setprecision(20)<<n<<endl;


    return 0;
}


Measured memory_bytes: 3784