#C2413. Cat Landing Simulation
Cat Landing Simulation
Cat Landing Simulation
This problem involves simulating the landing of a cat based on various environmental conditions. You are given a set of factors with their corresponding influence values. The initial probability of landing safely is 100%. Each factor (which can be positive or negative) is added to the initial probability to get the final probability. The cat will land safely if the resulting probability is at least 50%.
If the input is an empty JSON object, then the cat is assumed to have exactly a 100% chance of landing on its feet. Otherwise, in addition to computing the final probability, you should also report the factor that helped the most (i.e. the key with the greatest positive effect) and the one that hindered the most (i.e. the key with the most negative effect). The answer must be printed on standard output.
The final output should be in the following format:
If the environmental conditions are provided:
The cat has a X% chance of landing on its feet. It will land safely. The biggest help was Y. The biggest hindrance was Z.
If no environmental conditions are provided:
The cat has a 100% chance of landing on its feet. It will land safely.
All percentages and messages must match exactly.
inputFormat
The input is provided on standard input as a single JSON string representing a dictionary whose keys are strings and values are integers. For example:
{"wind speed": 10, "temperature": 20}
outputFormat
Print the result on standard output as a single line following the format specified in the problem description.
## sample{}
The cat has a 100% chance of landing on its feet. It will land safely.