majk's blog

By majk, 21 month(s) ago,

The end of the December is fast approaching and it is time for the best last contest of the year! The Good Bye 2018 round will take place on Sunday, December 30, 2018 at 14:35 UTC.

As the people who already engaged in discussions about the ultimate problem suspect, I am the problem writer. As such, I'd like to thank to:

The round will last for 2:30 hours and you will be given 8 problems for both divisions. There will be an interactive problem.

You have the last opportunity to reach Your rating goals for 2018. Good luck!

UPD: The top 3 participants eligible for ICPC 2019/20 season can win a great prize.

UPD2: The scoring distribution is 500-1000-1750-2250-3000-3000-3750-4000.

UPD3: Round is finished. I hope you enjoyed the contest! I am really sorry for the duck-up in problem G. I'll share more details once the important things (systest, editorial ...) are taken care of. The systest might be slightly delayed because of that.

UPD4: Editorial

UPD5: We apologize for the issue with problem G. We are still investigating this issue. Verdicts “Idleness limit exceeded” may be changed to other. We will write a full report about it later.

UPD6: The results are final, rating will be recalculated shortly. Congratulations to the winners:

Announcement of Good Bye 2018

• +1032

 » 21 month(s) ago, # |   +1 please, add Eve to the tags
•  » » 21 month(s) ago, # ^ |   +84 Are you crazy? Eve is a criminal!
•  » » » 21 month(s) ago, # ^ |   +35 Eve makes the problems fun, she deserves to be in the main page.
•  » » » 21 month(s) ago, # ^ |   +56 On the other hand, she adds Christmas-y feeling.
•  » » » 21 month(s) ago, # ^ |   +3 Who is Eve?
•  » » » » 21 month(s) ago, # ^ |   +10
•  » » » » » 21 month(s) ago, # ^ |   0 Oh that... I knew about Alice and Bob but not about Eve
•  » » » » » 21 month(s) ago, # ^ |   +7 You just changed the way how I perceive EVE for the rest of my life.
•  » » » 21 month(s) ago, # ^ |   -13 mama ama criminal
 » 21 month(s) ago, # |   +30 I always enjoyed contests from majk. Hope to see something interesting for the last contest of the year!
 » 21 month(s) ago, # |   +3 Looking forward to it :))))
 » 21 month(s) ago, # |   -52 I am so sorry, but is it rated?
•  » » 21 month(s) ago, # ^ | ← Rev. 2 →   +21 Did you just missed this? "You have the last opportunity to reach Your rating goals for 2018. Good luck!"
•  » » » 21 month(s) ago, # ^ |   -51 Oh, oh, oh I missed it men, I am so sorrrrry, Thank you very much, You are the best, You are better than tourist
•  » » » » 21 month(s) ago, # ^ |   +2 Are you doing this to win Most annoying person on CF by Um_nik? You are doing pretty well in it if you ask me.
 » 21 month(s) ago, # | ← Rev. 2 →   +6 Best birthday gift ever! Thanks, majk!
•  » » 21 month(s) ago, # ^ |   +3 Happy Birthday :DD
 » 21 month(s) ago, # |   +5 I don’t have good memory of goodbye 2017 hope this one overwrites that.
 » 21 month(s) ago, # |   0 wait for the rating up！
 » 21 month(s) ago, # |   -28 is 2019 going to be rated?
 » 21 month(s) ago, # | ← Rev. 2 →   +81 Damn,It might take CF 1 year to update the ratings.
•  » » 21 month(s) ago, # ^ |   0 No there is 31 December for updating rating :3
•  » » » 21 month(s) ago, # ^ |   0 Might, mate.
 » 21 month(s) ago, # |   -29 "...you will be given 8 problems for both divisions." For (div. 2 and 1) or (div.2 and 3)?
•  » » 21 month(s) ago, # ^ |   +13 Div 1 and 2.
 » 21 month(s) ago, # |   +21 Why is this post tagged with 'Alice' and 'Bob ? By the way, Happy new year in advance to everyone in Codeforces community.
•  » » 21 month(s) ago, # ^ |   +9 Because I often use Alice and Bob in the statements.
•  » » 21 month(s) ago, # ^ |   0 They are just placeholders names, specifically used in Cryptography
 » 21 month(s) ago, # | ← Rev. 2 →   0 "You have the last opportunity to reach Your rating goals for 2018"This makes me kinda sad. As I feel like I won't be able to reach it.
•  » » 21 month(s) ago, # ^ |   +4 Be confident...
 » 21 month(s) ago, # |   +63 Here's a list of past Good Bye contests.
•  » » 21 month(s) ago, # ^ |   -88 who fricking cares
•  » » » 21 month(s) ago, # ^ |   +4 Newbies like me freaking Care, and I'm freaking worried about the fact that you can't spell "freaking".
•  » » 21 month(s) ago, # ^ | ← Rev. 5 →   -12 EDIT:The past Hello contests:- Hello 2018- Hello 2015 (Div.1) [Unrated]- Hello 2015 (Div.2) [Unrated]Happy New Year!!
•  » » » 21 month(s) ago, # ^ |   0 Not exact. Hello 2015 (Div.1) Hello 2015 (Div.2)
•  » » » » 21 month(s) ago, # ^ | ← Rev. 2 →   -8 Oops! Sorry for the inconvenience!But I think they(Hello 2015 Contests) were Unrated CF Gym Contests.
•  » » » » » 21 month(s) ago, # ^ |   0 Sure, but they are important because they're a origin of Hello ! rated series.
•  » » » 21 month(s) ago, # ^ |   -17 Can I ask you?
•  » » » 21 month(s) ago, # ^ |   -17 how did you get the 800 rating
•  » » » » 21 month(s) ago, # ^ |   0 Participate in a rated CF Contest, and that's it! you'll get rated. Before your first rated contest, you're considered as a Pupil(Rating: 1500). Then, if you do good in the contest, your rating will increase comparing to 1500, and if you get a poor ranking your rating will be decreased by the same.Read this blog for more information about the CF Rating System.
 » 21 month(s) ago, # |   +8 tfw my rating goal for 2018 was CM...
•  » » 21 month(s) ago, # ^ |   +9 nvm, thanks to magic my rating goal is a (temporary) reality
 » 21 month(s) ago, # | ← Rev. 2 →   0 Happy New Year to all!
 » 21 month(s) ago, # |   0 happy new year！
 » 21 month(s) ago, # | ← Rev. 2 →   0 nitella don't miss this!
•  » » 21 month(s) ago, # ^ |   0 Thanks dude
 » 21 month(s) ago, # |   0 kg16 try your luck on this :)!
 » 21 month(s) ago, # |   0 so excited to back expert by end of 2018
 » 21 month(s) ago, # |   -28 if i dont get crapping expert this time i will do russian shooting
•  » » 21 month(s) ago, # ^ |   -10 what the frick ??!
 » 21 month(s) ago, # |   +2 Just a little thought. Why dont codeforces make everyone automatically registered for every contest like codechef where we dont need to register for a contest ?
•  » » 21 month(s) ago, # ^ |   +16 Because there are rooms in codeforces for hacking. If everyone is assigned to a room there will be alot of rooms and most of them are empty.
 » 21 month(s) ago, # | ← Rev. 3 →   0 Last contest of the year, Wishing a very good rating for everyone...
•  » » 21 month(s) ago, # ^ |   0 Wow man, you're creating quite inspiring rating graph :). All the best for tomorrow's contest.
 » 21 month(s) ago, # |   -27 Good to see an Indian Problem Setter. Random doubt, Is there any contest that is from an Indian User?
 » 21 month(s) ago, # |   -23 Will this round be rated for div 3?
•  » » 21 month(s) ago, # ^ |   +2 Yes.
•  » » » 21 month(s) ago, # ^ |   +3 Thank you!
 » 21 month(s) ago, # |   -197 Upvote me, If you think, I can cross 1600 rating in Good bye 2018 contest. Downvote me, If you think, I can't !Be honest with your opinions, that will motivate me to do hard-work !
•  » » 21 month(s) ago, # ^ |   +36 Or just downvote him for spam comment.
•  » » » 21 month(s) ago, # ^ |   -17 That also fine by me :) kostka I upvoted you !
•  » » 21 month(s) ago, # ^ |   +10 This contest was a quite challenging, enjoyable and memorable contest for me. I pushed myself so hard to reach that 1600 mark. I couldn't reach there but I ended up solving 4 problems.Thanks a lot ! your contest is pre-new year gift for me. majk
 » 21 month(s) ago, # |   0 You can win if you want
 » 21 month(s) ago, # |   0 best pat of the year
 » 21 month(s) ago, # |   +189 Everyone else on New Year's eve vs me
•  » » 21 month(s) ago, # ^ |   +7
 » 21 month(s) ago, # | ← Rev. 2 →   0 When verdict of problem will be accepted and when will be "Happy New Year"?
•  » » 21 month(s) ago, # ^ |   0 Happy New Year when AC i think
 » 21 month(s) ago, # |   +1 Hope to All high rating.
 » 21 month(s) ago, # |   0 Happy new year,guys!(So what does the tag"Alice and Bob'...mean?)
 » 21 month(s) ago, # |   +57 Every time i see this blog, majk color keeps changing :D
•  » » 21 month(s) ago, # ^ |   +108 I am a fast learner!
•  » » » 21 month(s) ago, # ^ |   +33 Not like it's helping your Atcoder rating.
•  » » » » 21 month(s) ago, # ^ |   +38 Are you competing today?
•  » » » » » 21 month(s) ago, # ^ |   +17 Maybe, if there's time. Hard to say, everything's messy around holidays.
•  » » » » » 21 month(s) ago, # ^ |   +18 And this is how it ends when I have people bugging me all the time during the contest.
 » 21 month(s) ago, # | ← Rev. 2 →   0 2018 was a great year with lot of good contests hope this year be even better. thank to every one how prepared a contest and a special thanks to mike.
 » 21 month(s) ago, # |   +25 I hope that everyone can get high rating && change his/her handle's color by no magic.
 » 21 month(s) ago, # | ← Rev. 2 →   +37 First contest in cf history with more than 10000 registrations
 » 21 month(s) ago, # |   +19 I hope codeforces servers could handle the requests from this much contestants.
 » 21 month(s) ago, # |   +58 9000 and counting ...
 » 21 month(s) ago, # |   -19 He doesn't want to achieve his goal anymore ?
•  » » 21 month(s) ago, # ^ |   +13 His new username is just V--o_o--V without the specs :D
 » 21 month(s) ago, # |   +25 Happy New Year! Fun & high rating for all of you:)But I have to warn, that CF-Predictor doesn't support handle change. So if you change handle, the prediction is going to be completely wrong (for the first time only). As there are some people who changed handles, today's prediction is going to be a bit inaccurate for everyone.Don't be upset, just enjoying the competition!
 » 21 month(s) ago, # |   +11 It's about time that I become a specialist.
•  » » 21 month(s) ago, # ^ |   +6 you are already a legendary grandmaster
•  » » 21 month(s) ago, # ^ |   0 missed by 2 points :)
 » 21 month(s) ago, # |   +9 It's biggest number of registrants ever
 » 21 month(s) ago, # |   +5 scoring distribution doesn't seem even
 » 21 month(s) ago, # |   0 Good Luck! (:D)
 » 21 month(s) ago, # |   +39 \10000 Registration!/
 » 21 month(s) ago, # |   0 Lets see if i can end this year with pupil
 » 21 month(s) ago, # |   +11 I suspect huge queues...
 » 21 month(s) ago, # |   +8 I freaked out when I opened the registrations page — lots of grandmasters :o. But then I realized they have just changed their colors :P
 » 21 month(s) ago, # |   +8 I already reached my 2018th goal (min 1600), but, damn ,this contest seems to be like a chocolate candy , cant keep my fingers from touching it. I hope for everyone steep positive slope in this contest.
 » 21 month(s) ago, # | ← Rev. 2 →   -6 And it's over 10000 registrants after a long time...
 » 21 month(s) ago, # |   +16 however,good luck to the server!!  Total: 10312
 » 21 month(s) ago, # |   +14 Will the CF servers be able to hold 10000 participants?let's hope for a smooth one this year boys.
 » 21 month(s) ago, # |   +1 Been Newbie throughout 2018, time to pull out all I've got, to, at the very least become Pupil. I know the Purple, Orange, Red and Black Reds be like "Seriously, someone fighting to reach green??"
•  » » 21 month(s) ago, # ^ |   +9 Most of us have been there, don't give up :)
 » 21 month(s) ago, # | ← Rev. 2 →   +4 All the best to legend Petr hope he does screencast for it too
 » 21 month(s) ago, # | ← Rev. 2 →   +125
 » 21 month(s) ago, # |   +15 Will the fake colors be disabled for hacking purposes? majk, gotta ping real fast, sorry.
 » 21 month(s) ago, # |   +6 tourist is here.
 » 21 month(s) ago, # |   +4 tourist joined. Let the battle begins!
 » 21 month(s) ago, # |   +4 11444 candidates registered...It'll be a fierce contest.Best of Luck Guys...
 » 21 month(s) ago, # |   0 legend Petr vs Master tourist ...here the battle begins ..
 » 21 month(s) ago, # |   0 Finally, I find a contest announcement with no one asking whether it is rated.
 » 21 month(s) ago, # |   0 It would be a pity to start a new year with a decrease of raiting. However i'm guessing that what awaits me.
 » 21 month(s) ago, # | ← Rev. 2 →   +81 Problem B: "As everyone knows, the world is a two-dimensional plane."So the earth is flat?
•  » » 21 month(s) ago, # ^ |   0 yes all loli is flat
 » 21 month(s) ago, # |   +6 CF Servers failed :( Denial of Judgement
•  » » 21 month(s) ago, # ^ |   0 CF — помойка
 » 21 month(s) ago, # | ← Rev. 2 →   +25
 » 21 month(s) ago, # | ← Rev. 3 →   0 Petr hasn't solved problems A and B yet :O :O :OHe tries to get AC problem H, but solving problems A and B will take just 3-4 minutes for him.UPD: Finished. He didn't solve them, neither he solved H :(((
•  » » 21 month(s) ago, # ^ |   0 Petr, please, solve problems A and B! Gain ~750 points!!!
 » 21 month(s) ago, # | ← Rev. 2 →   0 .
 » 21 month(s) ago, # |   +1 After reading first 5 problems GoodByeExpert :(
•  » » 21 month(s) ago, # ^ | ← Rev. 3 →   0 No need for Expert ;) You are already Grandmaster!\ps Actually same here :((( Also after reading first 5 problems "MathForces confirmed!".
 » 21 month(s) ago, # |   +1 Hacks for B?
•  » » 21 month(s) ago, # ^ |   +1 Overflow
 » 21 month(s) ago, # |   +1 problem c was nice :D , how to solve D ?
•  » » 21 month(s) ago, # ^ | ← Rev. 2 →   +25 n!+((ans for n-1)-1)*n) Don't know why it works though.
•  » » » 21 month(s) ago, # ^ |   0 How did you get this? :D
•  » » » » 21 month(s) ago, # ^ | ← Rev. 2 →   +1 Observation ;)I was trying different methods to get 56 for n=4 using the answer of n=3 i.e 9. Coincidentally the first method I tried gave the correct answer for 10 and it passed :)
•  » » » » 21 month(s) ago, # ^ | ← Rev. 2 →   +8 A concatenation of 2 permutations will have the sum n*(n+1)/2 iff the suffix of the first permutation won't contain any elements from the prefix of the second. That mean that the prefix of the first permutation needs to have the same elements as the prefix of the second (when we are talking of some prefix i and suffix n-i). Now 2 consecutive permutations will satisfy this condition always except for one time when the suffix elements are sorted in decreasing order. For example: 1 3 5 4 2 , the next permutation will have some elements from {5,4,2} in the prefix. Now it's only the matter of implementation. For each prefix i add to the answer A(n,i) * ((n-i)!-1)
•  » » 21 month(s) ago, # ^ | ← Rev. 2 →   +3 It should be clear that we automatically get n! subarrays, from the permutations themselves.For a given permutation, look at the the length of the prefix that remains the same when going to the next permutation. For example, for n = 4 say the permutation 1324 appears at index i. from 1324 -> 1342, the length of the prefix that remains the same is 2 (because 13 stays the same). Then, this means that we get 2 more subarrays that work, i.e. the ones starting from i + 1 and i + 2.The answer will be n! plus the sum of the lengths of these prefixes. We can calculate that recursively, given by the formula in the other comment.
•  » » » 21 month(s) ago, # ^ |   +8 So every subarray p which works is a permutation of numbers [1...n]? Can't there be some other subarrays?
•  » » » » 21 month(s) ago, # ^ | ← Rev. 2 →   0 So, this part was really hand wavy, but I think that a given subarray can have at most one duplicate, and if that's true then it would follow that every subarray that works is a permutation of 1..n. Not at all sure whether that's true, though.EDIT: This is not true, as given in an example by DEGwer in the editorial comments. spacewalker's comment below is good justification though.
•  » » » » » 21 month(s) ago, # ^ |   0 Still, thanks.
•  » » » » 21 month(s) ago, # ^ |   +5 It is... at least in this scenario.Every subarray is either a permutation of [1..n], or some suffix of a permutation, plus a prefix of the next permutation. Consider some permutation P, and divide it into parts R1 a R2 b R3 such that the length of R2 b R3 is maximal, and R2 b a R3 is decreasing. The next permutation algorithm tells us that the next one, Q is R1 b reverse(R2 a R3). Let's look at the subarrays based on where they start:So we end up with a range R1 a R2 b R3 | R1 b reverse(R2 a R3). (The divider indicates where Q starts.) The subarray starts in R1 a. Then the prefix of P we don't hit is precisely the prefix of Q that does intersect with the subarray. So it's a permutation of [1..n]. The subarray starts in R2 b R3. If you simulate moving the subarray start through R2 b R3, you'll notice that the differences in sums of neighboring subarrays increase, then decrease. This means that the only time the sum will equal is when the start moves in Q. So either the subarray is a permutation of [1..n], or it doesn't have the right sum.
•  » » » » » 21 month(s) ago, # ^ |   +5 Thanks for the full explanation. It explained well.P.S. At first I was tricked by your fake grey color :D
•  » » 21 month(s) ago, # ^ | ← Rev. 2 →   0 We can calculate for each x, the number of permutations where suffix of length x is not sorted. All these permutations combined with prefix of ext permutation of length n-x will have all distinct elements. As out of all x! permutations only one will be sorted.This can be calculated as n! * (x! — 1) / (x!) for all x <= n-1and simply n! for x == nThe sum of all these terms will be the answer.
•  » » 21 month(s) ago, # ^ |   +2 ( (  ×  i!  ×  ((n-i)!-1))) + n!
 » 21 month(s) ago, # | ← Rev. 5 →   +12 This contest was the worst performance of mine ever.. what a great way to end the year :/ I really felt out of luck this time, spent an hour on D but couldn't guess that formula even though it seems I was close. Oh well.
•  » » 21 month(s) ago, # ^ |   +2 same here ..
 » 21 month(s) ago, # |   +17 Please don't tell E was erdos gallai + binary search
•  » » 21 month(s) ago, # ^ |   +3 But it was...
•  » » » 21 month(s) ago, # ^ |   +11 You supposed to not telling that.
•  » » 21 month(s) ago, # ^ | ← Rev. 3 →   0 That's what I tried, but the only thing I don't quite get is the range to binary search over, since the set of values that work (within a particular parity) isn't monotonic. I'm pretty sure it's an interval, but I don't quite get how to find a value in that interval to pivot from.EDIT: nvm, seems like I'm misunderstanding what exactly you're binary searching on...
•  » » 21 month(s) ago, # ^ |   0 So sad. I didn't know this theorem. However, it may be more difficult for me to prove it during the contest. Thanks for reminding, and I'll learn it later. Thanks majk for a nice contest!
 » 21 month(s) ago, # |   +4 what a problem D is!how to solve D.
•  » » 21 month(s) ago, # ^ |   +12 The idea is: number the permutations p1, ..., pn!. Then, for each interval of length n, say [l, r], some part of it is in permutation pi and the rest in permutation pi + 1. Let's say that [l, m] is in pi, and [m + 1, r] is in pi + 1. Now, you need to make two observations: Between one permutation and the next, any prefix either is the same as the other, or changes in exactly one element. If pi and pi + 1 have the same prefix of length r - (m + 1) + 1, then [l, r] will have sum . Else, they will not.The second observation is that a prefix of length l will change every (n - l)! permutations, so in total, this prefix will change times (the  - 1 comes from the last permutation).Therefore, to solve this problem, you notice first that if some interval is completely contained in a permutation, its sum will equal . Then, iterate over all the sizes of prefix, and for each, add to your current answer . The result is the answer.
 » 21 month(s) ago, # |   +16 all math problems and i got hacked, gg
 » 21 month(s) ago, # |   +33 It was a year full of "well, I cannot prove it but seems a lot had solved it. let's try the intuitive solution. Damn! seems it worked".
 » 21 month(s) ago, # |   0 Pretest 8 for B?
•  » » 21 month(s) ago, # ^ | ← Rev. 2 →   0 I think the test case is that which some coordinates are located in same row or same column. (But it is not certain.)
•  » » 21 month(s) ago, # ^ |   0 pretest 4 was more challenging
 » 21 month(s) ago, # |   0 The difficulty of Problem D and E seem to be quite different. How to solve E?
 » 21 month(s) ago, # |   +1 any idea about test 18 problem E?
 » 21 month(s) ago, # |   +17 How to solve D: 1) Write bruteforce 2) output n*n!-bruteforce(n) 3) find this sequence in oeis 4) profit
•  » » 21 month(s) ago, # ^ |   +6 I searched for this sequence for 30 minutes, but did not find it ((
•  » » » 21 month(s) ago, # ^ |   +14 http://oeis.org/A038156 n!n - that
•  » » » 21 month(s) ago, # ^ |   +3
 » 21 month(s) ago, # |   +10 Btw, is there a Hello 2019 where I can recover back? 1500 rating is not quite suitable for a Legendary grandmaster :D.
•  » » 21 month(s) ago, # ^ |   +1 Yes there is, you can find it by going to the contests page.
 » 21 month(s) ago, # |   0 Very interesting problemset. Does anyone know how to pass 18th test of problem E?
•  » » 21 month(s) ago, # ^ | ← Rev. 2 →   +36 What did you do? My solution is a horrible bunch of formulas and pointers and simply put garbage. I haven't coded something so ugly in the past year or so. I just iterated through all possible values of x and checked them with erdos gallai theorem (which btw, was kind of given in the statement, and I find that even more stupid than the problem itself). I also thought of maybe binary searching and having all values of a given parity in a range, but since people kept getting WA, I assumed that this was a wrong approach (+ I didn't have a proof)
•  » » » 21 month(s) ago, # ^ |   0 I used the same approach. First I find minimum degree of graph with Erdos-Gallai theorem and then do a binary search to find the maximum degree.
•  » » » 21 month(s) ago, # ^ |   0 I did the same thing. Agree it's one of the trickiest things I coded in a while :(
•  » » » » 21 month(s) ago, # ^ | ← Rev. 2 →   0 There is already a pseudocode available here which works in linear time.
•  » » » » » 21 month(s) ago, # ^ |   0 For my solution I needed a modified version of the algorithm (to compute bounds for the missing degree), so just plain code wouldn't help too much.
 » 21 month(s) ago, # |   +2 How to solve E
•  » » 21 month(s) ago, # ^ |   0
 » 21 month(s) ago, # |   +6 it cost me totally three papers to solve problem DBTW,a nice contest :)
•  » » 21 month(s) ago, # ^ |   0 large lao take me up，take me up！！！
 » 21 month(s) ago, # |   +4 Who thought it was a good idea to propose a stackexchange answer as a problem? Reference
•  » » 21 month(s) ago, # ^ |   +5 The problem statement provided a reference to those algorithms.
•  » » 21 month(s) ago, # ^ |   +46 Before clicking your link I was expecting to see this :)I've still managed to spend more than an hour to get it to work, though :(
•  » » » 21 month(s) ago, # ^ |   +3 why u didnt solve a and b , petr
•  » » » » 21 month(s) ago, # ^ |   +39 It's a combination of two things: I was hoping to get H right until the end of the contest, which would give more points; I was quite tired at the end of the contest, so I was basically staring at the statements and not understanding them (at least not immediately, and then I switched back to H).
•  » » » » » 21 month(s) ago, # ^ |   0 ok , i understand ! :)
•  » » » 21 month(s) ago, # ^ |   0 I also assumed G would be googlable, but I couldn't find this thread. I also solved D by googling the algo for next permutation and probably would've taken one extra hour to solve the problem otherwise (and with a complete proof, since it's not straight forward that you can only cut a sequence in the unaltered prefix)
•  » » » » 21 month(s) ago, # ^ | ← Rev. 2 →   +1 Problem D seemed quite solvable to me: I just wrote some random permutation such that the next one differs much from it, and looked at how much the sum differed from the expected sum at each point: prev: 2 8 3 7 6 5 4 1 next: 2 8 4 1 3 5 6 7 diff: 0 0 +1 -5 -8 -8 -6 0 In another view: target sum is 36 subarray sum difference 2 8 3 7 6 5 4 1 36 0 8 3 7 6 5 4 1 2 36 0 3 7 6 5 4 1 2 8 36 0 7 6 5 4 1 2 8 4 37 +1 6 5 4 1 2 8 4 1 31 -5 5 4 1 2 8 4 1 3 28 -8 4 1 2 8 4 1 3 5 28 -8 1 2 8 4 1 3 5 6 30 -6 2 8 4 1 3 5 6 7 36 0 From such example, we can see that, for the whole suffix that changed, the differences are nonzero in the general case: the first one is positive, and all the following ones are negative.Next, there is a straightforward calculation of how many permutations differ from the previous one in the last k positions. And then summing that up.
•  » » » 21 month(s) ago, # ^ |   0 Nice find!I wonder though. The answer at StackExchange does not use the fact that all primes are of the form 4k + 3. It seems correct in the general case.So, how does the 4k + 3 help? When trying to solve problem G, I've found that law of quadratic reciprocity has a special case for numbers of the form 4k + 3, but couldn't make anything of it.
•  » » » » 21 month(s) ago, # ^ |   0 It is explained in the editorial: finding square roots modulo primes of form 4k+3 is faster, so the interactor is faster this way.
•  » » » » » 21 month(s) ago, # ^ |   0 Thanks, didn't see the editorial is already published.So I was trying to find a solution using a special property, but the property was ultimately for the jury side of things. Aaargh.
•  » » 21 month(s) ago, # ^ |   +25 That's not just a stack exchange problem. It's even worse: a relatively well known theorem (erdos gallai) which as a matter of fact was directly linked by the wikipedia article from the statement. I also find the problem veeeery bad, and apart from the trivial idea once you know the theorem, I found the code quite disgusting.
•  » » 21 month(s) ago, # ^ | ← Rev. 2 →   +16 That's not the correct causality. We found out after the problem was set, but still saw some substance to the problem (you first need to understand which question to ask and why). UPD: I thought it was about problem G. Disregard.
•  » » » 21 month(s) ago, # ^ |   +11 That's trivial for anyone who has a chance to understand the theorem in the first place, the hardest part is writing correct code.
 » 21 month(s) ago, # |   0 super tricky problems hehe, tnx
 » 21 month(s) ago, # | ← Rev. 3 →   +8 For B, I just output: {tx, ty} = {(sum of all(a[i]) + sum of all(x[i]))/n , (sum of all(b[i]) + sum of all(y[i]))/n}I feel confused after seeing big codes of others :|
•  » » 21 month(s) ago, # ^ |   0 I just sorted {a[i], b[i]} and {x[i], y[i]} and output a[0] + x[n-1], b[0] + y[n-1]
•  » » » 21 month(s) ago, # ^ |   +10 As soon as i saw, all of the x[i] + a[j] are equal, the first thing that came into my mind was, sum of all of it will be n*tx.
 » 21 month(s) ago, # |   +2 Actually, the best contest of 2018...
 » 21 month(s) ago, # |   +1 Today's problems were fun! Thanks to majk and coordinators!
 » 21 month(s) ago, # |   +23 Problems were very well explained. No ambiguity. It gave you time to think instead of wasting it trying to understand the problems.
 » 21 month(s) ago, # | ← Rev. 2 →   +9 Nice problems. Bad difficulty. 2.5k+ solved D and 300- solved E. It's really big step. What results are you expected for that problems?
•  » » 21 month(s) ago, # ^ |   +2 We knew the jump was big. We expected a bit more solutions on F, but E is roughly what we anticipated after the tester spent time on them. I originally thought that F is a nice and simple Div1A-B problem.
•  » » » 21 month(s) ago, # ^ |   0 What was the solution for F? My idea is: first check how much water/grass needs to be added to avoid getting stamina < 0 on lava (water preferred to grass, added as early as possible); start with all flying, then "convert" it to walking/swimming with cost 2/1 for all lava in order; swimming is preferred and gets converted from largest position to smallest, walking gets converted from smallest position to largest. Finally, ensure the stamina doesn't drop below 0 on grass/water by converting flying in the same way (this part is trivial).
•  » » » » 21 month(s) ago, # ^ |   0 Yes, this greedy was my solution as well.
•  » » » » » 21 month(s) ago, # ^ |   0 ...WA on pretest 11
•  » » » » » » 21 month(s) ago, # ^ |   0 I actually didn't find the conversion to flying to be that trivial. Maybe you have some issue there?
•  » » » » » » » 21 month(s) ago, # ^ | ← Rev. 2 →   0 I convert from flying. If there's a half-meter of water where the duck is currently flying and I'm processing a half-meter of lava, I make the duck swim the last possible half-meter of water (where it's currently flying) that's before that half-meter of lava. Otherwise, I make it walk on the first possible half-meter of grass where it's currently flying.
•  » » » » 21 month(s) ago, # ^ |   0 Are you saying you have two passes of conversion? Not sure, but it doesn't sound right.Maybe for the second pass, you need some flying converted to swimming earlier. And previously, you converted water from largest position to smallest. It may have been profitable to move the converted part closer to the front, so that the second pass is cheaper.In my solution, I had to handle both passes you describe simultaneously. To look ahead, I first calculated two quantities from back to front: how much surplus energy we will need moving ahead, and how much grass will be available ahead for conversion (I convert to flying, not from flying). Still not sure whether I got everything right though.
•  » » » » » 21 month(s) ago, # ^ |   0 How would I convert flying to swimming earlier? I convert to swimming asap whenever possible. If by earlier you mean position-wise, that could just lead to a worse situation where I just removed some flying I could convert to swimming to add stamina for flying over early grass in the 2nd pass.
 » 21 month(s) ago, # |   +109 My rule of thumb: Quickly check the hard side of problem, and Ctrl+F for the word "factor", "prime number" or any number theory stuff. If there's any, skip the round.Trust me. It works very well.
•  » » 21 month(s) ago, # ^ |   +164 Got a better idea: check if the setter's handle contains "majk"
•  » » 21 month(s) ago, # ^ |   -42 I like numbers!
•  » » » 21 month(s) ago, # ^ |   0 are u one of the problem setters for Hello 2019??? I am probably not in the mood of another round of mathforces XDDD
•  » » 21 month(s) ago, # ^ |   +74 Just my personal (i.e. biased) opinion:This Good-Bye contest was by far the least enjoyable one for me. Problems D and E (which for many constituted the main 2 problems in this contest) were not of very high quality: Problem D has a nice solution — which is, unfortunately, much easier to come up with than to prove. Also, for many, OEIS helped, and very few spent time proving their solution is correct (I, for instance, saw the ridiculous number of fast ACs and just coded it and prayed it works on the N = 10 test). Problem E allows for many solutions, but I think the problem is not very "fresh" — meaning that there are quite a few standard results about degree sequences.
•  » » » 21 month(s) ago, # ^ |   +50 My opinions are also heavily biased, but honestly it's funny to see my "strategy" giving me so much win XDGoogling up "degree sequence" is first thing I'll do if I solve E, so it's interesting how majk overcomes the issue: Just link the wikipedia and make people see them. It's better than nothing, I believe..
•  » » » 21 month(s) ago, # ^ |   0 Completely agree with you. I hate problems that are 90% math and 10% coding (C and D).
•  » » 21 month(s) ago, # ^ |   -38 What if instead of whining about the contest, you practice math problems so you can start AC-ing them? :)
•  » » » 21 month(s) ago, # ^ |   -12
 » 21 month(s) ago, # |   +10 Great contest to end 2018! Specially because you have multiple solutions for the problems :), which you get to know when you visit your room and see people doing tons of things to solve B!!
 » 21 month(s) ago, # | ← Rev. 4 →   +23 [RANT]I feel really hurt by problem G. One of my solutions, 47754232, should clearly be WA#1 (notice that very early in the source code I output N nonsense lines of numbers!). However, it failed only on 4th pretest, costing me 50 points (actually a couple of times, as understandably, I couldn't expect the bug to stay there!) One of my other solutions, 47754966, passed pretests in just under 3s. This was quite weird for me as my solution was essentially: while (4 seconds did not elapse) { ask the interactor for stuff; } (This is very important for what happens next.)...but okay, it happens.Then, 20-25 mins later, I get an announcement that we can't actually use more than 100 queries! This of course incurred a large penalty on me (a few more WAs, 40min worse time etc.) as I needed to do a bunch of patches in order to make it into the limit. (Hopefully, it will pass the systests.) The statement for G still contains the phrase "You can print as many queries as you wish, adhering to the time limit." Dammit! [/RANT]I feel you should do something about each of the above.
•  » » 21 month(s) ago, # ^ |   +17 I have checked the submission you mentioned manually and changed it so that it doesn't ask too many queries. You seem to have some bug in your approach, since on test 5 it sometimes detects as few as 6 factors, depending on the randomness. The correct approach should have error probability of order 10 - 14 with 50 queries. I am deeply sorry about the issues you had during the contest with this problem, but in this case we will not change the verdict.I am happy to discuss more if you wish, either here or PM.
•  » » » 21 month(s) ago, # ^ |   +11 I vented in the comment before and I don't think I have anything else to add. It's good to know that I had something wrong in my code, too. I still totally hate the way the things worked out (I hardly remember getting that infuriated by a single task), but there's no frickin' thing to do now.I wonder if I would've passed the original version of the problem. Or maybe not, I'd be fuming if it turned out I would.:<
 » 21 month(s) ago, # |   -99 I dont see how tourist can come up with the solutions to hard problems so fast. I think he is a great googler.
•  » » 21 month(s) ago, # ^ |   +14 haha, great google is in his mind
•  » » 21 month(s) ago, # ^ |   +17 I think it's pretty hard to be tourist just being a great googler ;)
•  » » 21 month(s) ago, # ^ | ← Rev. 3 →   +15 HEAVY DOWNVOTES on the way xD
 » 21 month(s) ago, # |   +9 Boy, I am so slow, not only am I slower to code than everybody, but even my programs are judged slower than everybody...
•  » » 21 month(s) ago, # ^ |   0 Man, your comment reminded me so much to Pet Cheetah lyrics, Lol.(8) No, I move slow. I want to stop time. I'll sit here 'til I find the problem. (8)If you want to hear it XD
•  » » » 21 month(s) ago, # ^ |   0 Funny that this song about slow is by a Cheetah :-)
 » 21 month(s) ago, # |   0 how do i view the contents of a hack?
•  » » 21 month(s) ago, # ^ |   +3 You need to wait for systest, then it should be avaible on the hacks tab and you can click on "View test", here is the link for some other past contest where you can do that.
•  » » 21 month(s) ago, # ^ |   0 After system testing, go to your submission page, you will find a link called View test in the verdict column, below Hack #some_number
 » 21 month(s) ago, # |   0 I made 5 unsuccessful hacks trying to hack two O(n3) solutions of problem B. This is the second problem in recent contests were the limit is set to 1000 and O(n3) solutions pass!
•  » » 21 month(s) ago, # ^ |   +9 Also depends on what is inside the loop. Implementation with very light calculations generally passes for the order of 109
•  » » 21 month(s) ago, # ^ |   0 1e9 operations can be done in about less than half a secondIt depends on the constant
 » 21 month(s) ago, # | ← Rev. 2 →   +5 Problem D. I don't sure it's correctness. a[n]=n*(a[n-1]-1) starting with a[1]=3. ans = n!*(n-2) + a[n-2]
 » 21 month(s) ago, # |   +15 Are you sure that "Idleness limit exceeded on test 4" is not a bug in interactor?
•  » » 21 month(s) ago, # ^ |   +13 I'm looking in it. It seems sometimes interactor is too slow and it gives ILE verdict because of huge waiting in a solution. I'll handle all such cases and rejudge solutions if needed. Sorry for it.
 » 21 month(s) ago, # | ← Rev. 2 →   +8 Possible way of thinking in D:Suppose the concatenated sequence of permutations is p(1) || p(2) || … || p(n!) where “||” is the concatenation operator. The sub-array you will choose will always be in the form of: suffix of length L from p(i) || prefix of length n-L from p(i+1).Let’s loop on j from 1 to n to see how many suffixes starting at index j (in any of the permutations) we can choose out of all n! suffixes out there. First note how p(i+1) will differ from p(i), the rightmost number in p(i) which is less than to the number on its right (call this number v1 and its index in p(i) ind) will be swapped with the smallest number in sub-array [ind+1:n] (call this number v2) such that v2 > v1, then subarray [ind+1:n] is sorted in ascending order, sub-array [1:ind-1] won't change, resulting in p(i+1).We have 3 cases here:1) ind >= j, then all the changes will happen within the sub-array [j:n] to get p(i+1), so prefix of length j-1 is same in p(i) and p(i+1), so you are sure this suffix || prefix should be added to answer.2) indj-1). So the prefix of length j-1 has sum in p(i+1) < than that of p(i) and this suffix || prefix shouldn’t be added to the answer.3) If ind==j-1, then prefix in p(i+1) will have greater sum (as v1 is swapped with v2), and this suffix || prefix also shouldn't be added to answer.To conclude, our answer for every suffix of length L (for L from 1 to N) is the number of suffixes of length L which are not sorted in descending order = n! – nCL * (n-L)!. Add 1 at the end to account for p(n!).
 » 21 month(s) ago, # |   +9 I was frustrated seeing so many people solve D quite fast. But What!? OEIS!? Thanks a lot to let me know such a great thing!
•  » » 21 month(s) ago, # ^ |   0 Actually, I tried to search it in OEIS but couldn't find the solution.After thinking for a while, realized it was just counting how many preffix — suffix combinations would exists and came up with it. :P
•  » » » 21 month(s) ago, # ^ |   +2 It's on OEIS as the difference dif(i) = i! * i — ans(i)
 » 21 month(s) ago, # | ← Rev. 2 →   +64 I made a submission for problem G which passed pretests with 100 sqrt requests, and then printed the answer. After the limit was put in place, it still showed as passed presets, but it failed systests on test 1. Is there anything we can do about this? The problem statement says 100 requests, and printing the answer doesn't seem to be a request.The submission is here: 47750364
•  » » 21 month(s) ago, # ^ |   +33 Hi, I'll handle it in the best way. Right now I'm fixing erroneous ILE verdicts for this problem.
•  » » » 21 month(s) ago, # ^ |   +6 Thanks Mike!
•  » » 21 month(s) ago, # ^ | ← Rev. 2 →   +12 I'm investigating your issue. I'll keep you posted.UPD: This is a mistake on our side. After rejudging you get AC.
 » 21 month(s) ago, # | ← Rev. 4 →   +12 Maybe I should actually read the wikipedia link that was given in the problem statement E instead of wondering where everyone got the solution from.
 » 21 month(s) ago, # |   +5 in problram F:3 1 1 1 GWLshouldn't it be 5+3+1=9?no, it's 2.5+0.5+3+1=7I didn't even realized can fly half meter until someone told me.Watch problem again, The duck looks at me like look at a retarded : |
 » 21 month(s) ago, # | ← Rev. 2 →   +86 After long struggle with Python3 and bugs, my 2018 sadly ends withMy solution rquires division over big integers. However I have no template for it, so I tried to implement it using C++ first, after some time I changed my mind. Because of unfamiliar with Python, I spent long time coding, thinking about many things about language rather than the problem(like is there any functions like std::unique()?). Oh it's really a terrible night for me.Well I didn't mean stop writing problem, I think the problem is a good problem but it's harder for people only using C/C++, compared with those are familiar with Java or Python.
•  » » 21 month(s) ago, # ^ |   0 Maybe throw them into a set using list(set(x)), not sure if this will work for your application?
•  » » » 21 month(s) ago, # ^ |   0 Seems work, thanks!
 » 21 month(s) ago, # |   -17 Who is the setter of problem B? The statement is not clear properly. Also a long boring story. I believe many people hate this type of statement. :3
 » 21 month(s) ago, # |   -8 Why do I see legendary grand masters with ratings less then 1400? Is this a glitch? Someone please explain.
•  » » 21 month(s) ago, # ^ |   +5 It's a feature on Codeforces during the holidays. You can change your color and even name.
•  » » » 21 month(s) ago, # ^ |   +5 Thanks.
 » 21 month(s) ago, # |   +38 A duck comes to another duck to 'duck' lmao
•  » » 21 month(s) ago, # ^ | ← Rev. 2 →   +18 For what purpose does a duck duck with another duck I wonder? ;_;
•  » » » 21 month(s) ago, # ^ |   +23 And I wonder that this duck travelled 1017( = 1012 * 105) meters over lava and what not just for a few seconds of ducking :D
•  » » » » 21 month(s) ago, # ^ |   +15 Maybe ducking with the chosen duck actually worths the efforts...
 » 21 month(s) ago, # |   +15 47761370Oh come on! TLE 50, for real?? That's , man, it's not supposed to have TLE on !
•  » » 21 month(s) ago, # ^ |   +5 Basically, the problem has an O(N) solution. The editorial mentions O(NlogN) and O(Nlog2N) solutions (which should both pass). But, somehow, N is set to 5 × 105. What's the reasoning behind setting N so large?
•  » » 21 month(s) ago, # ^ |   +3 Tragic tears were shed when I couldn't get my nlogn to pass pretest #18it was a lazy seg-tree so the constant factor was larger but still...
•  » » 21 month(s) ago, # ^ | ← Rev. 4 →   0 Similar to what happened to me. Mine is though. :'(47751545
•  » » » 21 month(s) ago, # ^ | ← Rev. 2 →   0 I resolved my case by changing multiset to vector... 47769849it appears that gathering all elements of multiset by iterators has extremely high constant o:
 » 21 month(s) ago, # |   +21 When will the ratings be updated?
 » 21 month(s) ago, # | ← Rev. 2 →   +13 The moment I saw the solved count of D for the first time, I felt like something wasn't right, and went for OEIS, yet found nothing (I tracked the wrong pattern I supposed). Then 20 minutes later I solved D by a math-inspired dp solution, with a few proofs backing my claim.Then two hours later people told me that D can be OEIS-ed...I don't know what to say regarding my case... :)
•  » » 21 month(s) ago, # ^ |   0 How do you find it on OEIS?
•  » » » 21 month(s) ago, # ^ |   0 I didn't make it to find anything on OEIS. Other people did.If you're asking generally of how to search on OEIS, just input a part of a sequence.
•  » » » » 21 month(s) ago, # ^ |   0 I input the sequence and oeis said not found...
•  » » » » » 21 month(s) ago, # ^ |   0 If it's the sequence of answer with input from 1 to 10, trust me, I tried it and found none as well :(You can look up for other people's comments. They mentioned some other derivative sequences ._.
•  » » » » » » 21 month(s) ago, # ^ |   +8 Actually, the sequence in OEIS has the formula f(n) = n*n! — (solution), so that's why it's hard to find it there. I couldn't find it either :(
•  » » » » » » 21 month(s) ago, # ^ |   0 Basically, I thought about the problem, and it occurred to me that really, what we want to count is the number of ranges that don't work. Ie: N!*N-cnt.And that's indeed what's on OEIS.
 » 21 month(s) ago, # |   +17 Is it rated majk?
•  » » 21 month(s) ago, # ^ |   +21 Most certainly yes. We're just checking some submissions on G.
 » 21 month(s) ago, # |   +18 Out of curiosity, how were the large primes of the form 4k+3 created for test data in G?
•  » » 21 month(s) ago, # ^ | ← Rev. 2 →   0 I think they pick some known big primes public somewhere. Probability checking is not allowed.
•  » » 21 month(s) ago, # ^ |   0 Random + Miller-Rabin.
 » 21 month(s) ago, # |   +8 It's so...disappointment... I used unsigned long long and get Time Limit on pretest 4 for n = 1: for (ull d = 1; d <= n - 2; d++) I shoud just use usual long long, but... loosing 39 points of rating because of such stupid little mistake...
 » 21 month(s) ago, # | ← Rev. 2 →   +8 Good Bye 2018 ok open the contestsolve first problem ok look at rest of problemsit's all math uh oh manage to solve the first 4 through some gift from the math godslose a couple rating but that's expected eh contest extended for 10 minutes what give up while there's 3 minutes left, can't possibly code E from scratchtime to relax after this disaster of a round, go play minecraft1 minute laterC got hacked what
•  » » 21 month(s) ago, # ^ |   +12 You got mathforced
•  » » 21 month(s) ago, # ^ |   -13 The story of your life.
 » 21 month(s) ago, # |   0 3 10 10 50 WGLIn problem F how is the ans 220 for this ? I think it should be 240? Am i missing something? pls help
•  » » 21 month(s) ago, # ^ | ← Rev. 2 →   +10 To fly pass 50 meters of lava, you'll need 50 units of stamina, taking 50 seconds.Going past 20 leftmost meters normally will build up 20 units of stamina, taking 80 seconds.To build up additional 1 unit of stamina, the most optimal way will be swimming in-place within water segment. It's like, from a point in the water segment, you swim to the right 0.5 meters, then swim back to your starting point (or you can choose to start swimming to the left then going back right, the result is still the same). Each unit of stamina stacked costs you 3 additional seconds.You'll need 30 more units of stamina before flying pass the lava, so you'll need 3·30 = 90 seconds for the process of building up stamina.Overall, the answer will be: 50 + 80 + 3·30 = 220.
•  » » » 21 month(s) ago, # ^ |   +8 thank you
 » 21 month(s) ago, # |   +56 Math problem: * exists *Codeforces users:
•  » » 21 month(s) ago, # ^ |   -46 Petition to ban weebs
 » 21 month(s) ago, # |   -30 rename codefoces in mathforces
 » 21 month(s) ago, # |   +52 Tourist beat 2nd place by more than 2000 points. Anyone else thinks this is scary?
 » 21 month(s) ago, # |   +64 I was wondering why rating update is taking so long. Then I noticed that my rating change is 0
•  » » 21 month(s) ago, # ^ |   0 lol
 » 21 month(s) ago, # | ← Rev. 3 →   +2 It was really a GoodBye 2018 Contest Good Job Problems Setters and thanks for Giving me a good feeling as a Competitive Programmer
 » 21 month(s) ago, # |   -29 majk is the worst author.
 » 21 month(s) ago, # |   0 The contest is amazing.
 » 21 month(s) ago, # |   -49 Please stop creating problems.
•  » » 21 month(s) ago, # ^ |   -34 Well, wrong account.
 » 21 month(s) ago, # |   +1 Goodbye 2018! This year I learned much knowledge and made many friends with the ones who also love algorithm and love codes.I think codeforces is a wonderful platform that give we all another home! Hope we all better and better:) Happy New Year!
 » 21 month(s) ago, # |   0 In Python for C question, return t + (t*(t-1)*d)/2 gives correct answer but, return (t/2)*(2 + (t-1)*d) where t is the number of terms in AP and d is the difference.. gives wrong answer on testcase 18. Can anyone explain this please?
•  » » 21 month(s) ago, # ^ |   +1 If t is odd then t/2 will round off to nearby value in second equation but it will not in first equation as either t or t-1 would be even.
 » 21 month(s) ago, # |   0 I see many of the comments referring that D can be easily solved with OEIS. Can someone explain what is it and how to use it?
•  » » 21 month(s) ago, # ^ | ← Rev. 3 →   +3 https://oeis.org/A sequence encyclopedia. In problem D you're given a N, if you assume the answer is a known sequence then you can brute force the first 10 elements of the sequence, and then search it on OEIS. If it's a known result then the website is going to provide you with a formula to calculate the i-th term of the sequence, i.e. the answer to the problem.In this case the problem itself wasn't on OEIS, but the diference between every interval (n! * n) and the answer for the problem, call it ans(n). If you brute force the solutions for the first 10 n or so, i.e. ans(1), ans(2), ... ans(10), you can look up the sequence of the difference dif(n) = n! * n — ans(n) on OEIS and get the formula that solves the problem.If the website gives you some formula f(n) to calculate dif(n), then then answer to the problem will be ans(n) = n! * n — f(n), derived from the previous equation.This is the difference sequence i found on OEIS: https://oeis.org/A038156This is the one i used, which is the opposite of the previous one: https://oeis.org/A166554The second link provides you with the formula "a(0)=1, a(n) = n*(a(n-1)-1) for n>0", so the answer you would be looking for is n! * n + a(n), since i said it's the opposite to the actual sequence, i.e. a(n) = -f(n)Don't forget to include % MOD when calculating everything on the implementation.
•  » » 21 month(s) ago, # ^ |   0 Well, it's better not to use it ;) Give some time on it's mathematics to see how overlaps between two permutations contain all the numbers (thus, the same sum), and you will yourself derive what's needed! Sample cases for the rescue, verify your formula for 3 and 4!
•  » » » 21 month(s) ago, # ^ | ← Rev. 2 →   +4 "How to do X?" "Don't do X, do Y" Stack Overflow in a nutshell
 » 21 month(s) ago, # |   0 Can anyone help me understanding the approach of C? I am a beginner.
•  » » 21 month(s) ago, # ^ |   0 only divisor(k) of N can be used and then it's a Arithmetic progression for 1 to n-k-1 by difference k
 » 21 month(s) ago, # |   +8 Huh, some specialist took the third place.
 » 21 month(s) ago, # |   -18 Good luck & high rating!
 » 21 month(s) ago, # |   +1 I am so happy to be a specialist after goodbye 2018.
 » 21 month(s) ago, # | ← Rev. 2 →   0 Case 7 of F is: 1 9 WJury's answer is 18. Can someone tell me how this is possible? The best option I can find is 19.[Solved] swim 4.5 meters and fly 4.2, 4.5*3 + 4.5 = 18