fork download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4. import java.util.Scanner;
  5.  
  6. class Ideone{
  7. public static void main (String[] args) throws java.lang.Exception{
  8. int n,P,S;
  9. Scanner myObj = new Scanner(System.in);
  10. while(myObj.hasNext()){
  11. n = myObj.nextInt();
  12. P = 4*n;
  13. S = n*n;
  14. System.out.println(P + " "+ S);
  15. }
  16.  
  17. }
  18. }
Success #stdin #stdout 0.17s 37852KB
stdin
3
5
10
stdout
12 9
20 25
40 100