/ SeriousOJ /

Record Detail

Accepted


  

Code

#include <iostream>
using namespace std;

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL); cout.tie(NULL);
	int t, b, h, hy;
	
	cin >> t;
	while(t--){
		cin >> b;
		h = 4 * (b / 3);
		hy = 5 * (b / 3);
		
		if(hy*hy == (h*h + b*b)){
			cout << b + h + hy;
		}else{
			cout << -1;
        }
    }
	return 0;
}

Information

Submit By
Type
Pretest
Problem
P1027 Right triangle
Language
C++20 (G++ 13.2.0)
Submit At
2024-03-06 14:36:23
Judged At
2024-11-11 03:41:51
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes