This contest (#91) seriously proved to be a nightmare.
I solved all three problems and each of them failed because of a really silly mistakes.
First one failed coz I forgot to mention a divisor 477 and 747 and my solution was hacked.
Second one again misread the statement and included a useless condition for -1 and solution failed on pretest
Third one was the silliest where I made a mistake of the constraints and counted the possible values only upto 9 digits instead of 10.
So couldn't submit even a single correct submission and ratings fell.
"Learned new lesson the hard way..."