410810: GYM104118 L LCG Manipulation

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

L. LCG Manipulationtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputExamplesInput
8
2 3 1 7 5
2 3 1 7 6
2 3 1 7 1
2 3 1 7 0
7 1 2 31 24
7 1 2 31 25
7 1 2 31 26
7 1 1 31 26
Output
1
2
0
IMPOSSIBLE
6
4
IMPOSSIBLE
2
Input
2
314159265 1234567890 2022 2147483647 2023
1234567890 314159265 2022 2147483647 2023
Output
1058977885
IMPOSSIBLE

加入题单

上一题 下一题 算法标签: