problem link:https://mirror.codeforces.com/contest/1352/problem/E
sol link with vctor :https://mirror.codeforces.com/contest/1352/submission/214450956
sol link with map :https://mirror.codeforces.com/contest/1352/submission/214450292
your valuable opinion will surely help others who's are like me. and if does not make any sense than please comment section is available, i will delete it.