Public Sale
Time Limit: 1000/1000 MS (Java/others) memory limit: 32768/32768 K (Java/Others)
Total submission (s): 11215 accepted submission (s): 6631
Problem description does not want to, but the reality is always a reality. Lele never escaped the fate of dropping out of school because he did not receive a scholarship. Now he is waiting for his farmland career like farmjohn.
Lele heard that there was a special auction on the street, and the auction of items was just a 20-acre field. So Lele took all his savings and rushed to the auction.
Later, we found that the auction only lasted for Lele and Yueyue.
Lele knew the auction rule was as follows: the reserve price was 0 at the beginning, and two people started to raise the price in turn, but each price increase was within 1 ~ Between N, when the price is greater than or equal to the cost of the field m, the organizer will sell the field to the price caller.
Although Lele and Yueyue cannot take the test, they are very proficient in the auction, and both of them really want this field. Therefore, each time they choose the most favorable way to increase their prices.
Because the Lele Lexicographic Order is higher than Yueyue, each time Lele starts to raise the price. Excuse me, when I first raise the price,
How much does Lele need to make sure they can buy this land?
Input this question contains multiple groups of tests. Please process it until the end of the file (EOF ). Each group of tests occupies one row.
Each group of tests contains two integers, M and N (for meanings, see the topic description, 0 <n, m <1100)
For each group of data, output the price that Lele can add for the first time in the ascending order of a row. The two data are separated by spaces.
If Lele cannot buy the land at whatever bid he made for the first time, it will output "NONE ".
Sample input4 23 5
Sample output1none3 4 5. the initial price is 0 RMB. You can increase the price by 1-N each time. You can purchase the product at a price greater than or equal to the cost. Question: First, if the bid range is greater than or equal to the cost price, then the first bid can be bought and all bid schemes that are greater than or equal to the cost price are directly output. If the bid range is less than the cost price, you can purchase it if you can bid first and maintain the price at a multiple of (n + 1.
1 #include<bits/stdc++.h> 2 using namespace std; 3 int main() { 4 int m,n; 5 while(~scanf("%d %d",&m,&n)) 6 { 7 if(m>n) 8 { 9 if(m%(n+1))10 {11 printf("%d\n",m%(n+1));12 }else13 {14 printf("none\n");15 } 16 17 } else18 {19 for(int i=m;i<=n;i++)20 {21 if(i!=n)printf("%d ",i);22 else printf("%d\n",i);23 }24 }25 }26 return 0;27 }
Hdu2149public sale (Bashi game)