CodeMan
Home
Uva
AtCoder
Codechef
Codeforce
Hackerrank
LeetCode
Devskill
TopCoder
Spoj
Algorithm
Python3
Hackerearth
Uri
C++
Data Structure
Monday, September 16, 2019
Codeforce A. Two Bags of Potatoes
#include
< iostream >
using
namespace
std
;
int
main
()
{
int
y
,
k
,
n
;
cin
>>
y
>>
k
>>
n
;
int
x
=
k
-
y
%
k
;
if
(
x
+
y
>
n
)
return
cout
<<
-
1
<<
endl
,
0
;
for
(
int
i
=
x
;
i
<=
n
-
y
;
i
+=
k
)
cout
<<
i
<<
" "
;
return
0
;
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment