Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Program
- {
- class Solution
- {
- static void Main(string[] args)
- {
- long n=long.Parse(Console.ReadLine());
- while (n-->0)
- {
- long m=long.Parse(Console.ReadLine())-1;
- Console.WriteLine(3L*(m/3L)*((m/3L)+1)/2+5L*(m/5L)*((m/5L)+1)/2-15L*(m/15L)*((m/15L)+1)/2);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment