Advertisement
roronoa

buckets

Apr 25th, 2019
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.48 KB | None | 0 0
  1.         // IT JUST WORKS ...//
  2. import java.util.*;
  3. import java.io.*;
  4. import java.math.*;
  5. class Solution {
  6.  
  7.     public static void main(String args[])
  8.     {
  9.         Scanner in = new Scanner(System.in);
  10.         int n = in.nextInt();
  11.         int d = in.nextInt();
  12.         int s = in.nextInt();
  13.         int t = 0;
  14.         int max = n%2==0?n/2:n/2+1;
  15.         for(int i = 1; i <= max; i++)
  16.         {
  17.             t = t + (n/2)*d*s;
  18.         }
  19.  
  20.         System.out.println(t);
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement