# Tag Archives: C++

## Write a C++ Program for Splitting the Choco Bars Problem

C++ Program for Splitting the Choco Bars   Dholu and Bholu are given chocolate bars which are rectangular shaped.Each chocolate is given a label A, B and C. The chocolate is to be splitted into exactly two pieces in a manner such that: The piece that Dholu has can not contain any chocolate with name… Read More »

C++ Program for Fedor’s Roadmap Navigation Problem Fedor is a research scientist, who has recently found a roadmap of Ancient Berland. Ancient Berland consisted of N cities that were connected by M bidirectional roads. The road builders weren’t knowledgable. Hence, the start city and the end city for each road were always chosen randomly and… Read More »

## Find the probability of getting a 1-bit number ?

Find the probability of getting a 1–bit number ? Find the probability of getting a 1-bit number after the following procedure is followed: Initially a number x is chosen at random in a given range .After this we again choose a bit from x randomly? Find the expected number of bit 1s if we randomly… Read More »

## Remainder Quotient Problem – Find all the combinations between n and m

Remainder Quotient – Find all combinations between n & m Andrew and James are best friends and are fond of puzzles. Andrew challenged James to solve a mathematical problem and promised him to pay \$100 if he gives the correct answer. The problem is that James will be given T pairs of (n,m). Now, all… Read More »

## Gangs of Dholakpur – Cumulative Weight Problem

Gangs of Dholakpur-Cumulative Weight Problem In the school of Dholakpur the gang having the greatest number of cumulative weight dominates. Currently Kalia’s gang dominates with cumulative weight M.Since, Kalia’s gang is abusive so, Bheem decides to end this and establish peace in the school. Bheem can only defeat Kalia if the cumulative weight of his… Read More »