1738:连乘问题

文件提交:无需freopen 内存限制:128 MB 时间限制:1.000 S
评测方式:普通裁判 命题人:
提交:5 解决:2

题目描述

给定 lns="http://www.w3.org/1998/Math/MathML">� 个整数 lns="http://www.w3.org/1998/Math/MathML">�1,�2,⋯ ,��,请计算一组乘积,记为 lns="http://www.w3.org/1998/Math/MathML">�1,�2,⋯ ,��,其中 lns="http://www.w3.org/1998/Math/MathML">�� 的定义如下:

也就是说,lns="http://www.w3.org/1998/Math/MathML">�� 是 lns="http://www.w3.org/1998/Math/MathML">�1 到 lns="http://www.w3.org/1998/Math/MathML">�� 的连乘再除去 lns="http://www.w3.org/1998/Math/MathML">��。由于答案可能比较大,输出每个 lns="http://www.w3.org/1998/Math/MathML">�� 模 lns="http://www.w3.org/1998/Math/MathML">10000 的余数。

输入


  • 第一行:单个整数表示 lns="http://www.w3.org/1998/Math/MathML">�;
  • 第二行:lns="http://www.w3.org/1998/Math/MathML">� 个整数表示 lns="http://www.w3.org/1998/Math/MathML">�1,�2,⋯ ,��。
  • 对于 lns="http://www.w3.org/1998/Math/MathML">30% 的数据,lns="http://www.w3.org/1998/Math/MathML">2≤�≤1000;
  • 对于 lns="http://www.w3.org/1998/Math/MathML">60% 的数据,lns="http://www.w3.org/1998/Math/MathML">2≤�≤10000;
  • 对于 lns="http://www.w3.org/1998/Math/MathML">100% 的数据,lns="http://www.w3.org/1998/Math/MathML">2≤�≤100000,lns="http://www.w3.org/1998/Math/MathML">1≤��≤10000。



输出

共 lns="http://www.w3.org/1998/Math/MathML">� 行:第 lns="http://www.w3.org/1998/Math/MathML">� 行输出 lns="http://www.w3.org/1998/Math/MathML">�� 模 lns="http://www.w3.org/1998/Math/MathML">10000 的余数。

样例输入-1 复制

4
1 3 4 6

样例输出-1 复制

72
24
18
12