| Task: | Bus tours |
| Sender: | aalto26km_049 |
| Submission time: | 2026-11-16 16:29:49 +0200 |
| Language: | C++ (C++20) |
| Status: | READY |
| Result: | ACCEPTED |
| test | verdict | time | |
|---|---|---|---|
| #1 | ACCEPTED | 0.00 s | details |
| #2 | ACCEPTED | 0.00 s | details |
| #3 | ACCEPTED | 0.00 s | details |
| #4 | ACCEPTED | 0.00 s | details |
| #5 | ACCEPTED | 0.00 s | details |
| #6 | ACCEPTED | 0.00 s | details |
| #7 | ACCEPTED | 0.00 s | details |
| #8 | ACCEPTED | 0.00 s | details |
| #9 | ACCEPTED | 0.00 s | details |
| #10 | ACCEPTED | 0.00 s | details |
| #11 | ACCEPTED | 0.00 s | details |
| #12 | ACCEPTED | 0.00 s | details |
| #13 | ACCEPTED | 0.00 s | details |
| #14 | ACCEPTED | 0.00 s | details |
| #15 | ACCEPTED | 0.00 s | details |
| #16 | ACCEPTED | 0.00 s | details |
| #17 | ACCEPTED | 0.00 s | details |
| #18 | ACCEPTED | 0.00 s | details |
| #19 | ACCEPTED | 0.00 s | details |
| #20 | ACCEPTED | 0.00 s | details |
| #21 | ACCEPTED | 0.01 s | details |
| #22 | ACCEPTED | 0.01 s | details |
| #23 | ACCEPTED | 0.01 s | details |
| #24 | ACCEPTED | 0.01 s | details |
| #25 | ACCEPTED | 0.01 s | details |
| #26 | ACCEPTED | 0.01 s | details |
| #27 | ACCEPTED | 0.01 s | details |
| #28 | ACCEPTED | 0.01 s | details |
| #29 | ACCEPTED | 0.01 s | details |
| #30 | ACCEPTED | 0.01 s | details |
| #31 | ACCEPTED | 0.01 s | details |
| #32 | ACCEPTED | 0.01 s | details |
| #33 | ACCEPTED | 0.01 s | details |
| #34 | ACCEPTED | 0.01 s | details |
| #35 | ACCEPTED | 0.01 s | details |
| #36 | ACCEPTED | 0.01 s | details |
| #37 | ACCEPTED | 0.01 s | details |
| #38 | ACCEPTED | 0.14 s | details |
| #39 | ACCEPTED | 0.01 s | details |
| #40 | ACCEPTED | 0.14 s | details |
| #41 | ACCEPTED | 0.01 s | details |
| #42 | ACCEPTED | 0.01 s | details |
| #43 | ACCEPTED | 0.01 s | details |
| #44 | ACCEPTED | 0.01 s | details |
| #45 | ACCEPTED | 0.01 s | details |
| #46 | ACCEPTED | 0.01 s | details |
| #47 | ACCEPTED | 0.01 s | details |
| #48 | ACCEPTED | 0.01 s | details |
| #49 | ACCEPTED | 0.01 s | details |
| #50 | ACCEPTED | 0.14 s | details |
| #51 | ACCEPTED | 0.01 s | details |
| #52 | ACCEPTED | 0.15 s | details |
| #53 | ACCEPTED | 0.01 s | details |
| #54 | ACCEPTED | 0.01 s | details |
| #55 | ACCEPTED | 0.01 s | details |
| #56 | ACCEPTED | 0.01 s | details |
| #57 | ACCEPTED | 0.01 s | details |
| #58 | ACCEPTED | 0.01 s | details |
| #59 | ACCEPTED | 0.01 s | details |
| #60 | ACCEPTED | 0.01 s | details |
Code
#include <iostream>
#include <vector>
#include <functional>
#include <set>
#include <algorithm>
#include <stack>
#include <unordered_map>
#include <map>
#include <iomanip>
#include <limits>
#include <queue>
#include <math.h>
#include <bits/stdc++.h>
typedef long long LL;
typedef std::tuple<LL> TUP1LL;
typedef std::tuple<LL,LL> TUP2LL;
typedef std::tuple<LL,LL,LL> TUP3LL;
typedef std::tuple<LL,LL,LL,LL> TUP4LL;
std::tuple<LL> readLL1(){
LL a;
std::cin >> a;
return {a};
}
std::tuple<LL,LL> readLL2(){
LL a, b;
std::cin >> a >> b;
return {a,b};
}
std::tuple<LL,LL,LL> readLL3(){
LL a, b, c;
std::cin >> a >> b >> c;
return {a,b,c};
}
std::tuple<LL,LL,LL,LL> readLL4(){
LL a, b, c, d;
std::cin >> a >> b >> c >> d;
return {a,b,c,d};
}
std::vector<LL> readVecLL(LL n){
std::vector<LL> arr(n);
for (LL i = 0; i < n; i++){
LL a;
std::cin >> a;
arr[i] = a;
}
return arr;
}
std::string readStr(){
std::string a;
std::cin >> a;
return a;
}
std::vector<std::string> readVecStr(LL n){
std::vector<std::string> arr(n);
for (LL i = 0; i < n; i++){
std::string a;
std::cin >> a;
arr[i] = a;
}
return arr;
}
std::vector<std::tuple<LL,LL>> readVecTup2(LL n){
std::vector<std::tuple<LL,LL>> arr(n);
for (LL i = 0; i < n; i++){
arr[i] = readLL2();
}
return arr;
}
std::vector<std::tuple<LL,LL,LL>> readVecTup3(LL n){
std::vector<std::tuple<LL,LL,LL>> arr(n);
for (LL i = 0; i < n; i++){
arr[i] = readLL3();
}
return arr;
}
std::vector<std::tuple<double,double,double>> readVecTup3Dup(LL n){
std::vector<std::tuple<double,double,double>> arr(n);
for (LL i = 0; i < n; i++){
double a, b, c;
std::cin >> a;
std::cin >> b;
std::cin >> c;
arr[i] = {a,b,c};
}
return arr;
}
std::vector<std::tuple<LL,LL,LL,LL>> readVecTup4(LL n){
std::vector<std::tuple<LL,LL,LL,LL>> arr(n);
for (LL i = 0; i < n; i++){
arr[i] = readLL4();
}
return arr;
}
void printNewLine(){std::cout << "\n";}
template<typename T, typename... Ts>
std::tuple<Ts...> tail(std::tuple<T,Ts...> as){
return std::apply([](T &a, Ts... b){return std::make_tuple(b...);},as);
}
template<typename T>
void print(T a){std::cout << std::setprecision(19) << a;}
template<typename... T>
void println(T... a);
template<typename T, typename Ts>
void print(std::tuple<T,Ts> a){
print(std::get<0>(a));
print(" ");
print(std::get<1>(a));
}
template<typename T, typename... Ts>
void print(std::tuple<T,Ts...> a){
print(std::get<0>(a));
print(" ");
print(tail(a));
}
template<typename T>
void print(const std::vector<T> &arr, LL width = -1){
if (width == -1) width = arr.size();
for (LL i = 0; i < (LL)arr.size(); i++){
print(arr[i]);
if (i+1 == (LL)arr.size()) continue;
if ((i%width) == width-1) printNewLine();
if ((i%width) != width-1) print(" ");
}
}
template<typename... T>
void println(T... a){print(a...);printNewLine();}
template<typename T>
void sorted(std::vector<T> &arr){
std::sort(arr.begin(),arr.end(),[](const T &a, const T &b){ return a < b; });
}
template<typename T>
std::set<T> toSet(const std::vector<T> &vec){
std::set<T> c;
for (T a : vec){ c.emplace(a);}
return c;
}
template<typename T, typename N>
std::vector<N> map(const std::vector<T> &a, const std::function<N(T)> &transform){
std::vector<N> b(a.size());
LL i = 0;
for (T x : a){
b[i] = transform(x);
i++;
}
return b;
}
template<typename N, typename M, typename R>
std::vector<R> zip(const std::vector<N> &a, const std::vector<M> &b, const std::function<R(N,M)> &transform){
LL n = std::min(a.size(),b.size());
std::vector<R> res(n);
for (LL i = 0; i < n; i++){
res[i] = transform(a[i],b[i]);
}
return res;
}
template<typename T, typename N>
std::vector<N> convertVec(const std::vector<T> &a){
std::vector<N> b(a.size());
LL i = 0;
for (T x : a){
b[i] = x;
i++;
}
return b;
}
template<typename T>
std::vector<T> reverse(const std::vector<T> &a){
std::vector<T> b(a.size());
LL i = 0;
for (T x : a){
b[a.size()-1-i] = x;
i++;
}
return b;
}
template<typename T, typename R>
R reduce(const std::vector<T> &arr, R init, const std::function<R(const R,const T)> &transform){
R current = init;
for (LL idx = 0; idx < (LL)arr.size(); idx++){
current = transform(current,arr[idx]);
};
return current;
}
template<typename T>
T max(const std::vector<T> &arr){return reduce(arr, arr[0], static_cast<std::function<T(const T,const T)>>(static_cast<const T& (*)(const T&, const T&)>(std::max<T>)));}
template<typename T>
T min(const std::vector<T> &arr){return reduce(arr, arr[0], static_cast<std::function<T(const T,const T)>>(static_cast<const T& (*)(const T&, const T&)>(std::min<T>)));}
template<typename T>
std::function<T(const T,const T)> add(){return [](T a,T b){return a+b;};}
template<typename T>
std::function<T(const T,const T)> modAdd(T mod){return [mod](T a,T b){return (((a+b)%mod)+mod)%mod;};}
template<typename T, typename R>
std::function<R(const R,const T)> mulAdd(R mul){return [mul](R a,T b){return a+b*mul;};}
template<typename T>
T sum(const std::vector<T> &arr){return reduce(arr, 0, add<T>());}
template<typename T>
T avg(const std::vector<T> &arr){return reduce(arr, 0.0, mulAdd<double,T>(1.0/arr.size()));}
template<typename T>
T binarySearch(T min, T max, const std::function<bool(T)> &leq){
if (min == max) return max;
T guess = (min+max)/2;
if (leq(guess)){
return binarySearch(min,guess,leq);
}else{
return binarySearch(guess+1,max,leq);
}
}
template<typename T>
T binarySearchDecending(T min, T max, const std::function<bool(T)> &leq){
std::function<bool(T)> gt = [leq](T x){
return !leq(x);
};
return binarySearch(min,max+1, gt)-1;
}
template<typename T>
std::vector<T> cloneVec(std::vector<T> a){return a;}
template<typename T>
std::vector<T> padding(const std::vector<T> &initial, T num, LL start, LL end){
std::vector<T> arr(start+initial.size()+end);
for (LL i = 0; i < start; i++){
arr[i] = num;
}
for (LL i = 0; i < (LL)initial.size(); i++){
arr[start+i] = initial[i];
}
for (LL i = 0; i < end; i++){
arr[start+initial.size()+i] = num;
}
return arr;
}
template<typename T>
LL findMax(LL start, LL end, const std::function<T(LL)> &maxHeuristic){
T initialGuess = maxHeuristic(start);
LL index = start;
for (LL i = start; i <= end; i++){
if (initialGuess < maxHeuristic(i)){
initialGuess = maxHeuristic(i);
index = i;
}
}
return index;
}
template<typename T>
void operateOnMax(LL start, LL end, const std::function<T(LL)> &maxHeuristic, const std::function<void(LL)> &found){
found(findMax(start,end,maxHeuristic));
}
template<typename T>
void stackOperate(std::vector<T> init, const std::function<std::vector<T>(T)> operate){
std::stack<T> stack;
for (auto x : init){
stack.push(x);
}
while (!stack.empty()){
T next = stack.top();
stack.pop();
std::vector<T> nextSteps = operate(next);
for (T a : nextSteps){
stack.push(a);
}
}
}
template<typename T>
void queueOperate(std::vector<T> init, const std::function<std::vector<T>(T)> operate){
std::queue<T> que;
for (auto x : init){
que.push(x);
}
while (!que.empty()){
T next = que.front();
que.pop();
std::vector<T> nextSteps = operate(next);
for (T a : nextSteps){
que.push(a);
}
}
}
template<typename T>
void priorityQueueOperate(std::vector<T> init, const std::function<std::vector<T>(T)> operate){
std::priority_queue<T> que;
for (auto x : init){
que.push(x);
}
while (!que.empty()){
T next = que.top();
que.pop();
std::vector<T> nextSteps = operate(next);
for (T a : nextSteps){
que.push(a);
}
}
}
template<typename T>
void recursiveVectorSplit(LL start, LL end, LL distl, LL distr, const std::function<T(LL)> &maxHeuristic, const std::function<void(LL)> &found){
if (start == end){
return found(start);
}else if (end < start){
return;
}
std::tuple<LL,LL> range = {start,end};
std::function<std::vector<std::tuple<LL,LL>>(std::tuple<LL,LL>)> splitter = [distl, distr,&maxHeuristic,&found](std::tuple<LL,LL> range){
auto [start,end] = range;
LL idx = findMax(start, end, maxHeuristic);
found(idx);
std::vector<std::tuple<LL,LL>> next;
if (idx+distl+1 <= end){
next.push_back({idx+distl+1,end});
}
if (start <= idx-distr-1){
next.push_back({start, idx-distr-1});
}
return next;
};
stackOperate({range},splitter);
}
template<typename T>
std::vector<T> dynamicallyComputableList(LL n, std::function<T(std::vector<T>&,LL)> next){
std::vector<T> arr(n);
for (LL i = 0; i < n; i++){
arr[i] = next(arr,i);
}
return arr;
}
template<typename T>
LL indexOfBinarySearch(const std::vector<T> &arr, const T &find){
return binarySearch((LL)0,(LL)arr.size()-1,(std::function<bool(LL)>)[&arr, &find](LL guess){return find <= arr[guess];});
}
template<typename T>
std::unordered_map<T, LL> indexCompress(const std::vector<T> &arr){
std::unordered_map<T, LL> compressed;
LL i = 0;
for (T x : arr){
if (compressed.find(x) != compressed.end()) compressed[x] = i++;
}
return compressed;
}
template<typename... Ts>
std::tuple<std::vector<std::tuple<LL,Ts...>>, std::vector<LL>> edgeIndexing(int n, std::vector<std::tuple<LL,Ts...>> edges){
sorted(edges);
std::vector<LL> edgeIndex(n+1);
{
LL j = 0;
for (LL i = 0; i < (LL)edges.size(); i++) {
auto a = std::get<0>(edges[i]);
while (j <= a){
edgeIndex[j++] = i;
}
}
while (j < n){
edgeIndex[j++] = edges.size();
}
edgeIndex[n] = edges.size();
}
return {edges,edgeIndex};
}
template<typename T>
std::tuple<std::vector<T>, std::vector<LL>> shortestPathDirected(const LL n, std::vector<std::tuple<LL, LL, T>> edgesInit, LL start){
//assumes all paths are between 0 <= c < n
//assumes 0 indexing
std::vector<LL> path(n);
std::vector<bool> edgeUpdated(n);
std::vector<T> distance(n);
for (LL i = 0; i < n; i++) path[i] = i;
for (LL i = 0; i < n; i++) edgeUpdated[i] = true;
edgeUpdated[start] = false;
for (LL i = 0; i < n; i++) distance[i] = std::numeric_limits<T>::max()/4;
distance[start] = 0;
auto [edges,edgeIndex] = edgeIndexing(n,edgesInit);
std::function<std::vector<std::tuple<LL,LL>>(std::tuple<LL,LL>)> func = [&distance,&edgeIndex,&edges,&path,&edgeUpdated](std::tuple<LL,LL> propagateW){
auto& [weight,propagate] = propagateW;
std::vector<std::tuple<LL,LL>> next;
if (distance[propagate] != -weight) return next;
if (edgeUpdated[propagate]) return next;
for (LL i = edgeIndex[propagate]; i < edgeIndex[propagate+1]; i++){
auto& [a, b, w] = edges[i];
if (distance[a]+w < distance[b]){
//if (std::min(distance[a],w) > distance[b]){
next.push_back({-(distance[a]+w),b});
//next.push_back({std::min(distance[a],w),b});
distance[b] = std::min(distance[a],w);
path[b] = a;
edgeUpdated[b] = false;
}
}
edgeUpdated[propagate] = true;
return next;
};
priorityQueueOperate((std::vector<std::tuple<LL,LL>>){{0,start}},func);
//for (LL i = 0; i < n; i++) {
// bool changed = false;
// for (auto& e : edges) {
// auto& [a, b, w] = e;
// if (!changed) {changed = (distance[b] != std::min(distance[b], distance[a]+w));}
// if (distance[a]+w < distance[b]){
// distance[b] = distance[a]+w;
// path[b] = a;
// }
// }
// if (!changed) break;
// if (changed && i == n){
// return std::tuple((std::vector<T>){},(std::vector<LL>){});
// }
//}
return std::tuple(distance,path);
}
std::vector<LL> pathFromPathMap(std::vector<LL> &map, LL goal){
std::stack<LL> fullPath;
fullPath.push(goal);
while (map[fullPath.top()] != fullPath.top()){
fullPath.push(map[fullPath.top()]);
}
std::vector<LL> p;
while (!fullPath.empty()){
p.push_back(fullPath.top());
fullPath.pop();
}
return p;
}
template<typename T>
std::tuple<std::vector<T>, std::vector<LL>> shortestPath(const LL n, std::vector<std::tuple<LL, LL, T>> &edgesMessy, LL start){
std::vector<std::tuple<LL, LL, T>> edges;
for (auto e : edgesMessy){
auto [a,b,t] = e;
edges.push_back({a,b,t});
edges.push_back({b,a,t});
}
return shortestPathDirected(n, edges, start);
}
template<typename T>
std::vector<T> range(const std::vector<T> &a, LL from, LL to){
std::vector<T> b;
for (LL i = from; i < to; i++){
b.push_back(a[i]);
}
return b;
}
template<typename T>
bool forall(const std::vector<T> &a, std::function<bool(T)> &test){
bool res = true;
for (auto v : a){
res = res & test(v);
}
return res;
}
LL gcd(LL a, LL b){
if (b == 0) return a;
return gcd(b,a%b);
}
LL moduloPower(LL a, LL b, LL modulo){
std::vector<LL> powers(65);
powers[0] = a;
for (int i = 0; i < 64; i++){
powers[i+1] = (powers[i]*powers[i])%modulo;
}
LL res = 1;
for (int i = 0; i < 64; i++){
if ((b>>i)&1){
res *= powers[i];
res %= modulo;
}
}
return res;
}
// a*x + b*y = 1; return {x,y};
std::tuple<LL,LL> inverse(LL a, LL b){
if (b == 0) return {1,0};
auto [n,m] = inverse(b,a%b);
return {m,n-(a/b)*m};
}
int main() {
auto [n,q] = readLL2();
auto arr = readVecTup2(q);
for (auto [a,b] : arr){
println(n/gcd(n,a));
}
//if (gcd(a,m) != 1) {
// println(-1);
// exit(0);
//}
//// a*x = 1 mod (M)
//auto [res,b] = inverse(a,m);
//res %= m;
//res += m;
//res %= m;
//println(res);
//println(((a*res)%m));
//if (gcd(a,m) == 1) for (int i = m-1; i > 0; i--) {
// if (moduloPower(a,i,m) == 1){
// println(moduloPower(a,i-1,m));
// break;
// }
//}
return 0;
}Test details
Test 1
Verdict: ACCEPTED
| input |
|---|
| 1 2 1 1 1 1 |
| correct output |
|---|
| 1 1 |
| user output |
|---|
| 1 1 |
Test 2
Verdict: ACCEPTED
| input |
|---|
| 2 4 1 2 2 2 1 1 1 2 |
| correct output |
|---|
| 2 1 2 2 |
| user output |
|---|
| 2 1 2 2 |
Test 3
Verdict: ACCEPTED
| input |
|---|
| 3 6 2 1 1 3 2 3 2 2 ... |
| correct output |
|---|
| 3 3 3 3 3 ... |
| user output |
|---|
| 3 3 3 3 3 ... |
Test 4
Verdict: ACCEPTED
| input |
|---|
| 4 8 3 1 3 4 2 1 3 3 ... |
| correct output |
|---|
| 4 4 2 4 1 ... |
| user output |
|---|
| 4 4 2 4 1 ... |
Test 5
Verdict: ACCEPTED
| input |
|---|
| 5 10 5 5 3 1 5 5 4 4 ... |
| correct output |
|---|
| 1 5 1 5 5 ... |
| user output |
|---|
| 1 5 1 5 5 ... |
Test 6
Verdict: ACCEPTED
| input |
|---|
| 6 12 2 1 6 5 2 3 6 6 ... |
| correct output |
|---|
| 3 1 3 1 2 ... |
| user output |
|---|
| 3 1 3 1 2 ... |
Test 7
Verdict: ACCEPTED
| input |
|---|
| 7 14 7 7 3 2 6 1 1 3 ... |
| correct output |
|---|
| 1 7 7 7 7 ... |
| user output |
|---|
| 1 7 7 7 7 ... |
Test 8
Verdict: ACCEPTED
| input |
|---|
| 8 16 1 2 7 3 4 8 6 4 ... |
| correct output |
|---|
| 8 8 2 4 1 ... |
| user output |
|---|
| 8 8 2 4 1 ... |
Test 9
Verdict: ACCEPTED
| input |
|---|
| 9 18 8 1 9 3 8 4 5 8 ... |
| correct output |
|---|
| 9 1 9 9 3 ... |
| user output |
|---|
| 9 1 9 9 3 ... |
Test 10
Verdict: ACCEPTED
| input |
|---|
| 10 20 1 4 6 5 5 1 2 4 ... |
| correct output |
|---|
| 10 5 2 5 5 ... |
| user output |
|---|
| 10 5 2 5 5 ... |
Test 11
Verdict: ACCEPTED
| input |
|---|
| 1 2 1 1 1 1 |
| correct output |
|---|
| 1 1 |
| user output |
|---|
| 1 1 |
Test 12
Verdict: ACCEPTED
| input |
|---|
| 2 4 1 1 1 2 1 1 2 2 |
| correct output |
|---|
| 2 2 2 1 |
| user output |
|---|
| 2 2 2 1 |
Test 13
Verdict: ACCEPTED
| input |
|---|
| 3 6 1 2 3 3 1 1 2 3 ... |
| correct output |
|---|
| 3 1 3 3 3 ... |
| user output |
|---|
| 3 1 3 3 3 ... |
Test 14
Verdict: ACCEPTED
| input |
|---|
| 4 8 4 3 1 4 4 4 4 1 ... |
| correct output |
|---|
| 1 4 1 1 1 ... |
| user output |
|---|
| 1 4 1 1 1 ... |
Test 15
Verdict: ACCEPTED
| input |
|---|
| 5 10 3 5 4 4 5 2 1 1 ... |
| correct output |
|---|
| 5 5 1 5 5 ... |
| user output |
|---|
| 5 5 1 5 5 ... |
Test 16
Verdict: ACCEPTED
| input |
|---|
| 6 12 6 5 2 4 1 1 3 5 ... |
| correct output |
|---|
| 1 3 6 2 3 ... |
| user output |
|---|
| 1 3 6 2 3 ... |
Test 17
Verdict: ACCEPTED
| input |
|---|
| 7 14 2 3 4 1 4 3 1 1 ... |
| correct output |
|---|
| 7 7 7 7 7 ... |
| user output |
|---|
| 7 7 7 7 7 ... |
Test 18
Verdict: ACCEPTED
| input |
|---|
| 8 16 3 2 5 7 2 8 1 7 ... |
| correct output |
|---|
| 8 8 4 8 8 ... |
| user output |
|---|
| 8 8 4 8 8 ... |
Test 19
Verdict: ACCEPTED
| input |
|---|
| 9 18 6 1 5 4 8 3 2 9 ... |
| correct output |
|---|
| 3 9 9 9 9 ... |
| user output |
|---|
| 3 9 9 9 9 ... |
Test 20
Verdict: ACCEPTED
| input |
|---|
| 10 20 1 5 8 5 3 8 2 3 ... |
| correct output |
|---|
| 10 5 10 5 5 ... |
| user output |
|---|
| 10 5 10 5 5 ... |
Test 21
Verdict: ACCEPTED
| input |
|---|
| 100000 1000 54883 59286 71521 84428 60278 85796 54490 84727 ... |
| correct output |
|---|
| 100000 100000 50000 10000 100000 ... |
| user output |
|---|
| 100000 100000 50000 10000 100000 ... |
Test 22
Verdict: ACCEPTED
| input |
|---|
| 2000000 1000 834232 1994819 1440974 1865535 229 256307 604802 1998532 ... |
| correct output |
|---|
| 250000 1000000 2000000 1000000 1000000 ... |
| user output |
|---|
| 250000 1000000 2000000 1000000 1000000 ... |
Test 23
Verdict: ACCEPTED
| input |
|---|
| 30000000 1000 13094992 5558892 778688 27978585 16508968 28464840 13074794 14559312 ... |
| correct output |
|---|
| 1875000 468750 3750000 15000000 30000000 ... |
| user output |
|---|
| 1875000 468750 3750000 15000000 30000000 ... |
Test 24
Verdict: ACCEPTED
| input |
|---|
| 400000000 1000 236565899 30376105 304147174 360755367 124942637 52110229 219398785 244517353 ... |
| correct output |
|---|
| 400000000 200000000 400000000 80000000 400000000 ... |
| user output |
|---|
| 400000000 200000000 400000000 80000000 400000000 ... |
Test 25
Verdict: ACCEPTED
| input |
|---|
| 500000000 1000 483517462 293793079 92715097 459357998 383763915 326973498 374590311 320810546 ... |
| correct output |
|---|
| 250000000 500000000 100000000 500000000 62500000 ... |
| user output |
|---|
| 250000000 500000000 100000000 500000000 62500000 ... |
Test 26
Verdict: ACCEPTED
| input |
|---|
| 600000000 1000 136207631 33856688 534252396 510075127 126836001 223176868 563629114 299672870 ... |
| correct output |
|---|
| 600000000 50000000 200000000 300000000 600000000 ... |
| user output |
|---|
| 600000000 50000000 200000000 300000000 600000000 ... |
Test 27
Verdict: ACCEPTED
| input |
|---|
| 700000000 1000 639134189 678229794 237640401 149898916 587858706 45995240 29847608 264934632 ... |
| correct output |
|---|
| 700000000 700000000 350000000 12500000 100000000 ... |
| user output |
|---|
| 700000000 700000000 350000000 12500000 100000000 ... |
Test 28
Verdict: ACCEPTED
| input |
|---|
| 800000000 1000 65548324 195282779 669945145 273995058 376590657 621451858 391344456 264580953 ... |
| correct output |
|---|
| 200000000 160000000 800000000 100000000 50000000 ... |
| user output |
|---|
| 200000000 160000000 800000000 100000000 50000000 ... |
Test 29
Verdict: ACCEPTED
| input |
|---|
| 900000000 1000 11934038 257096283 405355767 570001955 876668629 249890139 453495728 12239373 ... |
| correct output |
|---|
| 450000000 300000000 900000000 56250000 225000000 ... |
| user output |
|---|
| 450000000 300000000 900000000 56250000 225000000 ... |
Test 30
Verdict: ACCEPTED
| input |
|---|
| 1000000000 1000 11139168 391337048 538883744 535937150 532332526 8099343 143698367 339543270 ... |
| correct output |
|---|
| 31250000 31250000 500000000 1000000000 31250000 ... |
| user output |
|---|
| 31250000 31250000 500000000 1000000000 31250000 ... |
Test 31
Verdict: ACCEPTED
| input |
|---|
| 636562060 1000 511952489 604348961 431474828 614141397 390042572 606486418 303263917 446364281 ... |
| correct output |
|---|
| 636562060 159140515 159140515 20534260 636562060 ... |
| user output |
|---|
| 636562060 159140515 159140515 20534260 636562060 ... |
Test 32
Verdict: ACCEPTED
| input |
|---|
| 773442532 1000 98253 110058063 259701699 126062352 202798887 79318250 340660250 159996304 ... |
| correct output |
|---|
| 773442532 773442532 773442532 386721266 773442532 ... |
| user output |
|---|
| 773442532 773442532 773442532 386721266 773442532 ... |
Test 33
Verdict: ACCEPTED
| input |
|---|
| 198730372 1000 5302491 190520836 112418208 193832000 89033117 99141977 85974570 65556834 ... |
| correct output |
|---|
| 198730372 49682593 198730372 99365186 99365186 ... |
| user output |
|---|
| 198730372 49682593 198730372 99365186 99365186 ... |
Test 34
Verdict: ACCEPTED
| input |
|---|
| 75940263 1000 54311996 64420602 22311186 9305398 39178355 43663813 68485322 33520835 ... |
| correct output |
|---|
| 397593 25313421 75940263 75940263 75940263 ... |
| user output |
|---|
| 397593 25313421 75940263 75940263 75940263 ... |
Test 35
Verdict: ACCEPTED
| input |
|---|
| 967034924 1000 587586158 185430194 918715995 767527830 653946995 749180621 641621091 232024335 ... |
| correct output |
|---|
| 483517462 967034924 967034924 967034924 241758731 ... |
| user output |
|---|
| 483517462 967034924 967034924 967034924 241758731 ... |
Test 36
Verdict: ACCEPTED
| input |
|---|
| 59249204 1000 51941206 49590638 12331278 21697751 54797275 58426170 29134863 5358034 ... |
| correct output |
|---|
| 29624602 29624602 59249204 59249204 59249204 ... |
| user output |
|---|
| 29624602 29624602 59249204 59249204 59249204 ... |
Test 37
Verdict: ACCEPTED
| input |
|---|
| 356460601 1000 74949458 293929353 22997620 14923804 132467316 38531826 352555547 212977432 ... |
| correct output |
|---|
| 356460601 356460601 356460601 356460601 356460601 ... |
| user output |
|---|
| 356460601 356460601 356460601 356460601 356460601 ... |
Test 38
Verdict: ACCEPTED
| input |
|---|
| 244103474 100000 197042690 80586782 110761958 182779959 115101311 77817928 136048363 66665685 ... |
| correct output |
|---|
| 122051737 122051737 244103474 244103474 122051737 ... |
| user output |
|---|
| 122051737 122051737 244103474 244103474 122051737 ... |
Test 39
Verdict: ACCEPTED
| input |
|---|
| 11934038 1000 11587328 2864583 10398781 4516499 6350997 9767896 2784292 5052878 ... |
| correct output |
|---|
| 5967019 11934038 11934038 5967019 5967019 ... |
| user output |
|---|
| 5967019 11934038 11934038 5967019 5967019 ... |
Test 40
Verdict: ACCEPTED
| input |
|---|
| 391337048 100000 215553498 214374860 212933011 3239737 57479347 135817308 61036250 5721761 ... |
| correct output |
|---|
| 195668524 391337048 391337048 195668524 97834262 ... |
| user output |
|---|
| 195668524 391337048 391337048 195668524 97834262 ... |
Test 41
Verdict: ACCEPTED
| input |
|---|
| 320792352 1000 6856072 163403660 209346034 146364209 247391400 274848623 164697794 192719062 ... |
| correct output |
|---|
| 40099044 160396176 703492 160396176 106930784 ... |
| user output |
|---|
| 40099044 160396176 703492 160396176 106930784 ... |
Test 42
Verdict: ACCEPTED
| input |
|---|
| 73343920 1000 1442165 49223311 34301870 14374488 53682199 68592328 31116565 7788343 ... |
| correct output |
|---|
| 14668784 7334392 73343920 14668784 73343920 ... |
| user output |
|---|
| 14668784 7334392 73343920 14668784 73343920 ... |
Test 43
Verdict: ACCEPTED
| input |
|---|
| 479126951 1000 397311153 468896160 141366175 46404049 286549153 388480761 7824874 188161591 ... |
| correct output |
|---|
| 479126951 479126951 479126951 479126951 479126951 ... |
| user output |
|---|
| 479126951 479126951 479126951 479126951 479126951 ... |
Test 44
Verdict: ACCEPTED
| input |
|---|
| 652127789 1000 170038626 615206830 590041554 639221905 128243055 543015584 324591612 538060272 ... |
| correct output |
|---|
| 652127789 652127789 652127789 652127789 652127789 ... |
| user output |
|---|
| 652127789 652127789 652127789 652127789 652127789 ... |
Test 45
Verdict: ACCEPTED
| input |
|---|
| 989875543 1000 830179652 707687014 934614610 393292735 8640346 159993019 332576424 216128931 ... |
| correct output |
|---|
| 989875543 989875543 989875543 989875543 989875543 ... |
| user output |
|---|
| 989875543 989875543 989875543 989875543 989875543 ... |
Test 46
Verdict: ACCEPTED
| input |
|---|
| 873575358 1000 192088036 634962594 58372062 119170657 388198952 295709490 569083414 26793118 ... |
| correct output |
|---|
| 436787679 145595893 436787679 10157853 145595893 ... |
| user output |
|---|
| 436787679 145595893 436787679 10157853 145595893 ... |
Test 47
Verdict: ACCEPTED
| input |
|---|
| 350744380 1000 187247456 19931185 197103729 110458251 16321574 49819680 129109880 252137537 ... |
| correct output |
|---|
| 87686095 350744380 175372190 17537219 17537219 ... |
| user output |
|---|
| 87686095 350744380 175372190 17537219 17537219 ... |
Test 48
Verdict: ACCEPTED
| input |
|---|
| 195182397 1000 103584216 164816216 37389796 173529335 13255901 157512328 153639856 80086158 ... |
| correct output |
|---|
| 65060799 195182397 195182397 195182397 65060799 ... |
| user output |
|---|
| 65060799 195182397 195182397 195182397 65060799 ... |
Test 49
Verdict: ACCEPTED
| input |
|---|
| 81615941 1000 41748187 35732930 72568551 20198635 15019189 75027737 70390638 16847208 ... |
| correct output |
|---|
| 81615941 7419631 81615941 81615941 81615941 ... |
| user output |
|---|
| 81615941 7419631 81615941 81615941 81615941 ... |
Test 50
Verdict: ACCEPTED
| input |
|---|
| 462211740 100000 363282517 196968602 117843390 341358936 65919011 123064016 158172463 322424470 ... |
| correct output |
|---|
| 462211740 5135686 462211740 462211740 231105870 ... |
| user output |
|---|
| 462211740 5135686 462211740 462211740 231105870 ... |
Test 51
Verdict: ACCEPTED
| input |
|---|
| 952851063 1000 875998819 667318630 38536147 687576518 742769042 406605561 722483998 556746891 ... |
| correct output |
|---|
| 952851063 952851063 952851063 952851063 952851063 ... |
| user output |
|---|
| 952851063 952851063 952851063 952851063 952851063 ... |
Test 52
Verdict: ACCEPTED
| input |
|---|
| 858211636 100000 248343308 583979982 619305380 31050621 18568217 817417300 176886310 599296532 ... |
| correct output |
|---|
| 214552909 214552909 858211636 429105818 858211636 ... |
| user output |
|---|
| 214552909 214552909 858211636 429105818 858211636 ... |
Test 53
Verdict: ACCEPTED
| input |
|---|
| 753727010 1000 413760880 627500429 361239419 547590421 738031717 670044259 147026654 727317481 ... |
| correct output |
|---|
| 75372701 753727010 753727010 376863505 753727010 ... |
| user output |
|---|
| 75372701 753727010 753727010 376863505 753727010 ... |
Test 54
Verdict: ACCEPTED
| input |
|---|
| 718437562 1000 158903900 657524927 671457583 242576186 492983549 189876521 379600966 589460284 ... |
| correct output |
|---|
| 359218781 718437562 718437562 359218781 359218781 ... |
| user output |
|---|
| 359218781 718437562 718437562 359218781 359218781 ... |
Test 55
Verdict: ACCEPTED
| input |
|---|
| 316145889 1000 231106260 17462220 104892428 72706295 119286558 168170985 244430219 260070478 ... |
| correct output |
|---|
| 105381963 316145889 35127321 316145889 105381963 ... |
| user output |
|---|
| 105381963 316145889 35127321 316145889 105381963 ... |
Test 56
Verdict: ACCEPTED
| input |
|---|
| 747395152 1000 500172076 372158084 239520832 84889368 159696538 155327109 353132323 129379927 ... |
| correct output |
|---|
| 186848788 46712197 373697576 747395152 46712197 ... |
| user output |
|---|
| 186848788 46712197 373697576 747395152 46712197 ... |
Test 57
Verdict: ACCEPTED
| input |
|---|
| 765697360 1000 446153883 253331338 659962663 480469218 677935454 85332598 747807123 93200007 ... |
| correct output |
|---|
| 765697360 765697360 382848680 765697360 382848680 ... |
| user output |
|---|
| 765697360 765697360 382848680 765697360 382848680 ... |
Test 58
Verdict: ACCEPTED
| input |
|---|
| 516256687 1000 437326314 491194180 394813416 251232863 466005669 206474116 205825988 157757970 ... |
| correct output |
|---|
| 516256687 516256687 516256687 516256687 516256687 ... |
| user output |
|---|
| 516256687 516256687 516256687 516256687 516256687 ... |
Test 59
Verdict: ACCEPTED
| input |
|---|
| 183419903 1000 104804598 53787839 23336070 30671162 74245488 74147577 145899705 58594803 ... |
| correct output |
|---|
| 183419903 183419903 183419903 183419903 183419903 ... |
| user output |
|---|
| 183419903 183419903 183419903 183419903 183419903 ... |
Test 60
Verdict: ACCEPTED
| input |
|---|
| 859561821 1000 305915452 372050560 78658441 819519705 526436955 486103389 357871847 582286838 ... |
| correct output |
|---|
| 859561821 859561821 31835623 859561821 859561821 ... |
| user output |
|---|
| 859561821 859561821 31835623 859561821 859561821 ... |
