{"problem":{"name":"A. Bath Temperature","description":{"content":"Lately Teodoro has been working a lot, solving tons of problems. Now he thinks that he needs some well deserved rest and decided to go to a bath house to take a nice relaxing bath.  Teodoro is very d","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF10148A"},"statements":[{"statement_type":"Markdown","content":"Lately Teodoro has been working a lot, solving tons of problems. Now he thinks that he needs some well deserved rest and decided to go to a bath house to take a nice relaxing bath. \n\nTeodoro is very demanding and wants the temperature of the water to be exactly X degrees celsius. The bath house has N taps of water, each with a specific water temperature of ai degrees celsius. He can open multiple taps to get the exact temperature that he wants by controlling the proportion of water coming out of each tap.\n\nFor example, imagine Teodoro opened two taps: the first tap has water at 50 degrees celsius and the second tap has water at 75 degrees celsius. He opened the taps so that there is four times more water coming out of the first tap than the second tap. The resulting temperature r can be calculated as:\n\nNotice that the resulting temperature will always be a weighted mean of the water temperatures of the open taps.\n\nThe amount of money that Teodoro will pay at the bath house depends on how many different taps he opens and Teodoro doesn't have much money to spend, so he wants to know what is the minimum number of taps that he has to open to get the desired temperature.\n\nThe first line of the input contains two integers N (1 ≤ N ≤ 105) and X (0 ≤ X ≤ 100), indicating respectively the number of taps and the desired temperature.\n\nThe following line contains N integers ai (0 ≤ ai ≤ 100). The i-th integer indicates the temperature of the water that comes out of the i-th tap.\n\nOutput the minimum number of taps that Teodoro needs to open to get his desired temperature. Output  - 1 if it is not possible to get the desired temperature in any way.\n\n## Input\n\nThe first line of the input contains two integers N (1 ≤ N ≤ 105) and X (0 ≤ X ≤ 100), indicating respectively the number of taps and the desired temperature.The following line contains N integers ai (0 ≤ ai ≤ 100). The i-th integer indicates the temperature of the water that comes out of the i-th tap.\n\n## Output\n\nOutput the minimum number of taps that Teodoro needs to open to get his desired temperature. Output  - 1 if it is not possible to get the desired temperature in any way.\n\n[samples]","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ N \\in \\mathbb{Z}^+ $ be the number of taps, and $ X \\in [0, 100] $ the desired temperature.  \nLet $ A = \\{a_1, a_2, \\dots, a_N\\} \\subseteq [0, 100] $ be the set of water temperatures from the taps.\n\n**Constraints**  \n$ 1 \\leq N \\leq 10^5 $, $ 0 \\leq X \\leq 100 $, $ 0 \\leq a_i \\leq 100 $ for all $ i $.\n\n**Objective**  \nFind the minimum $ k \\in \\mathbb{Z}^+ $ such that $ X $ is a convex combination of $ k $ elements from $ A $, i.e., there exist $ k $ indices $ i_1, \\dots, i_k $ and weights $ \\lambda_1, \\dots, \\lambda_k \\geq 0 $, $ \\sum_{j=1}^k \\lambda_j = 1 $, satisfying:  \n$$\n\\sum_{j=1}^k \\lambda_j a_{i_j} = X\n$$  \nIf no such $ k $ exists, output $ -1 $.","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF10148A","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}