Theatre Square time limit per test 2 seconds memory limit per test 64 megabytes input standard input output standard output Theatre Square in the capital city of Berland has a rectangular shape with the size n × m meters. On the occasion of the city'…
A permutation of length n is an array containing each integer from 1 to n exactly once. For example, q = [4, 5, 1, 2, 3] is a permutation. For the permutation q the square of permutation is the permutation p that p[i] = q[q[i]] for each i = 1... n. F…
A. Again Twenty Five! time limit per test 0.5 seconds memory limit per test 64 megabytes input standard input output standard output The HR manager was disappointed again. The last applicant failed the interview the same way as 24 previous ones. "Do…
N. Forecast time limit per test 0.5 seconds memory limit per test 64 megabytes input standard input output standard output The Department of economic development of IT City created a model of city development till year 2100. To prepare report about g…
Description The Department of economic development of IT City created a model of city development till year 2100. To prepare report about growth perspectives it is required to get growth estimates from the model. To get the growth estimates it is req…
N - Forecast Crawling in process... Crawling failed Time Limit:500MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Submit Status Description The Department of economic development of IT City created a model of city development till year…
Loops are often used in programs that compute numerical results by starting with an approximate answer and iteratively improving it. For example, one way of computing square roots is Newton’s method. Suppose that you want to know the square root of a…