### MotaSanyal's blog

By MotaSanyal, history, 14 months ago,

Hello everyone!!

Consider the Fitting Shelves Problem

The solution : We can consider all multiples of "m" less than equal to "w" to find the minimum remaining space.

My claim : We only have to consider the highest or second highest multiple of "m" to find the minimum remaining space.

Actually I have not been able to prove this but it works correctly on most of the inputs. So, any prove as to why this will work correctly or any contradictory test case that fails with this approach will be highly appreciated.

• 0

By MotaSanyal, history, 20 months ago,

Hello Everyone! I am stuck at this problem. I would highly appreciate if somebody explains me how the approach to this problem.

P.S. : This problem doesn't have an editorial yet.

• -2

By MotaSanyal, history, 20 months ago,

Hi everyone!

I was trying to solve this problem which came in last year ICPC Gwalior-Pune Onsite Round.

My approach :

I first checked whether C is present either in A or in B, if so, then answer will be length(A) + length(B) Otherwise , found the longest prefix of C that occurs as a suffix of A (say, X) and longest suffix of C that occurs as prefix of B (say, Y). Then if X+Y <= length(C), answer will be length(A) + length(B) + (length(C) — (X+Y)) , else if X+Y > length(C), then answer is length(A) + length(B) + (length(C) — max(X,Y)).

The verdict I am getting is Wrong Answer. Can anyone please point out where am I going wrong?

• +5

By MotaSanyal, history, 23 months ago,

Hello everyone ! It would be nice if anyone helps me with the solution to this problem — Constrained GCD Array

Problem Source — Codenation Hiring Test

• -9

By MotaSanyal, history, 23 months ago,

Hello everyone ! It would be nice if anyone helps me with the solution to this problem — Even Paths

Problem Source — Codenation Hiring Test

• +4

By MotaSanyal, history, 2 years ago,

Hello everyone. It would be nice if anyone helps me with the solution to this problem — Integer Expression

Problem Source : TCS Codevita 2018