akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

int main() {
    int N, K;
    cin >> N >> K;
    int xs[N];
    for (int i=0; i<N; i++) cin >> xs[i];
    int sum_of_distance = 0;
    for (int x : xs){
        sum_of_distance += 2 * min(x, abs(x-K));
    }
    cout << sum_of_distance << endl;
}


Measured memory_bytes: 3616
#include<bits/stdc++.h>
using namespace std;
int main(){
	char c;
	cin>>c;
	if(c=='a'||c=='i'||c=='u'||c=='e'||c=='o'){
		cout<<"vowel"<<endl;
	}
	else{
		cout<<"consonant"<<endl;
	}
	return 0;
}


Measured memory_bytes: 256
MOD = 10 ** 9 + 7
def powmod(n,r)
  return 1 if r.zero?
  return n if r == 1
  s = powmod(n, r / 2)
  return s * s % MOD if r.even?
  return n *  s * s % MOD
end
N = gets.to_i
ans = (powmod(10, N) - 2 * powmod(9, N) + powmod(8, N)) % MOD
puts ans


Measured memory_bytes: 14316
/*
─────────────────────
───────────████████──
──────────███▄███████
──────────███████████
──────────███████████
──────────██████─────
──────────█████████──
█───────███████──────
██────████████████───
███──██████████──█───
███████████████──────
███████████████──────
─█████████████───────
──███████████────────
────████████─────────
─────███──██─────────
─────██────█─────────
─────█─────█─────────
─────██────██────────
─────────────────────
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>

#define int long long
#define read(a) int a; cin >> a;
#define readarr(a, n) int a[(n) + 1] = {}; fori(i, 1, (n)) {cin >> a[i];}
#define readmat(a, n, m) int a[n + 1][m + 1] = {}; fori(i, 1, n) {fori(j, 1, m) cin >> a[i][j];}
#define pb push_back
#define fi first
#define se second
#define rz resize
#define fori(i, a, b) for (int i = (a); i <= (b); i++)
#define ford(i, a, b) for (int i = (a); i >= (b); i--)
#define sort1(v) sort(v.begin(), v.end()) 
#define endl '\n'

using namespace std;
using namespace __gnu_pbds; 

typedef tree<long long,null_type,less<long long>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<pair <int, int>> vpi;
typedef vector < vector <int> > vvi;

const long long inf2 = (long long)1e18;
const long long mod = (long long)(1e9+7);
const long long inf1 =(long long)(1e6+1);
 
signed main() 
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    read(n);
    readarr(a, n);

    int ans = 0, mn = n+1;
    fori(i, 1, n)
    {
        mn = min(mn, a[i]);
        if(a[i] <= mn) ans++;
    }
    cout << ans;

    return 0;
}

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

int main(void) {
  string n;
  cin >> n;
  for (int i = 0; i < n.length(); i++) {
    if (n[i] == '9')
      n[i] = '1';
    else
      n[i] = '9';
  }
  cout << n << endl;
  return 0;
}

Measured memory_bytes: 256
#include <ctime>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <algorithm>
#include <iostream>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <set>
#include <map>
using namespace std;

typedef long long ll;
typedef double lf;
typedef long double Lf;
typedef pair <int,int> pii;
typedef pair <ll, ll> pll;

#define TRACE(x) cerr << #x << "  " << x << endl
#define FOR(i, a, b) for (int i = (a); i < int(b); i++)
#define REP(i, n) FOR(i, 0, n)
#define all(x) (x).begin(), (x).end()
#define _ << " " <<

#define fi first
#define sec second
#define mp make_pair

const int MAXN = 200100;

int n, p[MAXN], l[MAXN], r[MAXN];

stack <int> s;

int main() {
  scanf("%d",&n);
  REP(i, n) scanf("%d",&p[i]);

  s.push(-1);
  REP(i, n) {
    l[i] = i;
    while (!s.empty() && p[s.top()] >= p[i]) s.pop();
    if (!s.empty()) l[i] = s.top() + 1;
    s.push(i);
  }

  while (!s.empty()) s.pop();
  s.push(n);
  for (int i = n - 1; i >= 0; i--) {
    r[i] = i;
    while (!s.empty() && p[s.top()] > p[i]) s.pop();
    if (!s.empty()) r[i] = s.top() - 1;
    s.push(i);
  }

  ll sol = 0;
  REP(i, n) {
    sol += (ll)p[i] * (r[i] - i + 1) * (i - l[i] + 1);
  }

  printf("%lld\n",sol);
  return 0;
}


Measured memory_bytes: 3456
#include<iostream>
#include<iomanip>
#include<cstdio>

#include<vector>
#include<queue>
#include<set>
#include<map>
#include<string>

#include<algorithm>
#include<cmath>
#include<numeric>

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 = 1e18+1;


ll N, M, Q;

//lからrまでに完全に含まれる列車の本数を全通り求められるようにしてクエリにこたえる
/*
dp[l][r] = dp[l-1][r]+dp[l][r-1] - dp[l][r]
*/

ll dp[500][500];

int main() {
    cin >> N >> M >> Q;
    vector<int> p(Q), q(Q);
    for (int i = 0; i < M; i++) {
        ll l, r;
        cin >> l >> r;
        dp[l-1][r-1] += 1;
    }
    for (int i = 0; i < Q; i++) {
        cin >> p[i] >> q[i];
    }
    for (int w = 1; w < N; w++) {
        for (int l = 0; l < (N-w); l++) {
            dp[l][l+w] += dp[l][l+w-1] + dp[l+1][l+w] - dp[l+1][l+w-1];
        }
    }/*
    for (int i = 0; i < N; i++) {
        for  (int j = 0; j < N; j++) {
            cout << dp[i][j] << " ";
        }
        cout << endl;
    }
    */
    for (int i = 0; i < Q; i++) {
        cout << dp[p[i]-1][q[i]-1] << endl;
    }
}

Measured memory_bytes: 3712
#include<iostream>
#include<vector>
#include<bitset>
using namespace std ;

int main()
{
  int N ;
  cin>>N ;
  int F[N][10] ;
  int P[N][11] ;
  for(int i=0;i<N;i++) for(int j=0;j<10;j++) cin>>F[i][j] ;
  for(int i=0;i<N;i++) for(int j=0;j<11;j++) cin>>P[i][j] ;
  
  int Max ;
  for(int tmp=1;tmp<(1<<10);tmp++){
    bitset<10>sis_store(tmp) ;
    vector<int>count(N,0) ;
    int tmp_Max=0 ;
    for(int i=0;i<N;i++){
      for(int j=0;j<10;j++){
        if(F[i][j]==sis_store.test(j)&&F[i][j]==1) count.at(i)++ ;
      }
      tmp_Max+=P[i][count.at(i)] ;
    }
    if(tmp==1) Max=tmp_Max ;
    else Max=(Max>tmp_Max?Max:tmp_Max) ;
  }
  
  cout<<Max<<endl ;
  return 0 ;
}

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

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

  int n;
  cin >> n;
  vector<pair<int, int>> arr(n);
  vector<int> orig(n);
  for (int i = 0; i < n; ++i) {
    cin >> arr[i].first;
    orig[i] = arr[i].first;
    arr[i].second = i;
  }
  sort(arr.begin(), arr.end());
  int mid = arr[n / 2].first;
  for (int i = 0; i < n; ++i) {
    if (orig[i] < mid) {
      cout << arr[n / 2].first << "\n";
    } else {
      cout << arr[(n - 1) / 2].first << "\n";
    }
  }
}


Measured memory_bytes: 4608
#include <bits/stdc++.h>
using namespace std;
 
pair<int,int> root (int &x, vector<int> &g, int t) {
  if (x == g.at(x)) {
    return pair<int,int>(x,t);
  }
  else {
    pair<int,int>  k = root(g.at(x),g,t+1);
    g.at(x) = k.first;
    return k;
  }
}
 
void connect(int &a, int &b, vector<int> &g, int &x) {
  pair<int,int> m = root(a,g,0);
  pair<int,int> n = root(b,g,0);  
  if (m.first != n.first) {
    if (m.second > n.second) {
      g.at(n.first) = m.first;
    }
    else {
      g.at(m.first) = n.first;      
    }
    x++;
  } 
  return;
}
 
int main() {
  
  int N, M;
  cin >> N >> M;
  
  vector<int> G(N);
  for (int i = 0; i < N; i++) {
    G.at(i) = i;
  }
  
  int A, B, n = 0;
  
  for (int i = 0; i < M; i++) {
    cin >> A >> B;
    A--;
    B--;
    connect(A,B,G,n);
  }
  
  cout << N - 1 - n << endl;
  
  return 0;
}

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

int main() {
	int n,m,i,j,k;
	cin >> n;
	for(i=1; i<10; i++){
		if(n%i==0 && n/i<=9){
			cout << "Yes"; return 0;
		}
	}
	cout << "No";
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  int h1,h2,k1,k2,a,b,c,d;
  cin>>h1>>h2>>k1>>k2>>a>>b>>c>>d;
  int hiro=h1*a+h2*b+h1/10*c+h2/20*d;
  int ken=k1*a+k2*b+k1/10*c+k2/20*d;
  if(hiro<ken)cout<<"kenjiro"<<endl;
  else if(hiro>ken)cout<<"hiroshi"<<endl;
  else cout<<"even"<<endl;
  return 0;
}

Measured memory_bytes: 3092
#include <iostream>
#include <algorithm>
#include <string>
#include <cstring>
using namespace std;
char sign[307];
string ans;
int a, b, c;
int A, B;
string print(int n) {
	string s = "";
	for (int j = 0; j < n; j++) {
		s += "|";
	}
	return s;
}

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

	//SUN, MON, TUE, WED, THU, FRI,
	if (s == "SAT")
		cout << 1 << endl;
	else if (s == "SUN")
		cout << 7 << endl;
	else if (s == "MON")
		cout << 6 << endl;
	else if (s == "TUE")
		cout << 5 << endl;
	else if (s == "WED")
		cout << 4 << endl;
	else if (s == "THU")
		cout << 3 << endl;
	else if (s == "FRI")
		cout << 2 << endl;


	return 0;
}


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

#define ALL(g) (g).begin(),(g).end()
#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i, x, n) for(int i = x; i >= n; i--)
#define rrep(i, n) RREP(i,n,0)
#define pb push_back
#define show_table(n, k, table) rep(i,n){ rep(j,k) cout << table[i][j] << " "; cout << endl;}

using namespace std;

template<class T> inline void chmax(T& a,T const& b){a=max(a,b);}
template<class T> inline void chmin(T& a,T const& b){a=min(a,b);}

using ll = long long;
using P = pair<int,int>;
using Pl = pair<ll,ll>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;

const int mod=1e9+7,INF=1<<30;
const double EPS=1e-12,PI=3.1415926535897932384626;
const ll lmod = 1e9+7,LINF=1LL<<60;
const int MAX_N = 100005;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int A,B; cin >> A >> B;
  string s[100];
  rep(i,100) s[i] = string(100,'.');
  for(int i=1;i<99;i+=2){
    for(int j=21;j<99;j++) s[i][j] = '#';
    if(i!=97) s[i+1][98] = '#';
  }
  int row = 0, col = 0;
  rep(b,B-1){
    s[row][col] = '#';
    row += 2;
    if(row>98){
      row = 0; col += 2;
    }
  }
  row = 2; col = 96;
  rep(a,A-1){
    s[row][col] = '#';
    row += 2;
    if(row>96){
      row = 2; col -= 2;
    }
  }
  cout << "100 100" << endl;
  rep(i,100) cout << s[i] << endl;
  return 0;
}


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

template <typename InputIterator>
typename InputIterator::value_type summation(InputIterator first,
                                             InputIterator last) {
  return std::accumulate(first, last, typename InputIterator::value_type());
}
template <typename T>
std::istream &operator>>(std::istream &stream, std::vector<T> &v);
template <typename T1, typename T2>
std::istream &operator>>(std::istream &stream, std::pair<T1, T2> &p);
template <typename T>
std::istream &operator>>(std::istream &stream, std::vector<T> &v) {
  for (auto &i : v) {
    stream >> i;
  }
  return stream;
}
template <typename T1, typename T2>
std::istream &operator>>(std::istream &stream, std::pair<T1, T2> &p) {
  stream >> p.first >> p.second;
  return stream;
}

int main() {
  int64_t n, m;
  std::cin >> n >> m;
  std::vector<std::unordered_set<int64_t>> no(n);

  for (int64_t i = 0; i < m; i++) {
    int64_t u, v;
    std::cin >> u >> v;
    u--;
    v--;
    no[u].insert(v);
  }

  int64_t s, t;
  std::cin >> s >> t;
  s--;
  t--;

  std::vector<bool> flag(3 * n, false);
  std::deque<std::pair<int64_t, int64_t>> q;

  flag[3 * s] = true;
  for (const auto i : no[s]) {
    q.push_back(std::make_pair(3 * i + 1, 1));
  }

  while (!q.empty()) {
    const auto v = q.front();

    if (flag[v.first]) {
      q.pop_front();
      continue;
    }
    flag[v.first] = true;

    for (const auto i : no[v.first / 3]) {
      auto next_m = (v.first % 3 + 1) % 3;
      const auto j = 3 * i + next_m;
      if (j == t * 3) {
        std::cout << (v.second + 1) / 3 << std::endl;
        return 0;
      }
      if (!flag[j]) {
        q.push_back(std::make_pair(j, v.second + 1));
      }
    }
  }
  std::cout << -1 << std::endl;
  return 0;
}


Measured memory_bytes: 12032
#include<iostream>
    #include<stdio.h>
    //#include <bits/stdc++.h>
    #include<vector>
    #include<float.h>
    #include<iomanip>
    #include<algorithm>
    #include<string>
    #include<cstring>
    #include<math.h>
    #include<sstream>
    #include<set>
    #include<map>
    #include<queue>

    #define INF 1e9
    #define rep(i,n)for(int i=0;(i)<(int)(n);i++)
    #define REP(i,a,b)for(int i=(int)(a);(i)<=(int)(b);i++)
    #define VEC(type, c, n) std::vector<type> c(n);for(auto& i:c)std::cin>>i;
    #define vec(type,n) vector<type>(n)
    #define vvec(m,n) vector<vector<int>> (int(m),vector<int>(n))

    using namespace std;
    using ll = long long;

    int main(){
      int n;
      cin>>n;
      map<int,int>ret;

      auto primeF = [&](int n,map<int,int>& mp){
        for(int64_t i = 2;i*i<=n;i++){
          while(n%i == 0){
            mp[i]++;
            n /= i;
          }
        }
        if(n != 1)mp[n]++;
      };

      long long ans = 1;
      REP(j,2,n){
        primeF(j,ret);
      }
      REP(i,2,n){
        ans *= 1+ret[i];
        ans %= 1000000007;
      }
      
      cout<<ans;
    }


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define rep(i,b) FOR(i,0,b)
#define INF mugen
#define dump(x) cerr<<#x<<"="<<x<<endl
#define ALL(a) (a).begin(),(a).end()
#define EACH(e,v) for(auto& e:v)
#define SORT(v) sort(ALL(v))
#define PERM(v) SORT(v);for(bool c##p=1;c##p;c##p=next_permutation(ALL(v)))
typedef vector<int> vi;
typedef vector<vi> vii;
typedef vector<vii> viii;
typedef pair<int,int> P;
template <class T> void chmin(T & a, T const & b) { if (b < a) a = b; }
template <class T> void chmax(T & a, T const & b) { if (b > a) a = b; }
template <typename T>
string to_string(const T &n){ostringstream stm;stm << n;return stm.str();}
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
using ll = long long;
const ll mod = 1000'000'007;
 
vector<int> vec;
signed main(){
    int n,ans;
    cin>>n;
    rep(i,n){
        int a;cin>>a;
        vec.push_back(a);
    }
    for(int i=0;i<n-2;i++){
        vector<int> temp;

        for(int j=i;j<i+3;j++){
            temp.push_back(vec[j]);
        }
        sort(temp.begin(),temp.end());
        
        if(temp[1]==vec[i+1])ans++;
    }
    cout<<ans<<endl;

 
}

Measured memory_bytes: 256
import sys

sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    n, m = map(int, input().split())
    ABC = []
    for _ in range(m):
        a, b = map(int, input().split())
        C = list(map(int, input().split()))
        bit = ["0"] * n
        for c in C:
            bit[c - 1] = "1"

        bit = "".join(bit)
        ABC.append([a, b, int(bit, 2)])

    dp = [f_inf for _ in range(1 << n)]
    dp[0] = 0
    for i in range(1 << n):
        for a, b, c in ABC:
            idx = i | c
            dp[idx] = min(dp[idx], dp[i] + a)

    if dp[-1] != f_inf:
        print(dp[-1])
    else:
        print(-1)


if __name__ == '__main__':
    resolve()


Measured memory_bytes: 3316
import math
A, B, H, M = list(map(int,input().split()))
thetah = H * 30 + M * 1/60 * 30
thetam = M / 60 * 360
theta = min(abs(thetah - thetam), 360 - abs(thetah - thetam))
ans = math.sqrt(A ** 2 + B ** 2 - 2 * A * B * math.cos(math.radians(theta)))
print(ans)

Measured memory_bytes: 9452
#include <bits/stdc++.h>
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define FORR(i,a,b) for (int i=(a);i>=(b);i--)
#define pb push_back

using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef set<int> si;
const int inf = 1e9;
const int mod = 1e9+7;
int n, s, ans = 0, m = inf;

main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> n;
  FOR(i, 0, n){
    cin >> s;
    if ((s % 10) && (m > s)) m = s;
    ans += s;
  }
  if (ans % 10 == 0){
    if(m == inf){
      cout << 0;
    }else{
      cout << ans - m;
    }
  }else{
    cout << ans;
  }
  cout << endl;
  return 0;
}


Measured memory_bytes: 256
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
input:
5
0 3 2 3 3 1 1 2
1 2 0 2 3 4
2 3 0 3 3 1 4 1
3 4 2 1 0 1 1 4 4 3
4 2 2 1 3 3

output:
0 0
1 2
2 2
3 1
4 3
"""

import heapq as hp
import sys

WHITE, GRAY, BLACK = 0, 1, 2


class SingleSourceShortestPath(object):
    __slots__ = ('adj_table', 'distance', 'parent', 'visited')

    def __init__(self, in_data):
        v_num = int(in_data[0])
        vertices = map(lambda x: x.split(), in_data[1:])
        adj_table = [{} for _ in range(v_num)]

        for v_info in vertices:
            source, v_adj_length, *v_adj_list = map(int, v_info)
            # assert len(v_adj_list) == v_adj_length * 2
            for target, cost in zip(v_adj_list[::2], v_adj_list[1::2]):
                adj_table[source][target] = cost

        self.adj_table = adj_table
        self.distance = [float('inf')] * v_num
        self.parent = [-1] * v_num
        self.visited = [WHITE] * v_num

    def path_heap_dijkstra(self, root):
        # path search init
        self.distance[root] = 0
        path_heap = []
        # heapq: rank by tuple[0], at here it's d[u]
        hp.heappush(path_heap, (0, root))

        while path_heap:
            csp, current = hp.heappop(path_heap)
            self.visited[current] = BLACK

            for adj, cost in self.adj_table[current].items():
                if self.visited[adj] != BLACK:
                    # alt: d[u] + w[u,v]
                    alt_path = self.distance[current] + cost
                    if alt_path < self.distance[adj]:
                        # update path_list
                        self.distance[adj] = alt_path
                        # update heap
                        hp.heappush(path_heap, (alt_path, adj))
                        self.visited[adj] = GRAY
                        self.parent[adj] = current

        return self.distance


if __name__ == '__main__':
    _input = sys.stdin.readlines()
    case = SingleSourceShortestPath(in_data=_input)
    ans = case.path_heap_dijkstra(root=0)
    for i, v in enumerate(ans):
        print(i, v)

Measured memory_bytes: 62868
#include <iostream>
using namespace std;
int main()
{
    int a, b, c, k;
    cin >> a >> b >> c >> k;
    int *p = &a;
    if (*p < b) p = &b;
    if (*p < c) p = &c;
    for (int i = 0; i < k; i++) *p *= 2;
    cout << a + b + c << endl;
    return 0;
}


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

typedef long long   signed int LL;
typedef long long unsigned int LU;

#define incID(i, l, r) for(int i = (l)    ; i <  (r); i++)
#define incII(i, l, r) for(int i = (l)    ; i <= (r); i++)
#define decID(i, l, r) for(int i = (r) - 1; i >= (l); i--)
#define decII(i, l, r) for(int i = (r)    ; i >= (l); i--)
#define  inc(i, n) incID(i, 0, n)
#define inc1(i, n) incII(i, 1, n)
#define  dec(i, n) decID(i, 0, n)
#define dec1(i, n) decII(i, 1, n)

#define inII(v, l, r) ((l) <= (v) && (v) <= (r))
#define inID(v, l, r) ((l) <= (v) && (v) <  (r))

#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define UB upper_bound
#define LB lower_bound
#define PQ priority_queue

#define  ALL(v)  v.begin(),  v.end()
#define RALL(v) v.rbegin(), v.rend()
#define  FOR(it, v) for(auto it =  v.begin(); it !=  v.end(); ++it)
#define RFOR(it, v) for(auto it = v.rbegin(); it != v.rend(); ++it)

template<typename T> bool   setmin(T & a, T b) { if(b <  a) { a = b; return true; } else { return false; } }
template<typename T> bool   setmax(T & a, T b) { if(b >  a) { a = b; return true; } else { return false; } }
template<typename T> bool setmineq(T & a, T b) { if(b <= a) { a = b; return true; } else { return false; } }
template<typename T> bool setmaxeq(T & a, T b) { if(b >= a) { a = b; return true; } else { return false; } }
template<typename T> T gcd(T a, T b) { return (b == 0 ? a : gcd(b, a % b)); }
template<typename T> T lcm(T a, T b) { return a / gcd(a, b) * b; }

// ---- ----

int r, c, n, x[2][100000], y[2][100000];
vector<pair<LL, int>> v;
deque<LL> q;

LL f(int k, int i) {
	LL v = -1;
	if(x[k][i] == 0 || x[k][i] == r || y[k][i] == 0 || y[k][i] == c) {
		if(y[k][i] == 0) { v = x[k][i]; }
		if(x[k][i] == r) { v = r + y[k][i]; }
		if(y[k][i] == c) { v = r + c + (r - x[k][i]); }
		if(x[k][i] == 0) { v = r + c + r + (c - y[k][i]); }
	}
	return v;
}

int main() {
	cin >> r >> c >> n;
	inc(i, n) { cin >> x[0][i] >> y[0][i] >> x[1][i] >> y[1][i]; }
	
	inc(i, n) {
		LL a = f(0, i);
		LL b = f(1, i);
		if(a != -1 && b != -1) {
			v.EB(a, i);
			v.EB(b, i);
		}
	}
	sort(ALL(v));
	// inc(i, v.size()) { cout << v[i].SE << " "; } cout << endl;
	
	inc(i, v.size()) {
		if(q.empty() || q.back() != v[i].SE) { q.PB(v[i].SE); }
		else { q.pop_back(); }
	}
	
	// while(! q.empty()) { cout << q.back() << " "; q.pop_back(); } cout << endl;
	
	cout << (q.empty() ? "YES" : "NO") << endl;
	
	return 0;
}


Measured memory_bytes: 7920
#include<bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define rrep(i,n) for (int i = (n)-1; i >= 0; i--)
#define rep2(i,s,n) for (int i = (s); i < (n); ++i)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define pb push_back
#define eb emplace_back
#define vi vector<int>
#define vvi vector<vector<int>>
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vd vector<double>
#define vs vector<string>
#define vc vector<char>
#define vb vector<bool>
#define vp vector<P>
using namespace std;
using ll = long long;
using P = pair<int,int>;
using LP = pair<ll,ll>;
template<class S,class T> istream& operator>>(istream &is,pair<S,T> &p) { return is >> p.first >> p.second; }
template<class S,class T> ostream& operator<<(ostream &os,const pair<S,T> &p) { return os<<'{'<<p.first<<","<<p.second<<'}'; }
template<class T> istream& operator>>(istream &is,vector<T> &v) { for(T &t:v){is>>t;} return is; }
template<class T> ostream& operator<<(ostream &os,const vector<T> &v) { os<<'[';rep(i,v.size())os<<v[i]<<(i==v.size()-1?']':','); return os; }
void Yes(bool b) { cout << (b ? "Yes" : "No") << endl; }
void YES(bool b) { cout << (b ? "YES" : "NO") << endl; }
template<class T> bool chmin(T& a,T b) {if(a > b){a = b; return true;} return false;}
template<class T> bool chmax(T& a,T b) {if(a < b){a = b; return true;} return false;}
const int inf = 1001001001;
const ll linf = 1001001001001001001;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr); cout.tie(nullptr);
    int n;
    cin >> n;
    ll now = 1;
    ll mx = 1e18;
    vl a(n);
    cin >> a;
    rep(i,n) if(a[i] == 0) {
        cout << 0 << endl;
        return 0;
    }
    rep(i,n) {
        if(now > mx/a[i]) {
            cout << -1 << endl;
            return 0;
        }
        now *= a[i];
    }
    cout << (ll)now << endl;
}

Measured memory_bytes: 3972
h,w = tuple(map(int,input().split()))

a = [input() for _ in [0]*h]

for _ in [0]*(w+2):
  print('#',end='')
print()
for i in range(h):
  print('#',end='')
  print(a[i],end='')
  print('#')

for _ in [0]*(w+2):
  print('#',end='')
print()

Measured memory_bytes: 38384
#include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000


int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N; cin >> N;
    int cnt = 1;
    while(cnt * 2 <= N) {
        cnt *= 2;
    }
    cout << cnt << endl;

    return 0;
}


Measured memory_bytes: 256
import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] h = new int[n];
		for(int i=0;i<n;i++){
			h[i] = sc.nextInt();
		}
		sc.close();

		// db[i] = iマス目にたどり着くための最小コスト
		int[] dp = new int[n];
		dp[0] = 0; //最初のマスは0コスト
		// 2つ目のマスは、1つ前から移動するパターンのみ
		dp[1] = Math.abs(h[1] - h[0]); // Math.aps()は絶対値を返す
		// 3マス目以降は、1マス前または2マス前からの2パターンの移動がある
		for(int i=2;i<n;i++){
			// 1マス前から移動したときの最小コストを求める
			int step1 = dp[i-1] + Math.abs(h[i] - h[i-1]);
			// 2マス前から移動したときの最小コストを求める
			int step2 = dp[i-2] + Math.abs(h[i] - h[i-2]);
			// 2つの最小値を求めることで、i+1マス目の最小コストを求めることができる
			dp[i] = Math.min(step1, step2);
		}
		// 最後のマスに到達するための必要数を出力する
		System.out.println(dp[n-1]);
	}
}

Measured memory_bytes: 50320
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < int(n); i++)
using namespace std;
using ll = long long;
const int INF = (1<<30)-1;
const long long LINF = (1LL<<62)-1;
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, 1, 0, -1};
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

using P = pair<double, int>;
const double DINF = 1e14;

double dist(double x1, double y1, double x2, double y2) {
  return sqrt(pow(x2-x1, 2)+pow(y2-y1, 2));
}

signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  double sx, sy, gx, gy;
  cin >> sx >> sy >> gx >> gy;
  int n;
  cin >> n;
  vector<double> x(n), y(n), r(n);
  rep(i, n) cin >> x[i] >> y[i] >> r[i];
  priority_queue<P, vector<P>, greater<P>> que;
  vector<double> res(n);
  rep(i, n) {
    res[i] = max(dist(sx, sy, x[i], y[i])-r[i], 0.0);
    que.emplace(res[i], i);
  }
  while (!que.empty()) {
    double cost;
    int now;
    tie(cost, now) = que.top();
    que.pop();
    if (cost > res[now])
      continue;
    rep(i, n) {
      if (chmin(res[i], res[now]+max(dist(x[now], y[now], x[i], y[i])-r[now]-r[i], 0.0)))
        que.emplace(res[i], i);
    }
  }
  rep(i, n)
    res[i] += max(dist(gx, gy, x[i], y[i])-r[i], 0.0);
  double ans = dist(sx, sy, gx, gy);
  rep(i, n)
    chmin(ans, res[i]);
  cout << fixed << setprecision(12) << ans << endl;
  return 0;
}

Measured memory_bytes: 7536
#include<bits/stdc++.h>
using namespace std;
using LL = long long;
constexpr int maxn = 2000;
constexpr int maxm = 4000000;
constexpr LL mod = 1000000007;
LL f[maxm + 1], g[maxm + 1];
LL dp[maxn + 1][maxn + 1];
LL F(int n, int m){
    return f[n + m] * g[n] % mod * g[m] % mod;
}
int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int N, K;
    cin >> N >> K;
    if(K == 1){
        cout << 1;
        return 0;
    }
    for(int i = 1; i <= maxm; i += 1)
        g[i] = i == 1 ? 1 : (mod - mod / i) * g[mod % i] % mod;
    for(int i = 0; i <= maxm; i += 1){
        f[i] = i ? f[i - 1] * i % mod : 1;
        g[i] = i ? g[i - 1] * g[i] % mod : 1;
    }
    for(int i = 0; i <= N; i += 1)
        for(int j = i; j <= N; j += 1)
            if(not j) dp[i][j] = 1;
            else{
                if(i) dp[i][j] = dp[i - 1][j];
                if(j > i) dp[i][j] = (dp[i][j] + dp[i][j - 1] * F((j - 1) * (K - 1) + i, K - 2)) % mod;
            }
    cout << dp[N][N] * f[N] % mod;
    return 0;
}

Measured memory_bytes: 94080
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define rep(i, n) for (int i = 0; i < n; i++)
#define all(a) (a).begin(), (a).end()
typedef vector<int> vi;
const int INF = 1LL << 60; //10e18+10e17ちょっとくらい
const int MOD = 1000000007;
const int MAX_N = 200100;

struct mint
{
    ll x; // typedef long long ll;
    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 { return mint(*this) += a; }
    mint operator-(const mint a) const { return mint(*this) -= a; }
    mint operator*(const mint a) const { return mint(*this) *= 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 { return mint(*this) /= a; }
};
istream &operator>>(istream &is, const mint &a) { return is >> a.x; }
ostream &operator<<(ostream &os, const mint &a) { return os << a.x; }

struct combination
{
    vector<mint> fact, ifact;
    combination(int n) : fact(n + 1), ifact(n + 1)
    {
        assert(n < MOD);
        fact[0] = 1;
        for (int i = 1; i <= n; ++i)
            fact[i] = fact[i - 1] * i;
        ifact[n] = fact[n].inv();
        for (int i = n; i >= 1; --i)
            ifact[i - 1] = ifact[i] * i;
    }
    mint operator()(int n, int k)
    {
        if (k < 0 || k > n)
            return 0;
        return fact[n] * ifact[k] * ifact[n - k];
    }
} c(200005);

mint tmp[200005];
signed main()
{
    //  以降 cin の入力元が 'input.txt' になる
    //std::ifstream in("input.txt");
    //std::cin.rdbuf(in.rdbuf());
    int n, k;
    cin >> n >> k;

    mint ans = 0;
    rep(i, k + 1)
    {
        if (i >= n)
            break;
        mint a = c(n - 1, n - i - 1);
        mint b = c(n, i);
        ans += a * b;
    }
    cout << ans << endl;
    return 0;
}

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

int main()
{
    int n;
    cin >> n;
    uint32_t max = 0;
    uint32_t min = 1000000000;

    vector<uint32_t> a(n);
    for (int i = 0; i < n; i++)
    {
        cin >> a.at(i);
        if (max < a.at(i))
        {
            max = a.at(i);
        }
        if (min > a.at(i))
        {
            min = a.at(i);
        }
    }

    cout << (max - min) << endl;
}

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

int main(){
    int n, k;
    std::cin >> n >> k;

    std::vector<int> h(n);
    for(int i = 0; i < n; ++i){
        std::cin >> h.at(i);
    }

    std::sort(h.begin(), h.end());
    int ans = 2147483647;
    for(int i = 0; i < n - k + 1; ++i){
        ans = std::min(ans, h.at(i + k - 1) - h.at(i));
    }

    std::cout << ans << std::endl;

    return 0;
}

Measured memory_bytes: 760
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <functional>

using namespace std;
#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--)
int N;
string s,t;




int main()
{

	cin >> N >> s >> t;

	int ans = 2*N;
	REP(i,N){
		if(s.substr(N-1-i) == t.substr(0,i + 1))
			ans = 2 * N - i - 1;
	}


	cout << ans << endl;



}



Measured memory_bytes: 256
use std::io::*;
use std::str::FromStr;
use std::collections::HashMap;

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")
}

fn main() {
    let n: usize = read();
    let k: usize = read();
    let mut sunuke = HashMap::new();
    let mut ans = 0;

    for i in 0..k {
        let d:usize = read();
        for j in 0..d {
            sunuke.entry(read::<usize>()).or_insert(1);
        }
    }

    for i in 1..n+1 {
        //println!("{:?}",sunuke.get(&i));
        if sunuke.get(&i) == None {
            ans += 1;
        }
    }
    println!("{}", ans);
}


Measured memory_bytes: 2188
#include<iostream>
using namespace std;
const int mol=1e9+7;
typedef long long ll;

int main(void)
{
	ll k,n,t=0;
	cin>>n>>k;
	for(int i=k;i<=n+1;i++)
	{
		t+=(n-i+1)*i+1;
		t%=mol;
	}
	cout<<t<<endl;
	return 0;
}
/*
我们只要求当取kk个数时，max-min+1就能得到当前的总数量。
max就是取k个数时的最大值，min就是指取k个数时的最小值。
然后，让k++，一直加到n+1为止。
这个累加过程可以用求和公式，而两个求和公式相减也可以用分配率。
我这里就说一下最终的推导结果：
当取k个数时，和的数量就是(n-k+1)×k+1
*/	

Measured memory_bytes: 3636
#include <iostream>
#include <set>
#include <vector>
#include <queue>
#include <stack>
#include <utility>

using namespace std;

typedef long long signed int ll;

constexpr ll NIL = -20000000000;

int g[101][101],n,d[101];

int main() {
    for(int i = 0;i < 101;i++)d[i] = -1;
    cin >> n;
    for(int i = 0;i < n;i++) {
        int u,k,v;
        cin >> u >> k;
        for(int j = 0;j < k;j++) {
            cin >> v;
            g[u][v]++;
        }
    }
    queue<int> q;
    q.push(1);
    d[1] = 0;
    while(!q.empty()) {
        int u = q.front();q.pop();
        for(int i = 1;i <= n;i++) {
            if(g[u][i] && d[i] == -1)
            {
                d[i] = d[u]+1;
                q.push(i);
            }
        }
    }
    for(int i = 1;i <=n;i++) {
        cout << i << " " << d[i] <<endl;
    }
}



Measured memory_bytes: 3112
#include <stdio.h>


int main(){
  int n;  scanf("%d", &n);
  static int a[200003];
  static int conne[200003][2];


  for(int i=1; i<=n; i++){
    conne[i][0] = conne[i][1] = 0;
  }
  
  for(int i=1; i<=n; i++){
    scanf("%d", &a[i]);
    if(i+a[i] <= n){
      conne[i+a[i]][0]++;
    }
    if(i-a[i] > 1){
      conne[i-a[i]][1]++;
    }
  }
  
  long long int count = 0;
  for(int i=2; i<n; i++){
    count = count + (long long int)(conne[i][0]) * (long long int)(conne[i][1]);
  }
  printf("%lld\n", count);
  return 0;
}
    


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

// template {{{
#define  range(i, l, r) for (int i = (int)(l); i < (int)(r); (i) += 1)
#define rrange(i, l, r) for (int i = (int)(r) - 1; i >= (int)(l); (i) -= 1)

#define  whole(f, x, ...) ([&](decltype((x)) container) { return (f)(  begin(container),  end(container), ## __VA_ARGS__); })(x)
#define rwhole(f, x, ...) ([&](decltype((x)) container) { return (f)( rbegin(container), rend(container), ## __VA_ARGS__); })(x)

#define debug(x) cerr << "(" << __LINE__ << ")" << #x << ": " << (x) << endl

using i32 = int;
using u32 = unsigned int;
using i64 = long long;
using u64 = unsigned long long;

// constexpr i32 mod   = 998244353;
constexpr i32 mod   = 1e9 + 7;
constexpr i32 inf   = 1001001001;
constexpr i64 infll = 1001001001001001001ll;

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

struct IoSetup { IoSetup(int x = 15){ cin.tie(0); ios::sync_with_stdio(0); cout << fixed << setprecision(x); cerr << fixed << setprecision(x); } } iosetup;

template <typename T = i64> T input() { T x; cin >> x; return x; }

template <typename T> ostream &operator<<(ostream &os, vector<T> &v) { range(i, 0, v.size()) { os << v[i] << (i + 1 != v.size() ? " " : ""); } return os; }
template <typename T> istream &operator>>(istream &is, vector<T> &v) { for (T &in : v) is >> in; return is; }

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

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

template <typename T1, typename T2> inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template <typename T1, typename T2> inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }
// }}}

void solver() {
    char a;
    cin >> a;

    if ('a' <= a && a <= 'z') {
        cout << "a" << endl;
    } else {
        cout << "A" << endl;
    }
}

signed main(int argc, char *argv[]) {
    solver();
}


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

#define int long long
#define ff first
#define ss second
#define endl "\n"
#define all(x) (x).begin(), (x).end()
#define sz(x) (int)(x.size())
int powmod(int a,int l, int md){a%=md; int res=1;while(l){if(l&1)res=res*a%md;l/=2;a=a*a%md;}return res;}
int binpow(int a,int l){int res=1;while(l){if(l&1)res=res*a;l/=2;a=a*a;}return res;}
int invmod(int a, int md){return powmod(a,md-2,md);}
typedef long long ll; typedef unsigned long long ull; typedef long double ld;
typedef vector<int> vi; typedef pair<int, int> ii; typedef vector< ii > vii;
#define pb push_back
int __set(int b, int i) {return b|(1LL<<i);} //set ith bit
int __unset(int b, int i) {return b&(~(1UL<<i));}
int __check(int b, int i) {return b&(1LL<<i);} //returns 0 if ith bit is 0
int mulmod(int a, int b, int md) {return (((a%md)*(b%md))%md+md)%md;}
int addmod(int a, int b, int md) {return ((a%md+b%md)%md+md)%md;}
int submod(int a, int b, int md) {return (((a%md-b%md)%md)+md)%md;}
int divmod(int a, int b, int md) {return mulmod(a, powmod(b, md-2, md), md);} //if md is prime;
const ll inf = 0xFFFFFFFFFFFFFFFL; //very large number
priority_queue<int, vector<int>, greater<int> > pq; //for min priority_queue
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int MOD = 1e9+7;
const int MX = 400010;

int f[MX];
int rf[MX];

int C(int l,int k, int md) 
{
    if (k<0||k>l){
        return 0;
    }
    return f[l]*rf[k]%md*rf[l-k]%md;
}

void precfac() {
    f[0]=1;
    for (int i=1;i<MX;i++){
        f[i]=f[i-1]*i%MOD;
    }
    rf[MX-1]=powmod(f[MX-1],MOD-2, MOD);
    for (int i=MX-2;i>=0;i--){
        rf[i]=rf[i+1]*(i+1)%MOD;
    }
}
signed main(void)
{
	IOS;
	int n; cin>>n;
	cout<<(1-n)<<endl;
	return 0;
}

Measured memory_bytes: 3652
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <cstring>
#include <math.h>
#include <bitset>
#include <queue>
#include <set>
#include <iomanip>
#include <math.h>
#include <assert.h>
// #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
constexpr long long int INFLL = 1001001001001001LL;
constexpr long long int infll = 1001001001001001LL;
constexpr int INF = 1000000007;
constexpr int inf = 1000000007;
const int mod = 1000000007;

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

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

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

inline double nCr(const int n, int r)
{
    if (n == 0)
    {
        return 0;
    }
    if (r == 0)
    {
        return 1;
    }
    if (r == 1)
    {
        return n;
    }
    if (n == r)
    {
        return 1;
    }

    if (r > n / 2)
    {
        r = n / 2;
    }

    double result = 1;
    for (double i = 1; i <= r; i++)
    {
        result *= (n - i + 1) / i;
    }

    return (result);
}

template <typename T>
T seinomi(T a)
{
    if (a > 0)
    {
        return a;
    }
    else
    {
        return 0;
    }
}

template <typename T>
map<T, T> soinsuubunkai(T n) //連想配列[素因数f.first][個数f.second]
{
    map<T, T> ret;
    for (T i = 2; i * i <= n; i++)
    {
        while (n % i == 0)
        {
            ret[i]++;
            n /= i;
        }
    }
    if (n != 1)
        ret[n] = 1;
    return ret;
}

template <typename T>
T ketasuu(T num)
{
    return std::to_string(num).length();
}

int kaizyou(int k)
{
    int sum = 1;
    for (int i = 1; i <= k; ++i)
    {
        sum *= i;
    }
    return sum;
}

template <class ForwardIt, class T>
void iota(ForwardIt first, ForwardIt last, T value)
{
    while (first != last)
    {
        *first++ = value;
        ++value;
    }
}

//nの階乗を計算
int factorial(int n)
{
    int answer = 1;
    while (n > 1)
    {
        answer *= n;
        n--;
    }
    return answer;
}
int comb(int n, int r)
{
    return factorial(n) / (factorial(r) * factorial(n - r));
}

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

//小数点以下10桁テンプレート（main関数内の最初に貼付け）
//std::cout << std::fixed << std::setprecision(10);

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


int main(){
    std::cout << std::fixed << std::setprecision(10);
ll t,x;
cin>>t>>x;
cout<<(double)t/x<<endl;
}









Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <iostream>
#include <string>
using namespace std;

int LR[502][502] = {0};
int dp[502][502] = {0};

int sumLR(int p, int q){
	int ret = dp[p][q];
	if(ret>=0) return ret;

	ret = 0;
	for(int i=p; i<=q; i++){
		for(int j=i; j<=q; j++){
			ret += LR[i][j];
		}
	}
	dp[p][q] = ret;
	return ret;
}

void calcdp(){
	for(int i=1; i<=500; i++){
		dp[i][i] = LR[i][i];
	}
	for(int i=1; i<500; i++){
		for(int j=i; j<500; j++){
			int s = 0;
			for(int k=i; k<=j+1; k++){
				s += LR[k][j+1];
			}
			dp[i][j+1] = dp[i][j] + s;
		}
	}

}

int main(int argc, char* argv[]){
	int N, M, Q; // N 1..500, M 1..200000, Q 1..100000

	cin >> N >> M >> Q;
	
	for(int i=1; i<=N; i++){
		for(int j=1; j<=N; j++){ dp[i][j] = -1;}
	}

	for(int i=1; i<=M; i++){
		int l, r;
		cin >> l >> r;
		LR[l][r]++;
	}
	calcdp();
	for(int i=1; i<=Q; i++){
		int p, q;
		cin >> p >> q;
		int r = sumLR(p, q);
		printf("%d\n",r);
	}
	return 0;
}

Measured memory_bytes: 2944
import java.util.Scanner;
public class Main {
  public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
       	int[] d = new int[n];
       	for(int i = 0 ; i < n ; i++ ){
        	d[i] = sc.nextInt();
        }
    	int s = 0;
       	for(int i = 0 ; i < n ; i++ ){
            for(int j = 0 ; j < i ; j++ ){
            	s += d[i] * d[j];
            }
        }
        System.out.println(s);
  	}
}

Measured memory_bytes: 27084
#include<stdio.h>
long long n,k,p,m;
int main(void)
{
	scanf("%lld%lld",&n,&k);
	p=n%k;
	m=k-n%k;
	if(p<m){
		printf("%lld\n",p);
	}
	else{
		printf("%lld\n",m);
	}
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,a,n) for (register int i=a;i<=n;i++)
#define per(i,a,n) for (register int i=n;i>=a;i--)
#define FOR(i,a,n,x) for (register int i=a;i<=n;i+=x)
#define ROF(i,a,n,x) for (register int i=n;i>=a;i-=x)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
#define pii pair<int, int>
#define pil pair<int, long long>
#define pll pair<long long, long long>
#define VI vector<int>
#define ll long long
#define ull unsigned long long
#define lowbit(x) ((x)&(-x))
#define mem(i, a) memset(i, a, sizeof(i))
#define sqr(x) ((x)*(x))
#define ls (p << 1)
#define rs (p << 1 | 1)
using namespace std;

template <typename T>

inline void read(T &X) {
  X = 0; char ch = 0; T op = 1;
  for(; ch > '9' || ch < '0'; ch = getchar())
    if(ch == '-') op = -1;
  for(; ch >= '0' && ch <= '9'; ch = getchar())
    X = (X << 3) + (X << 1) + ch - 48;
  X *= op;
}

const int INF = 0x3f3f3f3f;
const int MAXN =  + 5;

int n;
string s;

int main() {
#ifdef WiLe
  freopen ("input.txt", "rt", stdin);
#endif

  int AC = 0, WA = 0, TLE = 0, RE = 0;
  read(n);
  rep (i, 1, n) {
    cin >> s;
    if (s == "AC") AC++;
    else if (s == "WA") WA ++;
    else if (s == "TLE") TLE ++;
    else if (s == "RE") RE ++;
  }

  printf("AC x %d\n", AC);
  printf("WA x %d\n", WA);
  printf("TLE x %d\n", TLE);
  printf("RE x %d\n", RE);
#ifdef WiLe
  cerr << "\nTime elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
  return 0;
}
/*
# author : WiLe
# date : 2020/07/18
*/

Measured memory_bytes: 3712
a,b = map(int,input().split())
grid_b = [list('#'*100) for _ in range(50)]
grid_w = [list('.'*100) for _ in range(50)]
for i in range(a-1):
    grid_b[2*(i//50)+1][2*(i%50)+1] = '.'
for i in range(b-1):
    grid_w[2*(i//50)+1][2*(i%50)+1] = '#'
print(100, 100)
for i in range(50):
    print(''.join(grid_b[i]))
for i in range(50):
    print(''.join(grid_w[i]))

Measured memory_bytes: 3188
// Author: Vamsi Krishna Reddy Satti
// With love for Competitive Programming!
 
#pragma GCC optimize ("Ofast,unroll-loops,-ffloat-store")
// #pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma,tune=native")

#include <bits/stdc++.h>
using namespace std;

string to_string(const string& s) { return '"' + s + '"'; }
void debug_out() { cout << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
    cout << " " << to_string(H);
    debug_out(T...);
}
#ifdef LOCAL
    #define debug(...) cout << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
    #define debug(...) 3
#endif
 
#define cin_exception cin.exceptions(cin.failbit);
#define cout_precision cout.setf(ios::fixed); cout.precision(15);
#define fast_io ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
using ll = int_fast64_t; using ld = long double;

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

const int N = 5e5 + 5;
int n, q;
string s;
int t[4 * N];

void build(int v = 1, int tl = 0, int tr = n - 1) {
    if (tl == tr) {
        t[v] = (1 << (s[tl] - 'a'));
        return;
    }
    int tm = (tl + tr) >> 1;
    int vl = v << 1, vr = vl | 1;
    build(vl, tl, tm);
    build(vr, tm + 1, tr);
    t[v] = t[vl] | t[vr];
}

void update(int p, char c, int v = 1, int tl = 0, int tr = n - 1) {
    if (tl == tr) {
        t[v] = (1 << (c - 'a'));
        return;
    }
    int tm = (tl + tr) >> 1;
    int vl = v << 1, vr = vl | 1;
    if(p <= tm) update(p, c, vl, tl, tm);
    else update(p, c, vr, tm + 1, tr);
    t[v] = t[vl] | t[vr];
}

int query(int l, int r, int v = 1, int tl = 0, int tr = n - 1) {
    if (r < tl || l > tr) return 0;
    if (l <= tl && tr <= r) return t[v];
    int tm = (tl + tr) >> 1;
    int vl = v << 1, vr = vl | 1;
    int ql = query(l, r, vl, tl, tm);
    int qr = query(l, r, vr, tm + 1, tr);
    return ql | qr;
}

void solve() {
    cin >> n >> s;
    build();
    cin >> q;
    for (int i = 0; i < q; ++i) {
        int t; cin >> t;
        if (t == 1) {
            int p; char c; cin >> p >> c; --p;
            update(p, c);
        } else {
            int l, r; cin >> l >> r; --l; --r;
            int res = query(l, r);
            cout << __builtin_popcount(res) << '\n';
        }
    }
}

int main() {
    fast_io; cin_exception;
    int t = 1; // cin >> t;
    for (int i = 0; i < t; ++i) {
        solve();
    }
}

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

typedef long long ll;
typedef long double ld;

#define n1		      "\n"
#define B                     begin()
#define E                     end()
#define F                     first
#define S                     second
#define pb                    push_back
#define pf                    push_front
#define popb                  pop_back()
#define popf                  pop_front()

const int BIG=1e5+55;
const int BIGG=1e9+7;
const ll BIGGE=1e12+55;
const double SML=(1e-7);

using namespace std;

    ll a[100];
    int n;

int main()
{
    ios::sync_with_stdio(false); cin.tie(NULL);
    cout.tie(NULL);
    a[0] = 2;
    a[1] = 1;
    for (int i=2; i<=86; i++) {
        a[i] = a[i-1] + a[i-2];
    }
    cin >>n;
    cout <<a[n];



    return 0;
}


Measured memory_bytes: 3620
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
typedef long long ll;
#define all(x) (x).begin(),(x).end()
int INF = 1000000000;

int main() {
  ll N; cin >> N;
  ll ans = 0;
  if (N == 1) {
    cout << 0 << endl;
    return 0;
  }
  if (N == 2) {
    cout << 1 << endl;
    return 0;
  }
  rep2(i, 0, N-1) {
    ans += i + 1;
  }
  cout << ans << endl;
}

Measured memory_bytes: 256