How do i solve this problem

I have this problem that i’m trying to solve its been over a day and it is very hard to solve

so the problem statement goes like this