Gym - 102569J The Battle of Mages

Two mages play the game. Both of them has their own set of creatures. Each creature is characterized by the integer — its strength. At the beginning of the game each mage summons kk distinct random creatures from their set of creatures, and each subset of kk creatures can be summoned equally likely. The mage who has the greater sum of strengths of their creatures wins. If the sums of strength are equal, the process repeats. If every subset of creatures of both mages always has the same strength, the draw is declared.

It has turned out, that if k=1k=1 or k=3k=3 , the first mage has strictly greater chances to win, and if k=2k=2 , the second mage has. You have to give an example of sets of creatures of the first and the second mages.

Input

This problem has only one test, and it is empty.

Output

In the first line output one integer n1n1 (3n1103≤n1≤10 ) — the number of creatures in the first mage's set.

In the second line output n1n1 integers s1is1i (1s1i101≤s1i≤10 ) — the strengths of creatures of the first mage.

In the third line output one integer n2n2 (3n2103≤n2≤10 ) — the number of creatures in the second mage's set.

In the fourth line output n2n2 integers s2is2i (1s2i101≤s2i≤10 ) — the strengths of creatures of the second mage.

If there are several possible answers, output any of them. It is guaranteed that the solution in the given constraints exists.

Example

Input

Output
3
1 2 3
3
2 2 2

Note

The output example is not an answer for the problem and is given only for better understanding of output format and to clarify the problem statement.

The first mage has three creatures, their strengths are 1, 2 and 3. The second mage has three creatures, all their strengths are equal to 2.

If k=1k=1 , the second mage always has fixed strength 2. If the first mage summons the creature with the strength 2, the process repeats. If he summons the creature with the strength 3, he wins, and with the strength 1 — loses. The probability of the first mage to win is 0.5, but the problem requires the first mage to have strictly better chances.

If k=2k=2 , the second mage always has strength 4. The first mage can summon the following subsets of creatures: (1, 2), (1, 3), (2, 3). If it is (1, 2), the first mage loses (as 3 < 4), if it is (1, 3) — the game starts again (as 4 = 4), and if it's (2, 3) — he wins. The resulting probability is again 0.5, but the second mage should have better chances in this case.

If k=3k=3 , the subsets of the first and second mages are always (1, 2, 3) and (2, 2, 2). They have equal strengths, and we got infinite game restarts. According to the rules, the draw is declared in this case, so the probability of the first mage winning is not greater again.

————————————————————————————————————————————————————————————

一道好神奇的题目,没有输入,随便输出符合题目要求的组合就ok了。简单来说就是,一比一的时候,第一组胜利的概率大,二比二的时候,第二组胜利概率大,三比三又是第一组赢。

做题的时候很傻逼地加错数了……

 

#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <stack>
#include <queue>
#include <map>
#include <vector>
#include <set>
#include <deque>
#include <cfloat>
#include <algorithm>
typedef long long ll;
using namespace std;

int gcd(int x,int y)
{
    return y?gcd(y,x%y):x;
}

int lcm(int x,int y)
{
    return x/gcd(x,y)*y;
}


int main()
{
    printf("3\n");
    printf("1 7 8\n");
    printf("3\n");
    printf("5 5 5\n");
    return 0;
}
View Code

 

posted @ 2020-07-15 23:46  璃灵  阅读(519)  评论(0)    收藏  举报