Exercises and problems in Informatics
Please read The Conditions of the Problem Solving Competition.
I. 10. Suppose we know the positions of N sticks placed onto a field. Our aim is to encircle the area these sticks occupy with a single rope from outside. (Of course, in general not all sticks will be touching the encircling rope.) Write a program that reads the number N, and both coordinates x and y of each of the N sticks, then prints the length of rope needed to encircle the area. (10 points)
I. 11 Write a program that simulates the orbit of a planet around our Sun. The Sun is to be placed in the middle of the screen, its position is fixed throughout the simulation, and its mass is denoted by N. We know the instantaneous position (X,Y) of the planet, its mass B, further its velocity vector V (perpendicular to the straight line connecting the Sun and the planet). The program should compute the position of the planet in each time step T, according to its original position, velocity vector and the forces acting on it. Your program should read the values N, X, Y, B, V and T, then draw the orbit of the planet. (10 points)
I. 12. Numbers having very many digits (e.g. 100) can not be added together or multiplied by Excel, therefore one should look for an alternative solution. These large numbers can be represented, for example, by writing only one digit into each cell, however, addition and multiplication should be devised for numbers of this form. Prepare a sheet to add and multiply two numbers which have been entered into the first two rows, and having at most 100 digits--one digit per cell. The product can not have more than 100 digits either. During the solution of the problem, you are only allowed to use the first seven rows and 201 columns of the sheet. The following example shows a solution for numbers having at most 10 digits: