1367. Cipher

单点时限: 5.0 sec

内存限制: 256 MB

We are given a sequence of positive integers ai (for i=1,2,…,n). This sequence is used to encrypt n-bit messages. If we have a message consisting of consecutive bits (t1,…,tn) (ti is either 0 or 1), then its encryption it the number:

S=t1a1+t2a2+…+tn*an

Task

You are given encrypted messages and sequences of numbers (ai), that have been used to encrypt the messages. Your task is to decrypt the encrypted messages and to save them in particular files. You are not expected to present any program. It is sufficient that you write the decrypted messages.

输入格式

You are given several sets of data at your disposal. where k is the number of the set. In the first line of each file there is one integer n, 5<=n<=40. In the successive n lines there is a sequence of numbers (ai) written: in the line of number i+1 there is one positive integer ai. The sum of the numbers ai does not exceed 2 000 000 000. In the line of number n+2 there is one integer S - the encrypted message, 0<=S<=a1+a2+…+an.

输出格式

For each set of data you out should containing the decrypted message. In the first line of this file you should write the successive numbers ti, without any spaces between them. The test data were chosen so that the encrypted messages are unambiguously determined.

样例

Input
24
19226985
123697
67356296
19721773
1113273
69335448
23680077
9029881
85168664
93676782
5253843
77616588
78572630
13375812
17199980
101508862
59248276
3505733
35790095
62028546
85726819
56462819
103373994
91757169
667509506
Output
110001000101101100010101

2 人解决,3 人已尝试。

5 份提交通过,共有 31 份提交。

8.9 EMB 奖励。

创建: 17 年,3 月前.

修改: 7 年,2 月前.

最后提交: 3 年,12 月前.

来源: POI

题目标签