编程介的小学生 2016-12-22 17:13 采纳率: 20.5%
浏览 788
已采纳

TN's Kingdom III - Assassination

Description

TN had never given up the thought that rebellion was always a possibility since that was how he came to de throne. He was worried about that Dzx might someday pay him back in his own coin. Therefore he elaborated a plot of sending killers to assassinate Dzx. In order to keep everything secret and guard against his enemies' spying, TN used a special scheme to encrypt the order of assassination before having it sent to the killers. The encryption scheme was as follows:
Encode the plot as a real sequence α of length n where n perfectly factors over the first eight prime numbers;
Choose another real sequence β of the same length;
Calculate a real sequence γ as the result of encryption according to the steps below:
Let γ be an empty sequence;
Write β in reversed order;
Rotate β to the right by one place;
Append the sum of element-wise products of α and β to the end of γ;
Repeat the steps iii. and iv. until γ has length n.
Though his most intimate advisor had warned that this scheme was unsafe and might cause the plot to be leaked, but TN obstinately stuck to it.
However, in the killers' eyes, the scheme was simply too safe rather than unsafe that they failed to decrypt the plot. They looked for help with little care about secrecy. Dzx was just lucky to come across them. He got and decrypted the plot and eventually survived the assassination. Nevertheless, the result was satisfactory to TN for Dzx had never been heard of since then.

From some rare records found in written history only the fact that what Dzx got was the sequences β and γ along with the encryption scheme was known. The sequences and the scheme were once lost. But through archaeologists' great effort they are rediscovered. From them the sequence α can be calculated, which will enable the historians to know more about TN.

Input

The input consists of a single test case. On the first line of input there is a positive integer n not greater than 217 that perfectly factors over the first eight prime numbers. It is the length of the sequences. Then follow 2n lines each containing a real number. The first n lines give the sequence β and the next n lines the sequence γ.
Output

Your solution should output n lines. These n lines should give the sequence α in the same format as sequences β and γ are given. All real numbers should be rounded to four decimal places.
Sample Input

4
1
2
3
4
26
28
26
20
Sample Output

1.0000
2.0000
3.0000
4.0000

  • 写回答

1条回答 默认 最新

  • threenewbee 2016-12-26 16:06
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮