Lucky Gifts
"Planet Kids Entertainment Fair" is back to delight kids and parents. The Fair will have non-stop entertainment with an extravaganza of games, exciting rides, sports, art & crafts, role-plays, inspiring competitions, prizes & gifts, and yummy food.Few lucky attendees at the Fair will be given a pack of candies as a lucky gift and the show coordinator has assigned you the task for choosing the number of attendees who will receive the pack of candies. There are 'N' candies available and you need to decide how many candies to place in each pack. Each pack must contain the same number of candies. You should choose an integer A between 1 and N, inclusive, and place exactly A candies into each pack. You should make as many packs as possible but since you enjoy eating candies very much, you eat the remaining candies.
Write a program that will calculate the pack size(A) so that you can eat as many candies as possible. If multiple pack size will result in the same number of leftover candies, then print the largest pack size.
Input Format:
The first and only line of input contains an integer N.
Output Format:
Output a single line that gives the pack size that will maximize the number of leftover candies.
Refer sample input and output for formatting specifications.
Sample Input 1:
2
Sample Output 1:
2
Explanation:
There will be no leftover candies regardless of the size of the pack you choose. So you choose the largest possible pack size 2.
Sample Input 2:
5
Sample Output 2:
3
Explanation:
There will be 2 leftover candies, if you choose 3 as the pack size.
Pranav and Change
Pranav, an enthusiastic kid visited the "Fun Fair 2017" along with his family. His father wanted him to purchase entry tickets from the counter for his family members. Being a little kid, he is just learning to understand about units of money. Pranav has paid some amount of money for the tickets but he wants your help to give him back the change of Rs. N using minimum number of rupee notes.
Consider a currency system in which there are notes of seven denominations, namely, Rs. 1, Rs. 2, Rs. 5, Rs. 10, Rs. 50, Rs. 100. If the change given to Pranav Rs. N is input, write a program to computer smallest number of notes that will combine to give Rs. N.
Note:
Refer to problem specifications.
Input Format:
First line of the input is an integer N, the change to be given to Pranav.
Output Format:
Output should display the the smallest number of notes that will combine to give N.
Refer sample input and output for formatting specifications.
Sample Input 1:
1200
Sample Output1:
12
Sample Input 2:
242
Sample Output2:
7
Consider a currency system in which there are notes of seven denominations, namely, Rs. 1, Rs. 2, Rs. 5, Rs. 10, Rs. 50, Rs. 100. If the change given to Pranav Rs. N is input, write a program to computer smallest number of notes that will combine to give Rs. N.
Note:
Refer to problem specifications.
Input Format:
First line of the input is an integer N, the change to be given to Pranav.
Output Format:
Output should display the the smallest number of notes that will combine to give N.
Refer sample input and output for formatting specifications.
Sample Input 1:
1200
Sample Output1:
12
Sample Input 2:
242
Sample Output2:
7
Problem Requirements:
C
Tile Game
In connection to the National Mathematics Day celebration, the Regional Mathematical Scholars Society had arranged for a Mathematics Challenge Event where school kids participated in large number. Many interesting math games were conducted, one such game that attracted most kids was the tile game where the kids were given 'n' square tiles of the same size and were asked to form the largest possible square using those tiles.
Help the kids by writing a program to find the area of the largest possible square that can be formed, given the side of a square tile (in cms) and the number of square tiles available.
Input Format:
First line of the input is an integer that corresponds to the side of a square tile (in cms).
Second line of the input is an integer that corresponds to the number of square tiles available.
Output Format:
Output should display the area of the largest possible square that can be formed (in square cms) with the available tiles.
Refer sample input and output for formatting specifications.
[All text in bold corresponds to input and rest corresponds to output.]
Sample Input and Output :
Enter the side in cm of a square tile
5
Enter the number of square tiles available
8
Area of the largest possible square is 100sqcm
Help the kids by writing a program to find the area of the largest possible square that can be formed, given the side of a square tile (in cms) and the number of square tiles available.
Input Format:
First line of the input is an integer that corresponds to the side of a square tile (in cms).
Second line of the input is an integer that corresponds to the number of square tiles available.
Output Format:
Output should display the area of the largest possible square that can be formed (in square cms) with the available tiles.
Refer sample input and output for formatting specifications.
[All text in bold corresponds to input and rest corresponds to output.]
Sample Input and Output :
Enter the side in cm of a square tile
5
Enter the number of square tiles available
8
Area of the largest possible square is 100sqcm
7 comments:
Thanks For Sharing Such A Informative Post On This Portal. Skill Based Learning is important. Want To See More Post Like This.
Thanks
Great Blog! This post gives a better idea. Thanks for the useful information. I hope you will share some more content. Read our blog for : Logo printed gifts
nice post..
Gifts For Women India
Best Gift Ideas For Women
Gift Ideas For Women
Thank you so much for your efforts and the info. Here i want to something. My niece just attended here confirmation ceremony few months ago. I've been looking so hard for gifting something meaningful to her. While searching, i found some useful suggestions from a certain site. If any of you searching for a gift for your baby girl, try these best confirmation gifts for girls from here.
Nice information, the blog is really informative. Kingston's the best senior care service agency, Like Our Own offers aged care services in Mornington Peninsula, Frankston, Kingston and Bayside suburbs of Melbourne. Call Today!
aged care home help frankston Melbourne
Post a Comment