CF1463F.Max Correct Set
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Let's call the set of positive integers S correct if the following two conditions are met:
- S⊆{1,2,…,n} ;
- if a∈S and b∈S , then ∣a−b∣=x and ∣a−b∣=y .
For the given values n , x , and y , you have to find the maximum size of the correct set.
输入格式
A single line contains three integers n , x and y ( 1≤n≤109 ; 1≤x,y≤22 ).
输出格式
Print one integer — the maximum size of the correct set.
输入输出样例
输入#1
10 2 5
输出#1
5
输入#2
21 4 6
输出#2
9
输入#3
1337 7 7
输出#3
672
输入#4
455678451 22 17
输出#4
221997195