题目描述
Problem Statement
Find the sum of integers between 1 and N (inclusive) that are not multiples of A or B.
Input
Input is given from Standard Input in the following format:
N A B
Output
Print the answer.
Constraints
- $1 \leq N, A,B \leq 10^9$
- All values in input are integers.
Sample Input 1
10 3 5
Sample Output 1
22
The integers between 1 and 10 (inclusive) that are not multiples of 3 or 5 are 1,2,4,7, and 8, whose sum is 1+2+4+7+8 =22.
Sample Input 2
1000000000 314 159
Sample Output 2
495273003954006262
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分
样例输入
10 3 5
样例输出
22