Guest User

Untitled

a guest
Jul 19th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.49 KB | None | 0 0
  1. import java.io.FileReader;
  2. import java.io.FileWriter;
  3. import java.io.PrintWriter;
  4. import java.util.Scanner;
  5.  
  6. public class Privet {
  7.     public static void main(String args[]) throws Exception {
  8.  
  9.         Scanner in = new Scanner(new FileReader("hello.in"));
  10.         PrintWriter out = new PrintWriter(new FileWriter("hello.out"), true);
  11.         long x = in.nextLong(), y = in.nextLong();
  12.         long a = (x * (x - 1) / 2), b = y * (2 * x + y - 1);
  13.         out.println(a + " " + b);
  14.     }
  15. }
Add Comment
Please, Sign In to add comment