akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <tuple>
#include <numeric>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> P;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;
const ll MAX_N = 100010;

int main() {
    ll x;
    cin >> x;

    if(x == 3 || x == 5 || x == 7) {
        out("YES");
    }
    else {
        out("NO");
    }

    re0;
}

Measured memory_bytes: 256
/******************************************
* AUTHOR : HRITIK AGGARWAL *
******************************************/
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define N 100005
#define MOD 1000000007
#define dd double
#define vi vector<int>
#define vll vector<ll>
#define forr(i, n) for(int i = 0; i < n; i++)
#define REP(i,a,b) for(int i=a;i<b;i++)
#define rep1(i,b) for(int i=1;i<=b;i++)
#define pb push_back
#define mp make_pair
#define clr(x) x.clear()
#define sz(x) ((int)(x).size())
#define ms(s, n) memset(s, n, sizeof(s))
#define F first
#define S second
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define int ll
ll po(ll a, ll x, ll m) { if (x == 0) {return 1;} ll ans = 1; ll k = 1;  while (k <= x) {if (x & k) {ans = ((ans * a) % m);} k <<= 1; a *= a; a %= m; } return ans; }
// DEKHIYE JI  WALID JO THE ABBA HAMARE WO YEH function CHHOD KR GYE THE
int n;
vector<int>a;

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

    cin >> n;
    a = vector<int>(n);
    forr(i, n)
    cin >> a[i];
    int dp[n];
    dp[0] = 0;
    dp[1] = abs(a[1] - a[0]);
    for (int i = 2; i < n; i++) {
        dp[i] = min(dp[i - 1] + abs(a[i] - a[i - 1]), dp[i - 2] + abs(a[i] - a[i - 2]));
    }

    //  cout << dp[1] << "\n";
    cout << dp[n - 1] << "\n";
    return 0;
}

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

vector<long long> burger, patty;

long long f(long long N, long long X){
    if(N == 0){
        if(X <= 0) return 0;
        else return 1;
    }else if(X <= 1 + burger[N - 1]){
        return f(N - 1, X - 1);
    }else{
        return patty[N - 1] + 1 + f(N - 1, X - 2 - burger[N - 1]);
    }
}

int main(){

    long long N, X;
    cin >> N >> X;

    burger.push_back(1), patty.push_back(1);
    for(int i = 0; i < N; i++){
        burger.push_back(2 * burger[i] + 3);
        patty.push_back(2 * patty[i] + 1);
    }

    cout << f(N, X) << endl;

    return 0;
}



Measured memory_bytes: 256
#include<iostream>
#include<stdio.h>
#include<cstring>
#include<cmath>
#include<vector>
#include<set>
#include<map>
#include<algorithm>
#include<unordered_map>
#include<bits/stdc++.h>
#define ll long long 
#define d double
using namespace std;
 
int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  
  int n;
  cin>>n;
  string s;
  string t;
  cin>>s>>t;
  string f;
  int i;
  for(i=0;i<n;i++){
  	
  	f=f+s[i]+t[i];
  	
  }
  
   cout<<f<<endl;
  
  return 0;
}

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

int main()
{
	double p, q;
	double price = 0, quantity = 0, amount = 0;

	while (scanf("%lf,%lf", &p, &q) != EOF) {
		price += (p * q);
		quantity += q;
		amount++;
	}

	cout << (int)price << endl;
	cout << (int)(quantity / amount + 0.5) << endl;

	return 0;
}


Measured memory_bytes: 3176
#include <iostream>
#include <stack>
#include <queue>
#include <vector>
#include <algorithm>
#include <string>
#include <iomanip>
#include <functional>
#include <map>
#include <math.h>
#include <list>

using namespace std;
#define ll long long int


int main(void) {

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

	int x, y, z;
	//z,x,y
	cin >> x >> y >> z;
	cout << z << ' ' << x << ' ' << y << endl;







	return 0;
}


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

using ll  = long long;
using vl  = vector<ll>;
using vvl = vector<vl>;
#define rng(i,a,b) for(int i = (a); i < (b); ++i)
#define rep(i,n) for(int i = 0; i < (n); ++i)

ll N, sum = 0;
vvl edges;
vl color, ans, cnts, sub_size;

void dfs(int v, int parent) {
    sub_size[v] = 1;
    ll prev_dfs = cnts[color[v]];
    for (auto to : edges[v]) {
        if (to == parent) continue;
        ll prev = sum - cnts[color[v]];
        dfs(to, v);
        sub_size[v] += sub_size[to];
        ll next = sum - cnts[color[v]];
        ll diff = next - prev;
        ans[color[v]] -= diff * (diff-1) / 2;
    }
    cnts[color[v]] = prev_dfs + sub_size[v];
    sum++;
}

int main() {
    cin >> N;
    edges.resize(N);
    color.resize(N);
    sub_size.resize(N);
    ans.assign(N,N*(N-1)/2);
    cnts.assign(N,0);
    rep(i,N) { cin >> color[i]; color[i]--; }
    rep(i,N-1) {
        int a, b; cin >> a >> b;
        a--; b--;
        edges[a].push_back(b);
        edges[b].push_back(a);
    }
    dfs(0,-1);
    rep(c,N) {
        ans[c] -= (N-cnts[c]) * (N-cnts[c]-1) / 2;
    }
    rep(i,N) ans[color[i]]++;
    rep(i,N) cout << ans[i] << endl;
    return 0;
}


Measured memory_bytes: 38984
fun main(args: Array<String>) {
    val X = readInputLine().toCharArray()
    
    var SCnt = 0
    var ans = 0
    
    for (x in X) {
        when (x) {
            'S' -> SCnt++
            'T' -> {
                if (SCnt > 0) {
                    SCnt--
                } else {
                    ans++
                }
            }
        }
    }

    println(ans + SCnt)
}

fun readInputLine(): String {
    return readLine()!!
}


Measured memory_bytes: 34192
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int h = sc.nextInt();
    int[] dp = new int[h + 1 + 10000];
    int n = sc.nextInt();
    int[] a = new int[n];
    int[] b = new int[n];
    for(int i = 0; i < n; i++) {
      a[i] = sc.nextInt();
      b[i] = sc.nextInt();
    }
    for(int i = 1; i < (h + 1 + 10000); i++) {
      dp[i] = (int)Math.pow(10, 8);
    }
    for(int i = 1; i < (h + 1 + 10000); i++) {
      for(int j = 0; j < n; j++) {
        if(i >= a[j]) {
          dp[i] = Math.min(dp[i], b[j] + dp[i - a[j]]);
        }
      }
    }
    int ans = Integer.MAX_VALUE;
    for(int i = 0; i < 10000; i++) {
      ans = Math.min(ans, dp[h + i]);
    }
    System.out.println(ans);
  }
}

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

int main() {
  string s;
  cin >> s;

  if (s[2] == s[3] && s[4] == s[5]) {
    cout << "Yes" << endl;
    return 0;
  }

  cout << "No" << endl;
}

Measured memory_bytes: 256
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <queue>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

static const double EPS = 1e-8;
static const double PI = 4.0 * atan(1.0);
static const double PI2 = 8.0 * atan(1.0);

#define REP(i,n)	for(int i=0;i<(int)n;++i)
#define ALL(c)		(c).begin(),(c).end()
#define CLEAR(v)	memset(v,0,sizeof(v))
#define MP(a,b)		make_pair((a),(b))
#define ABS(a)		((a)>0?(a):-(a))
#define FOR(i,s,n)	for(int i=s;i<(int)n;++i)

int main(int argc, char **argv) {
	int a, b;
	char op;
	cin >> a >> op >> b;
	cout << (op == '+' ? a + b : a - b) << endl;
	return 0;
}


Measured memory_bytes: 256
import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math, std.typecons, std.numeric;

void main()
{
    auto N = readln.chomp.to!int;
    int[string] ss;
    foreach (_; 0..N) ++ss[readln.chomp];
    int max_n;
    foreach (_, n; ss) max_n = max(max_n, n);
    string[] rs;
    foreach (s, n; ss) if (n == max_n) rs ~= s;
    sort(rs);
    foreach (r; rs) writeln(r);
}

Measured memory_bytes: 28540
#include <iostream>
#include<queue>
#include<stack>
#include<vector>
#include<set>
#include<map>
#include<algorithm>
#include<cstring>
#include<string>
#include<cassert>
#include<cmath>
#include<climits>
#include<iomanip>
#include<bitset>
#include<unordered_map>
 
using namespace std;

#define REP(i,n) for(ll (i)=0;(i)<(n);(i)++)
#define rep(i,j,n) for(ll (i)=(j);(i)<(n);(i)++)
#define FOR(i,c) for(decltype((c).begin())i=(c).begin();i!=(c).end();++i)
#define ll long long
#define ull unsigned long long
#define all(hoge) (hoge).begin(),(hoge).end()
typedef pair<ll, ll> P;
const long long INF = 1LL << 60;
const long long MOD = 1e9 + 7;
typedef vector<ll> Array;
typedef vector<Array> Matrix;
 
 
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;
}
 
//グラフ関連
struct Edge {//グラフ
	ll to, cap, rev;
	Edge(ll _to, ll _cap, ll _rev) {
		to = _to; cap = _cap; rev = _rev;
	}
};
typedef vector<Edge> Edges;
typedef vector<Edges> Graph;
 
void add_edge(Graph& G, ll from, ll to, ll cap, bool revFlag, ll revCap) {
	G[from].push_back(Edge(to, cap, (ll)G[to].size()));
	if (revFlag)G[to].push_back(Edge(from, revCap, (ll)G[from].size() - 1));
}

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

	string s;
	cin>>s;
	ll n=s.size();
	cout<<(((s[0]==s[n-1])^(n%2==0))?"Second":"First")<<endl;

	return 0;
}

Measured memory_bytes: 512
#include<iostream>
#include<string>
using namespace std;
int main(){
  string str;
  int ab[26]={};
  int i;
  while(getline(cin,str)){
    for(i=0;i<str.size();i++){
      if(str[i]>='a'&&str[i]<='z') ab[str[i]-'a']++;
      else if(str[i]>='A'&&str[i]<='Z') ab[str[i]-'A']++;
    }
  //cout << str << endl;
  }
  for(i=0;i<26;i++){
    cout << (char)('a'+i) << " : " << ab[i] << endl;
  }
  return 0;
}


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

int main(){
  int N, D, X;
  cin >> N >> D >> X;
  int A[N];
  int sum = 0;
  for(int i=0;i<N;i++) cin >> A[i];
  for(int i=0;i<N;i++){
  	sum += (D-1)/A[i] + 1;
  }
  cout << sum+X << endl;

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
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 ll INF = 1LL << 60;
const ll MOD = 1000000007;

int main() {
    while (true) {
        int a, b; cin >> a >> b;
        if (a == 0 && b == 0) break;
        vector<vector<ll>> dp(b + 1, vector<ll>(a + 1, 0));
        vector<vector<bool>> m(b + 1, vector<bool>(a + 1, true));
        dp[1][1] = 1;
        int n; cin >> n;
        for (int i = 0; i < n; i++) {
            int x, y; cin >> x >> y;
            m[y][x] = false;
        }
        for (int i = 1; i <= b; i++) {
            for (int j = 1; j <= a; j++) {
                if (m[i][j]) {
                    dp[i][j] += dp[i - 1][j]; //from south
                    dp[i][j] += dp[i][j - 1]; //from west
                }
            }
        }
        cout << dp[b][a] << endl;
    }
    return 0;
}


Measured memory_bytes: 3032
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define FUP(i, a, b) for(int i = a; i <= b; i++)
#define FDOWN(i, a, b) for(int i = a; i >= b; i--)
#define MS(a, b) memset(a, b, sizeof(a))
#define ALL(v) v.begin(), v.end()
#define CIN(a) cin >> a;
#define CIN2(a, b) cin >> a >> b
#define CIN3(a, b, c) cin >> a >> b >> c
#define COUT(a) cout << a
#define COUT2(a, b) cout << a << ' ' << b
#define COUT3(a, b, c) cout << a << ' ' << b << ' ' << c
#define ENDL cout << '\n'
int dy[4] = { -1, 1, 0, 0 };
int dx[4] = { 0, 0, 1, -1 };

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	
	string S;
	CIN(S);
	int cnt = 0;
	int answer = 0;
	for (char s : S)
	{
		if (s == 'R')
		{
			answer = max(answer, ++cnt);
		}
		else
		{
			cnt = 0;
		}
	}
	COUT(answer);
}

Measured memory_bytes: 3648
use std::io;
use std::cmp;
fn main (){
    let input = get_line();
    let nums : Vec<i32>
        = input.split_whitespace().map(|st| {st.parse().unwrap()}).collect();
    let (k,s) = (nums[0],nums[1]); // ?
    println!("{}", solve(k,s));
}

fn get_line() -> String {
    let mut buf = String::new();
    io::stdin().read_line(&mut buf).unwrap();
    buf
}

fn solve(k:i32, s:i32) -> i32 {
    let cases_with = |z| {
        let xy = s-z;
        cmp::max(2*cmp::min(k, xy) -xy+1, 0)
    };
    (0..k+1).map(cases_with).fold(0, |x, y|{x+y})
}

Measured memory_bytes: 380
import java.util.Scanner;
import java.util.Arrays;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		int m=sc.nextInt();
		int l=sc.nextInt();
		long[][] min=new long[n][n];
		for(int i=0; i<n; i++){
			Arrays.fill(min[i],Long.MAX_VALUE/10);
		}
		for(int i=0; i<m; i++){
			int a=sc.nextInt()-1;
			int b=sc.nextInt()-1;
			long c=sc.nextLong();
			if(c>l){
				continue;
			}
			min[a][b]=c;
			min[b][a]=c;
		}
		for(int i=0; i<n; i++){
			for(int j=0; j<n; j++){
				for(int k=0; k<n; k++){
					min[j][k]=Math.min(min[j][k],min[j][i]+min[i][k]);
				}
			}
		}
		for(int i=0; i<n; i++){
			for(int j=0; j<n; j++){
				if(min[i][j]<=l){
					min[i][j]=1;
				}else{
					min[i][j]=Long.MAX_VALUE/10;
				}
			}
		}
		for(int i=0; i<n; i++){
			for(int j=0; j<n; j++){
				for(int k=0; k<n; k++){
					min[j][k]=Math.min(min[j][k],min[j][i]+min[i][k]);
				}
			}
		}
		int q=sc.nextInt();
		for(int i=0; i<q; i++){
			int s=sc.nextInt()-1;
			int t=sc.nextInt()-1;
			if(min[s][t]==Long.MAX_VALUE/10){
				System.out.println(-1);
			}else{
				System.out.println(min[s][t]-1);
			}
		}
	}
}


Measured memory_bytes: 90040
s = str(input())
t = "ATCG"
ans = 0

for i in range(len(s)):
    now = 0
    for j in range(i, len(s)):
        ok = False
        for k in range(len(t)):
            if s[j] == t[k]:
                ok = True
        if ok:
            now += 1
            ans = max(ans, now)
        else:
            break
print(ans)


Measured memory_bytes: 3060
use std::collections::VecDeque;
use std::io::*;
use std::str::FromStr;

fn main() {
    let (n, m): (usize, usize) = (read(), read());
    let mut graph: Vec<Vec<usize>> = vec![Vec::new(); n];
    for _ in 0..m {
        let (a, b) = (read::<usize>() - 1, read::<usize>() - 1);
        graph[a].push(b);
        graph[b].push(a);
    }
    let mut color: Vec<i32> = vec![0; n];
    let mut nibu = true;
    let mut que: VecDeque<usize> = VecDeque::new();
    que.push_back(0);
    color[0] = 1;
    while !que.is_empty() {
        let p = que.pop_front().unwrap();
        for i in &graph[p] {
            if color[*i] == 0 {
                color[*i] = 3 - color[p];
                que.push_back(*i);
            }
            if color[*i] == color[p] {
                nibu = false;
                break;
            }
        }
    }
    let mut sum = n * (n - 1) / 2;
    if nibu {
        let (mut c1, mut c2) = (0, 0);
        for i in 0..n {
            if color[i] == 1 {
                c1 += 1;
            } else {
                c2 += 1;
            }
        }
        sum -= c1 * (c1 - 1) / 2;
        sum -= c2 * (c2 - 1) / 2;
    }
    println!("{}", sum - m);
}

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}


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

using ll = long long;
using Pi = pair<int, int>;
using Pl = pair<ll, ll>;
using vint = vector<int>;
using vvint = vector<vint>;
using vvvint = vector<vvint>;
using vdouble = vector<double>;
using vvdouble = vector<vdouble>;
using vvvdouble = vector<vvdouble>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using uint = unsigned int;
using ull = unsigned long long;

template<typename T> using uset = unordered_set<T>;
template<typename T1, typename T2> using umap = unordered_map<T1, T2>;

constexpr int INF = (1 << 30) - 1;
constexpr ll LLINF = 1LL << 60;
constexpr int dy[] = {1, 0, -1, 0, 1, -1, -1, 1};
constexpr int dx[] = {0, 1, 0, -1, 1, 1, -1, -1};
constexpr char el = '\n';
constexpr int mod = 1000000007;
constexpr int mod2 = 998244353;
template<typename T> T gcd(T a, T b) { return (b ? gcd(b, a % b) : a); }
template<typename T> T lcm(T a, T b) { return (a / gcd(a, b) * b); }
template<typename T1, typename T2>
inline bool chmin(T1 &a, T2 b) { return (a > b && (a = b, true)); }
template<typename T1, typename T2>
inline bool chmax(T1 &a, T2 b) { return (a < b && (a = b, true)); }

template<typename T>
vector<T> makeVector(size_t a, T b) { return (vector<T>(a, b)); }
template<typename... Ts>
auto makeVector(size_t a, Ts... ts) { 
	return (vector<decltype(makeVector(ts...))>(a, makeVector(ts...)));
}

template<typename T>
bool isin(T y, T x, T h, T w) { return (0 <= y && 0 <= x && y < h && x < w); }
template<typename T>
bool isin1(T y, T x, T h, T w) { return (0 < y && 0 < x && y <= h && x <= w); }

template<typename T>
ostream& operator <<(ostream &os, vector<T> &v) {
	if (v.size()) {
		os << v[0];
		for (int i = 1; i < v.size(); i++) os << " " << v[i];
	}
	return (os);
}

template<typename T>
istream& operator >>(istream &is, vector<T> &v) {
	for (auto &u : v) is >> u;
	return (is);
}

template<typename T1, typename T2>
istream& operator >>(istream &is, pair<T1, T2> &p) {
	return (is >> p.first >> p.second);
}


void Main() {
	map<string, int> cnt;
	int N; cin >> N;

	ll ans = 0;
	for (int i = 0; i < N; i++) {
		string S; cin >> S;
		sort(begin(S), end(S));
		ans += cnt[S];
		cnt[S]++;
	}
	cout << ans << endl;
}

int main() {
	cin.tie(0);
	ios::sync_with_stdio(0);
	cout << fixed << setprecision(20);
	Main();
	return (0);
}


Measured memory_bytes: 11292
#![allow(unused_imports)]
#![allow(non_snake_case)]

use std::cmp::{max, min};
use std::collections::*;
use std::io::BufRead;
use std::ops::*;
use std::*;

fn solve(K: usize, expects: Vec<(i64, i64, bool)>) -> i64 {
    let K2 = 2 * K;
    let K3 = 3 * K;

    // 解法:
    // 点を同一視して、白四角と黒四角を2つずつ並べた 2K*2K の矩形の上にすべての希望が乗っていることにしていい。また、すべての希望が黒であるとしていい。(白の希望はKずらせばいい。) 模様の種類は 2K*2K 通り。(この矩形の模様の種類と同じだから。)
    //
    // 各希望につき、その希望が叶えられる K*K の範囲が定まる。(範囲は希望に対する相対的な位置のみ考えればいい。以降の計算が平行移動不変だから。) それらの範囲が重なっている個数を各点のスコアと呼ぶ。各点を左上隅の K*K 範囲に集めたとき、そのマスを白四角の左下隅にすれば白マスのスコアが得られる。黒も同様。
    //
    // 希望が矩形の端のほうにあると範囲の「折り返し」が生じて記述がやっかいだが、これは矩形を拡張して 3K*3K にすると解消できる。厚みの計算を高速化するには2次元累積和を使う。

    let mut ds = vec![vec![0_i64; K3 + 1]; K3 + 1];

    for (x, y, black) in expects {
        // (y, x): white <=> (y + K, x): black
        let y = if black { y } else { y + K as i64 };

        // (y, x): black <=> (y + 2K Z, x + 2K Z): black
        let y = (y % K2 as i64) as usize;
        let x = (x % K2 as i64) as usize;

        ds[y][x] += 1;
        ds[y + K][x] -= 1;
        ds[y][x + K] -= 1;
        ds[y + K][x + K] += 1;
    }

    for y in 0..K3 {
        for x in 0..K3 {
            ds[y + 1][x] += ds[y][x];
        }
    }

    for y in 0..K3 {
        for x in 0..K3 {
            ds[y][x + 1] += ds[y][x];
        }
    }

    let mut T = vec![vec![[0_i64; 2]; K]; K];
    for y in 0..K3 {
        for x in 0..K3 {
            let black = (y / K + x / K) % 2;
            T[y % K][x % K][black] += ds[y][x];
        }
    }

    let mut ma = 0;
    for black in 0..2 {
        for y in 0..K {
            for x in 0..K {
                ma = max(ma, T[y][x][black]);
            }
        }
    }
    ma
}

pub fn main() {
    let (_, k, expects) = {
        let mut line = String::new();
        let stdin = std::io::stdin();
        let mut stdin = stdin.lock();

        stdin.read_line(&mut line).unwrap();
        let words = line.split_whitespace()
            .map(|s| s.parse::<usize>().unwrap())
            .take(2)
            .collect::<Vec<_>>();
        let (N, K) = (words[0], words[1]);

        let mut expects = Vec::new();

        for _ in 0..N {
            line.clear();
            stdin.read_line(&mut line).unwrap();
            let words = line.split_whitespace().take(3).collect::<Vec<&str>>();

            let (x, y, black) = (
                words[0].parse::<i64>().unwrap(),
                words[1].parse::<i64>().unwrap(),
                words[2] == "B",
            );

            expects.push((x, y, black));
        }
        (N, K, expects)
    };

    println!("{}", solve(k, expects));
    return;
}

#[cfg(test)]
pub mod tests {
    use super::*;

    const W: bool = false;
    const B: bool = true;

    #[test]
    fn test_case1() {
        let expects = vec![(0, 1, W), (1, 2, W), (5, 3, B), (5, 4, B)];
        assert_eq!(4, solve(3, expects));
    }

    #[test]
    fn test_case2() {
        let expects = vec![
            (1, 2, B),
            (2, 1, W),
            (2, 2, B),
            (1, 0, B),
            (0, 6, W),
            (4, 5, W),
        ];
        assert_eq!(4, solve(2, expects));
    }
}


Measured memory_bytes: 110844
#include <iostream>
#include <string>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <numeric>

using namespace std;


int main(){
   string s;
   cin>>s;
   s[5]=' ';
   s[13]=' ';
   cout<<s<<endl;
}
   


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define all(v) v.begin(), v.end()
#define vl vector<ll>
#define vi vector<int>
#define pii pair<int,int>
#define pb push_back
#define ff first
#define ss second
const int N=100005;
ll dp[3003][3004]={};
void solve()
{
    int n,k=1,m=0,i=1,j,x,y,l,r,p,q,z,a[3000];
    ll ans=0;
    cin>>n>>k>>m;
    cout<<((n+k-1)/k)*m;
}
int main()
{
    ios::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
     #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin) ;
    freopen("output.txt", "w", stdout) ;
    #endif 
    int t=1;
    //cin>>t;
    while(t--)solve();
    return 0;
}

Measured memory_bytes: 3636
#include<stdio.h>
#include<math.h>
int main(){
  double r,i,j,n;
  scanf("%lf",&r);
  i=r*r*M_PI;
  j=2*r*M_PI;
  printf("%.6f ",i);
  printf("%.6f\n",j);
  return (0);
}

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

int main()
{
    int n;
    cin >> n;
    int a[100002];
    for(int i = 0; i < n; i++){
        cin >> a[i];
        a[i]--;
    }
    int ans = 0;
    for(int i = 0; i < n; i++) if(a[a[i]] == i) ans++;
    cout << ans / 2 << endl;
}

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

int main(){
	int x,y,size,glid[10][10];
	int max = 0,count = 0;
	for(int i=0; i<10; i++){
		for(int j=0; j<10; j++){
			glid[i][j]=0;
		}
	}

	while(scanf("%d,%d,%d",&x,&y,&size) != EOF){
		glid[x][y]++;
		if(size == 1){
			if(x-1 >= 0 && x-1 < 10) glid[x-1][y]++;
			if(x+1 >= 0 && x+1 < 10) glid[x+1][y]++;
			if(y-1 >= 0 && y-1 < 10) glid[x][y-1]++;
			if(y+1 >= 0 && y+1 < 10) glid[x][y+1]++;
		}
		if(size == 2){
			if(x-1 >= 0 && x-1 < 10) glid[x-1][y]++;
			if(x+1 >= 0 && x+1 < 10) glid[x+1][y]++;
			if(y-1 >= 0 && y-1 < 10) glid[x][y-1]++;
			if(y+1 >= 0 && y+1 < 10) glid[x][y+1]++;
			if(x-1 >= 0 && y+1 >= 0 && x-1 < 10 && y+1 < 10) glid[x-1][y+1]++;
			if(x+1 >= 0 && y+1 >= 0 && x+1 < 10 && y+1 < 10) glid[x+1][y+1]++;
			if(x-1 >= 0 && y-1 >= 0 && x-1 < 10 && y-1 < 10) glid[x-1][y-1]++;
			if(x+1 >= 0 && y-1 >= 0 && x+1 < 10 && y-1 < 10) glid[x+1][y-1]++;
		}
		if(size == 3){
			if(x-1 >= 0 && x-1 < 10) glid[x-1][y]++;
			if(x+1 >= 0 && x+1 < 10) glid[x+1][y]++;
			if(y-1 >= 0 && y-1 < 10) glid[x][y-1]++;
			if(y+1 >= 0 && y+1 < 10) glid[x][y+1]++;
			if(x-1 >= 0 && y+1 >= 0 && x-1 < 10 && y+1 < 10) glid[x-1][y+1]++;
			if(x+1 >= 0 && y+1 >= 0 && x+1 < 10 && y+1 < 10) glid[x+1][y+1]++;
			if(x-1 >= 0 && y-1 >= 0 && x-1 < 10 && y-1 < 10) glid[x-1][y-1]++;
			if(x+1 >= 0 && y-1 >= 0 && x+1 < 10 && y-1 < 10) glid[x+1][y-1]++;
			if(x-2 >= 0 && x-2 < 10) glid[x-2][y]++;
			if(x+2 >= 0 && x+2 < 10) glid[x+2][y]++;
			if(y-2 >= 0 && y-2 < 10) glid[x][y-2]++;
			if(y+2 >= 0 && y+2 < 10) glid[x][y+2]++;
		}
	}
	
	for(int i=0; i<10; i++){
		for(int j=0; j<10; j++){
			if(max < glid[i][j])
				max = glid[i][j];
			if(glid[i][j] == 0)
				count++;
		}
	}
			cout << count << endl << max << endl;

}

Measured memory_bytes: 0
#include <bits/stdc++.h>
using namespace std;
#include <math.h>
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 int64_t INF = 1LL << 60;

int main() {
 string N;
 cin>>N;
 int count=0;
 for(int i=0;i<N.size();i++){
   if(N[i]=='2'){count++;}
 }
 cout<<count<<endl;
  return 0;
} 

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

namespace _0005
{
    class Program
    {
        static void Main(string[] args)
        {
            while (true)
            {
                string input = Console.ReadLine();
                if (input == null)
                {
                    break;
                }
                int[] x = input.Split().Select(int.Parse).ToArray();
                int GCD = x[0];
                while (true)
                {
                    if (x[0] % GCD == 0 && x[1] % GCD == 0)
                    {
                        break;
                    }
                    GCD--;
                }
                long LCM = x[0] / GCD * x[1];
                Console.WriteLine(GCD + " " + LCM);
            }
        }
    }
}

Measured memory_bytes: 9576
a,b,c = map(int,raw_input().split())

if a == b and b == c :
	print 0 if a %2 == 1 else -1

else : 
	count = 0
	while True:
		if a % 2 == 1 or b%2 == 1 or c%2 ==1:
			print count 
			break
		else :
			a_tmp = b/2 + c/2
			b_tmp = a/2 + c/2
			c_tmp = a/2 + b/2
			a = a_tmp
			b = b_tmp
			c = c_tmp
			count += 1


Measured memory_bytes: 2572
N=int(input())
x=[0 for i in range(N)]
y=[0 for i in range(N)]
for i in range(N):
    x[i],y[i]=map(int,input().split())
Mat=[[(x[i]-x[j],y[i]-y[j]) for j in range(i+1,N)] for i in range(N)]
D=dict()
for i in range(N):
    for j in range(N):
        if i==j:
            continue
        dr=(x[i]-x[j],y[i]-y[j])
        if dr in D:
            D[dr]+=1
        else:
            D[dr]=1
maxk=0
for v in D:
    if D[v]>maxk:
        maxk=D[v]
print(N-maxk)


Measured memory_bytes: 3572
#include<iostream>
#include<cmath>

int main()
{
	double Xa,Ya,Xb,Yb,Ra,Rb,d;

	int N;

	std::cin >> N;

	for(int i=0;i<N;++i)
	{		
		std::cin >> Xa >> Ya >> Ra >> Xb >> Yb >> Rb;

		d=sqrt((Xa-Xb)*(Xa-Xb)+(Ya-Yb)*(Ya-Yb));

		if(d<Ra-Rb)
		{
			std::cout << '2' << '\n';
		}

		else if(d<Rb-Ra)
		{
			std::cout << "-2" << '\n';
		}

		else if(Ra+Rb<d)
		{
			std::cout << '0' << '\n';
		}

		else
		{
			std::cout << '1' << '\n';
		}
	}
}

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

#define SORT(x) sort((x).begin(),(x).end())
#define RSORT(x) sort((x).begin(),(x).end(),greater<int>())
#define SZ(x) ((int)(x).size())
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
#define dump(x)  cout << #x << " = " << (x) << endl;

typedef long long ll;
typedef pair<int, int> ii;
const int mod = 1e9+7;
const ll INF = 1e18;
const int inf = 1e9;

void solve()
{
  int n,k;cin>>n>>k;
  ll ans = 1;
  if (k==2) {
    ans = pow(n/k,3) + pow((n+1)/k,3);
  } else if (k%2==1) {
    ans = pow(n/k,3);
  } else {
    ans = pow(n/k,3) + pow((2*n/k)-(n/k),3);
  }
  cout << ans << endl;
}

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


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

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

    int n;cin>>n;

    int ans=0;

    for(int i=1;i<=n;i+=2)
    {
        int num=i;
        for(int r=3;r<sqrt(n);r+=2)
        {
            if(num%r)continue;
            int cnt=0;
            for(;num%r==0;num/=r)cnt++;
            num*=(cnt+1);
        }
        if(num==8)ans++;
    }

    cout<<ans<<"\n";

    return 0;
}


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

enum inf3 = 1_001_001_001;
enum inf6 = 1_001_001_001_001_001_001L;
enum mod = 1_000_000_007L;

alias Edge = Tuple!(int, "u", int, "v");

void main() {
    int n;
    scan(n);
    auto b = readArr!(int)();

    int[] ans;

    foreach (i ; 0 .. n) {
        int p = -1;

        foreach_reverse (j ; 0 .. b.length) {
            if ((j + 1) == b[j]) {
                p = j.to!int;
                break;
            }
        }

        if (p == -1) {
            writeln(-1);
            return;
        }

        ans ~= p + 1;
        b = b[0 .. p] ~ b[p + 1 .. $];
        debug {
            writeln(b);
        }
    }

    ans.reverse();

    writefln("%(%s\n%)", ans);
}


























int[][] readGraph(int n, int m, bool isUndirected = true, bool is1indexed = true) {
    auto adj = new int[][](n, 0);

    foreach (i; 0 .. m) {
        int u, v;
        scan(u, v);
        if (is1indexed) {
            u--, v--;
        }
        adj[u] ~= v;
        if (isUndirected) {
            adj[v] ~= u;
        }
    }

    return adj;
}

//alias Edge = Tuple!(int, "to", int, "cost");

Edge[][] readWeightedGraph(int n, int m, bool isUndirected = true, bool is1indexed = true) {
    auto adj = new Edge[][](n, 0);

    foreach (i; 0 .. m) {
        int u, v, c;
        scan(u, v, c);
        if (is1indexed) {
            u--, v--;
        }
        adj[u] ~= Edge(v, c);
        if (isUndirected) {
            adj[v] ~= Edge(u, c);
        }
    }

    return adj;
}

void yes(bool b) {
    writeln(b ? "Yes" : "No");
}

void YES(bool b) {
    writeln(b ? "YES" : "NO");
}

T[] readArr(T)() {
    return readln.split.to!(T[]);
}

T[] readArrByLines(T)(int n) {
    return iota(n).map!(i => readln.chomp.to!T).array;
}

void scan(T...)(ref T args) {
    import std.stdio : readln;
    import std.algorithm : splitter;
    import std.conv : to;
    import std.range.primitives;

    auto line = readln().splitter();
    foreach (ref arg; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront();
    }
    assert(line.empty);
}

void fillAll(R, T)(ref R arr, T value) {
    static if (is(typeof(arr[] = value))) {
        arr[] = value;
    }
    else {
        foreach (ref e; arr) {
            fillAll(e, value);
        }
    }
}

bool chmin(T, U...)(ref T x, U args) {
    bool isChanged;

    foreach (arg; args) {
        if (x > arg) {
            x = arg;
            isChanged = true;
        }
    }

    return isChanged;
}

bool chmax(T, U...)(ref T x, U args) {
    bool isChanged;

    foreach (arg; args) {
        if (x < arg) {
            x = arg;
            isChanged = true;
        }
    }

    return isChanged;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define f first
#define s second
typedef long long ll;
typedef pair<int, int> pii;
const int MOD = 1000000007;
const int oo = 1000000001;
const int N = 200011;
ll q,h,s,d,n;

int main() {
	//freopen("input.txt", "r", stdin);
	cin >> q >> h >> s >> d >> n;
	h = min(h,2*q);
	s = min(s,2*h);
	d = min(d,2*s);
	ll cost = 0;
	if(n>= 2){
		int need = n/2;
		cost += d * need;
		n -= need * 2;
	}
	cost += s * n;
	printf("%lld\n", cost);
	return 0;
}

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


int main() {

    int a, b, c;
    cin >> a >> b >> c;
    if (a+b+c >= 22) cout << "bust" << endl;
    else cout << "win" << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>

using namespace std;

int gcd(int a, int b){
    if(a < b) swap(a, b);
    int tmp;
    while(tmp = a%b){
        a = b;
        b = tmp;
        //cout << "a";
    }
    return b;

}

int main(){
    int n;
    cin >> n;
    vector<int> a(n);
    vector<int> fw(n), bk(n);
    for(int i = 0; i < n; i++){
        cin >> a[i];
    }

    fw[0] = a[0];
    for(int i = 1; i < n; i++){
        fw[i] = gcd(a[i], fw[i-1]);
    }
    bk[n-1] = a[n-1];
    for(int i = n-2; i >= 0; i--){
        bk[i] = gcd(a[i], bk[i+1]);
        //cout << bk[i] << endl;
    }

    int max = 0;
    for(int i = 0; i < n; i++){
        int g;
        if(i == 0) g = bk[1];
        else if(i == n-1) g = fw[n-2];
        else g = gcd(fw[i-1], bk[i+1]);

        if(max < g) max = g;
    }

    cout << max << endl;
    
}

Measured memory_bytes: 1408
#include <iostream>
#include <vector>
#include <cmath>
#include <queue>
#include <deque>
#include <set>
#include <string>
#include <map>
#include <algorithm>
#include <stack>
#include <cstdlib>
#include <iomanip>
#include <ctime>
using namespace std;

using ll = long long;
using ull = unsigned long long;
using ld = long double;
#define ff first
#define ss second

vector<bool> used;
vector<vector<int>> g;

void dfs(int v) {
	used[v] = true;
  	for (int u : g[v]) {
    	if (!used[u])
          	dfs(u);
    }
}

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n, m;
  	cin >> n >> m;
  	g.resize(n);
  	used.resize(n);
  	for (int i = 0; i < m; i++) {
    	int u, v;
      	cin >> u >> v;
      	u--, v--;
      	g[u].push_back(v);
      	g[v].push_back(u);
    }
  	int k = 0;
  	for (int i = 0; i < n; i++) {
    	if (used[i])
        	continue;
      	k++;
      	dfs(i);
    }
  	cout << k - 1;
    return 0;
}

Measured memory_bytes: 9256
//  A bug is never just a mistake. It represents something bigger. An error of thinking that makes you who you are.
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
typedef long long int ll;
typedef vector<int> vi;
typedef vector<ll> vl;
#define pii pair<int,int>
#define pll pair<ll,ll>
#define MAXN 500009
const int INF = 1.01e9;
#define int int64_t
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define db(x) cerr << #x << " = " << x << endl
#define db2(x, y) cerr << "(" << #x << ", " << #y << ") = (" << x << ", " << y << ")\n";
#define db3(x, y, z) cerr << "(" << #x << ", " << #y << ", " << #z << ") = (" << x << ", " << y << ", " << z << ")\n"
#define dbv(a) cerr << #a << " = "; for (auto xxxx: a) cerr << xxxx << " "; cerr << endl


int32_t main(){
		
	ios::sync_with_stdio(false);
    cin.tie(0);
    int n,p;
    cin>>n>>p;
    string s;
    cin>>s;
    int ppow[n+1];
    ppow[0] = 1;
    rep(i,1,n+1){
    	ppow[i] = ppow[i-1]*10;
    	ppow[i]%=p;
    }

    int h[n+1];
    h[n] = 0 ;
    per(i,0,n){
    	int c = s[i]-'0';
    	h[i] = (h[i+1] + c*ppow[n-1-i])%p;
    }
    unordered_map<int,int> cc;
    cc[0] = 1;
    int ans = 0;
    if(p!=2 && p!=5 && p!=10){
    per(i,0,n){
    	ans+=cc[h[i]];
    	cc[h[i]]++;
    }
    cout<<ans<<"\n";}
    else{
    	if(p==2){
    		int cnn = 0;
    		per(i,0,n){
    			ans+=cnn;
    			if(s[i]=='4' || s[i]=='2' || s[i]=='0' || s[i]=='8' || s[i]=='6'){
    				cnn++;
    				ans++;
    			}
    		}
    		cout<<ans<<"\n";
    	}

    	if(p==5){
    		int cnn = 0;
    		per(i,0,n){
    			ans+=cnn;
    			if(s[i]=='5' || s[i]=='0'){
    				cnn++;
    				ans++;
    			}
    		}
    		cout<<ans<<"\n";
    	}

    	if(p==10){
    		int cnn = 0;
    		per(i,0,n){
    			ans+=cnn;
    			if(s[i]=='0'){
    				cnn++;
    				ans++;
    			}
    		}
    		cout<<ans<<"\n";
    	}

    }
    


}

Measured memory_bytes: 3988
#include <bits/stdc++.h>
using namespace std;
int main() {
	int N;
	cin >> N;
	int B[110];
	int A[110];
	int sum = 0;
	for (int i = 0; i < N-1; i++) {
		cin >> B[i];
		if (i > 0 && i < N-1) {
			A[i] = min(B[i], B[i-1]);
		}
	}
	A[0] = B[0];
	A[N-1] = B[N-2];
	for (int i = 0; i < N; i++) {
		sum += A[i];
	}
	cout << sum << endl;
}

Measured memory_bytes: 256
//↓見なくていいよ！ここから--------------------------------------------------
var read = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});
var obj;
var inLine = [];
read.on('line', function(input){inLine.push(input);});
read.on('close', function(){
  obj = init(inLine);
  console.error("\n");
  var start = Date.now();
  Main();
  var end = Date.now() - start;
  myerr("time : " + (end) + "ms");
  myerr("memory : " + Math.round(process.memoryUsage().heapTotal / 1024) + "KB");
});
function makeClone(obj){return JSON.parse(JSON.stringify(obj));}
function nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}
function nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}
function next(){return obj.next();} function hasNext(){return obj.hasNext();}
function init(input){  
  var returnObj = {
    list : input, index : 0, max : input.length,
    hasNext : function(){return (this.index < this.max);},
    next : function(){if(!this.hasNext()){throw "ArrayIndexOutOfBoundsException これ以上ないよ";}else{var returnInput = this.list[this.index];this.index++;return returnInput;}}
  };
  return returnObj;
}
function myout(s){console.log(s);}
function myerr(s){console.error("debug:" + require("util").inspect(s,false,null));}
//[no]要素の扱い。数値型
//不明値、異常時:引数そのまま返す 1:数値へ変換
//2:半角SPで分割 4:半角SPで分割し、数値配列へ
//6:1文字で分割  7:1文字で分割し、数値配列へ
//8:半角SPで結合 9:改行で結合 0:文字なしで結合
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(" ");case 4:return i.split(" ").map(Number);case 6:return i.split("");case 7:return i.split("").map(Number);case 8:return i.join(" ");case 9:return i.join("\n");case 0:return i.join("");default:return i;}}catch(e){return i;}}

//↑見なくていいよ！ここまで--------------------------------------------------
function Main(){
	var N = nextInt();
	var list = new Array(N);
	for(var i = 0; i < N; i++){
		list[i] = {
			child : {},
			color : -1,
			access : false
		};
	}
	for(var i = 0; i < N - 1; i++){
		var tmp = nextIntArray();
		list[tmp[0] - 1].child[tmp[1] - 1] = tmp[2];
		list[tmp[1] - 1].child[tmp[0] - 1] = tmp[2];
	}
	
	var queue = new Array(100005);
	var maeIndex = 0;
	var atoIndex = 1
	queue[0] = 0;
	list[0].access = true;
	list[0].color = 0;
	while(maeIndex != atoIndex){
		var tmp = queue[maeIndex];
		maeIndex++;
		var child = list[tmp].child;
		var keys = Object.keys(child);
		for(var i = 0; i< keys.length; i++){
			if(!list[keys[i]].access){
				if(child[keys[i]] % 2 == 1){
					list[keys[i]].color = (list[tmp].color == 1) ? 0 : 1;
				}else{
					list[keys[i]].color = list[tmp].color;
				}
				list[keys[i]].access = true;
				queue[atoIndex] = keys[i];
				atoIndex++;
			}
		}
	}
	var output = new Array(N);
	for(var i = 0; i < N; i++){
		output[i] = list[i].color;
	}
	myout(myconv(output,9));
}


Measured memory_bytes: 105100
#include <bits/stdc++.h>
using namespace std;
#define itn int
#define nibu(K,x) binary_search(K.begin(),K.end(),x)
#define rep(i,n) for(int i=0;i<n;i++)
#define all(x) x.begin(),x.end()
#define sz(x) x.size()
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define out(x) cout<<x<<endl
#define put(x) out(x)
#define in(x) cin>>x
#define maxx(a,b,c) max(a,max(b,c))
#define minn(a,b,c) min(a,min(b,c))
using ll = long long;
using vl = vector<ll>;
using vs = vector<string>;
const double pi = 3.14159265358979;
const ll mod = 1000000007;

int main() {
 int a,b;
  in(a>>b);
  if(a%2==1&&b%2==1)out("Yes");
  else out("No");
}
  

Measured memory_bytes: 256
MV = {}
MV["U"] = [-1, 0]; MV["D"] = [1, 0]; MV["L"] = [0, -1]; MV["R"] = [0, 1]
Tank = {}
Tank["^"] = "U"; Tank["v"] = "D"; Tank["<"] = "L"; Tank[">"] = "R"
gets.to_i.times do |i|
  puts if i > 0
  h, w = gets.split.map(&:to_i)
  fld = (h+2).times.map{""}
  fld[0] = fld[h+1] = " "*(w+2)
  y, x = 0, 0 
  z = ""
  h.times do |i|
    f = gets.chomp
    Tank.keys.each do |t|
      if f.include?(t)
        y, x = i + 1, f.index(t) + 1
        z = Tank[t]
      end
    end
    fld[i+1] << " " + f + " "
  end 

  n = gets.to_i
  tank = gets
  n.times do |i|
    if tank[i] == "S"
      my, mx = y, x
      while fld[my][mx] != " "
        my += MV[z][0]; mx += MV[z][1]
        if fld[my][mx] == "*"
          fld[my][mx] = "."
          break
        elsif fld[my][mx] == "#"
          break
        end
      end
    else
      z = tank[i]
      if fld[y + MV[z][0]][x + MV[z][1]] == "."
        fld[y][x] = "."
        y += MV[z][0]; x += MV[z][1]
        fld[y][x] = Tank.key(z)
      else
        fld[y][x] = Tank.key(z)
      end
    end
  end
  (1..h).each{ |i| puts fld[i][1,w] }
end

Measured memory_bytes: 8736
#include <iostream>
#include <cstdio>
#include <vector>
#include <stack>
#include <math.h>

using namespace std;

typedef long long int ll;
typedef long double ld;

#define rep(i,n) for(int i = 0; i < (n); ++i)
#define vsort(a) sort(a.begin(), a.end())
#define rev(a) reverse(a.begin(), a.end())


// a,bの最小公倍数
ll LCM(ll a, ll b){ll lcm = a * b; ll r = a % b;while(r != 0){a = b; b = r; r = a % b;}return lcm /= b;}
// a,bの最大公約数
ll GCD(ll a, ll b){ll r = a % b;while(r != 0){a = b; b = r; r = a % b;}return b;}


const int MOD = 1000000007;
const int INF = INT_MAX;



int main(){

    int n;
    cin >> n;
    vector <string> s(n);
    rep(i,n) cin >> s[i];

    vsort(s);

    int mx = 1;
    int tmp = 1;
    for (int i = 1; i < n; i++){
        if (s[i-1] == s[i]){
            tmp++;
            mx = max(mx, tmp);
        }
        else{
            mx = max(mx, tmp);
            tmp = 1;
        }
    }


    tmp = 1;
    for (int i=1; i < n; i++){
        if (tmp == mx) cout << s[i-1] << endl;
        if (s[i-1] == s[i]) {
            tmp++;
        }
        else tmp = 1;
    }
    if (tmp == mx) cout << s[n-1] << endl;

}





//              g++ -std=c++1z


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

#define ll long long
#define fornum(A,B,C) for(A=B;A<C;++A)
#define fornumd(A,B,C) for(A=(ll)C-1;A>=B;++A)
#define pii pair<int,int>
#define pll pair<ll,ll>
template<typename T>
void mxin(T& a,T b){if(a<b)a = b;}
template<typename T>
void mnin(T& a,T b){if(a>b)a = b;}
using namespace std;

/////////////////////////////////////////////////////
#define PI 3.14159265358979323846

ll X;
ll i, j, k;

int main(){
    scanf("%lld", &X);
    double x = X * PI / 180;
    double a = 0;
    double px = 0, py = 0;
    k = 0;
    do{
        px += cos(a);
        py += sin(a);
        a += x;
        ++k;
    } while (px < -1e-5 || 1e-5 < px || py < -1e-5 || 1e-5 < py);
    printf("%lld\n", k);
    return 0;
}

Measured memory_bytes: 4152
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define P pair<ll,ll>
#define FOR(I,A,B) for(ll I = (A); I < (B); ++I)
#define FORR(I,A,B) for(ll I = ((B)-1); I >= (A); --I)
#define TO(x,t,f) ((x)?(t):(f))
#define SORT(x) (sort(x.begin(),x.end())) // 0 2 2 3 4 5 8 9
#define REV(x) (reverse(x.begin(),x.end())) //reverse
ll gcd(ll a,ll b){if(a<b)swap(a,b);if(a%b==0)return b;else return gcd(b,a%b);}
ll lcm(ll a,ll b){ll c=gcd(a,b);return ((a/c)*(b/c)*c);}//saisyo kobaisu
#define NEXTP(x) next_permutation(x.begin(),x.end())
const ll INF=1e18+7;
const ll MOD=1e9+7;
#define pri(a) cout << (a) << endl

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	ll n;
	cin >> n;
	cout << n/3 << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
#define rep(i, n) for(ll i = 0;i < n;i++)
template<class T, class U> void cmax(T& a, U b) { if (a<b) a = b; }
template<class T, class U> void cmin(T& a, U b) { if (a>b) a = b; }

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

  int n, m;
  cin >> n >> m;
  vector<bool> l(n);
  l[0] = true;
  vector<int> cnt(n, 1);

  rep(i, m) {
    int x, y;
    cin >> x >> y;
    x--; y--;
    if (l[x]) {
      if (cnt[x] == 1) l[x] = 0;
      l[y] = 1;
    }
    cnt[x]--;
    cnt[y]++;
  }

  cout << count(l.begin(), l.end(), 1) << endl;
}


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

#define  int  long long
#define  endl  '\n'
const int mod = 1e9 + 7;


int32_t main()
{ 
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
 
  
  int a, b;
  cin >> a >> b;

  int cur = 1, cnt = 0;

  while(cur < b)
  {
    cur += (a - 1);
    cnt++;
  }

  cout << cnt;
  
  return 0;
}

Measured memory_bytes: 256
import sys
input = sys.stdin.readline
H,W,D=map(int,input().split())
A=[list(map(int,input().split())) for _ in range(H)]

m=[[None]*(H*W//D+1) for _ in range(D+1)]
#print(m)
for h in range(H):
    for w in range(W):
        amari=A[h][w]%D
        shou=A[h][w]//D
        if amari==0:
            amari=D
            shou-=1
        m[amari][shou]=[h,w]

"""for i in m:
    print(i)
"""
mrui=[[0]for _ in range(D+1)]
for i in range(D+1):
    for j in range(1,H*W//D+1):
        if m[i][j]!=None and m[i][j-1]!=None:
            x=abs(m[i][j][0]-m[i][j-1][0])
            y=abs(m[i][j][1]-m[i][j-1][1])
            mrui[i].append(x+y)
for i in mrui:
    for j in range(1,len(i)):
        i[j]+=i[j-1]
#print(mrui)

Q=int(input())
for i in range(Q):
    L,R=map(int,input().split())
    ramari=R%D
    rshou=R//D
    if ramari==0:
        ramari=D
        rshou-=1
    lamari=L%D
    lshou=L//D
    if lamari==0:
        lamari=D
        lshou-=1
    print(mrui[ramari][rshou]-mrui[lamari][lshou])


Measured memory_bytes: 80236
#include <iostream>
using namespace std;
int main(){
    long long a, b; cin >> a >> b;
    if(a == b) {
        cout << "Positive" << endl;
        return 0;
    }
    if(a > 0 && b > 0) {
        cout << "Positive" << endl;
        return 0;
    }
    if(a == 0 || b == 0 || (a < 0 && b > 0)) {
        cout << "Zero" << endl;
        return 0;
    }
    if((b - a) % 2 == 0) {
        cout << "Negative" << endl;
    } else {
        cout << "Positive" << endl;
    }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
#define rrep(i,n) for(int i=1;i<(n);++i)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define maxs(a, b) a = max(a, b)
#define mins(a, b) a = min(a, b)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const ll linf = (1ll << 61);
const int inf = 1001001001;
const int mod = 1000000007;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n, k;
	cin >> n >> k;
	vector<int> x(n), y(n);
	rep(i, n) {
		cin >> x[i] >> y[i];
	}
	vector<int> recx = x, recy = y;
	sort(x.begin(), x.end());
	sort(y.begin(), y.end());
	ll ans = 1e20;
	for (int x1 = 0; x1 < n; ++x1) {
		for (int x2 = x1 + 1; x2 < n; ++x2) {
			for (int y1 = 0; y1 < n; ++y1) {
				for (int y2 = y1 + 1; y2 < n; ++y2) {
					int cnt = 0;
					rep(i, n) {
						if (recx[i] >= x[x1] && recx[i] <= x[x2] && recy[i] >= y[y1] && recy[i] <= y[y2]) cnt++;
					}
					if (cnt >= k) {
						mins(ans, ll(x[x2] - x[x1])* ll(y[y2] - y[y1]));
					}
				}
			}
		}
	}
	printf("%lld\n", ans);
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>
#include <queue>
#include <iomanip>
using namespace std;
typedef long long ll;

int main() {
    int n, mn = 0;
    cin >> n;
    while (pow(2, mn) < n) mn++;
    mn--;
    
    int ans[505][505];
    for (int i = 0; i < n*n; i++) ans[i%n][i/n] = -1;
    
    for (int i = 0; i <= mn; i++) {
        for (int p = 0; p < n; p++) {
            for (int q = p + 1; q < n; q++) {
                //cout << p << " " << q << " " << (p & (1 << i)) <<" " << (q & (1 << i)) << endl;
                if (ans[p][q] == -1 && (((p & (1 << i)) ^ (q & (1 << i))) == pow(2, i))) {
                    ans[p][q] = i;
                }
            }
        }
    }

    for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < n; j++) {
            if (j != i + 1) cout << " ";
            cout << ans[i][j] + 1;
        }
        cout << endl;
    }


}

/* 
g++ -std=c++14 _main.cpp
*/

Measured memory_bytes: 1536