Hey everybody!

We (MagentaCobra, Tlatoani, golions, qlf9) are super excited to invite you to take part in Codeforces Round 655 (Div. 2), which will happen on Jul/11/2020 18:05 (Moscow time). *Please note the unusual start time*. The round is rated for users with rating strictly less than **2100**, although higher rated users are more than welcome to take part out of competition.

Huge thanks to those who helped make this round possible:

- Tlatoani, golions, qlf9 for creating problems and preparation
- antontrygubO_o for r̶e̶j̶e̶c̶t̶i̶n̶g̶ ̶m̶o̶s̶t̶ ̶o̶f̶ ̶o̶u̶r̶ ̶p̶r̶o̶b̶l̶e̶m̶s̶ coordinating our round
- gamegame, dorijanlendvaj, thenymphsofdelphi, aryanc403, Ari, alireza_kaviani, KonaeAkira, Mn619, AmShZ, smax, galen_colin, cuber_coder, gabrielwu, nvmdava, 300iq, Monogon, Mohamed.Sobhy, 244mhq, pajenegod, Devil, Osama_Alkhodairy, Mohammad_Yasser, taran_1407 for testing and providing invaluable feedback
- MikeMirzayanov for Codeforces and Polygon platforms
- You for participating in our contest :)

There will be **6 problems** and **2 hours** to solve them.

We really hope you enjoy our first contest!

**UPD:** Scoring Distribution:

**500—1000—1500—2000—2500—3000**

**UPD:** Due to long queue, the round will be unrated. We're extremely sorry this happened, and all of us are sad about it. We hope you will at least enjoy the problems.

**UPD:** Editorial

Auto comment: topic has been updated by MagentaCobra (previous revision, new revision, compare).No score distributions until now?

Once score distribution was published 2/3 hours before.but its 32 hours more left why are you hurrying!

What do you even use score distributions for? Is there some op preparing/strategy based on score distribution I am unaware of?

Well usually people go from the easiest to the hardest. But for example if both E and F have the same score, you might want to read both of them first and then decide which one to solve.

What order to read problems can be decided right before the round starts. You don't need to know 32 hours in advance

That's true I suppose. I was just answering the question of why you even need to know the scores.

Feel sorry for people who got their best rank in this contest (like me). Sob :(

And me. More sob :(

Hope you all enjoy the problems :)

Definitely, We will... :)

Hoping the same qlf9

xD how much problems did he rejected :)

You'll see after we post the editorial :P

wtmoo global round 9 was awesome

except the points distribution.

god damn it I was posting nearly same meme here u did it before me

Muahahahahah you need way more than that to take me down

I was about to post exactly the same meme. xD

Hoping to see good and interesting problems rather than only maths

.

I think you shouldn't put memes in a language other than English or Russian, many of us don't understand it.

You mean: "I think you shouldn't put memes"?

Or maybe only in English,many of us don't understand Russian too.

No offense, but do you think it is decent to say that in a website maintained by a Russian university? Why "should" Russian users spend time translating their memes to let you understand?

This is not about wasting time, I mean memes are for fun... if someone is spending his time in making it then it's better if everyone understand it.

P.s: I don't think Russian gets a special power if this website is maintained by Russian university.

It is saying " Rating double in 25 days "

You forgot to mention that score distribution will be updated later

I hope C and D will not be too easy. Bring back the glory of div2C.

Hoping to see myself in Cyan after this round.

me too!

me too !!!

Others 2 failed but me still cyan :|

Damn broo

I have to miss a Div.4 round for this :(

[Deleted]

Hope to become LGM this contest!

Why there is no "as a tester" comments until now ??

As a tester, this contest is so good that we don't want to trash it with spam comments

As a tester, I second that.

As a tester, I third that. :P

Very good decision.

it was trashed due to other reasons...

But we're not getting emojis and stickers and gifs either. :(

Those were just suggestions which no one took seriously. :(

As a tester, the round is unrated.

Waiting for this contest, Contest in a gap of seven days (Global Round 9 was on the 4th of July). Excited Can't-Wait!

Wow! This seems like a really good contest!!!!! Out of curiosity, is there any advice you would give a

new and inexperienced:P coder? In particular, I am very interested in what qlf9 has to say.Interesting to see four author from four different country. Finally a round which will not called some countryan round.

I am little bit curious to know how you four people from four different country get together to prepare the round?

I think they studied in the same school, although I'm not sure

one day

CODEFORCESwill renamed toMONGONFORCESAnd people will thank monogon and polygon XD

Where are the tester comments, how will I know if the problems are interesting :P

i hope that the statement of Problems be to short like Announcement :XD

Long time no see :v

I hope we all will get maximum increase in rating in the first contest of MagentaCobra

Hope to have negative rating after this contest.

And Surely you can do it ..I checked your profile,, you just use this id for doing this :D

so many unnecessary blog in recent action !!

Hard work & up your rank

Create a meme to increase your contribution

Our college decided to dump on us every deadline of submission between 8th-10 July and I still can't believe how well it fit in the long gap between after back-to-back rounds!

Please upload the scoring/weightage distribution of the problems

Wait bro..They will update it before contest..

Me watching more and more contests coming after each other!

[Your text to link here...](

Sorry for the meme :( I just replied his comment :(

Now the meme is true AF.that man is also like 655 div -2 who can't help mr bean!!

Every time I read comments .There are lots of memes and some of these are motivating to take part in round .

my first contest need some suggestions??

Did you mean can I have any suggestions?

yes

leave it it is horrifying!!

Turn back while you still can..Once you are in there's no going back :P

If you haven't submitted you can go back

Just read the first 2 Questions(may be 3 or 4 even) and try solving them..Believe me,it will be fun solving if you are a beginner.:D

Okk lets see in the contest.

Seriously!

I hope to become expert in this round :)

OOPS

Go Colonials!

Go wassim.omais!

0_IQ_DOG Your privilege, lack of empathy, and disregard for others is astounding.

wassim.omais Your racism and privilege are showing. Go check them.

I believe we should cancel the term Colonials. It honors our Founding Fathers, which were some of the most racist men in history. #CancelTJHSST.

I agree. The multitude of racists among the Founding Fathers is unacceptable. Anyone who says otherwise is privileged and racist. #CancelTJHSST

AkshajK I agree with 0_IQ_DOG. Take down your racist comment. Don't be complicit in honoring those terrible men. Let's get TJ renamed to Northern Virginian School!

Founding fathers were colonials, hitler was human should we cancel the term human?

yes... after all, I am an ogre, so I would be obliged to endorse such a cancellation.

i am simply a zombie, so such a cancellation works fine for me.

Hope there will be interesting problems. Good luck and High rating.

ummm what is meant by cyan etc etc. i am new here and don't know much about the slangs used here !!

cyan refers to color given to specialist(rating 1400-1600)

is your score the same as your rating? i'm new to this website so idk how it works :/

No,you will be given a rank based on your total score and your rating will increase if you performed better in comparison to the rating you already have.It is not like if you have earned total 2000 points then your rating will become 2000 !!

![ ]()

When you want something, all the universe conspires in helping you to achieve it.

Thanks for your support guys! I am overwhelmed.

A few days ago, my contribution was +1, now it's 0, how to keep or rise my contribution?

Keep constant by no comment/write blog And rise/decrease contribution by comment/write blog according to your get upvotes/downvotes...

hopefully now it's 1 again :D

Unusual start time nowadays have become the new usual start time.

wow! the one who is no.2 contributor is coordinating this round!!! I think we will get problems that we will enjoy to the fullest

Hi I am a beginner.I want to ask that at least how many questions one should solve in a Div2 contest to avoid rating decrement.

In your rating range two problems.. I guess even if you solve just 1 but fast.

Looking at your current rating two questions should definitely do the job and sometimes, if the second question is little bit tough then solve the first question quickly to avoid rating decrement.

24k+ participants already!

Isn't the queue very long?

Yes

## queueforces

why does printing odd numbers in first problem throw a wrong answer??

discuss after contest please..

over 75 pages of submissions in queue...

that's all(

waiting for hundreds of "queue forces" commentaries :)

Waiting and Waiting..Really Annoying !!!

Only to find that its a WA on test 2

Signing a long queue like a "long queue" is genius :)

Can we have this contest unrated, please?

Yet Another Queue Problem

(i am crying): what is going on codeforces?((

i submit problem number B 10minutes ago..it's still in queue

I think this round will unrated!!!

After a week of waiting...

More Than 125 page of queue

my code had been in queue for 15 minutes, I think this round will be unrated

10 minute queue is definitely not reasonable and round should be unrated..

168 pages of queue :(

already 15 mins now still in queue

I don't want to look like I am overreacting, but I think that most of the beauty of CF rounds comes from the instant feedback and, as you can notice, this rounds has a big lack of such feature. Therefore, in my opinion, this round should become unrated.

Shoot,I had been waiting for about 10 minutes to get WA on test 1

I got 3 WAs on B problem. Think about my waiting time

Same

Same, contest is ruined and should be unrated I think

you could've checked it on your ide first

Some problems have multiple answers correct also

and there have people who had been waiting for about 10 minutes to get compilation error(

That's on you, should've compiled on your local machine

Is it gonna be unrated ?

IGI was waiting for this contest since 1 week but such queuing issue is really annoying

Okay, I give up! It would be ridiculous if this round is rated!

QUEUEFORCESWelcome to Queueforces

QueueForces

Also the my submission page -_-

The questions are really interesting but the long Queue ruined the contest.

submit a solution and then refresh and refresh for 15 minutes+ to see that solution passed or not or even Wa on test 1..What the hell -_-

The contest should be unrated.

As per the announcement, contest should go unrated if the queue goes for more than 15 minutes, right? I could see that it is 20 minutes long right now. So, is it going to be unrated?

20 minutes and still in the queue..

Right now the queue is 16 minutes+. Disappointing.

Will it be unrated?

Queueforces again :(

Queue reached 15min. Is it rated? NO! It's unrated!

YEEEEAAAAH ... round unrated !!

It is sad that round is unrated. btw Problems were interesting.

How to solve B ..

one of a or b has to be a factor of n in optimal answer

Let the smallest prime factor of n be r.

Answer will be n/r and (r-1)*n/r

Im supposed to be pupil in this round. Sad

Queues Again Came Up , I again fear Monogons Next Round!

Sorry, because of the long queue the round is unrated.

Was literally doing good in this one, btw nice questions

Testcases were weak for C and moreover announcement for A actually gave out the answer.

How to solve C

Contest might be unrated ,but still it is running.Ask your question related to answers after the contest.

I guess it's better to solve problems after contest else one has to wait 25+ min just to get verdict

Just curious, what wrong idea was able to pass due to the weak pretests of C?

9

3 1 2 6 4 5 9 7 8

For this test case answer is 1. In my code I had the condition when the max element till now becomes equal to the index, I was incrementing my answer by 1 or 2. My code will print 3 for the test case mentioned and it passed the pretests.

I forgot about test when "unsorted" part is in the middle

Like this4

1 3 2 4

Really stupid that their didn't make $$$t \leq 1000$$$ and made second case all permutation of 6... It is really easy to generate and I think that would reduce number of failed codes from 600 to around 20...

Great! waited a week to participate and then it's become an unrated round

It's like going to Pierre's on Wednesdays

Hope we won't have the same issue in tomorrow's contest.

## BePositive

Hope its date is not extended.

Very interesting tasks and once again unrated.

It's sad that contests with nice problems are getting unrated. First Monogon's round, now this.

To be honest, I feel bad for the authors.

Today

hackerearthandcodeforcesbecame the same :)hackerearthis way behind in terms of problem qualityProblemset was quite intersting, yet unrated. :3

I have really enjoyed your problems! I hope to see you in the next rounds as writers :=)

No need to apologize MikeMirzayanov. You have been doing an awesome job. We are proud to have you.

Nice contest after long long time, but it's unrated :(

One hour before contestMe:

Well, good rating to me, contest after a long time.Goes to contest page to registerMe: Oh look, there are so many upcoming contests!

Monogon contest name stands outMe: Lol, when

Monogonmade a contest thelast time, contests this close were plagued with Queueforces. Let's hope it doesn't happen this time.Submit B, redirects to status pageGives up CP and becomes a soothsayer's apprentice...The queue strikes back.

“Mike Awakens”.

Becomes the “Last to Shuteye”.

Leads to the “Rise of the Sleepcoder”.

I thought cf has overcome it queue problem. Last few contests were very nice. Pretests were judged very fast and they were very strong too. Sad about today's contest. Hope things will be fine soon.

In C, is it true that you can sort any permutation in 2 or less actions?

Yes! It's true. :D

Please translate. D:

You submit the solution, but verdict will be given to your grandson Xd

There is this famous TV comedy show in India. In that show during a festival sale, this character who worked in a shop as assistant gave the idea of the offer to shopkeeper-"Let people buy items, we will take money from their grandsons." This meme is based on that line "You solve the question, verdict will be given to your grandsons"!.

Just Want to ask one question to problem setter why you used name

Omkar?At the start of the contest I was like, Did I made any mistake? ...xD

i wrote this mem by words, but i have no upvotes...

We live in a society

When you finally think you gonna reach expert but god has other plans.

After -200 rating in the last 2 contests. This round was going too good for me. Rip rating gain. Lol.

where do u see this delta??

Check this out

Felt lucky that Round #645 was rated even though the queue's long...

The queue is ruining the experience...

To be honest, I feel bad for the authors. Problem were pretty interesting

Why cant the difficulty of A,B,C be increased so there are lesser number of submissions? and i don't think there's much one can learn from the current A B C problems anyways.

maverick16 thats why there is a div1 too. I think the problems were very interesting.

Mike after making changes to the platform:

PS: this is just a meme and I really respect what Mike is doing for the cp community

Photoshop wizard :)

Guys, I am disheartened a lot. I started CP just 3 months ago. I was a noob. Today, before the round becoming unrated my rank was 1260. Delta was +206. It is very rare. I have lost the confidence. What positives should I take from this?

If you have the ability to go +206 this round, you will be able to do so again in future rounds. Just keep practicing and know that you're improving!

The artwork in ur dp seems really cool; can you tell me the source?

same about me. Delta was +238, though it would be lower, had everyone done the problems with usual speed. I suggest you not to worry since in the long run, such things won't matter much. If you really improved your skills, you will get that rating in the next contests.

negative contribution!! XD

u can do good in the next round too, i was also getting enough delta to be in div 1 :)

How many servers are running cf?

I am feeling bad for the problem setters.

Good contest and awesome problems.

I saw somewhere that this is the first contest organised by its organisers. But it seems after looking at the questions that organisers have large experience. So much beautifull,difficult questions i have never seen in any single contest

:)

Cool problems, pity the que blew out of proportion.

Nowadays, Codeforces has become Constructive forces, Missing those days when we were able to find good concepts like binary search, DP, Graph, DSU, etc in problems.

In the past, C, D problems really made me comfortable even when I could not solve them. These days, I feel like C, D problems are usually just some random observations with under 10 lines of code. God, I miss graph problems -_-

Those days are never going to be back, at least not until antontrygubO_o is the coordinator. He rejects 72 problems just to make Codeforces, Atcoder.

It seems that we should slightly increase the difficulty of problem

`A`

, increase $$$T$$$ for the first problems and make fewer pretests for them.It's bad to see round unrated. I have a suggestion for next rounds . I don't know it is right or wrong.

There may be an unrated easy problem (a+b type) 10 minutes before contest starts, and at that time registrations should be closed. It will help in stress testing. If there will be any problem during testing then round should not be hosted.

Anything could happen

duringthe contest, so I don't think it'll help much.Can anyone help me in C? It's giving TLE

Even though it is unrated, contest is still ongoing. Please don’t discuss the problems.

This contest has really good problems and perfectly matches div. 2 status but now it is unrated. let us, Hope, we get some more exciting contests like this one.

I think one should go through this article and understand difference between programming and coding.Programming vs Coding.These cleared many of my doubts between Coding and Programming.

The contest was really awesome, hope to see more from you! :)

[Sorry for the meme. But really disappointed , i missed a important task for attending this]

Stop posting shit memes mf.

Nice Contest! I really liked the problems!

Wear some clothes mf

How to solve D? Thanks in advnce:)

You can choose at most (n+1)/2 elements, and you should choose (n+1)/2 elements because all elements are non-negative. And you can observe that unchosen elements cannot be adjacent.

Then the problem is find n/2 elements which are not adjacent and have smallest sum. DP can solve it. The time complexity is O(n).

I think I am right.

I also thought of the same approach but couldn't figure out which n/2 elements to eliminate from the sum.Could you help a little more on how to do the dp part?

86561722 You can refer to my code. Notice that head and tail can not be chosen simultaneously.

yeye Is it not possible that n/2 elements which contribute to smallest sum, change after one operation(for instance, after smallest element is replaced by sum of its adjacent elements in the very first operation).

Can you give an example? My submission has been accepted.

I see. This approach is global. No need to worry such things.

How to approach question D?

there is a simpler solution. firstly note that we cant have three consecutive elements in a sum. also we can't have two consecutive elements which are not in the sum. also note that we can only have at most (n+1)/2 elements in the sum. so we can simply find the max over the sum of all (n+1)/2 alternating sequences

Though I haven't implemented it , but may be this greedy works. Always try replacing those adjacent is who have maximum value of ai+1 +ai-1-ai. Idk if this works or not.

I think it doesn't work. Try: 1 2 3 3 2. The answer is 7, but your algorithm (if I got it right) gives 6.

I think it gives 7 replace 1 3 array becomes 4 3 2 Repalce 4 3 array becomes 7.

This doesn't match your requirement of "maximum value". Your replacement gives: 3 + 1 — 2 = 2. But if you replace the 4 1 array (remember the array is circular) you get: 2 + 2 — 1 = 3, which is higher.

If the circularity of the array confused you, let's rotate it: 2 1 2 3 3.

Yep Sorry! thus greedy fails for this problem. Only way is to consider all the possible cases through dp.. Thank you for figuring my mistake.

Can someone please help me with approach of B. It's giving TLE in pretests 4

Simply check for each factor.

Time Complexity O(sqrt(n))

Code

Thanks a lot! It was quite easy. I don't know why I couldn't crack it!

Its simple for as we can see for even n ans is n/2, n/2 and for odd n if n is prime then ans is 1, n-1 it is self explanatory. now if n is odd and it is not prime then find smallest prime divisor of n let it is sm(n) so ans is n/(sm(n)), sm(n) it is optimal solution

to find smallest prime divisor refer this

Thanks a lot!

That's completely unfair !!. been for a long time doing bad in contests and when i don't, it's going to be unrated. i am very disappointed.

Waited for 10 minutes for the verdict Wrong answer on pretest 3.

Very beautiful problems; great round! Irrespective of this round being unrated, I enjoyed the problems a lot, so thanks problem-setters!

Nice problems

Would appreciate any help in figuring out the issue with my C submission:

http://codeforces.com/contest/1372/submission/86577996

You can change 1 3 2 4 ---> 1 2 3 4 in 1 operation

If all elements that are out of place form a single subarray, it's also solvable with 1 operation, e.g. 1 2 6 5 4 3 7

Yeah I forgot to consider this. Thanks

Thanks for such a hard competition that must have shown everyone like me that you need more practice. After giving this contest i feels that i started coding yesterday only :(

For question C,i counted number of sets where a[i]=/=i for example if a = {5,4,3,2,1} {5,4} and {2,1} are two such sets so ans = 2, for a ={3 2 4 5 1 6 7} {3},{4,5,1} are two such sets so ans = 2.I failed on pretest 3.Can anyone provide a counter where it may fail.

Try for a = {3,2,5,4,1} , ans is 2. {3,2,5,4,1} -> {4,1,2,3,5} -> {1,2,3,4,5}

look bro maximum answer will never exceed 2 ,according to your technique it will exceed 2. for a={3 2 5 4 6 1 7} {3},{5},{6,1} will become three sets but answer should be 2. in 1st step:-{3 2 5 4 6 1 7}->{5 4 6 2 1 3 7}(taking from position 1 to 6 as sub array) in 2nd step:-{5 4 6 2 1 3 7}->{1 2 3 4 5 6 7}(taking from position 1 to 6 as sub array ) so, the basic point is if number of sets is more than 1 answer will be 2 always Hope u understood..

How to solve D ?? looked like dp to me.

I found a telegram group with over 2400 participants,in which people were directly sharing problem hints and solutions during live contest.Can something be done for this issue?

Share the link I will report it mf! I wonder how participants solve D, C problems quite easily they must be banned.

Here is the group link — CodeForces

Make a blog and tell everyone to report it.

Have you reported?

My solutions for A,B,C,D pending system testing

A) Return all ones

B) The smaller number = A // (smallest prime factor of A)

C) - If already sorted, return 0.

If there is only one subarray with all elements unsorted — return 1

Otherwise, return 2

D) The task is to select (N+1)//2 elements from the circle such that only a pair of elements are adjacent. Procedure:

Rearrange the array by take every alternate element and every other alternate element.

Repeat the array once (since it is circular).

Take the prefix sum (i.e. cumulative sum).

Find the maximum difference of elements (N+1)//2 distance apart.

What was your intuition behind your solution for D?

The editorial has been out https://codeforces.com/blog/entry/79974

During the contest when working on small examples, I realised that you can only admit one adjacent pair. I could not think of a counterexample. So I code it out.

Problem D: What is the problem with iteratively taking the minimum number of the current set?

How do you choose which one to take if there are multiple minimums? Consider the case

`1 1 30 30 20`

, with answer 61: if you take the first number, you can only get 60.Thanks a lot. That completely satisfies my question.

I was puzzled by the same question...Thanks a lot

For multiple minimums occurring together, I choose the one which gives max sum.

For example, consider 8 4 4 5 9. So, we choose the 4 at index 1 because it gives higher sum i.e. 12 than the 4 at index 2 which gives sum 9.

What is the problem in doing this?

The big problem is that this algorithm is greedy, just like the one ReginaFelangi described. I believe that no greedy solution exists for problem D because sometimes you might want to “sacrifice” a little bit in one iteration so that you can get much more in the future.

If you know the structure the correct sequence should have, it's easy to construct a counter-example:

Notice how we'd like to keep both 100 and 90, but they are adjacent. This means the correct answer is to keep

`2 _ 1 _ 100 90 _`

, removing the left 1 (sum = 193), but your heuristic says we should remove the right one because (2 + 1) < (1 + 3).Another way of looking at it is that you would like to remove 9, but 9 = 4 + 5 = 1 + 3 + 5, i.e. that's actually three numbers from the original array!

Yeah I understood the problem with greedy. That's why I wrote my next comment but thanks anyways for explaining so well.

Nevermind. Iteratively taking the minimum is wrong itself.

Hi guys

try these video solution

Problem C I My self was also shocked how can it be sorted so fast

Problem B Explained Math in detail (Good for math lovers)

Problem A Fastest method but if you have fast fingers :) :)

Hope it help

Can someone please let me know why below solution for D doesn't work? Chose the minimum value present currently, replace it by sum of its two adjacent values, do until u r left with only one element.

Can u please tell why can't there be more than 2 special exchanges in C ?

So below are the possible cases: 1) when array is already sorted then answer will be 0

2) If lets say starting and last fews elements are in the exact postion we want after getting sorted, then there will be two possible case:

->all the elements in the middle portion which we need to sort are in different position as of the final required position then we can sort the complete middle subrray in 1 operation.

-> If one or more elements in the subarray are in the same position as after it will be in sorted array then we can just select the middle subarray and first distribute all the elements such that no element is in the same position as they will be after sorting, which will require 1 operation, after that we can just use one more operation and sort middle subrray.

In worst case, you can just select the whole array and make it such that all the elements are in wrong places. After that select the whole array again and sort it. So in worst case, the answer would be 2.

5

4 2 1 2 4

your solution gives 8, optimal is 9

Ahh, thanks makes sense.

consider this test case : 5 1 3 9 10. your output is 19 but the answer is 20. The optimal answer is always in this form : take a node and from the next node take one and leave one. In this example the first node is 9 and from 10 you will take one and leave one so you will take 9,10,and 1 so the answer is 20. you can simply check all possible cases starting from the first node calculating the current choice's sum using prefix sum on parity, which means that if

iis odd then prefixsum[i] is the sum of all odd indices values tilli, arr[1]+arr[3] .. + arr[i]. ifiis even then it's the opposite, arr[0]+arr[2] .. + arr[i].Hume to apno ne loota gairo me kya dum tha, sala vahi contest unrated hua jisme humara predicted rating maximum tha.

D E N I E DAfter knowing the fact that 72 problems were rejected, I am feeling even worse for the authors

[Deleted]

assign min=n+1 after take input(n) ..

-*someone solved A in 1 min*

-I HAD DELTA +228 WHY IS THE ROUND UNRATED

Such a beautiful contest with so good questions, but the unfortunate happened. I feel bad for the Setters and testers and for the participants who did better than their average performance today. But still, thanks for this amazing contest, the problems, at least the one I managed to solve, I found then quite interesting. Hope to see more contests like this.

In problem B , when n = 63 why answer is 9 54 and not 21 42 ??

It is indeed 21 42

The answer is indeed 21 42

look...

And? You are looking at the output, look at the answer, it's correct.

So much lucky today, :p I would get more than 100 minus ratings in this contest. :)

Do not worry, you will get it next time, it's fine.

You are right, edu is waiting for me.

I just published a screencast + commentary of getting 13th on my youtube channel, with solution walkthroughs at the end for people who are interested.