COIN - Coin Collecting

题意翻译

作为硬币铸造者协会(ACM)的成员,你对各种硬币都很着迷,你的爱好之一就是从不同的国家收集本国货币。你的朋友,也是一个狂热的钱币收藏家,她的心放在你的一些珍贵的硬币上,并提议玩一个游戏,让赢家获得输家的收藏(或其中的一部分)。 她先准备了两个信封,每个信封里装着两枚来自不同国家的硬币。然后她让你从两个信封中选一个。在做出选择之前,你可以看到他们的内容,也可以拒绝他们的提议,也不接受他们的提议。这个过程重复了r次。随着比赛的进行,如果你认为你能做得更好,你也可以改变你对以前选择的想法。最后,你的朋友在你的最终选择中检查了信封,她自己从中挑选了几个信封。如果她的选择是非空的,包括来自每个国家的偶数枚硬币(可能为零),她会赢,你必须把你的全部硬币收藏交给她,这将使多年的艰苦努力付诸东流,迫使你重新开始。但是如果你赢了,你就可以把硬币从你选的信封里拿出来。 尽管存在风险,但扩大收藏的前景是如此诱人,以至于你决定接受挑战。你最好确保你赢了尽可能多的硬币。 输入 每个测试用例的第一行是轮数r(1r=0表示输入的结束)。接下来的r行包含四个非负整数0 a、b、c、d<10000,这意味着您的朋友将标有a和b的国家的硬币放在其中一个信封中,将c和d放在另一个信封中。空行分隔测试用例。 输出 为每个测试用例打印一行,其中包含保证的最大数量的硬币。

题目描述

As a member of the Association of Coin Minters (ACM), you are fascinated by all kinds of coins and one of your hobbies involves collecting national currency from different countries. Your friend, also an avid coin collector, has her heart set on some of your precious coins and has proposed to play a game that will allow the winner to acquire the loser’s collection (or part thereof). She begins by preparing two envelopes, each of them enclosing two coins that come from different countries. Then she asks you to choose one of the two envelopes. You can see their contents before making your choice, and also decline the offer and take neither. This process is repeated for a total of _r_ times. As the game progresses, you are also allowed to change your mind about your previous picks if you think you can do better. Eventually, your friend examines the envelopes in your final selection, and from among them she picks a few envelopes herself. If her selection is non-empty and includes an even number of coins from every country (possibly zero), she wins and you must hand over your entire coin collection to her, which would make years of painstaking effort go to waste and force you to start afresh. But if you win, you get to keep the coins from all the envelopes you picked. Despite the risks involved, the prospect of enlarging your collection is so appealing that you decide to take the challenge. You’d better make sure you win as many coins as possible. **Input** The first line of each test case is the number _r_ of rounds (1 r r = 0 indicates the end of the input. The next _r_ lines contain four non-negative integers 0 a, _b_, _c_, _d_ < 10,000, meaning that your friend puts coins from countries labelled _a_ and _b_ inside one of the envelopes, and _c_ and _d_ inside the other one. A blank line separates test cases. **Output** Print a line per test case containing the largest number of coins you are guaranteed. **Sample Input** ``` <pre class="verbatim">4 0 1 0 5 5 1 0 5 1 2 0 1 1 5 2 0 6 1 4 1 4 2 4 2 4 0 3 0 3 0 4 0 4 4 3 4 3 1 3 1 3 0 ``` **Sample Output** ``` <pre class="verbatim">6 8 ``` - - - - - - > _Problemsetter: David García Soriano_

输入输出格式

输入格式


输出格式


输入输出样例

暂无测试点