SP17945 MMMAGIC5 - Mickey Mouse Magic Trick v5

题目描述

在这个问题中,我们的常量值为 $n=124$ 和 $k=5$。你的任务是分别帮助米奇和唐老鸭解决牌的问题。 输入的第一行是两个整数 $M$ 和 $D$,表示米奇需要帮助的测试用例有 $M$ 个,唐老鸭需要帮助的测试用例有 $D$ 个,并且 $M + D < 10^6$。 接下来的 $M$ 行中,每行都有 $k$ 个在 $[1, n]$ 范围内的不同整数,表示给到米奇的牌。这些整数已经按升序排列。 在随后的 $D$ 行中,每行包含 $k-1$ 个在 $[1, n]$ 范围内的不同整数,表示桌面上留给唐老鸭的牌,顺序与实际展示一致,从左到右。

输入格式

All integers in the same line are single-space separated (the same concerns problem output). Values n, k are constant. In this problem n=124 and k=5. There are also problems with different values: [MMMAGIC3](../../problems/MMMAGIC3/), [MMMAGIC4](../../problems/MMMAGIC4/), [MMMAGIC6](../../problems/MMMAGIC6/) The first line of input contains two integers M, D, where M is the number of test cases in which Mickey needs help, D is the number of test cases in which Donald needs help (M+D < 10 $ ^{6} $ ). Every of next M lines contains k distinct integers from range \[1, n\] - the values on cards given to Mickey. The values are sorted in ascending order. Every of next D lines contains k-1 distinct integers from range \[1, n\] - the cards left to Donald on the table. The order is the same, as on the table, from left to right.

输出格式

对于每个米奇的问题,请输出一行,内容包含 $k-1$ 个整数,表示米奇应该留下的那些牌的数值,并从左至右按顺序排列。 对于每个唐老鸭的问题,请输出一行,内容为一个整数,表示隐藏的那张牌的数值。如果你的策略使得某种情况下无法识别这些牌,输出任意一个其余的数值即可。 **本翻译由 AI 自动生成**