Programming Basics Exam - 21 February 2016
Здраейте!
В Judge разгледах задачите за изпит, който се е провел на 21.02.2016г., но на Problem 01 и на Problem 03 не ми отваря условието на задачите.
Някой друг с подобен проблем?
Здраейте!
В Judge разгледах задачите за изпит, който се е провел на 21.02.2016г., но на Problem 01 и на Problem 03 не ми отваря условието на задачите.
Някой друг с подобен проблем?
Долу в ляво на монитора ми се появява zip файл.Трябва да се отвори.Ако си отворил доста такива zip файла може просто да не се вижда.
Zip файла го отварям, но като влезна във zip-a не ми отваря Word документа, изписва ми някаква грешка. Затова се чудя дали и при други дава грешка. Грешка има в само в задача 1 и 3 .Другите се отварят без проблеми.
При мен всичо е ок!
Problem 1 – Hungry Garfield
You know that Garfield is a very lazy cartoon cat that is always hungry and, just like you and me, likes Italian food very much. His favorite dishes are pizza, lasagna and sandwiches. John is a talented cartoonist and sometimes he goes on a business trip here and there and Garfield has to stay home alone and take care of himself. Every time John is away for a long time he gives Garfield some money to make sure he is well fed. Garfield is a very smart cat, he can talk, he can buy pizza himself, but he doesn’t care about calculations, because cats don’t care about anything else but food and a good nap. He asks you to make a simple program that calculates whether the money John gave him would be enough to eat all the pizzas, lasagnas and sandwiches he wants.
You are given the sum of money (in dollars) that John gives the prices of pizza, lasagna and sandwiches in leva. Then you will be given the quantity of pizza, lasagna and sandwiches he would like to eat in order to be well fed. You have to convert all the money to dollars. If the money he wants to spend is equal or less than the money John gave him, he will be satisfied, otherwise he will be hungry and angry at John.
Input
The input data should be read from the console.
The input data will always be valid and in the format described. There is no need to check it explicitly.
Output
The output data should be printed on the console.
If the money John gave Garfield is more or equal to buy all the food he wants, print:
Garfield is well fed, John is awesome. Money left: ${the money that has left}.
If the money John gave Garfield is not enough, print:
Garfield is hungry. John is a badass. Money needed: ${the money that is needed}.
Money should be always positive and formatted with two digits after the decimal point.
Constraints
· The money John gave and the dollar rate will be a floating point number in the range [1 - 232].
· The prices of pizza, lasagna and sandwiches will be floating point numbers in the range [0 - 232].
· The quantity of pizza, lasagna and sandwiches will be integers in the range [0 - 232].
· Allowed working time for your program: 0.1 seconds.
· Allowed memory: 16 MB.
Examples
Input
Comments
Output
50
1.55
5
4
3
5
5
1
The money Garfiel needs is
5/1.55 * 5 + 4/1.55 * 5 + 3/1.55 *1 = 30.97.
30.97 is less than 50, so the money John gave him is enough.
Garfield is well fed, John is awesome. Money left: $19.03.
Input
Output
100
1.55
10
15
3
5
8
2
Garfield is hungry. John is a badass. Money needed: $13.55.
Problem 3 – Fallen In Love
Ivancho is a student in high school. One of his classmates is his best friend Mariyka. They have known each other since they were born and it was when they were in first grade that Ivancho realized he was in love with Mariyka. Now that he is already a grown up man, he decides he can hide his feelings no more. Mariyka’s birthday is coming and Ivancho wants to impress her. He knows that recently Mariyka has started a Programming Basics course in SoftUni, so he decides to surprise her with a “virtual present”. He asked you as Mariyka’s classmate in SoftUni to write him a program, which prints a flower on the console.
Input
The input data should be read from the console.
The input data will always be valid and in the format described. There is no need to check it explicitly.
Output
Constraints
Examples
Input
Output
Input
Output
5
##..........##..........##
#~#........#..#........#~#
#~~#......#....#......#~~#
#~~~#....#......#....#~~~#
#~~~~#..#........#..#~~~~#
.#~~~~~#..........#~~~~~#.
...#~~~~#........#~~~~#...
.....#~~~#......#~~~#.....
.......#~~#....#~~#.......
.........#~#..#~#.........
...........####...........
............##............
............##............
............##............
............##............
............##............
3
##......##......##
#~#....#..#....#~#
#~~#..#....#..#~~#
.#~~~#......#~~~#.
...#~~#....#~~#...
.....#~#..#~#.....
.......####.......
........##........
........##........
........##........
Копирай ги!
Не зная дали е позволено да пишем толкова дълъг текст.