Function to calculate maximum capital obtained after choosing at most K projects whose capital is less than the given cost of projects
static int maximizedCapital ( int K , int W , int profits [ ] , int capital [ ] ) {