• Study Materials
    • InfyTQ Archive
    • Infosys Archive
    • TCS Archive
    • Accenture Archive
    • AMCAT Archive
    • Capgemini Archive
    • Cisco Archive
    • CoCubes Archive
    • Cognizant(CTS) Archive
    • Deloitte Archive
    • DXC Archive
    • Goldman Sachs Archive
    • Hexaware Technologies Archive
    • LTI Archive
    • MindTree Archive
    • Virtusa Archive
    • Wipro Archive
  • Interview Preparation
    • C Interview Questions
    • Data Structures Interview Questions
    • DBMS Interview Questions
    • HR Interview Questions
    • Java Interview Questions
    • Operating System Interview Questions
    • Python Interview Questions
    • SQL Query Interview Questions
  • Tutorials
    • Node.js Tutorial
    • Express.js Tutorial
    • Python Tutorial
  • Programming
    • C Programming MCQs
    • C Code Snippets – Output Questions
    • Python Code Snippets – Output Questions
    • Java Code Snippets – Output Questions
  • Aptitude
    • Verbal Ability for Placements
CODE OF GEEKS

We at CODE OF GEEKS, aim at providing best and quality content for our users at no extra cost.

    • Study Materials
      • InfyTQ Archive
      • Infosys Archive
      • TCS Archive
      • Accenture Archive
      • AMCAT Archive
      • Capgemini Archive
      • Cisco Archive
      • CoCubes Archive
      • Cognizant(CTS) Archive
      • Deloitte Archive
      • DXC Archive
      • Goldman Sachs Archive
      • Hexaware Technologies Archive
      • LTI Archive
      • MindTree Archive
      • Virtusa Archive
      • Wipro Archive
    • Interview Preparation
      • C Interview Questions
      • Data Structures Interview Questions
      • DBMS Interview Questions
      • HR Interview Questions
      • Java Interview Questions
      • Operating System Interview Questions
      • Python Interview Questions
      • SQL Query Interview Questions
    • Tutorials
      • Node.js Tutorial
      • Express.js Tutorial
      • Python Tutorial
    • Programming
      • C Programming MCQs
      • C Code Snippets – Output Questions
      • Python Code Snippets – Output Questions
      • Java Code Snippets – Output Questions
    • Aptitude
      • Verbal Ability for Placements
CODE OF GEEKS
CODE OF GEEKS
  • Study Materials
    • InfyTQ Archive
    • Infosys Archive
    • TCS Archive
    • Accenture Archive
    • AMCAT Archive
    • Capgemini Archive
    • Cisco Archive
    • CoCubes Archive
    • Cognizant(CTS) Archive
    • Deloitte Archive
    • DXC Archive
    • Goldman Sachs Archive
    • Hexaware Technologies Archive
    • LTI Archive
    • MindTree Archive
    • Virtusa Archive
    • Wipro Archive
  • Interview Preparation
    • C Interview Questions
    • Data Structures Interview Questions
    • DBMS Interview Questions
    • HR Interview Questions
    • Java Interview Questions
    • Operating System Interview Questions
    • Python Interview Questions
    • SQL Query Interview Questions
  • Tutorials
    • Node.js Tutorial
    • Express.js Tutorial
    • Python Tutorial
  • Programming
    • C Programming MCQs
    • C Code Snippets – Output Questions
    • Python Code Snippets – Output Questions
    • Java Code Snippets – Output Questions
  • Aptitude
    • Verbal Ability for Placements

Hedger

  • January 15, 2022
  • pulkitverma27
  • 0


Problem Description

A hedger is an investor who takes steps to reduce the risk of investment by doing appropriate research and analysis of stocks. Assume that you are a hedger.

Now you have been given some parameters based on which you have to analyse and pick the correct stocks. You have been assigned a fund that you have to manage in such a way that it should give maximum returns.

According to your research you have a list of stocks for which you know the corresponding profit percentage that you can earn within a certain horizon. Being a hedger, you don’t want to pull all your eggs in one basket. That’s why you have decided the upper limit in terms of quantity that you will buy.

Given number of stocks, the upper limit on quantity per stock, the amount to be invested, the list of stock prices and list of expected profit percentages, calculate the maximum profit you can make.

Note: All computations should be up to two digits after the decimal point.

Constraints

0 <= A <= 10^6

1 <=K <= 100

1 <= N <= 10^4



Input

First line contains three space separated integers N K A where N is number of stocks you are interested in, K is maximum quantity of any particular stock you can buy and A is capita; amount you have.

Second line contains N space separated decimals denoting the prices of stocks.

Third line contains N space separated decimals denoting the profit percentages corresponding to the index of stock prices.

Output

Print the maximum profit that can be earned from the given amount, rounded to the nearest integer

Time Limit

1

Examples

Example 1

Input

4 2 100

20 10 30 40

5 10 30 20

Output

26

Explanation

Here, we can select only two quantities of any stock that we choose to buy. We choose to buy stocks which are priced at 0 and 40 respectively before we exhaust our capital. The maximum profit that can be earned

Profit = 2*((30*30)/100)+1*(40*20)/100)=26



  • Previous Strings in Python, Slicing and Basic Operations on Python Strings
  • Next Skip Station

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Advertise with us

Python Tutorial

NodeJS Tutorial

Express.JS Tutorial

Study Materials : Company Wise

Verbal Ability for Placements

CODE OF GEEKS

Subscribe to Newsletter

CODE OF GEEKS

Learn | Code | Achieve

Reach us

[email protected]
We at CODE OF GEEKS, aim at providing quality content to our users at no cost.
CODE OF GEEKS

Important Pages

About us
Advertise
Privacy Policy
Terms and Conditions
Refund Policy
Contact us

Placements – Study Materials

TCS NQT     Wipro     CapGemini
Accenture     MindTree     CTS
DXC     Hexaware Technologies     AMCAT
CoCubes     Goldman Sachs     Dell
Cisco     Deloitte     Virtusa     LTI     Infosys   

Tutorials

Python
Node.js
Express.js
Golang

Recent Posts

Strings in Go and its basic operations
  • August 11, 2023
Introduction to Functions in Go programming
  • August 11, 2023

Copyright @ CODE OF GEEKS. All Rights Reserved.