Advertisement
Chaosfirebolt

Resurrection BigDecimal

Nov 17th, 2017
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.99 KB | None | 0 0
  1. import java.io.BufferedReader;
  2. import java.io.IOException;
  3. import java.io.InputStreamReader;
  4. import java.math.BigDecimal;
  5. /**
  6.  * Created by ChaosFire on 17.11.2017 г.
  7.  */
  8. public class ResurrectionFirst {
  9.  
  10.     public static void main(String[] args) throws IOException {
  11.         BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
  12.         int phoenixCount = Integer.parseInt(reader.readLine());
  13.         StringBuilder output = new StringBuilder();
  14.         for (int i = 0; i < phoenixCount; i++) {
  15.             BigDecimal bodyLength = new BigDecimal(reader.readLine());
  16.             BigDecimal bodyWidth = new BigDecimal(reader.readLine());
  17.             BigDecimal wingLength = new BigDecimal(reader.readLine());
  18.  
  19.             BigDecimal years = bodyLength.pow(2).multiply(wingLength.multiply(BigDecimal.valueOf(2)).add(bodyWidth));
  20.             output.append(years).append(System.lineSeparator());
  21.         }
  22.         reader.close();
  23.         System.out.print(output);
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement