@@ -0,0 +1,1005 @@
+package project_euler;%0D%0A%0D%0Aimport java.util.Scanner;%0D%0A%0D%0Apublic class MultOf3And5 %7B%0D%0A%0D%0A%09public static void main(String%5B%5D args) %7B%0D%0A%09%09%0D%0A%09%09Scanner sc = new Scanner(System.in);%0D%0A%09%09int numCases = Integer.parseInt(sc.nextLine());%0D%0A%09%09for (int i = 0; i %3C numCases; i++) %7B%0D%0A%09%09%09long max = sc.nextLong();%0D%0A%09%09%09System.out.println(getSum(max));%0D%0A%09%09%7D%0D%0A%09%09sc.close();%0D%0A%09%7D%0D%0A%09%0D%0A%09private static long getSum(long maximum) %7B%0D%0A%09%09maximum--;%0D%0A        %0D%0A        long sum = 0;  %0D%0A        long totalElements = 0;  %0D%0A          %0D%0A        if(maximum %3E= 3) %7B  %0D%0A            totalElements = maximum / 3;  %0D%0A            sum += (totalElements * ( 3 + totalElements*3)) / 2;  %0D%0A        %7D  %0D%0A          %0D%0A        if(maximum %3E= 5) %7B  %0D%0A            totalElements = maximum / 5;  %0D%0A            sum += (totalElements * (5 + totalElements * 5)) / 2;  %0D%0A        %7D  %0D%0A%0D%0A        if(maximum %3E= 15) %7B  %0D%0A            totalElements = maximum / 15;  %0D%0A            sum -= (totalElements * (15 + totalElements * 15)) / 2;  %0D%0A        %7D%0D%0A%09%09%0D%0A%09%09return sum;%0D%0A%09%7D%0D%0A%7D

Add MultOf3And5