B. 三四五

    problem_type.undefined ms MiB

三四五

Cannot parse: cfg.checker.includes is not a function

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

题目描述

33DAI 很喜欢勾股数,这天他拿到了 nn 个正整数,a1ana_1\sim a_n

对于每个正整数,他都希望你找到另外两个正整数,使得三个数构成勾股数。即两个较小的数的平方和等于较大数的平方。

输入格式

一个数 nn

第二行 nn 个正整数,a1ana_1\sim a_n

输出格式

输出 nn 行,第 ii 行为 aia_i 的解决方案。

  • 如果 aia_i 无解,输出 1-1
  • 否则,输出三个整数 xi,yi,zix_i,y_i,z_i,要求 1xiyizi10181\le x_i\le y_i\le z_i\le 10^{18},且 xi2+yi2=zi2x_i^2+y_i^2=z_i^2,且这三个正整数中至少有一个等于 aia_i。如果存在多解,输出任意一个即可。
6
3 6 1 17 67 32
3 4 5
6 8 10
-1
17 144 145
67 2244 2245
24 32 40

数据规模与约定

对于 100%100\% 的数据,1n1001 \le n \le 1001ai1091\le a_i\le 10^9

  • 子任务 1(30 分):保证 1ai1001\le a_i\le 100
  • 子任务 2(30 分):保证有解。
  • 子任务 3(40 分):没有特殊限制。

2026 庆元旦积分赛

Not Attended
Status
Done
Rule
Ledo
Problem
4
Start at
2025-12-31 12:00
End at
2026-1-3 12:00
Duration
72 hour(s)
Host
Partic.
8