Вопрос с Exceptions, без try/catch, пробрасываю = валидатор не пропускает все равно
package com.javarush.task.task14.task1420;
/*
НОД
*/
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader buffer = new BufferedReader(new InputStreamReader(System.in));
int k = Integer.parseInt(buffer.readLine());
if (k < 0) throw new Exception();
int l = Integer.parseInt(buffer.readLine());
if (l < 0) throw new Exception();
System.out.println(gcd(k, l));
}
public static int gcd(int a, int b) {
if (b == 0)
return a;
return gcd(b, a % b);
}
}