⌘K
Flycodx

NSP Merit Rank Scholarship Bracket

NSP Merit Rank Scholarship Bracket

MediumBinary Search100% accepted

NSP scholarship portal in Pune calculates awards by merit rank. Rank brackets: 0-100 (₹50000), 101-500 (₹30000), 501-1000 (₹15000), 1001+ (₹5000). Ravi ranked 650. Find his scholarship.

Approach

Given sorted rank boundaries and Ravi's rank, find scholarship amount for corresponding bracket.

Input

rank=650 brackets=[100,500,1000] amounts=[50000,30000,15000,5000]

Output

15000
solution.py
Loading editor...
Test 1
Test 2
Test 3

Press Run to test your custom input, or Submit to judge against all test cases.

Sign in to continue

Create a free account to run code, submit solutions and track progress.

  • Free forever — no credit card
  • 10+ languages with live execution
  • Points, streaks & leaderboards
Auto Save OnLn 1, Col 1Spaces: 4UTF-8LFPython 3