Question: Rubrik OA | IIIT Delhi | FTE | 2023 | Old Rubrik had a farm | Spoiler Alert
3
Entering edit mode

Old Rubrik had a farm


Rubrik needs your help! Rubrik has n servers in their server farm. Rubrik knows that the i-th server will be operational from momentof time 4 until moment i, inclusive.
Rubrik wants to decommission one of the servers in order to free up resources. Let's call a server redundant if, after decommissioning it, the number of integer
moments of time when at least one server is operational won't decrease. Rubrik's service will go down if they remove a non redundant server.
Help Rubrik by telling them the indexes of redundant servers. If there is none, print -1

 

Input Format


The first line contains one integer number n(1 ≤ n ≤ 2 * 105) _ the number of servers. Then 1 lines follow, each of them containing two integer numbers
liri(0 ≤ l≤ ri ≤ 109) denoting the working time of i-th server.

 

Output Format


If there are no redundant servers, print - 1,Else, In first line print the number ofpossible redundant servers.In each proceeding line print an index of apossible redundant server inascending order of indexes (servers are indexed from 1 to n).

 

Constraints


For Testcases worth 30% of score
1≤ n ≤ 2.10^3
0545r ≤10°


For Testcases worth 100% of score

1 ≤ n  ≤ 2.105

0 ≤ l≤ri ≤ 109  

Sample Testcase


Testcase 1

Input
1 4

5 6

18

Output

2

1

2

 

Explanation


Either one of the two servers can be removed as their intervals completely overlap each other

 


 Spoiler Alert


To avenge the death of inosuke's mother. Inosuke wants to kill Muzan Jackson and Douma in a blood battle in the Infinity Castle But to enter the room where both reside. Inosuke has to impress Douma's biggest fan
Akshat who is guarding Douma's room. Akshat, being a past Techno member, asks a newer version of the double cone puzzie So you have a chess board mounted on a cone, with n equi-sized longitudinal columns/n
is even) and k equi-sized latitudinal rows. And 2 such cones are joined together symmetrically. Please look at the example and samples for a clearer view of the double cone.
Akshat tells Inosuke that he can color the white regions with any of the c colors provided to him. Please note there are two ways of loining the cones to form the double cone.. Both the orientations are shown below . And the first way of joining is considered for the problem statement

 

The above figure shows the front view of the double cone for n=4  and k = 3

Akshat asks Inosuke to tell the total number of distinct double cone configurations possibio As this number can pe very big he asks to tollthe remainder with 1000000007. Two
configurations are considered same if they can overlap completely after some rotationaltranslation or even flipping the double cone upside down and then rotating.Can you help Inosuke find the answer to this
puzzle?

 

Input Format


First line contains a single integer 1 whic denotes the number of test cases Then the first line of each lest case containsintegers n, k, €, Here n denotes the number longitudinal columns and & denotes the number of latitudinal rows per cone and
denotes the number of colors allowed


Output Format


For each test case print the number of distinct double cone configurations possible mod 1000000007.


Constraints


For all test cases
1  ≤  t  ≤ 1000
1  ≤  k  ≤ 10^9
1  ≤ c  ≤ 10^9
n is even


For test cases worth 20% of total score


n = 2

 

For test cases worth 70% of total score
1 ≤ n ≤ 104
For test cases worth 100% of total score
1 ≤ n ≤ 10

 

ADD COMMENTlink 17 months ago PoGo 2.4k

Login before adding your answer.

Similar Posts
Loading Similar Posts