Truck Tour

Cerinta completa Suppose there is a circle. There are petrol pumps on that circle. Petrol pumps are numbered to (both inclusive). You have two pieces of information corresponding to each of the petrol pump: (1) the amount of petrol that

Triplets

Cerinta completa There is an integer array which does not contain more than two elements of the same value. How many distinct ascending triples () are present?  Input format The first line contains an integer, , denoting the number of

Tree Coordinates

Cerinta completa We consider metric space to be a pair, , where is a set and such that the following conditions hold: where is the distance between points and . Let’s define the product of two metric spaces, , to

The crazy helix

Cerinta completa Natural numbers from 1 to N have been placed in an increasing order over some helix ( a circular structure ). When the helix starts rotating, it is easy to find out The position of a given number