@@ -0,0 +1,840 @@
+import java.util.*;%0Aimport java.io.*;%0A%0A%0Aclass Calculator %7B%0A        %0A    int power( int n, int p ) throws Exception %7B%0A    %0A        if ( n %3C 0 %7C%7C p %3C 0 ) %7B%0A            throw new Exception( %22n and p should be non-negative%22 );%0A        %7D%0A        %0A        return (int)Math.pow( n, p );%0A    %0A    %7D%0A%0A%7D%0A%0Aclass Solution%7B%0A%0A    public static void main( String %5B%5Dargh ) %7B%0A    %0A        Scanner in = new Scanner(System.in);%0A        int T = in.nextInt();%0A    %0A        while ( T-- ) %7B%0A            int n = in.nextInt();%0A            int p = in.nextInt();%0A            Calculator myCalculator = new Calculator();%0A            try %7B%0A                int ans = myCalculator.power( n, p );%0A                System.out.println(ans);%0A            %7D%0A            catch( Exception e ) %7B%0A                System.out.println(e.getMessage());%0A            %7D%0A        %7D%0A%0A    %7D%0A%0A%7D%0A

Add day 17 solution