# Going to office | hackerearth practice problem solution

__problem:-__

- Online taxi: It can be booked by using an online application from phones
- Classic taxi: It can be booked anywhere on the road

The online taxis cost

*${O}_{c}$*

for the first

*${O}_{f}$*

km and

*${O}_{d}$*

for every km afterward. The classic taxis travel at a speed of

*${C}_{s}$*

km per minute. The cost of classic taxis are

${C}_{b}$,

${C}_{m}$, and

*${C}_{d}$*

* _{ }*that represents the base fare, cost

*for every minute that is spent in the taxi, and cost for each kilometer that you ride.*

You are going to the office from your home. Your task is to minimize the cost that you are required to pay. The distance from your home to the office is D. You are required to select whether you want to use online or classic taxis to go to your office. If both the taxis cost the same, then you must use an online taxi.

Input format

- First line: Single integer
that denotes the distance from your house to the office

- Next line: Three integers
*,**${O}_{f}$**${O}_{d}$*_{ } - Next line: Four integers
,_{ }*${C}_{b}$*,_{ }*${C}_{m}$*, and_{ }*${C}_{d}$*

Output format

If you select an online taxi to travel, then print a string ‘Online Taxi‘. Otherwise, select ‘Classic Taxi‘. You can print this string in a new, single line.

Constraints

1

*$D,\text{}{O}_{c},\text{}{O}_{f},\text{}{O}_{d},\text{}{C}_{s},\text{}{C}_{b},\text{}{C}_{m},\text{}{C}_{d}$*

$\le $

10^{9}

__solution:-__

__Recommended post:-__

__Hackerearth Problems:-__

- Very Cool numbers | Hacker earth solution
- Birthday party | Hacker earth solution
- Most frequent | hacker earth problem solution
- program to find symetric difference of two sets
- cost of balloons | Hacker earth problem solution
- Chacha o chacha | hacker earth problem solution
- jadu and dna | hacker earth solution
- Bricks game | hacker earth problem
- Anti-Palindrome strings | hacker earth solution
- connected components in the graph | hacker earth data structure
- odd one out || hacker earth problem solution
- Minimum addition | Hackerearth Practice problem
- The magical mountain | Hackerearth Practice problem
- The first overtake | Hackerearth Practice problem

__Data structure:-__

- Program to find cycle in the graph
- Implementation of singly link list
- Implementation of queue by using link list
- Algorithm of quick sort
- stack by using link list
- program to find preorder post order and inorder of the binary search tree
- Minimum weight of spanning tree
- Preorder, inorder and post order traversal of the tree

__Key points:-__