Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.BufferedReader;
- import java.io.IOException;
- import java.io.InputStreamReader;
- import java.math.BigDecimal;
- /**
- * Created by ChaosFire on 17.11.2017 г.
- */
- public class ResurrectionFirst {
- public static void main(String[] args) throws IOException {
- BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
- int phoenixCount = Integer.parseInt(reader.readLine());
- StringBuilder output = new StringBuilder();
- for (int i = 0; i < phoenixCount; i++) {
- BigDecimal bodyLength = new BigDecimal(reader.readLine());
- BigDecimal bodyWidth = new BigDecimal(reader.readLine());
- BigDecimal wingLength = new BigDecimal(reader.readLine());
- BigDecimal years = bodyLength.pow(2).multiply(wingLength.multiply(BigDecimal.valueOf(2)).add(bodyWidth));
- output.append(years).append(System.lineSeparator());
- }
- reader.close();
- System.out.print(output);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement