Jun 8, 2019 at 9:25pm UTC
what should be the answer of n=1 and k=6 ?
PLz explain also..
Jun 8, 2019 at 9:30pm UTC
UPDATE: I got AC, was making a silly mistake.
@lame , read the question properly, n>=2 is a constraint, if n was 1, the answer would be infinite.
also please refer to @blackmamba 's reply, he has given a good explanation which is way more than enough to solve the problem. its simple. just look for the PATTERN.
Jun 8, 2019 at 9:30pm UTC
N>=2 as stated in problem
Jun 8, 2019 at 9:34pm UTC
according to the pattern i m getting two cases:
for n=2 and rest of the cases.
Is my approach right ?
Jun 8, 2019 at 9:44pm UTC
first try for n=2, you'll see an obvious pattern, then try for n=3, and so on.. pattern will be much clearer then
Jun 8, 2019 at 11:09pm UTC
is there any corner case...I m getting second subtask wrong.
Jun 9, 2019 at 1:22am UTC
okay
Last edited on Jun 9, 2019 at 7:42am UTC
Jun 9, 2019 at 7:43am UTC
ok
Last edited on Jun 10, 2019 at 10:51am UTC
Jun 10, 2019 at 6:52am UTC
@theKlaw Please provide me that test case bro
Last edited on Jun 10, 2019 at 10:19am UTC
Jun 10, 2019 at 12:58pm UTC
@iotaa and @blackmamba and @theKlaw
Can u explain this problem for n=3 and k=2 ?
According to me there are infinite number of unreachable points.
For above case: starting with 2,4,6,8,10............ in this case we are getting only even numbers.
Jun 10, 2019 at 1:32pm UTC
@anup30 did you get AC in sub task 1 ? Can you give me a hint
Last edited on Jun 10, 2019 at 1:33pm UTC
Jun 10, 2019 at 1:37pm UTC
@TheTimes i got AC in sub task 1
did you get AC in subtask 2?
Last edited on Jun 10, 2019 at 1:37pm UTC
Jun 10, 2019 at 1:41pm UTC
@Dum Yeah , I directly applied %M to final sum . It gave me all AC except the subtask 1.Whats your approach?
Jun 10, 2019 at 2:00pm UTC
@TheTimes Can you give me some testcase
Jun 10, 2019 at 2:08pm UTC
2
large cases bro not small
Last edited on Jun 10, 2019 at 2:09pm UTC
Jun 10, 2019 at 2:16pm UTC
It's small bro , 7 8 9 14 15 16 17 18 21 22 23 24 25 26 27 28 29 30 ...etc
as you can see Missing numbers are :
1 to 6 - 6
10 to 13 - 4
19 to 20 -2
So you can see a AP series with 6 , 4, 2
with common difference -2 i.e nothing but n -1
Jun 10, 2019 at 2:18pm UTC
yeah i did the same but 2nd case in 2nd subtask is failing
Jun 10, 2019 at 2:19pm UTC
you said you are getting wa in 1st sub task right
so better put this if n == 2 then print n*(n+1)/2