A candidate who gets 30% of the marks fails by 50 marks. But another candidate who gets 45% marks gets 25 marks more than necessary for passing. Find the number of marks for passing?