akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include <climits>
#include <cstring>
#include <string>
#include <bitset>
#include <cmath>

using namespace std;

int getEdge(int x1, int y1, int x2, int y2) {
    return abs(x1 - x2) * abs(x1 - x2) + abs(y1 - y2) * abs(y1 - y2);
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int x1, y1, x2, y2;
    int x3, y3, x4, y4;
    cin >> x1 >> y1 >> x2 >> y2;
    int edge2 = getEdge(x1, y1, x2, y2);
    for (int x = -500; x <= 500; ++x) {
        for (int y = -500; y <= 500; ++y) {
            if (getEdge(x, y, x2, y2) == edge2) {
                if ((x - x2) * (y2 - y1) - (y - y2) * (x2 - x1) == -edge2) {
                    x3 = x;
                    y3 = y;
                }
            }
        }
    }
    for (int x = -500; x <= 500; ++x) {
        for (int y = -500; y <= 500; ++y) {
            if (getEdge(x, y, x3, y3) == edge2) {
                if ((x - x3) * (y3 - y2) - (y - y3) * (x3 - x2) == -edge2) {
                    x4 = x;
                    y4 = y;
                }
            }
        }
    }
    cout << x3 << " " << y3 << " " << x4 << " " << y4 << endl;
    return 0;
}

Measured memory_bytes: 256
n = int(input())
s = input()

l = [str(i).zfill(3) for i in range(0,1000)]

ct = 0
for i in l:
  n0 = s.find(i[0])
  if n0==-1:
    continue
  n1 = s.find(i[1], n0+1)
  if n1==-1:
    continue
  n2 = s.find(i[2], n1+1)
  if n2!=-1:
    ct += 1
   
print(ct)

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

int main(){
  int A, B, C;
  cin >> A >> B >> C;
  for(int i=1;i<B;i++){
    if((i*A)%B==C){
	  cout << "YES" << endl;
	  return 0;
	}
  }
  cout << "NO" << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define FOR(i, a, b) for(ll i = (a); i < (b); ++i)
#define FORR(i, a, b) for(ll i = (a); i > (b); --i)
#define REP(i, n) for(ll i = 0; i < (n); ++i)
#define REPR(i, n) for(ll i = n; i >= 0; i--)
#define FOREACH(x, a) for(auto &(x) : (a))
#define dump(x) cout << #x << " = " << (x) << endl;
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
using namespace std;
using ll = long long;
using P = pair<ll, ll>;

#define int long long

signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N, L;
  cin >> N >> L;
  vector<int> a(N);
  REP(i, N) a[i] = L + i;
  int sum = 0;
  REP(i, N) sum += a[i];
  int mn = 1e9;
  REP(i, N) {
    if(abs(mn) > abs(a[i])) { mn = a[i]; }
  }
  cout << sum - mn << endl;
  return 0;
}

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

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

template<class Type>
Type modpow(Type a, Type n, Type mod)
{
	Type res = 1;
	while (0 < n)
	{
		if (n & 1)
		{
			res = res * a % mod;
		}
		a = a * a % mod;
		n >>= 1;
	}
	return res;
}

template<class Type>
Type gcd(Type x, Type y)
{
	Type r;
	if (x < y)
	{
		swap(x, y);
	}

	while (0 < y)
	{
		r = x % y;
		x = y;
		y = r;
	}
	return x;
}

template<class Type>
bool isPrime(Type x)
{
	if (x == 2) return true;
	if (x < 2 || x % 2 == 0) return false;

	for (Type i = 3; i <= sqrt(x); i += 2)
	{
		if (x % i == 0) return false;
	}
	return true;
}

template<class Type>
vector<bool> eratos(Type n)
{
	vector<bool> isPrime(n + 1, true);
	isPrime[0] = isPrime[1] = false;
	for (Type i = 2; i <= n; i++)
	{
		if (isPrime[i])
		{
			Type j = i + i;
			while (j <= n)
			{
				isPrime[j] = false;
				j = j + i;
			}
		}
	}
	return isPrime;
}

bool binarySearchJudge(vector<int> a, int index, int key)
{
	if (key <= a[index]) return true;
	else return false;
}

int binarySearch(vector<int> a, int key)
{
	int ng = -1;
	int ok = a.size();
	while (1 < abs(ng - ok))
	{
		int mid = (ng + ok) / 2;
		if (binarySearchJudge(a, mid, key)) ok = mid;
		else ng = mid;
	}
	return a[ok] == key;
}

double dist(vector<int> x, vector<int> y, int i, int j)
{
	return sqrt(pow(x[i] - x[j], 2) + pow(y[i] - y[j], 2));
}

int main()
{
	ll x, y;
	cin >> x >> y;
	int i = 1;
	int length = 1;
	while (true)
	{
		x *= 2;
		if (y < x) break;
		length++;
		i++;
	}
	cout << length << endl;
}

Measured memory_bytes: 256
#![allow(unused)]

use std::{cell, cmp, collections, fmt, ops};

use cell::{Cell, RefCell};
use cmp::Ordering::{Equal, Greater, Less};
use collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, LinkedList, VecDeque};
use fmt::{Debug, Display};

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

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

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

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

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

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

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

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

#[cfg(feature = "debug")]
macro_rules! dbg {
    ($($args: tt)*) => { eprint!($($args)*) };
}

#[cfg(feature = "debug")]
macro_rules! dbgln {
    ($($args: tt)*) => { eprintln!($($args)*) };
}

#[cfg(not(feature = "debug"))]
macro_rules! dbg {
    ($($args:tt)*) => {};
}

#[cfg(not(feature = "debug"))]
macro_rules! dbgln {
    ($($args:tt)*) => {};
}

mod num {
    //
}

macro_rules! vmin {
    ($x: expr, $y: expr) => { cmp::min($x, $y) };
    ($x: expr, $($args: expr),*) => { cmp::min($x, vmin!($($args),*)) };
}

macro_rules! vmax {
    ($x: expr, $y: expr) => { cmp::max($x, $y) };
    ($x: expr, $($args: expr),*) => { cmp::max($x, vmax!($($args),*)) };
}

mod bits {
    pub fn is_high(bits: u64, pos: u64) -> bool {
        bits & (1 << pos) != 0
    }
}

fn main() {
    input!(a: i32, b: i32, k: i32);

    let mut a = a;
    let mut b = b;

    for i in 0..k {
        if i % 2 == 0 {
            let (a_, b_) = f(a, b);
            a = a_;
            b = b_;
        } else {
            let (b_, a_) = f(b, a);
            a = a_;
            b = b_;
        }
    }

    println!("{} {}", a, b);
}

fn f(mut a: i32, mut b: i32) -> (i32, i32) {
    if a % 2 == 1 {
        a -= 1;
    }
    b += a / 2;
    a /= 2;
    (a, b)
}

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

    #[test]
    fn test() {
        //
    }
}


Measured memory_bytes: 4352
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define fr(i,j,k) for(int i=j;i<k;i++)
#define f(n) fr(i,0,n)
#define f1(n) fr(i,1,n+1)
#define pb push_back
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define SZ(x) (int)x.size()
const int maxn = 108576;
const int mod = 998244353;
vector<int>ans[100005];
set<int>g[100005];
int v[100005];
void dfs(int now, int pre) {
    for (auto &i : g[now]) {
        if (i == pre)continue;
        if (!v[i]) {
            v[i] = 1;
            dfs(i, now);
        }
        else {
            g[i].erase(now);
            ans[now].pb(i);
        }
    }
    if (ans[now].size() & 1) {
        ans[now].pb(pre);
    }
    else {
        ans[pre].pb(now);
    }
}
int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int n, m;
    cin >> n >> m;
    if (m & 1) {
        cout << -1 << endl;
        exit(0);
    }
    f (m) {
        int x, y;
        cin >> x >> y;
        g[x].insert(y);
        g[y].insert(x);
    }
    v[1] = 1;
    dfs(1,1);
    ans[1].pop_back();
    f1(n) {
        for (auto &j : ans[i]) {
            cout << i << ' ' << j << '\n';
        }
    }
}

Measured memory_bytes: 27648
#include <iostream>
using namespace std;
 
int main() {
    int n;
    cin >> n;
 
    int array[n];
    for(int i=0; i < n; i++){
        cin >> array[i];
    }
    
    int ans = 0;
    for(int i=0; i < n; i++){
        if((i+1) != array[i]){
            ++ans;
        }
    }
    // cout << ans << endl;
    if(ans <= 2){
        cout << "YES" << endl;
    }else{
        cout << "NO" << endl;
    }
 
    return 0;
}


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

int main() {
	int n;
	cin >> n;
	vector<int> a(n + 2);
	for (int i = 0; i < n; i++) {
		cin >> a[i + 1];
	}
	int s = 0;
	for (int i = 0; i < n + 1; i++) {
		s += abs(a[i] - a[i + 1]);
	}
	for (int i = 0; i < n; i++) {
		cout << s - abs(a[i] - a[i + 1]) - abs(a[i + 1] - a[i + 2]) + abs(a[i] - a[i + 2]) << endl;
	}
	return 0;
}


Measured memory_bytes: 1664
#include <bits/stdc++.h>
#include <vector>
#include <set>
#include <map>
#include <string> 
#include <cstdio>
#include <cstdlib>
#include <climits>
#include <utility>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <iomanip> 
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp> 

using namespace std;
using namespace __gnu_pbds;

#define f(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) f(i,0,n)
#define fd(i,a,b) for(i=a;i>=b;i--)
#define pb push_back
#define mp make_pair
#define vi vector< int >
#define vl vector< ll >
#define ss second
#define ff first
#define ll long long
#define pii pair< int,int >
#define pll pair< ll,ll >
#define sz(a) a.size()
#define inf (1000*1000*1000+5)
#define all(a) a.begin(),a.end()
#define rev(a) a.rbegin(),a.rend()
#define tri pair<int,pii>
#define vii vector<pii>
#define vll vector<pll>
#define viii vector<tri>
#define mod (1000*1000*1000+7)
#define pqueue priority_queue< int >
#define pdqueue priority_queue< int,vi ,greater< int > >



void solve(){
    ll m = 0, n = 0, i = 0, j = 0, k = 0, ma = -1e9, mi = 1e9, ans = 0, cnt = 0;	
    cin>>n;
    map<ll, ll> mp;
    rep(i, n){
        ll temp;
        cin>>temp;
        mp[temp]++;
        ans += temp;
    }
    //cout<<ans<<" ans ";
    cin>>m;
    while(m--){
        ll b, c;
        cin>>b>>c;
        ans += (mp[b] * c - mp[b] * b);
        mp[c] += mp[b];
        mp[b] = 0;
        cout<<ans<<"\n";
    }
}

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

    /* ll t;
    cin>>t;
    while(t--){ */
        solve();
    /* } */

}


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

int main() {
    int a, b;
    char op;
    
    cin >> a >> op >> b;
    
    if (op == '+') {
        cout << a + b << endl;
    }
    
    if (op == '-') {
        cout << a - b << endl;
    }
}


Measured memory_bytes: 3540
#include<iostream>
#include<cstring>
#include<algorithm>
using namespace std;
int a, b, n;
pair<int, int>x[8000000];
int main() {
	while (true) {
		memset(x, 0, sizeof(x));
		cin >> n;
		if (n == 0) { break; }
		for (int i = 0; i < n; i++) {
			cin >> x[i].second;
			for (int j = 0; j < 4; j++) {
				cin >> a >> b;
				x[i].first += a * 60 + b;
			}
		}
		sort(x, x + n);
		cout << x[0].second << endl << x[1].second << endl << x[n - 2].second << endl;
	}
}

Measured memory_bytes: 63672
#include <iostream>
#include <vector>
#include <string>
#include <cstdlib>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <stack>
#include <math.h>
#include <map>
#define Z class
#define ln cout<<'\n'
#define ll long long
#define rep(i, n) for(int i = 0; i < (n); ++i)
//ASCII a=97, A=65
// int H[N]; rep(i,N) scanf("%d", &H[i]);
// int max_x = *std::max_element(x.begin(), x.end());
// int min_y = *std::min_element(y.begin(), y.end());
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;}
template<Z A>void pr(A a){cout<<a;ln;}
template<Z A,Z B>void pr(A a,B b){cout<<a<<' ';pr(b);}
template<Z A,Z B,Z C>void pr(A a,B b,C c){cout<<a<<' ';pr(b,c);}
template<Z A,Z B,Z C,Z D>void pr(A a,B b,C c,D d){cout<<a<<' ';pr(b,c,d);}
template<Z A>void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<<a[i];}ln;}

int GCD(int a, int b) { return b ? GCD(b, a%b) : a; }
const long long INF = 1LL << 60;

int main(){
    int A,B,C; cin >> A >> B >> C;
    if(A==B)      pr(C);
    else if(B==C) pr(A);
    else          pr(B);
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main()
{
    string S; cin >> S;
    int ans = 0, cnt = 0;
    for (char c : S) {
        if (c == 'A' || c == 'C' || c == 'G' || c == 'T') {
            ans = max(ans, ++cnt);
        } else {
            cnt = 0;
        }
    }
    cout << ans << endl;
    return 0;
}


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

int main() {
  int A, B, C;
  cin >> A >> B >> C;
  int sum=A+B+C,large=max({A,B,C}),small=min({A,B,C}),middle=sum-large-small;
  int cnt=0;
  if((large*3)%2==sum%2) {
    cout << (3*large-sum)/2 << endl;
  }
  else {
    cout << (3*(large+1)-sum)/2 << endl;
  }
}


Measured memory_bytes: 256
package main

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

func out(x ...interface{}) {
	fmt.Println(x...)
}

var sc = bufio.NewScanner(os.Stdin)

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

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

// min, max, asub, absなど基本関数
func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func asub(a, b int) int {
	if a > b {
		return a - b
	}
	return b - a
}

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

func lowerBound(a []int, x int) int {
	idx := sort.Search(len(a), func(i int) bool {
		return a[i] >= x
	})
	return idx
}

func upperBound(a []int, x int) int {
	idx := sort.Search(len(a), func(i int) bool {
		return a[i] > x
	})
	return idx
}

const mod = 1000000007

func mpow(a, b int) int {
	if b == 0 {
		return 1
	} else if b%2 == 0 {
		tmp := mpow(a, b/2)
		return tmp * tmp % mod
	}
	return mpow(a, b-1) * a % mod
}

var fracMemo = []int{1, 1}

func mfrac(n int) int {
	if len(fracMemo) > n {
		return fracMemo[n]
	}
	if len(fracMemo) == 0 {
		fracMemo = append(fracMemo, 1)
	}
	for len(fracMemo) <= n {
		size := len(fracMemo)
		fracMemo = append(fracMemo, fracMemo[size-1]*size%mod)
	}
	return fracMemo[n]
}

var ifracMemo = []int{1, 1}

func mifrac(n int) int {
	if len(ifracMemo) > n {
		return ifracMemo[n]
	}
	if len(ifracMemo) == 0 {
		fracMemo = append(ifracMemo, 1)
	}
	for len(ifracMemo) <= n {
		size := len(ifracMemo)
		ifracMemo = append(ifracMemo, ifracMemo[size-1]*mpow(size, mod-2)%mod)
	}
	return ifracMemo[n]
}

func nCr(n, r int) int {
	if n == r {
		return 1
	}
	if n < r || r < 0 {
		return 0
	}
	ret := 1
	ret *= mfrac(n)
	ret %= mod
	ret *= mifrac(r)
	ret %= mod
	ret *= mifrac(n - r)
	ret %= mod
	return (ret)
}

func main() {
	sc.Split(bufio.ScanWords)
	N, M, K := getInt(), getInt(), getInt()

	ans := 0
	for d := 1; d < N; d++ {
		cnt := d * (N - d)
		cnt %= mod
		cnt *= M
		cnt %= mod
		cnt *= M
		cnt %= mod
		ans += cnt
		ans %= mod
	}
	for d := 1; d < M; d++ {
		cnt := d * (M - d)
		cnt %= mod
		cnt *= N
		cnt %= mod
		cnt *= N
		cnt %= mod
		ans += cnt
		ans %= mod
	}
	ans *= nCr(N*M-2, K-2)
	ans %= mod
	out(ans)
}


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

using namespace std;

#define SZ(x) (int)(x.size())
#define REP(i, n) for(int i=0;i<(n);++i)
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define RREP(i, n) for(int i=(int)(n);i>=0;--i)
#define RFOR(i, a, b) for(int i=(int)(a);i>=(int)(b);--i)
#define ALL(a) (a).begin(),(a).end()
#define DUMP(x) cerr<<#x<<" = "<<(x)<<endl
#define DEBUG(x) cerr<<#x<<" = "<<(x)<<" (L"<<__LINE__<<")"<< endl;

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using P = pair<int, int>;

const double eps = 1e-8;
const ll MOD = 1000000007;
const int INF = INT_MAX / 2;
const ll LINF = LLONG_MAX / 2;

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

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

template<typename T1, typename T2>
ostream& operator<<(ostream &os, const pair<T1, T2> p) {
  os << p.first << ":" << p.second;
  return os;
}

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

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

  // dp[i][j]: i番目まででj株持っているときの所持金の最大値
  int n; cin >> n;
  vll a(n);
  REP(i, n) cin >> a[i];
  ll yen = 1000;
  ll kabu = 0;
  bool up = false;
  FOR(i, 1, n) {
    if(up && a[i] < a[i-1]) {
      yen += kabu * a[i-1];
      kabu = 0;
      up = false;
    } else if(!up && a[i] > a[i-1]) {
      kabu += yen / a[i-1];
      yen -= yen / a[i-1] * a[i-1];
      up = true;
    }
  }

  yen += kabu * a[n-1];
  cout << yen << endl;


}








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

int main() {
  int a,b,c ;
  cin >> a >> b >> c;
  if (a < b){
      if(b < c){
          cout << a << " " << b <<" " << c << endl;
      }
      else{
          if(a < c){
              cout << a <<" " << c <<" " << b << endl;
          }
          else{
              cout << c <<" " << a << " " << b << endl;
          }
      }
  }
  else {
      if(a < c){
          cout << b <<" " << a <<" " << c<< endl;
      }
      else{
          if(b < c){
              cout << b <<" " << c <<" " << a << endl;
          }
          else {
              cout << c <<" " << b <<" " << a << endl;
          }
      }
  }
  
}


Measured memory_bytes: 3088
#include<iostream>
#define N 20
#define M 10000
#define rep(i,a) for(int i = 0 ; i < a ; i ++)
using namespace std;

int data[N][N];
void init(){
  rep(i,N){
    rep(j,N){
      if(i==j)data[i][j] = 0;
      else data[i][j] = M;
    }
  }
}

void input(int *a,int *b,int *c,int *d){
  char dm;
  cin >> *a >> dm >> *b >> dm >> *c >> dm >> *d;
  --*a;
  --*b;
}
int main(void){  
  int n,m;
  int a,b,c,d;
  int x1,x2,y1,y2;
  char dm;
  init();
  cin>>n>>m;
  
  rep(i,m){
    input(&a,&b,&c,&d);
    data[a][b] = c;
    data[b][a] = d;
  }
   
  rep(k,n)
    rep(i,n)
      rep(j,n)
        data[i][j] = min(data[i][j],data[i][k] + data[k][j]);
  
  input(&x1,&x2,&y1,&y2);
   
 
  cout << (y1 - (y2 + data[x1][x2] + data[x2][x1])) << endl;
}

Measured memory_bytes: 1160
#include <bits/stdc++.h>
using namespace std;
/* typedef */
typedef long long ll;
typedef pair<int, int> pii;
/* constant */
const int INF = 1 << 30;
const ll LINF = 1LL << 50;
const int NIL = -1;
const int MAX = 100005;
const int mod = 1000000007;
/* struct for mod Calculation*/
struct mint {
    ll x;
    mint(ll x = 0):x((x % mod + mod) % mod) {}
    mint operator-() const { return mint(-x); }
    mint& operator+=(const mint a) {
        if ((x += a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator-=(const mint a) {
        if ((x += mod - a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator*=(const mint a) {
        (x *= a.x) %= mod;
        return *this;
    }
    mint operator+(const mint a) const {
        mint res(*this);
        return res += a;
    }
    mint operator-(const mint a) const {
        mint res(*this);
        return res -= a;
    }
    mint operator*(const mint a) const {
        mint res(*this);
        return res *= a;
    }
    mint pow(ll t) const {
        if (!t) return 1;
        mint a = pow(t >> 1);
        a *= a;
        if (t & 1) a *= *this;
        return a;
    }
    // for prime mod
    mint inv() const {
        return pow(mod - 2);
    }
    mint& operator/=(const mint a) {
        return (*this) *= a.inv();
    }
    mint operator/(const mint a) const {
        mint res(*this);
        return res /= a;
    }
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}
/* global variables */
/* function */
/* main */
int main(){
    string L;
    cin >> L;
    int N = L.size();
    /*
    a[i] + b[i] = a[i] xor b[i] <=> (a[i], b[i]) = (0, 0), (0, 1), (1, 0);
    if L[i] == 0
        dp[0][i+1] += dp[0][i] * 3
        dp[1][i+1] += dp[1][i]
    if L[i] == 1
        dp[0][i+1] += dp[0][i] * 3 + dp[1][i] * 1
        dp[1][i+1] += dp[1][i] * 2
    */
    // Init DP table
    vector<vector<mint>> dp(2, vector<mint>(N+1, 0));
    dp[1][0] = 1;
    // calculate Digit DP
    for (int i = 0; i < N; i++) {
        dp[0][i+1] += dp[0][i] * 3;
        if (L[i] == '0') dp[1][i+1] += dp[1][i];
        else {
            dp[0][i+1] += dp[1][i];
            dp[1][i+1] += dp[1][i] * 2;
        }
    }

    mint ans = dp[0][N] + dp[1][N];
    cout << ans << '\n';
}

Measured memory_bytes: 2816
#include<bits/stdc++.h>
using namespace std;
using pint=pair<int,int>;

int N;
vector<vector<pint> >v;
bool judge(int bit){
    for(int i=0;i<N;i++){
        if(!(bit&(1<<i))) continue;
        
        for(pint xy:v[i]){
            int x=xy.first;
            int y=xy.second;

            if(y==1&&!(bit&(1<<x)))return false;

            if(y==0 && (bit&(1<<x))) return false;
        }
    }
    return true;
}

int main(){
    cin>>N;
    v.resize(N);
    for(int i=0;i<N;i++){
        int A; cin>>A;
        v[i].resize(A);
        for(int j=0;j<A;j++){
            cin>>v[i][j].first>>v[i][j].second;
            --v[i][j].first;
        }
    }

    int res=0;
    for(int bit=0;bit<(1<<N);++bit){
        if(judge(bit)){
            int count=0;
            for(int i=0;i<N;i++){
                if(bit&(1<<i))count++;
            }
            res=max(res,count);
        }
    }
    cout<<res<<endl;
}

 



Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <algorithm>

using namespace std;

int main() {
	int w, a, b;
	cin >> w >> a >> b;
	int minab, maxab;
	minab = min(a, b);
	maxab = max(a, b);
	if (minab + w >= maxab) {
		cout << 0 << endl;
	}
	else {
		cout << maxab - (minab + w) << endl;
	}
	return 0;
}

Measured memory_bytes: 256
//#include<bits/stdc++.h>
#include<iostream>
#include<iomanip>
#include<string>
#include<cmath>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<deque>
#include<set>
#include<map>
#include<bitset>
#define sz(v) (int)v.size()
#define ll long long
#define ull unsigned long long
using namespace std;
const int PI = 3.14159265;
void fast() {
	std::ios_base::sync_with_stdio(0);
	cin.tie(0);cout.tie(0);
}
int main()
{
	//freopen("file.in","r",stdin);
	//freopen("file.out","w",stdout);
	fast();

	string s, t;
	cin >> s >> t;
	int cnt = 0;
	for (int i = 0; i < sz(s); i++)
	{
		if (s[i] != t[i]) {
			cnt++;
		}
	}
	cout << cnt << '\n';
	return 0;
}


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

int main(){
    int n;
    cin >> n;
    pair<pair<string, int>, int> p[n];

    for(int i = 0; i < n; i++){
        string s;
        int t;
        cin >> s >> t;
        p[i] = make_pair(make_pair(s, -t), i);
    }
    sort(p, p+n);
    for(auto x : p) cout << x.second + 1 << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
ll N;
int main(){
  cin>>N;
  ll n=1;
  for(ll i=0;i<N;i++)
    n*=2;
  set<ll>S;map<ll,ll>M;ll Min=1;S.insert(1);
  for(ll i=0;i<n;i++){
  ll a;cin>>a;a*=-1;if(a<Min)Min=a;
    S.insert(a);
    if(M.count(a))
      M.at(a)++;
    else
      M[a]=1;
  }bool judge=true;
  multiset<ll>S1;S1.insert(Min);M.at(Min)--;
  if(M.at(Min)==0)S.erase(Min);
  for(ll i=0;i<N;i++){
  multiset<ll>S2;
    for(auto x:S1){
    auto itr=S.upper_bound(x);
    ll a=*itr;if(a==1){judge=false;break;}
      S2.insert(a);M.at(a)--;
      if(M.at(a)==0)S.erase(a);
     }if(!judge)break;
     for(auto x:S2){
     S1.insert(x);
     }
  }if(judge)
        cout<<"Yes"<<endl;
        else
        cout<<"No"<<endl;
  return 0;
}

Measured memory_bytes: 38284
#include<iostream>
#include<set>
#include<vector>
#include<queue>
#include<map>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb push_back
#define INF (1e9+1)
//#define INF (1LL<<59)


#define MAX_V 100
struct edge { int to, cap, cost,rev; };

vector<edge> G[MAX_V];
vector<int> h(MAX_V);	//??????????????£???
vector<int> dist(MAX_V);// ???????????¢
int prevv[MAX_V], preve[MAX_V];// ??´??????????????¨???

// from??????to??????????????????cap????????????cost????????????????????????????????????
void add_edge(int from, int to, int cap, int cost) {
	G[from].push_back((edge){to, cap, cost, (int)G[to].size()});
	G[to].push_back((edge){from, 0, -cost, (int)G[from].size() - 1});
}


//?????????????????????????????????????????´????????????
void shortest_path(int s,vector<int> &d){
	int v = d.size();
	rep(i,d.size())d[i]=INF;
	d[s]=0;
	rep(loop,v){
		rep(i,v){
			rep(j,G[i].size()){
				edge e = G[i][j];
				if(!e.cap)continue;
				if(d[i]!=INF && d[e.to] > d[i]+e.cost){
					d[e.to] = d[i]+e.cost;
				}
			}
		}
	}
}


// s??????t????????????f???????°??????¨???????±???????
// ??????????????´??????-1?????????
int min_cost_flow(int s, int t, int f) {
	int res = 0;
	shortest_path(s, h);
	
	while (f > 0) {
		// ?????????????????????????????¨??????h?????´??°??????
		priority_queue<pii, vector<pii>, greater<pii> > que;
		rep(i,dist.size())dist[i]=INF;
		dist[s] = 0;
		que.push(pii(0, s));
		while (!que.empty()) {
			pii p = que.top(); que.pop();
			int v = p.second;
			if (dist[v] < p.first) continue;
			for (int i = 0; i < G[v].size(); i++) {
				edge &e = G[v][i];
				if (e.cap > 0 && dist[e.to] > dist[v] + e.cost + h[v] - h[e.to]) {
					dist[e.to] = dist[v] + e.cost + h[v] - h[e.to]; prevv[e.to] = v;
					preve[e.to] = i;
					que.push(pii(dist[e.to], e.to));
				}
			}
		}
		if (dist[t] == INF) return -1;	//????????\???????????????
		
		for (int v = 0; v < h.size(); v++) h[v] += dist[v];
		
		
		// s-t????????????????????£??????????????????
		int d = f;
		for (int v = t; v != s; v = prevv[v]) {
			d = min(d, G[prevv[v]][preve[v]].cap);
		}
		f -= d;
		res += d * h[t];
		for (int v = t; v != s; v = prevv[v]) {
			edge &e = G[prevv[v]][preve[v]]; e.cap -= d;
			G[v][e.rev].cap += d;
		}
	}
	return res;
}int main(){
	int vv,e,f;
	cin>>vv>>e>>f;
	rep(i,e){
		int u,v,c,d;
		cin>>u>>v>>c>>d;
		add_edge(u, v, c, d);
	}
	cout<<min_cost_flow(0, vv-1, f)<<endl;
}

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

#define INF 1.1e9
#define LINF 1.1e18
#define FOR(i,a,b) for (int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define BIT(x,n) bitset<n>(x)
#define PI 3.14159265358979323846

typedef long long ll;
typedef pair<ll,int> P;
typedef pair<ll,P> PP;

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

int n,m;
ll a[100000];
vector<int> g[100000];
bool used[100000];
priority_queue<int,vector<int>,greater<int> > crt,rest;

void dfs(int i) {
	for(auto u:g[i]) {
		if(used[u]) continue;
		used[u]=true;
		crt.push(a[u]);
		dfs(u);
	}
}

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

	cin>>n>>m;
	REP(i,n) cin>>a[i];

	REP(i,m) {
		int x,y;cin>>x>>y;
		g[x].pb(y),g[y].pb(x);
	}

	if(n-m==1) {
		cout<<0<<endl;
		return 0;
	}
	if(2*(n-m-1)>n) {
		cout<<"Impossible"<<endl;
		return 0;
	}

	ll ans=0;
	REP(i,n) {
		if(used[i]) continue;
		used[i]=true;
		crt.push(a[i]);
		dfs(i);
		ans+=crt.top();crt.pop();
		while(!crt.empty()) {
			rest.push(crt.top());
			crt.pop();
		}
	}
	REP(i,n-m-2) {
		ans+=rest.top();rest.pop();
	}
	cout<<ans<<endl;

	return 0;
}


Measured memory_bytes: 7800
#include<cstdio>
#include<iostream>
#include<cmath>
#include<ctype.h>
#include<vector>
#include<cstdlib>
#include<cstdlib>
#include<string>
#include<algorithm>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<time.h>

#define ll long long
#define LL long long
#define ULL unsigned long long 
#define ull unsigned long long 
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define RFOR(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define REP(i,n) for(int i=0;i<n;i++)
#define RREP(i,n) for(int i=(n)-1;i>=0;i--)
const int INF = 100000000;
using namespace std;



ll dp[10000][10000] = {};
ll memo[10000][10000] = {};
ll N;


int main()
{
	bool tmp=0;
	ll num;
	ll ans = 0;
	cin >> N;

	for (int i = 0; i < N; i++) {
		cin >> num;

		if (num&&tmp) {
			ans++;
			num--;
		}
			ans += num / 2;
			tmp = num % 2;
		
	}
	cout << ans << endl;


	return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<algorithm>
#define ll long long
using namespace std;
pair<ll,pair<ll, ll>> ch1[100010];
ll a[100010];
ll gap[100010];
int main()
{
	ll n, m;
	scanf("%lld %lld", &n, &m);
	for (int i = 1; i <= n; i++)
		scanf("%lld", &a[i]);
	ll dap = 0;
	for (int i = 2; i <= n; i++)
	{
		ll ch = (a[i] + m - a[i - 1]) % m;
		dap += ch;
		ch--;
		ch1[a[i]].second.first++;
		ch1[a[i]].first += ch;
		ll x = a[i] - ch;
		if ((x <= 0))
		{
			x+=m;
			ch1[x].second.second--;
		}
		else
		{
			ch1[x].second.first--;
		}
	}
	ll xx = 0;
	ll ch = 0;
	for (int i = m; i >= 1; i--)
	{
		xx += ch1[i].first;
		ch += ch1[i].second.first;
		gap[i] = xx;
		xx -= ch;
	}
	for (int i = m; i >= 1; i--)
	{
		ch += ch1[i].second.second;
		gap[i] += xx;
		xx -= ch;
	}
	ll jj = 0;
	for (int i = 1; i <= m; i++)
	{
		jj = max(jj, gap[i]);
	}
	printf("%lld", dap - jj);
}

Measured memory_bytes: 4096
n = int(raw_input())
C = [[] for _ in [0]*n]
W = {}
for i in range(n):
  C[i] = map(int, raw_input().split())
  W[(i, i)] = 0
for i in range(1, n):
  for j in range(0, n-i):
    a = j+i
    W[(j, a)] = min([C[j][0] * C[k][1] * C[k+1][0] * C[a][1] + W[(j, k)] + W[(k+1, a)] for k in range(j, a)])
print W[0, n-1]

Measured memory_bytes: 4476
#include <bits/stdc++.h>
using namespace std;
#define finish(x) return cout << x << endl, 0
#define ll long long

int n, k;

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cin >> n >> k;
    if(k == 0) finish(1LL * n * n);
    ll ans = 0;
    for(int i = k + 1 ; i <= n ; i++){
        for(int j = 0 ; i * j <= n ; j++){
            ans += min(n, i * (j + 1) - 1) - min(n + 1, i * j + k) + 1;
        }
    }
    cout << ans << endl;
}


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

#define mp make_pair
#define pb push_back
#define REP(i,a,n) for(int i = a;i < (n);i++)
#define rep(i,n) for(int i = 0;i < (n);i++)
#define all(s) s.begin(), s.end()
#define rall(s) s.rbegin(), s.rend()
#define range(x,min,max) ((min) <= (x) && (x) <= (max))
#define xyrange(x, minX, maxX, y, minY, maxY) (range(x, minX, maxX) && range(y, minY, maxY))

using namespace std;

typedef long long LL;
typedef vector<int> VI;
typedef vector<vector<int> > VVI;
typedef vector<string> VS;
typedef vector<bool> VB;
typedef pair<int,int> PII;
typedef vector<PII> VPII;


const int DX[]={1,0,-1,0},DY[]={0,-1,0,1};
const int INF = 0x3f3f3f3f;

int X, Y;

int main(){
	cin.tie(0);
   	ios::sync_with_stdio(false);
	cin >> X >> Y;
	int ans;
	if (X > Y) {
		if (X >= 0 && Y >= 0) {
			if (Y == 0) {
				ans = X + 1;
			} else {
				ans = X - Y + 2;
			}
		} else if (X >= 0 && Y < 0) {
			if (X > abs(Y)) {
				ans = X - abs(Y) + 1;
			} else {
				ans = abs(Y) - X + 1;
			}
		} else {
			ans = abs(Y) - abs(X) + 2;
		}
	} else {
		if (X >= 0 && Y >= 0) {
			ans = Y - X;
		} else if (X < 0 && Y >= 0) {
			if (Y == 0) {
				ans = abs(X);
			} else if (abs(X) <= Y) {
				ans = Y - abs(X) + 1;
			} else {
				ans = abs(X) - Y + 1;
			}
		} else {
			ans = abs(Y - X);
		}
	}
	cout << ans << endl;
	return 0;
}



Measured memory_bytes: 256
N,M = map(int,input().split())

n =  [[] for i in range(N)]

for i in range(N):
    n[i] = list(map(int,input().split()))

m = [ 0 for k in range(M)]

for k in range(M):
    m[k] = int(input())

for x in range(N):
    a = 0
    for y in range(M):
        a += n[x][y] * m[y]
    print(a)


Measured memory_bytes: 6020
#from collections import defaultdict, deque
import itertools
import numpy as np

def main():
    N, M, X = tuple(int(c) for c in input().split(' '))
    C = []
    A = []
    for _ in range(N):
        tmp = tuple(int(c) for c in input().split(' '))
        C.append(tmp[0])
        A.append(np.array(tmp[1:]))

    # max_rikai = np.zeros(M)
    # for i in range(N):
    #     max_rikai += A[i]
    # #print(max_rikai)
    # if min(max_rikai) < X:
    #     print(-1)
    #     exit()

    #c_index = [(i, C[i]) for i in enumerate(C)]
    cmin = -1
    for n in range(1, N+1):
        for t in itertools.combinations(range(N), n):
            ri = np.zeros(M)
            ctmp = 0
            for i in t:
                ri += A[i]
                ctmp += C[i]
            if min(ri) >= X:  #すべて理解できた
                if cmin == -1:
                    cmin = ctmp
                elif ctmp < cmin:
                    cmin = ctmp
    print(cmin)

if __name__ == "__main__":
    main()

Measured memory_bytes: 27168
while True:
    try:
        a, b = map(int, input().split(" "))
        if a < b:
            key = a
            a = b
            b = key
        A = a
        B = b
        while a % b != 0:
            key = a % b
            a = b
            b = key
        key = int(A * B / b)
        print(b, key)
    except:
        break


Measured memory_bytes: 5596
// g++ -std=c++11 a.cpp
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<stack>
#include<bitset>
#include<cstdio>
#include<sstream>
#include<iomanip>
#include<assert.h>
#include<typeinfo>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
//kaewasuretyuui
typedef long long ll;
//#define int ll
typedef int Def;
typedef pair<Def,Def> pii;
typedef vector<Def> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<Def,pii> pip;
typedef vector<pip>vip;
// #define mt make_tuple
//typedef tuple<pii,int,int> tp;
//typedef vector<tp> vt;
template<typename A,typename B>bool cmin(A &a,const B &b){return a>b?(a=b,true):false;}
template<typename A,typename B>bool cmax(A &a,const B &b){return a<b?(a=b,true):false;}
//template<class C>constexpr int size(const C &c){return (int)c.size();}
//template<class T,size_t N> constexpr int size(const T (&xs)[N])noexcept{return (int)N;}
const double PI=acos(-1);
const double EPS=1e-7;
Def inf = sizeof(Def) == sizeof(long long) ? 2e18 : 1e9;
int dx[]={0,1,0,-1};
int dy[]={1,0,-1,0};
int main(){
	int a,b,c;
	cin>>a>>b>>c;
	cout<<(a-c)/(b+c)<<endl;
}




Measured memory_bytes: 256
import math
def main():
    x = int(input())
    tmp = [0] * 1000
    for i in range(1000):
        tmp[i] = i**5
    for i in range(1000):
        a = x+tmp[i]
        if abs(a) in tmp:

            print(int(a**0.2),i)
            return

        a = x - tmp[i]
        if abs(a) in tmp:

            print(int(a**0.2),-i)
            return

if __name__=='__main__':
    main()


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

using namespace std;

int main() {
  int N;
  long long K;
  cin >> N >> K;
  vector<int> A(N);
  for (auto &a : A) {
    cin >> a;
  }
  vector<int> F(N);
  for (auto &f : F) {
    cin >> f;
  }
  sort(A.begin(), A.end());
  sort(F.rbegin(), F.rend());

  long long l = -1, r = 1e12 + 1;
  while (l + 1 < r) {
    long long m = (l + r) / 2;
    long long cnt = 0;
    for (int i = 0; i < N; i++) {
      long long a_want = m / F.at(i);
      if (a_want < A.at(i)) {
        cnt += A.at(i) - a_want;
      }
    }
    if (cnt <= K) {
      r = m;
    } else {
      l = m;
    }
  }

  cout << r << endl;

  return 0;
}


Measured memory_bytes: 1792
/**
       **********    ************
	  Author : Avi J Patel
	  University : DAIICT
       **********    ************
**/
#include<bits/stdc++.h>
#include<math.h>
#include<fstream>
using namespace std;
#define ll long long
#define ull unsigned long long
#define ld long double
#define pb push_back
#define pf push_front
#define mp make_pair 
#define mt make_tuple
#define ff first
#define ss second
#define si size()
#define MOD 1000000007
#define Mod 998244353
#define N 200001
#define large 1844674407370955161
#define For(i,m,n) for(long long i=m;i<n;i++)
#define st(x) sort(x.begin(),x.end())
#define re(x,i) reverse(x.begin()+i,x.end())
#define FAST ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);srand(time(NULL));
#define min_heap priority_queue<int, vector<int>, greater<int>>
#define max_heap priority_queue<int>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
#define pp pair<pair<ll,ll>,pair<ll,ll>>
using namespace __gnu_pbds; 
#define ordered_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> 

bool sortbysec(const pair<int,int> &a, const pair<int,int> &b) 
{ 
    if(a.ss < b.ss) return true; 
	else return false;
}
bool sortbyboth(const pair<int,int> &a, const pair<int,int> &b)
{
	if(a.ff<b.ff) return true;
	else if(a.ff==b.ff) return a.ss<b.ss;
	else return false;
} 
bool sortff_resortss(const pair<int,int> &a, const pair<int,int> &b)
{
	if(a.ff<b.ff) return true;
	else if(a.ff==b.ff) return a.ss>b.ss;
	else return false;
}
bool sortbystring(const string &a, const string &b)
{
	string c=a+b;
	string d=b+a;
	if(c>=d) return true;
	else return false;
}
class CompareDist
{
	public:
	    bool operator()(pair<int,pair<int,int>> a,pair<int,pair<int,int>> b) 
		{
	        if(a.ff<b.ff) return true;
	        else if(a.ff==b.ff) return a.ss.ff>b.ss.ff;
	        else return false;
	    }
};

ll modi(ll a, ll m) 
{ 
    ll m0 = m; 
    ll y = 0, x = 1; 
    if (m == 1) 
      return 0; 
    while (a > 1) 
    { 
        ll q = a / m; 
        ll t = m; 
        m = a % m, a = t; 
        t = y; 
        y = x - q * y; 
        x = t; 
    } 
    if (x < 0) 
       x += m0; 
    return x; 
} 
ll Logn(ll  n, ll r) 
{ 
    return (n > r - 1) ? 1 + Logn(n / r, r) : 0; 
} 

ll power(ll x, ll y, ll p) 
{ 
    ll res = 1;      // Initialize result 
    x = x % p;  // Update x if it is more than or 
    while (y > 0) 
    { 
        if (y & 1) 
            res = (res*x) % p; 
        y = y>>1; // y = y/2 
        x = (x*x) % p; 
    } 
    return res; 
} 

ll modinv(ll n, ll p) 
{ 
    return power(n, p-2, p); 
} 
ll ncr(ll n, ll r, ll p) 
{ 
   if (r==0) 
      return 1; 
    int n1=n;
    ll fac[n1+1]; 
    fac[0] = 1; 
    for (int i=1 ; i<=n; i++) 
        fac[i] = fac[i-1]*i%p; 
  
    return (fac[n]* modinv(fac[r], p) % p * 
            modinv(fac[n-r], p) % p) % p; 
} 
int main()
{
	FAST
	int t=1;
//	cin>>t;
	while(t--)
	{
		int a,b;
		cin>>a>>b;
		cout<<a*b;
	}
	return 0;
}

















Measured memory_bytes: 3656
N = int(input())
A_list = [int(num) for num in input().split()]

count = 0
is_even = True
while is_even:
  for i, num in enumerate(A_list):
    if num % 2:
      is_even = False
      break
    else:
      num = num // 2
      A_list[i] = num
  else:
    count +=1
print(count)

Measured memory_bytes: 3060
#include<stdio.h>
int main(){
  char s[3];
    scanf("%s",s);
    if((s[0]==s[1])&&(s[1]==s[2])&&(s[0]=='R')){
      printf("3");
    }else if(((s[0]==s[1])||(s[1]==s[2]))&&(s[1]=='R')){
      printf("2");
    }else if((s[0]=='R')||(s[1]=='R')||(s[2]=='R')){
      printf("1");
    }else{
      printf("0");
    }
    return 0;
}


Measured memory_bytes: 1664
while True:
    a,op,b=input().split()
    a=int(a)
    b=int(b)
    if op == "?":
        break
    if op == "+":
        print(a + b)
    elif op == "-":
        print(a - b)
    elif op == "*":
        print(a * b)
    elif op == "/":
        print(a // b)
    



Measured memory_bytes: 5592
if __name__ == "__main__":
    bit = int(input())
    k, *E = map(lambda x: int(x), input().split())
    m = sum(1 << e for e in E)

    if (0 == m):
        print(f"0:")
    for d in range(1, 1 << bit):
        if (d & m == m):
            print(f"{d}: ", end="")
            print(" ".join([str(elem) for elem in range(bit) if d & (1 << elem)]))



Measured memory_bytes: 5780
n, m = [int(i) for i in input().split()]
l_max = 0
r_min = n

for _ in range(m):
    l, r = [int(i) for i in input().split()]
    if l > l_max:
        l_max = l
    if r < r_min:
        r_min = r

print(max(r_min - l_max + 1, 0))


Measured memory_bytes: 3060
#include<iostream>
 using namespace std;
int main(){
	int n,i,a[101];
	cin>>n;
	for(i=1;i<=n;i++){
		cin>>a[i];
	}
	for(i=n;i>0;i--){
		if(i==1){
			cout<<a[1];
		}else{
			cout<<a[i]<<" ";
		}
	}
	cout<<endl;
		return 0;
}

Measured memory_bytes: 3032
#include <stdio.h>
#include <stdlib.h>
#define int long long
#define p 998244353

int *fact, *fact_inv;

int MOD(int a){
	a %= p;
	return a >= 0 ? a : a + p;
}

int power(int a, int N){
	if(N == 0){
		return 1;
	}
	else if(N % 2 == 0){
		return power(MOD(a * a), N / 2);
	}
	else{
		return MOD(a * power(a, N - 1));
	}
}

int comb(int N, int k){
	return MOD(fact[N] * MOD(fact_inv[k] * fact_inv[N - k]));
}

signed main(){
	int N, A, B, K, i, j, ans = 0;
	scanf("%lld%lld%lld%lld", &N, &A, &B, &K);
	fact = (int *)malloc(sizeof(int) * (N + 1));
	fact_inv = (int *)malloc(sizeof(int) * (N + 1));
	fact[0] = 1;
	fact_inv[0] = 1;
	for(i = 1; i <= N; i++){
		fact[i] = MOD(fact[i - 1] * i);
		fact_inv[i] = power(fact[i], p - 2);
	}
	for(i = 0; i <= N; i++){
		if((K - i * A) % B == 0){
			j = (K - i * A) / B;
			if(j >= 0 && j <= N){
				ans = MOD(ans + comb(N, i) * comb(N, j));
			}
		}
	}
	printf("%lld\n", ans);
	return 0;
}

Measured memory_bytes: 4864
#include<iostream>
#include<string>
#include<map>
#include<utility>
#include<vector>
#include<algorithm>
#include<stack>
#include<queue>

using namespace std;

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

  int e_num = 0, o_num = 0;
  for(int i = 0; i < n; i++) {
    if(a[i] % 2 == 0) e_num++;
    else              o_num++;
  }

  //cout << o_num << " " << e_num << endl;
  if(o_num % 2 == 0) {
    cout << "YES" << endl;
  }else{
    cout << "NO"  << endl;
  }

  return 0;
}


Measured memory_bytes: 768
#include <bits/stdc++.h>
// statics
using namespace std;
using int64 = int_fast64_t;
using PAIR = pair<int64, int64>;
constexpr int INF = 1 << 30;
constexpr int64 LINF = 1LL << 60;
constexpr int MOD = 1e9 + 7;
constexpr int MAX_N = 3e5 + 1;

// init/input
#define int int64
#define INIT ios::sync_with_stdio(false);cin.tie(0);
#define VAR(type, ...) type __VA_ARGS__;MACRO_VAR_Scan(__VA_ARGS__);
template<typename T> void MACRO_VAR_Scan(T &t) {cin>>t;}
template<typename First, typename...Rest> void MACRO_VAR_Scan(First &first, Rest&...rest) {cin>>first;MACRO_VAR_Scan(rest...);}
#define VEC(type, c, n) vector<type> c(n);for(auto &&i:c)cin>>i;

// out
#define OUT(dist) cout<<(dist);
#define FOUT(n, dist) cout<<fixed<<setprecision(n)<<(dist);
#define SP cout<<" ";
#define BR cout<<endl;
#define zero(n) cout<<setfill('0')<<right<<setw(n)
#define debug(x) cerr<<#x<<":"<< (x);BR;

// utility
#define ALL(a) (a).begin(), (a).end()
#define EACH(i, a) for(auto &&i:(a))
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define RFOR(i, a, b) for(int i=(b)-1;i>=0;--i)
#define REP(i, n) for(int i=0;i<(n);++i)
#define RREP(i, n) for(int i=(n)-1;i>=0;--i)

signed main() {
  INIT;
	VAR(int,a,b);
	if (b%a==0)cout << a+b<< endl;
	else cout << b-a << endl;
  
  return 0;
}


Measured memory_bytes: 256
import sys
from math import sqrt
n = input()
for line in sys.stdin:
    [x1,y1,x2,y2,x3,y3] = [float(x) for x in line.split()]
    a1 = 2*(x2-x1)
    b1 = 2*(y2-y1)
    c1 = x1**2-x2**2+y1**2-y2**2
    a2 = 2*(x3-x1)
    b2 = 2*(y3-y1)
    c2 = x1**2-x3**2+y1**2-y3**2
    x = (b1*c2-b2*c1)/(a1*b2-a2*b1)
    y = (c1*a2-c2*a1)/(a1*b2-a2*b1)
    a = sqrt((x2-x1)**2 + (y2-y1)**2)
    b = sqrt((x3-x1)**2 + (y3-y1)**2)
    c = sqrt((x3-x2)**2 + (y3-y2)**2)
    r = (a*b*c)/sqrt((a+b+c)*(-a+b+c)*(a-b+c)*(a+b-c))
    print "%.3f %.3f %.3f" % (x,y,r)

Measured memory_bytes: 4452
//
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;

// #define MOD 1000000007
#define rp(i,n) for(int i=0;i<(n);i++)
#define up(i,s,e,d) for(int i=(s);i<(e);i+=(d))
// #define ot(x) cout<<(x)
#define ote(x) cout<<(x)<<endl

int main(){
	int N,M,C;cin>>N>>M>>C;

	vi B(M);
	rp(i,M) cin>>B[i];

	// vvi A(N,vi(M));
	// vi A(M);
	int count = 0;
	rp(i,N){
		int s = C;
		rp(j,M){
			int a; cin>>a;
			s += a*B[j];
			// cout<<a<<","<<B[i]<<"\n";
		}
		// ote(s);
		if(s>0){
			++count;
		}
	}

	ote(count);
}


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

int main() {
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  
  int n, m;
  cin >> n >> m;
  vector<pair<int, int>> ab(n);
  
  rep(i, n) {
    cin >> ab[i].first >> ab[i].second;
  }
  sort(ab.begin(), ab.end());
  
  ll ans = 0;
  rep(i, n) {
    if(m - ab[i].second > 0) {
      m -= ab[i].second;
      ans += ll(ab[i].first) * ab[i].second;
    }
    else {
      ans += m*ll(ab[i].first);
      m -= ab[i].second;
    }
    
    if(m <= 0) {
      cout << ans << endl;
      return 0;
    }
  }
}

Measured memory_bytes: 3972
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define mod 1000000007
#define f(i,a,b) for(ll i=a;i<b;i++)
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ii pair<ll,ll>
#define vii vector<ii>
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define MAX 1e9
 
ll modpow(ll base, ll exp, ll modulus) {base %= modulus;ll result = 1;while (exp > 0) {if (exp & 1) result = (result * base) % modulus;base = (base * base) % modulus;exp >>= 1;}return result;}
const ld pi=acos(-1);

int main(){
    IOS;
    string s;cin>>s;
    ll n=s.size();
    bool ok=1;
    string temp=s;
    reverse(temp.begin(),temp.end());
    if(temp!=s)ok=0;
    // cout<<"ok->"<<ok<<endl;
    ll need=(n-1)/2;
    // cout<<need<<endl;
    f(i,0,need){
        if(s[i]!=s[need-i-1]){ok=0;break;}
    }
    //  cout<<"ok->"<<ok<<endl;
    ll hell=(n+3)/2;
    // cout<<hell<<endl;
    f(i,hell-1,n){
        if(s[i]!=s[n-i-1]){ok=0;break;}
    }
    //  cout<<"ok->"<<ok<<endl;
    if(!ok)cout<<"No";
    else cout<<"Yes";
    return 0;  
} 





Measured memory_bytes: 256