Submission details
Task:Road blockade
Sender:aalto26gm_050
Submission time:2026-10-19 17:30:07 +0300
Language:C++ (C++20)
Status:READY
Result:
Test results
testverdicttime
#1ACCEPTED0.00 sdetails
#2ACCEPTED0.00 sdetails
#3ACCEPTED0.00 sdetails
#4ACCEPTED0.00 sdetails
#5ACCEPTED0.00 sdetails
#6ACCEPTED0.00 sdetails
#7ACCEPTED0.00 sdetails
#8ACCEPTED0.00 sdetails
#9ACCEPTED0.00 sdetails
#10ACCEPTED0.00 sdetails
#11ACCEPTED0.00 sdetails
#12ACCEPTED0.00 sdetails
#13ACCEPTED0.00 sdetails
#14ACCEPTED0.00 sdetails
#15ACCEPTED0.00 sdetails
#16ACCEPTED0.00 sdetails
#17ACCEPTED0.00 sdetails
#18ACCEPTED0.00 sdetails
#19ACCEPTED0.00 sdetails
#20ACCEPTED0.00 sdetails
#21ACCEPTED0.00 sdetails
#22ACCEPTED0.00 sdetails
#23ACCEPTED0.00 sdetails
#24ACCEPTED0.00 sdetails
#25ACCEPTED0.00 sdetails
#26ACCEPTED0.00 sdetails
#27ACCEPTED0.00 sdetails
#28ACCEPTED0.00 sdetails
#29ACCEPTED0.00 sdetails
#30ACCEPTED0.00 sdetails
#31ACCEPTED0.00 sdetails
#32ACCEPTED0.00 sdetails
#33ACCEPTED0.00 sdetails
#34ACCEPTED0.00 sdetails
#35ACCEPTED0.00 sdetails
#36ACCEPTED0.00 sdetails
#37ACCEPTED0.00 sdetails
#38ACCEPTED0.01 sdetails
#39ACCEPTED0.00 sdetails
#40ACCEPTED0.00 sdetails
#41ACCEPTED0.00 sdetails
#42ACCEPTED0.01 sdetails
#43ACCEPTED0.00 sdetails
#44ACCEPTED0.00 sdetails
#45ACCEPTED0.00 sdetails
#46ACCEPTED0.00 sdetails
#47ACCEPTED0.01 sdetails
#48ACCEPTED0.01 sdetails
#49ACCEPTED0.00 sdetails
#50ACCEPTED0.01 sdetails
#51ACCEPTED0.01 sdetails
#52ACCEPTED0.01 sdetails
#53ACCEPTED0.01 sdetails
#54ACCEPTED0.01 sdetails
#55ACCEPTED0.01 sdetails
#56ACCEPTED0.01 sdetails
#57ACCEPTED0.01 sdetails
#58ACCEPTED0.01 sdetails
#59ACCEPTED0.01 sdetails
#60ACCEPTED0.17 sdetails
#61ACCEPTED0.17 sdetails
#62--details
#63--details
#64ACCEPTED0.18 sdetails
#65ACCEPTED0.21 sdetails
#66ACCEPTED0.17 sdetails
#67ACCEPTED0.19 sdetails
#68ACCEPTED0.33 sdetails
#69ACCEPTED0.18 sdetails

Compiler report

input/code.cpp: In function 'int main()':
input/code.cpp:531:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  531 |     for (int i = 1; i < walkedPath.size(); i++){
      |                     ~~^~~~~~~~~~~~~~~~~~~

Code

#include <iostream>
#include <vector>
#include <functional>
#include <set>
#include <algorithm>
#include <stack>
#include <unordered_map>
#include <map>
#include <iomanip>
#include <limits>
#include <queue>

typedef long long LL;

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::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::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<long long> readVecLong(LL n){
    std::vector<long long> arr(n);
    for (LL i = 0; i < n; i++){
        long long 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++){
        LL a, b;
        std::cin >> a;
        std::cin >> b;
        arr[i] = {a,b};
    }
    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++){
        LL 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++){
        LL a, b, c,d;
        std::cin >> a;
        std::cin >> b;
        std::cin >> c;
        std::cin >> d;
        arr[i] = {a,b,c,d};
    }
    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>> &edges, 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;
    sorted(edges);
    std::vector<LL> edgeIndex(n+1);
    {
        LL j = 0;
        for (LL i = 0; i < (LL)edges.size(); i++) {
            auto& [a,b,w] = edges[i];
            while (j <= a){
                edgeIndex[j++] = i;
            }
        }
        while (j < n){
            edgeIndex[j++] = edges.size();
        }
        edgeIndex[n] = edges.size(); 
    }
    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;
}
void prev(){
    
    auto [n,x] = readLL2();
    auto arr = readVecLong(n);
    std::vector<LL> arr2 = arr;
    for (LL i = 0; i< n; i++) arr2[i] = x - arr2[i];
    auto set = toSet(arr2);
    for (LL i = 0; i< n; i++) for (LL j = i + 1; j < n; j++) if (set.contains(arr[i]+arr[j])){
        for (LL k = 0; k< n; k++){
            if (k==i || k==j) continue;
            if (arr[k]+arr[i]+arr[j] == x) {
                std::vector<LL> res = {i+1,j+1,k+1};
                sorted(res);
                println(res);
                exit(0);
            }        
        }
    };
    println("IMPOSSIBLE");
}

int main() {
    auto [n,m] = readLL2();
    auto arr = readVecTup2(m);
    //println(arr,1);
    //exit(1);
    std::vector<std::tuple<LL, LL, double>> paths;
    for (int j = 0; j < m; j++) {
        auto [a,b] = arr[j];
        paths.push_back({a,b,0.0});
    }
    auto [min,path] = shortestPath(n+1,paths,(LL)1);
    auto walkedPath = pathFromPathMap(path,n);
    for (int i = 1; i < walkedPath.size(); i++){
        std::vector<std::tuple<LL, LL, double>> arr2;
        for (auto p : paths){
            auto [a,b,x] = p;
            if (a == walkedPath[i-1] && b == walkedPath[i]){
                continue;
            }
            if (b == walkedPath[i-1] && a == walkedPath[i]){
                continue;
            }
            arr2.push_back(p);
        }
        auto [min2,path2] = shortestPath(n+1,arr2,(LL)1);
        if (min2[n] != 0.0) {
            for (int j = 0; j < m; j++) {
                auto [a,b] = arr[j];
                if (a == walkedPath[i-1] && b == walkedPath[i]){
                    println(j+1);
                }
                if (b == walkedPath[i-1] && a == walkedPath[i]){
                    println(j+1);
                }
            }
            exit(0);
        }
    }
    println(0);
    return 0;
}

Test details

Test 1

Verdict: ACCEPTED

input
2 1
1 2

correct output
1

user output
1

Test 2

Verdict: ACCEPTED

input
3 2
1 2
2 3

correct output
1

user output
1

Test 3

Verdict: ACCEPTED

input
3 2
2 3
1 2

correct output
2

user output
2

Test 4

Verdict: ACCEPTED

input
3 3
1 2
1 3
2 3

correct output
0

user output
0

Test 5

Verdict: ACCEPTED

input
4 6
1 3
1 4
2 4
2 3
...

correct output
0

user output
0

Test 6

Verdict: ACCEPTED

input
4 4
1 3
2 3
3 4
1 2

correct output
3

user output
3

Test 7

Verdict: ACCEPTED

input
4 3
1 3
2 4
2 3

correct output
1

user output
1

Test 8

Verdict: ACCEPTED

input
4 3
2 3
2 4
1 3

correct output
3

user output
3

Test 9

Verdict: ACCEPTED

input
4 4
3 4
2 3
1 3
1 2

correct output
1

user output
1

Test 10

Verdict: ACCEPTED

input
5 7
2 5
3 5
3 4
1 5
...

correct output
0

user output
0

Test 11

Verdict: ACCEPTED

input
5 10
3 4
1 5
1 4
1 2
...

correct output
0

user output
0

Test 12

Verdict: ACCEPTED

input
5 6
1 4
3 4
4 5
2 3
...

correct output
3

user output
3

Test 13

Verdict: ACCEPTED

input
5 5
3 5
1 4
1 5
2 3
...

correct output
0

user output
0

Test 14

Verdict: ACCEPTED

input
5 7
2 4
1 5
3 5
2 5
...

correct output
0

user output
0

Test 15

Verdict: ACCEPTED

input
5 4
1 3
2 3
2 4
4 5

correct output
1

user output
1

Test 16

Verdict: ACCEPTED

input
5 4
2 4
3 5
2 3
1 4

correct output
4

user output
4

Test 17

Verdict: ACCEPTED

input
5 9
4 5
1 2
3 4
1 5
...

correct output
0

user output
0

Test 18

Verdict: ACCEPTED

input
5 10
1 3
2 5
4 5
3 4
...

correct output
0

user output
0

Test 19

Verdict: ACCEPTED

input
5 7
1 3
1 2
4 5
2 4
...

correct output
0

user output
0

Test 20

Verdict: ACCEPTED

input
10 12
2 5
4 9
4 7
3 9
...

correct output
9

user output
9

Test 21

Verdict: ACCEPTED

input
10 43
7 10
1 2
1 3
2 3
...

correct output
0

user output
0

Test 22

Verdict: ACCEPTED

input
10 11
2 5
2 3
6 7
1 2
...

correct output
4

user output
4

Test 23

Verdict: ACCEPTED

input
10 10
4 9
5 9
7 8
6 8
...

correct output
8

user output
8

Test 24

Verdict: ACCEPTED

input
10 12
7 9
3 8
3 5
4 5
...

correct output
0

user output
0

Test 25

Verdict: ACCEPTED

input
10 9
2 4
8 10
6 7
2 3
...

correct output
9

user output
9

Test 26

Verdict: ACCEPTED

input
10 9
3 5
5 7
1 6
4 6
...

correct output
3

user output
3

Test 27

Verdict: ACCEPTED

input
10 37
5 9
3 4
1 4
7 10
...

correct output
0

user output
0

Test 28

Verdict: ACCEPTED

input
10 44
2 6
1 2
1 6
4 7
...

correct output
0

user output
0

Test 29

Verdict: ACCEPTED

input
10 27
1 10
7 10
4 7
2 9
...

correct output
0

user output
0

Test 30

Verdict: ACCEPTED

input
100 107
44 59
24 76
35 79
14 57
...

correct output
107

user output
107

Test 31

Verdict: ACCEPTED

input
100 107
27 79
43 89
83 96
34 75
...

correct output
42

user output
42

Test 32

Verdict: ACCEPTED

input
100 143
13 14
20 59
25 95
38 84
...

correct output
129

user output
129

Test 33

Verdict: ACCEPTED

input
100 155
29 92
3 63
16 18
9 28
...

correct output
36

user output
36

Test 34

Verdict: ACCEPTED

input
100 105
74 85
6 49
7 81
45 55
...

correct output
50

user output
50

Test 35

Verdict: ACCEPTED

input
100 121
8 74
14 50
44 55
12 93
...

correct output
0

user output
0

Test 36

Verdict: ACCEPTED

input
100 102
54 97
45 82
30 78
40 44
...

correct output
35

user output
35

Test 37

Verdict: ACCEPTED

input
100 106
57 85
3 58
14 93
31 61
...

correct output
8

user output
8

Test 38

Verdict: ACCEPTED

input
100 188
3 58
53 63
8 19
97 100
...

correct output
0

user output
0

Test 39

Verdict: ACCEPTED

input
100 100
16 94
48 96
4 37
71 85
...

correct output
41

user output
41

Test 40

Verdict: ACCEPTED

input
200 207
111 188
80 121
115 170
157 175
...

correct output
199

user output
199

Test 41

Verdict: ACCEPTED

input
200 207
99 117
139 143
151 174
136 184
...

correct output
190

user output
190

Test 42

Verdict: ACCEPTED

input
200 287
36 180
125 138
33 147
38 188
...

correct output
77

user output
77

Test 43

Verdict: ACCEPTED

input
200 310
162 195
21 199
95 180
29 127
...

correct output
30

user output
30

Test 44

Verdict: ACCEPTED

input
200 205
140 187
127 185
100 196
55 144
...

correct output
150

user output
150

Test 45

Verdict: ACCEPTED

input
200 243
8 85
73 137
52 72
51 157
...

correct output
53

user output
53

Test 46

Verdict: ACCEPTED

input
200 202
45 72
5 96
1 31
35 187
...

correct output
3

user output
3

Test 47

Verdict: ACCEPTED

input
200 214
81 116
113 164
154 199
17 153
...

correct output
45

user output
45

Test 48

Verdict: ACCEPTED

input
200 375
68 93
93 101
87 109
23 56
...

correct output
0

user output
0

Test 49

Verdict: ACCEPTED

input
200 201
64 124
145 164
103 127
126 186
...

correct output
137

user output
137

Test 50

Verdict: ACCEPTED

input
1000 1007
61 967
252 530
105 953
490 826
...

correct output
914

user output
914

Test 51

Verdict: ACCEPTED

input
1000 1007
489 976
53 720
478 732
104 111
...

correct output
248

user output
248

Test 52

Verdict: ACCEPTED

input
1000 1435
520 551
702 787
76 719
619 993
...

correct output
1114

user output
1114

Test 53

Verdict: ACCEPTED

input
1000 1550
206 315
476 801
287 713
456 677
...

correct output
1059

user output
1059

Test 54

Verdict: ACCEPTED

input
1000 1005
304 771
84 930
17 988
282 364
...

correct output
714

user output
714

Test 55

Verdict: ACCEPTED

input
1000 1221
254 729
301 692
201 239
530 550
...

correct output
406

user output
406

Test 56

Verdict: ACCEPTED

input
1000 1002
147 586
502 522
194 372
176 451
...

correct output
117

user output
117

Test 57

Verdict: ACCEPTED

input
1000 1075
470 600
129 251
654 850
567 661
...

correct output
642

user output
642

Test 58

Verdict: ACCEPTED

input
1000 1874
668 731
316 335
532 731
523 839
...

correct output
0

user output
0

Test 59

Verdict: ACCEPTED

input
1000 1009
674 739
96 435
360 670
130 773
...

correct output
768

user output
768

Test 60

Verdict: ACCEPTED

input
100000 100007
44087 69715
31775 43251
18923 35874
36912 75163
...

correct output
923

user output
923

Test 61

Verdict: ACCEPTED

input
100000 100007
19253 34700
66338 83144
22343 27898
4199 35494
...

correct output
9842

user output
9842

Test 62

Verdict:

input
100000 143600
14018 46297
31183 86763
34508 87502
54400 64922
...

correct output
0

user output
(empty)

Test 63

Verdict:

input
100000 155080
7038 29509
13361 87647
1940 92912
7785 12866
...

correct output
0

user output
(empty)

Test 64

Verdict: ACCEPTED

input
100000 100005
33360 89287
42922 67061
77709 78585
48488 51346
...

correct output
523

user output
523

Test 65

Verdict: ACCEPTED

input
100000 122199
24155 82039
27201 64021
37961 66619
7615 11277
...

correct output
61740

user output
61740

Test 66

Verdict: ACCEPTED

input
100000 100002
13135 96454
53655 77933
52027 71763
40622 57175
...

correct output
60082

user output
60082

Test 67

Verdict: ACCEPTED

input
100000 107630
30498 57903
5372 70239
51740 59293
41709 92770
...

correct output
102920

user output
102920

Test 68

Verdict: ACCEPTED

input
100000 187345
5859 71722
58010 74508
66929 91927
15925 53657
...

correct output
129660

user output
129660

Test 69

Verdict: ACCEPTED

input
100000 101036
13541 29328
50426 75396
46089 77950
42830 56873
...

correct output
80466

user output
80466