結果
| 問題 | No.3301 Make Right Triangle | 
| コンテスト | |
| ユーザー |  detteiuu | 
| 提出日時 | 2025-10-05 15:03:45 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 447 ms / 2,000 ms | 
| コード長 | 308 bytes | 
| コンパイル時間 | 259 ms | 
| コンパイル使用メモリ | 82,372 KB | 
| 実行使用メモリ | 77,812 KB | 
| 最終ジャッジ日時 | 2025-10-05 15:04:05 | 
| 合計ジャッジ時間 | 8,797 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 | 
| other | AC * 9 | 
ソースコード
from math import isqrt
for _ in range(int(input())):
    A = int(input())
    if A == 2**(A.bit_length()-1):
        print(A, A//4*3, isqrt(A**2+(A//4*3)**2))
        continue
    
    a2 = A**2
    if a2%2 == 1:
        print(A, a2//2, a2//2+1)
    else:
        print(A, (2+(a2//2))//2-2, (2+(a2//2))//2)
            
            
            
        