Brightness of Brain
Contest
Problem B
Time limit: 1 second Memory: 16 MB |
Dear GOD, Pardon Me |
The Problem
This is the judgment day. All people are standing in front of the GOD. The GOD has the book of deeds for all people.
He is calling one after one and punishing them or giving gift
according to their deeds on earth. Unfortunately the situation become quiet
confusing
with the people who have equal number of good deeds and misdeeds, and most of the people are of this kind.
The
GOD has taken a policy for this kind of peoples. HE has kept some cards all of them
numbered less then 10 in a
basket (basket T). Another basket (basket N) contains cards which are numbered
by numbers less then 100. Each people with equal deeds and misdeeds will choose randomly a
card from each basket. Then he has to collect some flowers, say X from
trees located there (flowers are huge, he can take as many as he want). Then he
has to go to the pond of reconciliation. Keeping those flowers beside the pond
he has to sink into the pond. When he will come up the number of flowers will be
changed to T times the number of flowers that he had before sinking into
the pond (the number T is the number written in the card chosen from basket `T'). He must take some flowers, say K
from those and dedicate them to the temple nearby. This amount K is fixed by him, but once fixed can't be changed. He is permitted
to sink N times, the number chosen from basket `N'. If after N'th sink and dedication
to the temple there is no flowers left then he will have to stay X days in the Hell and then
he will be shifted to heaven. Otherwise if there is any flower left or the flower was finished before N'th
sink
he will be thrown to the hell.
You, some how managed to take your pocket computer there. After knowing about the policy, you
noticed that you are of the same
category of equal_good_deeds & equal_bad_deeds. Now quickly write a program to make sure that you can go to the heaven without staying in the
hell for any given
T and N.
The Input
The input is two integer indicating T and N. Input is terminated
by EOF.
The Output
Output a line "Dear GOD, Pardon Me" at first. Then output X and K
each in a new line in the format shown below. No invalid input will be present. Print a blank line between two set of output except the last
one.
Sample
Input
7 4
3 7
Sample
Output
Dear GOD, Pardon Me
X = 400
K = 2401
X = 1093
K = 2187
Suman Mahbub
Created: 28-04-2001
Updated: 14-12-2002, 26-01-2003, 07-02-2003
Idea: Ashraful Alam Joy