INTELLECT-3
Collection
INTELLECT-3: A 100B+ MoE trained with large-scale RL
•
4 items
•
Updated
•
11
info
large_stringlengths 120
50k
| question
large_stringlengths 504
10.4k
| avg@8_qwen3_4b_instruct_2507
float64 0
0.88
|
|---|---|---|
{"tests": "{\"inputs\": [\"\\\"51230100\\\"\", \"\\\"123\\\"\", \"\\\"61\\\"\", \"\\\"680\\\"\", \"\\\"561\\\"\", \"\\\"563000\\\"\", \"\\\"2400000\\\"\", \"\\\"231400\\\"\", \"\\\"68085000000\\\"\", \"\\\"601626560\\\"\", \"\\\"8438682911711716633214751365219626743737461956719455758661336162737333413873348734551161599324912798322447411666496112476637129667878555487737651293339367483498778388235348974166686842242267642926851212816853579599653537439649939813454662191849584693244738618891949195675475188525272221657313886414153236446678596241289683355186973262952237356811623969952182165623695552275386999277843719864343848326968554621399713172649929749583848512694461848161436925113181956836998515495533497882489698864759185363739311519827143861335862599593742665921765397191587722734249485997968165743416899758865452884847332233851817489812116496352985521932483656841125364558794279786971515185365255795342319358899976742643713118418446786382213128993318768963593658823516978221761293515473623751419957163862824599271112164587195815237768427853158556166278468783487884925216324537615276225839231641479177451513458214125142776274972854781932188687326358493263383925695762938216592987496241000\\\"\", \"\\\"217713289649867213128525236262454849287848244213913498569126651489678929965745115679668139865535623154814991531936523664757594645668758544483389632363888788676138636569484152586827534473978562358919715675213282195328514177465635957781655627279816458866164454162169269522741296926282785461835869197254484253821152963637744444369613434698646723422413112433564651639447775866655484635948247386832248661548829516236395846557431476672129289982471475172859828386669616227375836128279817767831678459693314934212795389659875328557315749291857319895737398246482686525849265272391491962965842784891232133743288372328343429794298958528821642634858279453937675284574761343153721151899552431379889529597239114594224267684276549847128753971679634577583541677319654668355472126378691997982443628199242871532432279549125954915878854384812469518544265787389543817888847143677952742138314598258842615525416731215761318228631755666493697443889942812655289392784655329795825542327256169343769900000\\\"\", \"\\\"6366892379879341266175971392763237547472738561527667982974273946743179299871941623952895728865533121594714388854377159674956252335759634244713378498166337899887168278882434762795355424462184128765516185127488651658526632463576537882461972564687383746939462674382258785546641785164646252929465288454418177641692985721257781466164143769775883171728515591451759288246944687187337181379578631617241389378168236712827847194569338556155695623821979168775518566627496949193699381932364776758189358717631174917888418671824137486958829415377895683899762118768694193214849557868547891512373573164153572223627555282147296826467963414457873163212336316391161448876377442212291827463816845962539221946123489732451174746593916243475757991776162591557486825542943455938313253363248432852937225971528327482292258455468931852559262249438514311858742381121768296379523856863845261493613164227729689285565599286168713813764296523948963943949449666514294655459861243458858382466569385676495777911991617997420000\\\"\", \"\\\"2347248044825683197915953242753954136458468135530569596982564376806744232209586209443445904032329604876884740433578422331078288115913718059342924039781204839817655684095045956571844017964775643167168509507529491151625647547059794026193209204187771685529561846011947466949469151855872764134740448092086421466303240286031787348599364594219758570296607102572895692336968744005418980079071338502828269187198732756344305624075593509647974954842933881932249995269911945145179349263872264263635770261555444608168918497546812202606961070408779649318783080756109336598467771235683764279754722087525787987268899831900032130693909300858560377702942440948716534165610989430321615777735800689004612218660748216666610743824770768611373885717471123628716599613929028217054104863827926901655975184640556799057114943769023042099081763608325332176623680868432607751543651130464150931513090745304939249935435592410530051296008520443540505526867599223436323905541239913543808338015806772635369022898357997364078491421063000\\\"\"], \"outputs\": [\"\\\"512301\\\"\", \"\\\"123\\\"\", \"\\\"61\\\"\", \"\\\"68\\\"\", \"\\\"561\\\"\", \"\\\"563\\\"\", \"\\\"24\\\"\", \"\\\"2314\\\"\", \"\\\"68085\\\"\", \"\\\"60162656\\\"\", \"\\\"8438682911711716633214751365219626743737461956719455758661336162737333413873348734551161599324912798322447411666496112476637129667878555487737651293339367483498778388235348974166686842242267642926851212816853579599653537439649939813454662191849584693244738618891949195675475188525272221657313886414153236446678596241289683355186973262952237356811623969952182165623695552275386999277843719864343848326968554621399713172649929749583848512694461848161436925113181956836998515495533497882489698864759185363739311519827143861335862599593742665921765397191587722734249485997968165743416899758865452884847332233851817489812116496352985521932483656841125364558794279786971515185365255795342319358899976742643713118418446786382213128993318768963593658823516978221761293515473623751419957163862824599271112164587195815237768427853158556166278468783487884925216324537615276225839231641479177451513458214125142776274972854781932188687326358493263383925695762938216592987496241\\\"\", \"\\\"2177132896498672131285252362624548492878482442139134985691266514896789299657451156796681398655356231548149915319365236647575946456687585444833896323638887886761386365694841525868275344739785623589197156752132821953285141774656359577816556272798164588661644541621692695227412969262827854618358691972544842538211529636377444443696134346986467234224131124335646516394477758666554846359482473868322486615488295162363958465574314766721292899824714751728598283866696162273758361282798177678316784596933149342127953896598753285573157492918573198957373982464826865258492652723914919629658427848912321337432883723283434297942989585288216426348582794539376752845747613431537211518995524313798895295972391145942242676842765498471287539716796345775835416773196546683554721263786919979824436281992428715324322795491259549158788543848124695185442657873895438178888471436779527421383145982588426155254167312157613182286317556664936974438899428126552893927846553297958255423272561693437699\\\"\", \"\\\"636689237987934126617597139276323754747273856152766798297427394674317929987194162395289572886553312159471438885437715967495625233575963424471337849816633789988716827888243476279535542446218412876551618512748865165852663246357653788246197256468738374693946267438225878554664178516464625292946528845441817764169298572125778146616414376977588317172851559145175928824694468718733718137957863161724138937816823671282784719456933855615569562382197916877551856662749694919369938193236477675818935871763117491788841867182413748695882941537789568389976211876869419321484955786854789151237357316415357222362755528214729682646796341445787316321233631639116144887637744221229182746381684596253922194612348973245117474659391624347575799177616259155748682554294345593831325336324843285293722597152832748229225845546893185255926224943851431185874238112176829637952385686384526149361316422772968928556559928616871381376429652394896394394944966651429465545986124345885838246656938567649577791199161799742\\\"\", \"\\\"2347248044825683197915953242753954136458468135530569596982564376806744232209586209443445904032329604876884740433578422331078288115913718059342924039781204839817655684095045956571844017964775643167168509507529491151625647547059794026193209204187771685529561846011947466949469151855872764134740448092086421466303240286031787348599364594219758570296607102572895692336968744005418980079071338502828269187198732756344305624075593509647974954842933881932249995269911945145179349263872264263635770261555444608168918497546812202606961070408779649318783080756109336598467771235683764279754722087525787987268899831900032130693909300858560377702942440948716534165610989430321615777735800689004612218660748216666610743824770768611373885717471123628716599613929028217054104863827926901655975184640556799057114943769023042099081763608325332176623680868432607751543651130464150931513090745304939249935435592410530051296008520443540505526867599223436323905541239913543808338015806772635369022898357997364078491421063\\\"\"], \"fn_name\": \"removeTrailingZeros\"}", "source": "lcbv5"}
|
Given a positive integer num represented as a string, return the integer num without trailing zeros as a string.
Example 1:
Input: num = "51230100"
Output: "512301"
Explanation: Integer "51230100" has 2 trailing zeros, we remove them and return integer "512301".
Example 2:
Input: num = "123"
Output: "123"
Explanation: Integer "123" has no trailing zeros, we return integer "123".
Constraints:
1 <= num.length <= 1000
num consists of only digits.
num doesn't have any leading zeros.
You will use the following starter code to write the solution to the problem and enclose your code within ```python delimiters.
```python
class Solution:
def removeTrailingZeros(self, num: str) -> str:
```
| 0.375
|
{"tests": "{\"inputs\": [\"[2, 1, 3]\", \"[1, 3, 3, 2]\", \"[1, 1]\", \"[3, 4, 4, 1, 2, 1]\", \"[1, 1]\", \"[1, 2, 2]\", \"[1, 4, 2, 3]\", \"[1, 3, 4, 4, 2]\", \"[3, 2, 5, 5, 1, 4]\", \"[4, 1, 2, 6, 6, 5, 3]\", \"[3, 7, 7, 6, 5, 4, 1, 2]\", \"[10, 9, 2, 7, 1, 4, 8, 5, 11, 3, 6, 11]\", \"[18, 14, 16, 20, 33, 3, 24, 11, 22, 2, 46, 17, 29, 28, 38, 40, 48, 21, 19, 4, 15, 8, 39, 27, 51, 12, 44, 7, 30, 23, 26, 13, 32, 42, 52, 9, 47, 6, 34, 10, 50, 45, 36, 31, 49, 35, 1, 5, 37, 25, 41, 52, 43]\", \"[83, 132, 194, 188, 59, 167, 116, 199, 164, 94, 12, 163, 128, 30, 92, 9, 151, 169, 121, 58, 170, 62, 186, 29, 189, 75, 100, 74, 89, 173, 162, 126, 2, 108, 86, 182, 122, 64, 43, 47, 37, 49, 197, 21, 144, 18, 112, 150, 40, 157, 97, 20, 129, 95, 68, 66, 142, 76, 48, 172, 84, 139, 99, 25, 1, 119, 41, 143, 180, 90, 24, 161, 73, 196, 82, 35, 135, 153, 8, 134, 13, 146, 5, 39, 133, 55, 198, 178, 171, 53, 137]\", \"[106, 78, 121, 76, 160, 104, 82, 47, 158, 151, 62, 134, 113, 74, 51, 121, 67, 87, 37, 199, 41, 90, 58, 48, 198, 101, 44, 177, 107, 112, 167, 20, 66, 35, 131, 102, 181, 191, 73, 83, 88, 135, 183, 50, 30, 186, 40, 38, 60, 17, 57, 133, 153, 174, 122, 86, 196, 95, 103, 69, 64, 123, 111, 89, 147, 19, 56, 164, 16, 184, 189, 25, 125, 129, 195, 139, 68, 55, 45, 99, 23, 180, 77, 144, 32, 152, 27, 175, 81, 193, 143, 182]\", \"[95, 53, 23, 8, 119, 1, 148, 179, 70, 185, 132, 161, 87, 80, 99, 60, 10, 115, 124, 73, 79, 71, 89, 58, 77, 111, 50, 167, 141, 189, 74, 82, 40, 22, 68, 13, 190, 30, 52, 45, 103, 177, 25, 158, 153, 15, 186, 3, 118, 105, 32, 91, 137, 108, 90, 112, 168, 156, 46, 191, 93, 139, 195, 135, 28, 155, 131, 17, 67, 169, 138, 144, 110, 78, 150, 154, 38, 64, 163, 55, 25, 48, 147, 11, 81, 33, 128, 198, 26, 140, 188, 182, 199, 171, 62, 6, 146, 37]\"], \"outputs\": [\"false\", \"true\", \"true\", \"false\", \"true\", \"true\", \"false\", \"true\", \"true\", \"true\", \"true\", \"true\", \"true\", \"false\", \"false\", \"false\"], \"fn_name\": \"isGood\"}", "source": "lcbv5"}
|
You are given an integer array nums. We consider an array good if it is a permutation of an array base[n].
base[n] = [1, 2, ..., n - 1, n, n] (in other words, it is an array of length n + 1 which contains 1 to n - 1 exactly once, plus two occurrences of n). For example, base[1] = [1, 1] and base[3] = [1, 2, 3, 3].
Return true if the given array is good, otherwise return false.
Note: A permutation of integers represents an arrangement of these numbers.
Example 1:
Input: nums = [2, 1, 3]
Output: false
Explanation: Since the maximum element of the array is 3, the only candidate n for which this array could be a permutation of base[n], is n = 3. However, base[3] has four elements but array nums has three. Therefore, it can not be a permutation of base[3] = [1, 2, 3, 3]. So the answer is false.
Example 2:
Input: nums = [1, 3, 3, 2]
Output: true
Explanation: Since the maximum element of the array is 3, the only candidate n for which this array could be a permutation of base[n], is n = 3. It can be seen that nums is a permutation of base[3] = [1, 2, 3, 3] (by swapping the second and fourth elements in nums, we reach base[3]). Therefore, the answer is true.
Example 3:
Input: nums = [1, 1]
Output: true
Explanation: Since the maximum element of the array is 1, the only candidate n for which this array could be a permutation of base[n], is n = 1. It can be seen that nums is a permutation of base[1] = [1, 1]. Therefore, the answer is true.
Example 4:
Input: nums = [3, 4, 4, 1, 2, 1]
Output: false
Explanation: Since the maximum element of the array is 4, the only candidate n for which this array could be a permutation of base[n], is n = 4. However, base[4] has five elements but array nums has six. Therefore, it can not be a permutation of base[4] = [1, 2, 3, 4, 4]. So the answer is false.
Constraints:
1 <= nums.length <= 100
1 <= num[i] <= 200
You will use the following starter code to write the solution to the problem and enclose your code within ```python delimiters.
```python
class Solution:
def isGood(self, nums: List[int]) -> bool:
```
| 0.75
|
{"tests": "{\"inputs\": [\"[2, 2, 1]\\n4\", \"[2, 1, 3]\\n5\", \"[2, 3, 3, 2, 3]\\n6\", \"[2]\\n114\", \"[17, 17]\\n3\", \"[25, 81]\\n48\", \"[20, 33, 1]\\n4\", \"[33, 89, 9]\\n200\", \"[14, 5, 7, 20]\\n5\", \"[47, 27, 74]\\n200\", \"[68, 46, 28]\\n200\", \"[2, 4, 26, 20, 49, 13, 47, 22, 3, 3, 28, 18, 11, 20, 39, 5, 8, 7, 10, 9, 32, 4, 35]\\n73\", \"[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100]\\n150\", \"[50, 150, 50, 150, 50, 150, 50, 150, 50, 150, 50, 150, 50, 150, 50, 150, 50, 150, 50, 150, 50, 150, 50, 150, 50, 150, 50, 150, 50, 150, 50, 150, 50, 150, 50, 150, 50, 150, 50, 150, 50, 150, 50, 150, 50, 150, 50, 150, 50, 150, 50, 150, 50, 150, 50, 150, 50, 150, 50, 150, 50, 150, 50, 150, 50, 150, 50, 150, 50, 150, 50, 150, 50, 150, 50, 150, 50, 150, 50, 150, 50, 150, 50, 150, 50, 150, 50, 150, 50, 150, 50, 150, 50, 150, 50, 150, 50, 150, 50, 150]\\n200\", \"[100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100]\\n201\"], \"outputs\": [\"true\", \"false\", \"true\", \"true\", \"true\", \"true\", \"true\", \"false\", \"true\", \"false\", \"false\", \"false\", \"true\", \"true\", \"false\"], \"fn_name\": \"canSplitArray\"}", "source": "lcbv5"}
|
You are given an array nums of length n and an integer m. You need to determine if it is possible to split the array into n non-empty arrays by performing a series of steps.
In each step, you can select an existing array (which may be the result of previous steps) with a length of at least two and split it into two subarrays, if, for each resulting subarray, at least one of the following holds:
The length of the subarray is one, or
The sum of elements of the subarray is greater than or equal to m.
Return true if you can split the given array into n arrays, otherwise return false.
Note: A subarray is a contiguous non-empty sequence of elements within an array.
Example 1:
Input: nums = [2, 2, 1], m = 4
Output: true
Explanation: We can split the array into [2, 2] and [1] in the first step. Then, in the second step, we can split [2, 2] into [2] and [2]. As a result, the answer is true.
Example 2:
Input: nums = [2, 1, 3], m = 5
Output: false
Explanation: We can try splitting the array in two different ways: the first way is to have [2, 1] and [3], and the second way is to have [2] and [1, 3]. However, both of these ways are not valid. So, the answer is false.
Example 3:
Input: nums = [2, 3, 3, 2, 3], m = 6
Output: true
Explanation: We can split the array into [2, 3, 3, 2] and [3] in the first step. Then, in the second step, we can split [2, 3, 3, 2] into [2, 3, 3] and [2]. Then, in the third step, we can split [2, 3, 3] into [2] and [3, 3]. And in the last step we can split [3, 3] into [3] and [3]. As a result, the answer is true.
Constraints:
1 <= n == nums.length <= 100
1 <= nums[i] <= 100
1 <= m <= 200
You will use the following starter code to write the solution to the problem and enclose your code within ```python delimiters.
```python
class Solution:
def canSplitArray(self, nums: List[int], m: int) -> bool:
```
| 0
|
{"tests": "{\"inputs\": [\"5\\n2\", \"3\\n3\", \"2\\n5\", \"1\\n7\", \"1\\n4\", \"6\\n2\", \"6\\n1\", \"1\\n1\", \"1\\n3\", \"2\\n1\", \"48\\n42\", \"49\\n41\", \"50\\n49\", \"49\\n48\"], \"outputs\": [\"3\", \"10\", \"6\", \"3\", \"3\", \"1\", \"0\", \"3\", \"3\", \"3\", \"1162\", \"1167\", \"1323\", \"1272\"], \"fn_name\": \"distributeCandies\"}", "source": "lcbv5"}
|
You are given two positive integers n and limit.
Return the total number of ways to distribute n candies among 3 children such that no child gets more than limit candies.
Example 1:
Input: n = 5, limit = 2
Output: 3
Explanation: There are 3 ways to distribute 5 candies such that no child gets more than 2 candies: (1, 2, 2), (2, 1, 2) and (2, 2, 1).
Example 2:
Input: n = 3, limit = 3
Output: 10
Explanation: There are 10 ways to distribute 3 candies such that no child gets more than 3 candies: (0, 0, 3), (0, 1, 2), (0, 2, 1), (0, 3, 0), (1, 0, 2), (1, 1, 1), (1, 2, 0), (2, 0, 1), (2, 1, 0) and (3, 0, 0).
Constraints:
1 <= n <= 50
1 <= limit <= 50
You will use the following starter code to write the solution to the problem and enclose your code within ```python delimiters.
```python
class Solution:
def distributeCandies(self, n: int, limit: int) -> int:
```
| 0.125
|
{"tests": "{\"inputs\": [\"\\\"aaaaa\\\"\", \"\\\"abddez\\\"\", \"\\\"zyxyxyz\\\"\", \"\\\"\\\"\", \"\\\"x\\\"\", \"\\\"k\\\"\", \"\\\"e\\\"\", \"\\\"a\\\"\", \"\\\"i\\\"\", \"\\\"d\\\"\", \"\\\"s\\\"\", \"\\\"b\\\"\", \"\\\"tuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmno\\\"\", \"\\\"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\\\"\", \"\\\"cxyayzaxybxzbyxcyybyycyzczzayxazyaxxczybxzczxbyxcyybxxaxzbzyczzayybyyayybxzczzbxxbyyaxzcxzczxcyyczzb\\\"\"], \"outputs\": [\"2\", \"2\", \"3\", \"0\", \"0\", \"0\", \"0\", \"0\", \"0\", \"0\", \"0\", \"0\", \"49\", \"50\", \"25\"], \"fn_name\": \"removeAlmostEqualCharacters\"}", "source": "lcbv5"}
|
You are given a 0-indexed string word.
In one operation, you can pick any index i of word and change word[i] to any lowercase English letter.
Return the minimum number of operations needed to remove all adjacent almost-equal characters from word.
Two characters a and b are almost-equal if a == b or a and b are adjacent in the alphabet.
Example 1:
Input: word = "aaaaa"
Output: 2
Explanation: We can change word into "acaca" which does not have any adjacent almost-equal characters.
It can be shown that the minimum number of operations needed to remove all adjacent almost-equal characters from word is 2.
Example 2:
Input: word = "abddez"
Output: 2
Explanation: We can change word into "ybdoez" which does not have any adjacent almost-equal characters.
It can be shown that the minimum number of operations needed to remove all adjacent almost-equal characters from word is 2.
Example 3:
Input: word = "zyxyxyz"
Output: 3
Explanation: We can change word into "zaxaxaz" which does not have any adjacent almost-equal characters.
It can be shown that the minimum number of operations needed to remove all adjacent almost-equal characters from word is 3.
Constraints:
1 <= word.length <= 100
word consists only of lowercase English letters.
You will use the following starter code to write the solution to the problem and enclose your code within ```python delimiters.
```python
class Solution:
def removeAlmostEqualCharacters(self, word: str) -> int:
```
| 0
|
{"tests": "{\"inputs\": [\"\\\"accca\\\"\\n2\", \"\\\"aabaab\\\"\\n3\", \"\\\"xxyz\\\"\\n1\", \"\\\"abcde\\\"\\n5\", \"\\\"aaaaaa\\\"\\n2\", \"\\\"wjlcta\\\"\\n5\", \"\\\"eictzzwx\\\"\\n1\", \"\\\"fvcalcqn\\\"\\n3\", \"\\\"zcjvkodq\\\"\\n5\", \"\\\"eifhjtmuj\\\"\\n7\", \"\\\"cxdzvmcbcv\\\"\\n3\", \"\\\"rnqrabcxrh\\\"\\n1\", \"\\\"xpfcubkanivkyjzrknwyapagrimbfidmckcyeupxioksdbcmucufydzepdedezeygezuvfmzyiodsenwqdldxjmwsvomyztnqpyxcqbwxnzhbfbogvdcnqjwqwedxmjblupctwicfofzczzyebagxmowivzpwlbucpyyevzidluoyltxsmvbfdeyvbentyozwebujyxfvvdewmvuxsxdviymdpjvlepegctykwxxbnyzccaemyqmlvzeitmvfjjlzqluvazjdvnovddnbtykyjdoisjibvgbniuqdxmxuvdhyawjkwqiphhjuvqxaxdbrdsrwsbevchsuwxpneazufmwueqguozujzczmuhpkjjaddhsvjwtzvlxmcymrgoxcsxbpwdmhovjpxpkgdfhlhullzdomxuvqoopacvcmjmobfwoemcyceajvycgrczyqvdchwplzvndodyhnbhthgwwzcmoykpycnosntzcrcznbsyynsdtadpdfgylycvemzuvqldvvqicckcaocbhcqipvqunnlwfdqrostrcltuouoqsqzepivyqqlcswvgnvxlditnftdxnlbxqarzjynpbsqcxgnfshgdvdimiiwrohuhmympmmtvhexqwdbqsdpitohxlarqlbabrlwodttiibbkbmczplsiwxyqegcneqyofppsiumftmvacspqcdfjppimtgrhuqdyrkntvcsrpaqovqjmyhoccqkdgxikxshdwrgudcconsqzbklbofdxyaxtkjajyndcudxbyfgcltuxzplllfrfwwwbdaibouxggxxdckpbfsfvvcbmcvczbpqtmxgysinelmbvlsclhloybhkhtscenkpakwhodfdgdrxgcguqomlxayakwaxwlqukkrvkqslefmfumnakskifztetyyrfgvzjiaepqqqwkdldjgplqriawrrukbwbqnhpcvdmkmjhlqpzwvgjjndzgqjoqevhyieipaffepwrthzehdquownsakrocpmdmepyfdulicftrefkhqvzgoohpykpydcxizcftnsgpghuxugvqttyyaydnhjusathtjisrtpwocwxtersgordudklpsvbpzewzvlypcgihdvpeikeovhihcbbndlgqzupxdjkbpdeuftmdbdrhtqesmezjcokbyzgwoqhawekinuidpbmzslspadbmvxgfiseyuibdrxpgoilysyqqshtnlfvrjgmwceopbxxmkzwssgrsqhlaoyebbhuhiiemjhximuqoykypklmmplgbzascuznhqidnkqnxcujseugybfadydqsgqufgzepqxbepvxzhnsbwbfbttoiylukopowsetqomnpdszmtjuaigjyqvqaaeqirxfeplubcvcjlttruulzsfedpsflgwxdckwnemdlhngcwmuwtsjwiaxjwlhriwhepscgpoitqycwjjmfecffcbivtnarupmgbqhpiiofqufosiulrarzxbeppwtjlyhlzmiwwqzdlfjebljjympzzaowppxrsphvftpeikuluyvivsjyhxzwolgijqfxeehmczwfptjfikgqpgjrhznbdnikqqilxfvuufoljxjjcvhdjarfslgwlkzczxqjtqnjgelxuakkjlrbhankcgwpdjhnljlnhajnqohuxapzptofyazrgmnlxtmrzkzvwhggzdmqvjhbwuiebtbaduukrapbdklxnjagptorxuvughpdmkabacnjzhduyuqjuutixfzupogfnwxrmnnqznwczpruxtsphfmcddhernkowdzvywlqhnkhsixidvovkyphdkfglhpkduodcltexgdphzfiwqvsacpcgirwrflyterhlrwioqabukywobwmkbvcadwqnxiblakmwesreitxfwnvsfftxcfozltwwnjyaixanvzbrntsrnatmfxulresfljxuthkjnovjaoaqivvwhjjxdmnlozliouvntwxrpuvfactvovpbhixihmoysolwburzvaoykjmhnwmtenkuiivbrhvniudaaigrsrutqnxlfqeuyvtqxozerlvotdgnkzgkbpgxzuoarjawxexgxokeoelyvdnxzpnkfsiaxatkpkkezenyewrnfwejyborcjqzhxybaykdtrntzvexlpfvzguhczemaxdjuvuxtlzpjcmqbvidbcxsktwrkxkocllaedcplpdpwfktzsvxqpagajtmeqkffeuckyhrshfdayxbjdjuivfmfkzbohobwsvahkpgcxauaeadvaxgxpkslbivlzmsqocqfoknlojgiwmletbtasyjmmfovjdotpediffjgtldzlgfbbumgaqmupfkweljgvdjfrqlabfqsjpfisbtumlqyqfdeaubsaajppbmkqrdwjzyzmhbrnqxcrjjufsltqqpyvmzgzcazyooosdfnymifvrjxezijteufhbmcxhvoxdbrmzioizmjmdvpdshqtheyrzmlfuivhwtkoorjbivqvwwokyxrwzwuxfdnaejlchkaksynqkmbwqmwmhsntqwhbrbrkafhfpjumnkbybkzabcmptpccgzdacmvsbwkheejololwsnuwfpuodanaihzvmothxyxslhhptcdijldyfpfhiuiihxpuursgxpuqixwcbqcrxjksfpyzxtkxmdtfveoosronvfpmnsxxsgjsetyvkxddbympmfpykydwofvnltihwgoejsgrfodohcaivptiaieuelhrcuoyrerkbuohdsjbbfntafpzztlzoseaxkxbnjbrxemfsvpwvzalmpvyjppzddnflitdejvqcrzyzntknvnejwnguynlrfewsnxcbovofulxuhgikxcsoiezvihrzvsfyxdsrufykenhrwfvnjnnncaxkzzjuimqnnqgtukxkvnvcfkairsemscrzjemrfwkwkkfwwphcnvqimmvvczcscqpnzdqfjvwajvtqoegqhedcynvishixmxedywrlbwmtorwwlowwuvzpsbscdcyjtoncbfjnfxpfevllncmmlifnucsiguwonhyccqcqtglbxxesjealqibehjedqbrnjohufapsqssqwvvzooqfwluedcbwmacheceplxmghogvunjrsketeienfidlixfdnqewyffpoteztkxipfdtatxetjbclqmcphpasbtkocvlhuffvqtfdhmdcmrswbctqafbnnntrppyywffdjhnuizkxhndadsloifxjaxheudjpuogwmakbbrdrvskhpciebuuwcbupoveclpvftbehyxjnclenbiibcjeideayphxtumesaoaeymhrvisgaaevwhjfvhdfdzsfuxrfxliignqauahcbfcgoxxxdlnwwovyeywyxlgvsizqfiausvoqilgvcbxkmfylmkphdvxrrfyfffgadhcypisptnvecwflhrsqwuzemwnubdisijkpaatfbriivthssajxbjmnxjrewdoyjvwmtokqeuldzppcnprarubqgpxktyzeleckfjpudmvywhjqnjfalpmieariepgptgbkwtgcasnhvnqvvurwhnlxmaiuuykfvncjzickxcwyidpwrehxcvvoanzxbdnjxixipfsmrmajddlhgvxmauftfuqdekhutmpoyunvxlyqaojobklnmgynyiiyfeorfvrajhgnmsrpdilotlbegewudpajhfpvrghwkyhuwvjzgplilzcintgpqwnqyjgtypadrviztlaxewjcncyskpsrxxgsplbbooqacnpjlfhghuqaxenhqnqcuqvpyfkfihiofvjwuygtntxnxiywvtbvdbrqbmfwtraposwyqamvcmderlchhgbbniyoxrhfuhtrzqjnqkphtvvzxleakbpsppibnkbfqvtokzmwvkxhlcgifrqsoynhxmycuhhcgzqdxtudfkdofqssqdzoipielydbdhaemzihwekzhcapwsvelpjdeludtlvcrwoenwsatlfxpirsxsqnaahwkygdaqhjzynlrtfiznuxagwfczcfxzpnxlxghgvwkcyhmtkuliqswdkvvhbzvjmrtliemukvgmfzaxeesowmajwcjmzebtfylwzijtptigfyznnftfzhjdcstaknwpyfwnvfdxlbaursomisixddklsqdtvrfrqcfddvqfbpqlskdyynjlegfzecjkyakkijwjkajfwsskpwsofbtqhjgexrsbhktzshkszbugpppytjsklckggawbnmuiwaehvszkuzprjyelldewdndjesigqrhgicyqaejauynyjoewytyoojeotssllkwuhgnmgpqyegehehwzhofszwyjftrsusucssjgaovyhnktywmxrnsriidbzulmapbjkxapmzqhqktilqxpjmhjpeaysegcnqtnjndfknnctmjkafdtgzyltupfonmsrmgtardlcgwntsxbcyjdohxwvghsegwkuhievlarsbdlgduohbxivjmrsolhtubqxzzvueyznhtrzkgimhpuhiunipyzbcrigdgeksgbtoqedkskorghkikbszycyuzfhinaxycvcfvurtoevqyufwjnvindcbwtwpqjwmvipafnlcodvndwlwwaaqgnblqpmvwjlpfzjudigkvvqpueecuutcwtdqqwjgcfvgphonspqehpeklgpzgkfamiwomgixdyxnsepajkshqghaqikdjqqpxbbkmjccgbkqvqfpigjypcgpfjkizbfcgxnngodlenqvgpvgickijvbiazwnmpxjjdesknldksyelesjwwzujbwnnrvceenajgtjywtghqagfzegkxecngokderlavngytjascyjnemnvxnlkriumxpatoazikjgtyeenykuayienfapxpurqnkmpuvimtzqowncffnrcswbcfhruwwmduepyzsqkuxgavwnbajosbldkaxgtzcreoaisxtxdzophtgfqcrrtmhmdrkcbzzwddjfpxqfvpvkoktevextftmuvakmteenblhmyyoaxvguyogvsotoqqciyysgrihgmfgccglzeckjxlfedxkfgutbpqolkbejqddjtsxlowhwmokwomkuyejtlaowtajpjmnzvmbmakyehyvfuunsxfjdcoypfmaqnwbdwxbgtzgmnmjbygarrmrjgixzmolzepgcypeuxlxycpnlrjtwvaedoogcobaamvppcwiyltwlxtyvdhzwqihsdepemdjedvzvvkqflsrudhngmoaeemvxsctapkzvanwgndhveptosrmqptyxmczzoxlawzidbumsrjxtkydodtezxiiutiotpsnkwzkcstgfkkxyiagtnbxwnztbnctpoatffiwoapkvsaryyxiezqlzdreshtllfwwycwjuspgnzjgfdajjkkqftewawzljyurxctoccjdzwnfiuvuohfeluparlazzulyeuzcatnexqpcsshjnvadbltwchxcowezlbybhhrgguhqnkmcukhlljunkuaanxrxoxafnzrlpgmhhfnvzwwybivqsrnspcswbufjztavsamlpbpwdedyplrzozmxvvhhuxuvvduqjsmrzafvrcniqxfktwiisvvhhbkzebielxhxlbnaycpgtuovinhekngbgkxlmxhtpvbmrbpguhthtefdokmfotgratwmatxnacxzdmxkqubnrorihqawbzktigvwopvdfauxupczvxtkuyyaeiwrrkjukrahxtkahxmusxotjrxnnzimghvlfgszrtiygqrnchpzqorsbaemnfptdxjtswgfdozecqbpxaujhuayhclbeipgzpvuusxwitlzzyqxygnhdlkiofrtsscgevehtolzodatycpejpusvgszlfstbqvcyjtnfmutmfemntzlrhsxtmogietnjxmfmznciqjdsudbsmkyhcnempgkgckqswbqaqcmwjgstlyryywkltdgzsshfoplzamqllwueovaagayzwaiaazjfsrfwtpivijqgubmbwhctrmtkoynfspqjmpwpaonlrlsaexwxpsahfbtfjsiybyfjaeqyrdiqrlfjbptgwbsgbwgwjitosjuxadckavzfgkrnvzbnbeziiaudmstuaeuftpyrqjbsggvjzebgduotnsboknhqhdowcomzdmdaeuiinjpyzwimhlipikgtzbmqeollckyratikhztwbmaiuzrwofkivrlebtapmktkbqpjatkvjiyccqswcufywgwkusflwusminggdmdtuvoxvilvukrayjlucbylzogndptfmnlllmiqethcnnginbtwrzcybylglqqovageizbaomcaqtgvsgehosyoxltplzhwyfjmbeuixbsooeponklcmggqfkovtzbbmnwluhhmcypxqdxkumcyqlvmnhadkelioqeznymbydnffioukljvvhyqwyvcfegrrytluagcpomwcyeckesbvyhewuhzlzptfflrsztsmzhgpradovzoperksqlkyntbzjcmylwmwqtinxhnoconwxcwfekpqxbkhqyatprwihjlrvimsncixjsoznavhbdchiuqyrlbelzcxdtmxjvpiibfihufucndkkvjkgdvzecnanleietqceyueqkgmpyfxdwtnjyhoaqbascgommlrdqdejhtydpqegawsemdnxlxbxgzruqrqlfglxrzudebmelidkezewdyovcuurxocpkajrirruyxbckdthlfdcrirheqjgnlpyequhjbqudfrrqiavtzklizwsejeuhzfhlozpwqsqmpiswvhjoyfazeebkjqvelninlvyucuffkgptyafokhgslpgsvsykgwualnrxjwurduoemlyehwvbxniwnjvijinjiajmvsneakmugjmkaerljtmqrhyideqkriodhvzhqvlhvxwzpyltwmbsnahcgdgsryhqbucjyzdjrpyqvtkkhjxsbbmevuedqkxajvvncowdtccbrmgdrwooranxobnwmmccvdiiaykktulxrtlxqhyzaqmzeijgbqwmvtqguripkngmicnccqesqqusezakzybniuuzvriijuosdpyuefvwdkupnqpishmyioltjkvhsmtnfqkysnfgiglvnyekzgcozdtqtffudcftjocyjfjpdyqmifvewcoxsvkgenmdbchbtoupjzqapsojjihbwhbudqnndzoxieahecwpshgjtzmhycjbltzjyixfjhezbdevgiojqiyphqknlypfmwqenudwqnbjtwsapnlupoupmenfbjcbbgepqcjxetcjmutlxpzobwwoblqhydaztngrdyhfkhwuhriamepvprnrsikmebpxmoaqcdnhiklohbdecalrfylkdxqiwqofvjeqvyzcfkfngdqkfgtjgpjdbfjgjadeuarqmzfcsytilaakzdkugakscjbxomkykicuwqrhcijsrxctrnemaqqdwwnfglsveypgzsirxfefxlltnaaqxeqbwwgwfnljkzzzelpplflchqcikqpiqloflqisrfsuiiaslauvcelgyjciwnoteftlzjiubliiaijzjbpcfnsvisfgoinuunuejetmznunmdrefhnmcrtdivhbcatconvofpoxdzzcbdnwekywlwqgsxwstcbqjpfyqcbfcaacpmymdlmkzmgoaranllybudylvhnpnzinjvmstxtbennsqihmlsmgriipzjyofxvygzahzzyuaeianzpzahtbkfrpiujepbhcqkpqcglosgalbrbibbjuphtuoolptvpxbeexoycqfsmlypswijisbyuvqqzlzmvjyigropakttrlgrvtimcnshwatqzwdfczonwouztyqiubrmxiirllzzjazedhwltpucdsexsbgbozdiztkxegztckjcqlwbosentzelgbcyrbezdoivvdgzbxlyunokjmpqzrqocugznspqcxzdggejpwominbcjntrjhafxbxbfsyzyqyxrwtukaurvizwioptncqmzmqcwnrfjfilanjyxlrgcasepeqimyvjmqmiweohrcucujginiovdowaorzkihsdhrccftjeliavyjvawtpsepmhchcdvpyzhjyglqjxwplsjcmploojnonjjbgygstfkgcxvntsaaaorjdtxeyqoqggwmdxddtomjckbnlvchuvemmcegebwkjwiyjwbcfyaetsrvodkjvrjhpfpsolrqxokfpycnwkerdtqsdvneothvcbadgcyjeesbzahxghdweuytouvjxyzpcjosewiujvmqhclalwwfegrldgcqbhkwevldzgxaksglfhbjetvpqslwwzhjttbvnhklhshjjwypoctubogkgcwcsicpyrzrqdkcgzymribpssojnrfcxjdwusqjcftcmiqjxxqcjizptwsshvwxggbpaokdbszgmeoionlypqgmejnjtllpynqwkkpybiyzwmlhrfohmcnwnaueozdyrckmkfmwnajtrmwxvaqasmkbcgcpdpvjgzyeceppeypahejhrhoudlhrdvzsfiocinxhntziyxssfwaqifntwhkhxjdydvzdwfmqfikecjvaesutwjqjhqewlvcmqekrbbwgfphefegnnuenwobbzchpzuvjuxbzhsdtlpjxsetwxfsuyitjblixyeomzdeylbumsmtgmbtnuiurksgrpbegpktwoxpxawfwmcimexvmmomqnqsjcluyaqialpwjtbptncawqrsxnvylxyqyyyarkoimeexlvikhvckkghhlormamwtzpzkrnudwzkubdlposzopqysdlefiqghfabvryozfrsvvtjwhcnetdfhohdfsmtjhneubshmseadxxkayqokzfbdlncgclnlapewefmcrwckuxjebdxfreazyjanmnicjnksdoalchzsjkjkzfqifrqhjrskhecbstynwcuhixdujjjqfreutsctkeswtprrmcwommwytbsmbejbzkdllqqgzydxpakkmnmfuaoxppbbyfpgbdgawxjxcjdgpbqkxbtpjhpixetotyxruayddfrlmoimmnvstukdrtmfhnnuwirkxshjvrldfxpqmkhwjbonuuntmezjnxuvliakgdvzfqytvbhxdampjhelcwwiqcnnpimpuouxfboujvzvwxrpikamrnnffavcyssaicjdwmtwtxmpbiyvxduvakewqnppovodjowaiypfnxxkpcqmjcmmlivkzcivzsdnayfshmblwsmgzulahirptppmeygjkrjyitzzmqcsmrbpkjbauitviezosypsxgoxumpqcwvicyverberyklkwmvsejjqkwlmplyzukvxclckhdrlkidqfgcbkiizkfzqdikjakqkwcuqrzzdwmkgsqxcpmgntxvvlwqqfpypplfqfyypggqobrzuhtvuuxrcrtstflymedmjcowoerofviozphlprvytzweeteawrdkfvnmnrgxkzdcijecuvjpfjullxcyvhhenvuvmftzxtnunxrdknutwhpsnmskaettcartezyzojkzxalqgorqifajrwtytizfzledygleyjflexbkducuraxgsiwfjxbcgyfnotusnmdmtpfjrcavjdepvsoztsrovfogsvffptwrfmqrpwhuabrvpojrfazfkftrvlpckmcnsltzgungznjsqqpzlyncpwmqlnwszwgpczoblnldpzvpvmckeggvawiwqlzeztdpeyawfvxszqpdrqnvlqixraaadfxpczddkduytpivpnvxvbgadpfkzigixcfsdmgepmajecgjshhkpt\\\"\\n5\", \"\\\"kqcqmheihegwnowzuewkstuahjozvinliwlwggkbvtkqvapvpppoqwxfhoefbubqbhpyswisbkalbvjgrjoyxijpghimeqrcxepaogezptdrxyxfwuiexwyywwwuqsottrvgtvzcgejdyxsfceninnigetacaohfsmkbgmyqymczxxqnhvixpyigssrhzhzkaqcahpvuopnsrffxezdpfxrlmsboymumocgdrigifnolrdlxsxgjczuhmqpnxljygjwjxipkwjynbsuzivynffwrxqfzchizgnuwswuvewthrlesncnpwtjczbsyotsxdebnasfotwewpajhxefwbnisnxtnobqyswwzuygpgrpvblbqtecluzpgebpvtqevvniphdvcqjinyrysdnqsojjnlcekwstjiwmyehwfjudaalgvdngffkrimyrglavkjtelnvltvsrftseiqmwwyrhilfohbotyiagufapsyebagpsqpkbjchnjoofgtwgjzqtlivqmaxtsjdnnguysmvydydzrcifrdlarmylwyzdxjqhuaukdhoaqxsxjfhmrvycjdzuqfbgvlgcakjndknxttoalrhdaexytsntgvxprtytplykqfbdwzlnuicnempnmgmwdzaderlmetvweixnsbxljrbvxshqhcdevfjaymqfmksmkctijchdavltldkmjvivkuqcgrmnxwaaruhanfmxaxciqyewsiexattmenfewqyokotzujkmzqlnbegrtitkrwarxnjaodfeobdglqgcfdurteeqivkbmsrdycbzygtoqarpqzcowveihygzptzgpvcjrgftfjigikwanrxttvnqtedbnztdmdlclachtquhablqzjjtyvcxkdeveizgdjpgqdeiqmuswngxzyjwnwleqrifvlysgzkzshdngxbhtkquyphqhkgftcwvxbcpptdakdvshqdmbhqrlksrjilhlixrbptnfhywhiczaiuqbcnizqqeivuynhpevmffkhiecfjtufhjakzosriwgqhpfapitlgsmmtoecoohpihdhbtmfwtewyfvaqjughqmjnnmbxrwcvsopxfqcktswvrdkqxkdpjyvklqxkqgzbdetgjmrfwwthmcpshwjaofatjbilfkefpjmspqcisaeobrzvbwfefgqpgvnkzklxiproipnemyqbruepcnobetlqkdcczxzxzzjovptgmywswuontmgeibzjvxhtkzdmecgereantfzbanhshjgthhhonrrhhbjddqytkjdntwvgjjoqkxlbnhtwwiasdnaeekjobrppbixcbwjabplcbruugxtjvdmjuqanldjnfhvwhhunjixtigppxvprsiomedqwnhmcxnzwaokanypzeknxzhykdrayyzmqhqwryomjgfoycqfqlpwcehdbwpqgzsdcwqkjluwzqpiflcrgrildsjxloiibubxgvcwytcjdvoyadfqwlxbemtoicxtixbffiyotmejykecajvegkskpifdzyppbrxlayebljarfooagugryhkskwhryfpabxggzwyoynonnpygpibtfvlvrzgkxqwtymewxqhjbvtipcbulehdbyeqtknrwuloyfnxpvomdhmgifavduhxpniizlungoybvptvcnuwowbbkitdckjoqoliycswkvbzmgazjmielztjgrsaiphgomxufdhtuqgdapmgfvkurlsbtokoeddduachorypdfytezrvhdzzcqxusavmyufwqxuevgxmetknrpoashmhmvjgvtzdilndbftcmcicgjxwhvamrvkqsvblclwviqgqmdfhandwervaylklcnjemmivtgtxtcytscquzdsibvekilvtiefwjftuhyustoybmtysgffqvponenlgaqcwwfzlzqalizvtwwdmmncrcgpnypnlvrmjvketnjrmpvtgzkkyqvyhdkpttmnyznyzkmhwlvzpsoxoulhvoqomtdllmiuuzogickiwoktlsbjwjftlxcoochmrsxqztakquwglwfplphbtnpnkilexztrjoniorurkamyujdhqainpuysxxoijtpissufzjewirrknfcjnwnsqeyowdmcuyhzktsotcxtjeqqqadpyakrqdjmxstxqbplogkqbsfasemlwijrmihypcuzdjeeyalewctlsxefmjjllddehbucezvdqiexbmaiaspgtlnyqccxpianxdnqyukfvdseuoomnstbrinbcgusuzsydywudijquqamodgasoxdiymcyknaoifvxyagbvtovcvxwgltuehdquaoalznskxxkygxbvumuyeplnchurhlkqutvejwyxqwzsdipddbsrnszxrzuktabpjddwgecjrzdcmfvmqjmdwjcsvlobzlbpcmztdasyfbeaefhdmapisvuysornwfpwslmyftvrwhjrcaesabbxcvtsuccihvozrnptzjyooawnvydbhhpusiwcwkwcsocjepztnhouqsyqzaqxwocxnereldxmyfvgpkfojtpycmpdpxxpcyfmyvukkurriupbizialnozyjnolemqqmftdnmwykzitupxehotywqonmqsjgidrubugycugbaexofhkmmsmrtitszcdovlhhuhjygjsozzrodgekwvarzszrinkfrlrdfnmjimmrvyqcdmanjufbtjutbitajdwbgneqpulxulkglpeicntktuymihmzknewapkmywzwtuzgafsdzqvuxertqdmthhgexujbtvwcilrgelhloxwhbmjcpjmuteykgwubqogzkauheirmxyvnbvyyucrzhmtcspgdphcmlkxqpajeypwsmokydijqxmbkdtiosqhzunpqxyfyrhqzmvejzezdektwoipsydjtfzylbfjyaneeqsxbohulxoeasycshtfdoicjpgrwjsntszidrtnbauxtslsionqlnvnhmyczpsdguifxsytciqnbvvoirsytcbytqwmuvlodhklqtwrvezoiudexryigmygdankvkpgijddnpsircgdxvbykdocjyloayzegyflvktpkorohlpxnbfivshhawszimqgqvnwvqfhkfhnkwenwamkpccrgmeyjdoscxsaszsmbodoezkvvvhldhgwltyvklkwxqxfzorttaqnajkbevjongldrrzkorgefzivewomdukdpqdmnvxrikhtusehhqdirmioeowgfbgktvqygzhspskvdngpwuyrbdxvhvoaemrzrlygcecdisvkyeyqlenznqyituuqvqyedzibueuwepdsiqlogwoojuelkssboqjhqcrhpfnuszogtljenlhrufidqnfukiniiwgpzgzmtxtuzcirifmevmfrfpvcfunwdqbupllnrwymfipzcxojmdfzhwluowvjqwxdmwlazzqlyutjgafgfyqariprmrnydywutycubfernqjaamstbqnwnzvodzozwjlisrgaselsrwiirvbrrgcgszzncmoltepnwyfsdwebkzvaaxkhybxdanpxlzrvoyyhoaxaokoldwarkbfgygvkbpftpuxhuqwotmhozgjaufxqrqidzzgbcwcvmofqmxqmmrqepsitbghnyrmxoizmbhqbxavbkvtyhstgroczwmixzkggaimfuhrnqkdywqixszebsqugiieagbvppkvpwcdcoivjranyfzozionhenhyvcokearpxwmwjlwpoltyzkpsjgiuwreszasywhuopxpjtawoimiyaphehibulkflkubdlylcgbqomnctvlxzowmhhreqyuqepsmkaiwmglqzsrsmvquiwjacticlrjnhyliqqxbgnxryblnevkugfricwvblfvhruojehaodbfcqebkuxlpaaxylrzoqdfsqcwvovkugeyzmxhwrnpyjhysgkxcoyrjjzxsyoopwfpynsknppfmhvrlbiwgdoopdfpgilqpgfzgqqyhwvoxryjrzqxiaezputvlkawwouvyxhigidmzvmzfnumsjugkwcqlutqvlfvvjkkbmwhkccsxucevyhfafovwtsbnkfbgjocmxchlvhsognmyqomlcgrypdsjxhynjxcwcczquaxulsvxcjdunhchulnpmefwlisjqvxkififzrpmreladkjmortwixvnmnmhhcerojlwntpdbpolllqadxivqiucgmmefhnahfycqnzdjscryehqzjexicinvtqbgvmgqfxlvsaeyrcpfcmeaidrifhayplqjvrxykolnbmvdgdzhpcpjwzbzlshgvoxkugyyyxtswfatbjofyyubvmvdzueyawvaujiuqlqjcinwkcuzukiumulfqcjxpttncwicfewflzchowksflzcrxaebkkebyautalkofbptdvgvpquxadaburdojzmivanvufigsxollgekonymbadxurtlgkkfodtmaaiqyblqjttvbgznvnawuegjrelqhzjyehboyreybvjllspjukzxgskbhqppvxrygziqtordmkskpafxaoesjzrhnojctizwocdvyhfntnkqkwppykqiofswbdbhnvoyvlxeimksyffgwjsdlezxynlhjydsqmnxvcejkpnohnyumagamquesizwvzlvorrjaxemtyobrtyqbasmlotvsaarrujjdmhtsmgvkhotsvbkskouamnzhgyvldhfsguryoqkxcapetonlmbqubqfakxedbhcyxsohgjosoosxlhrpryekbqjahwlljqyvbwxblcimjqcvfeuuycxblmxgzqcevjvofwajgkpqndiywshkdweosanlfnmfxnmavyhzjdezcquvozsjquwjdlubryrfbdcfzxasgvnjjlwjlmksxqatbjgnloitqcclnexfqldyomkyrwyoyaapryhzqjsyovcpinrdlqsrotsyhacrujptgyklkiejfvmslmrmoekecbfidntxdmhlnkirrjhzotnapgpxawizypeerkircjvifirzgxnvxkbygthpgjvobycygirbiptexjsoambtxkjbycswzradntgkoubmwwzsqrdfmcoxcndwsnquppbgqrzqigufdecsjtlyciizbknscmpzdjewonmobfcmbqcngxsnwoscdqpqnwsxtxfejdxrilgmmexpybhqobtqxzxudzcparldmsnnhtpptaejkrabtaqraybobwnpucumqzwvsecbvqviisrgrdebcnwdfjilbqukflacfmpeirtsmafqipsvaqrqjqhlqcuhkyhrwyujdfczrubrcekuamtqnrvvkroevhbssvrvybihnbtyxymdgndrcpospdvivyszmubwgdommmpdtogsomxgomukjkhyzhiqqyszowvplbxgyevomrzgulxdbfmixgmbqsgzresgfqiyzltvihedxnxcokvjmbwtbgvmkaohtfhvzrpyvmpgvmwhvygejgeywdbhfpgeyhfvqqedozcaxfvnjfdtwfllffjbhpjlvcqexuhuurtvhttromxtrxfsvbjkjzlainvynhgjduwmybxxciknpmbixooaornnxqolodqghegdkcmksfnihswlgpvhvesvcrypespbxwyyotzphmqctvlqnrfqedcdoozlrkhnzvebkqwimpnacifttfzqbbiwpnduixlvspmnfzbymxrunfniiloijgpwlbswxeuwuevkrugyphmgqrswmspljbmpjgzgehkljevjrnvfkaeyiqklcpswgifxnqpkpuvfizhviyfejecocfxrazmfqkiywqdfkxpclcudwientjzidmssnoeyhqscgyjzkbeffradnprizfyodcwylxteeibiutwprmwwtmvetfpcidqsjhguikalvdjvintrhqysmywqrqveagxduwaigpcmwydljaizbdgbhrsjrsugebyitcgrnhkffstvwathdwydwckxlsfjepiorevduwfvwwyerqzcgwlazhxgxixrmbcdqkwswtkmmdzcokxkxwwltukyisjeprtaxwsmmkbkeezjolbwfpplkdfpjodqfcsizhlnfsalsdescboxogtidkzlurzgeaykworwvtqqelydcifxnsdnebgakpihejzwwbbdhkoayvknznodvgweeblobcsqgrhlootngibfhwvlkeqloscrlinrnfajdcmamtvmsbxmifqedtduqmraakxztobcejczwwbehfgvwmlixwtujhjsdfjtinqhotmzdjudggkqsorsyrmbanyaifkfkhruyxalbsjeectphhkybpewghwemdkdzwahhoaqgzrhllafezgwpzgcxaicoqoncjgbweeoaefhtjtwkechbgdgclmuieyabrtajjbsepcaoopzskwjbaxtioopeuvsuhcszztjvkycqzshlycmsaudtcvaytamzxkpeivmxxrnyneafqpomcflcgvbmtmbfrmuprlzdtkmcysutswhqeaxrlqucsqiexlfhdldbuxxgzudobzlwoeszeoumfnryutxrdhosujdoxysppddxvwkroafsbdmtcehsmvmzcfmvujhdwsxidvvcyecerwnrgmmflxypqhkmabjbuahyhcdlbvnjswszvchjkftrlfsbtjgukldmxgwbsbttolkxxpaslmfsledvqejrojlywpdmzutrvwbuuldfoqrsfxamgmbfpxykisxpiwgsjsdbbwqaksdgisnwcckasgnbiuyjmxivlkahdpmecmxoodgvvobavbqkbfaxemadyjkclhieuylqudldcljrtbcvbiqxettsaaxjecjjuynstugyahuzaonzozziieuwxadvhbhrnucjzysrxrjutmpwdwraqtrakqtmivpyggormdkypbevjshggkehoiywieocplpeezmghckkklogocebzauvywqekosbbnkwfucihqkphhgyxvfhpfhjacxicgjqwjzbalablyrrzxcjbmeatdfweqdlxntogeojejujzafzxwpgfepkxhotuxuxtxsjhsbeuytuzgbkcfxdwlpaxowlmyffoocadrwcxmidvbqhrvyuexypyychcvvbwsxrkizatevjlkwspakiltgbuhgzrnvjqvcrxikjtdlzpflvwjpcpectxcdbndkmbedhnnxmkxwfrxnhyrfjnocxoozerpxjhbfpxiveyjgawxfoxpveutkyxbfcrnbrlfbvbbrqrlcjcvmqfjfnnntenzbtkegluelqwhwsmvsfmwomdfhxrgjlcvzakfqyopdsuknjyqadbgaabhxlfwjqpiuqeqjqvmyttschlatqtqgrvzcrxuzdvlrwcvxpgjekdlvprsvgqnjoyyskzggecssgwdkxtrehkygbvnfbhcwtlcekxygempbelldacfgscrqvsxewhtfqbkdnmvnldtbwkqebraxsjkgtwpucgtywfgrebaempnnzcvgnioiwixzevzagugdxvwsvpfwhwvineiyaptoaotsytuhvhlljzuryzgneevedecmqbcbjowyapvdeinukadfbwmohrpdffauegzslbmgbwphvteeoaoxcqdohdfqizxqgecqwhyldfpqcwrwompnqfsfnzmrbtdjzndojdashwwircatzsbxekyhzvoptuxslssynmublhduwjweaohgwegfvmarttfvaiddkgfxcptfkqwrtlieshuydgbxqqivljmuzdnuyaikmoaxlminabpvapknrsynoplvpheedjmtoavtmupvgaacelhmxdzutsombxjeoxsmqmthdtovzgmilauxkhdmdzftbnbpgnuxksifimxzyfvasgluboprinubqwijjzptmyynznqdgzgddupcprrxldqplblbyzyjjfsyhndekkhdepythnlctxheuihclivvqlwlyfnucbrefhchelfbrsunegpqpetymfkpnldewemapknpdnnyxzhvsnekdhjdvtsoonmpwhnukfkiklipvdvcytbolqskqglfmpyptjiybydhhpgbtutitbeyypoecxnxddyrgbgsocakebfkioqbgmxfnflgqsvcervjunqqtqrrksdhibcqxgslseqcxmoliayllawfjxqeoyrwakvhppogjogvplbefveftxeyedrochojzdmegwldjurwggxwmrsosipzwmhrkadkwrrpcfkdagyjnhggdjfrabuxjeltxkabnfcqcgmixdsaccdhpsqjkcicxfsjuyeiybotplvhpwrbjlapsthabbgtnruixjreouznrawhmdeuvkmorvbuorssyzbjhprfspvuldctleqvaqcyjpinuttjjtyaagqdnrxnydqdknutwbhwqcchpaaigrzfdqmlzfwjstpylcqgffhvpcipgifdptawkhxmbdvcgnwziniomzzrhrkmaarndqurrauxupqhqbwoicsssxldvoxyqdmrwfdhhgaldzyezrfksavgsowfdzmpriytfblsyvvkjzztqsgepllijssnpberntnyzihkybrvxkzrwpvsxyddukmpnmxcxycpsdvfiinpcnduezprgqvdyjrzucgfyqbijaspjmvzxezxpgkjqhabfnydzmehjcyqlwobakrcrstergxtflcfmkabxixhigltgczbqrtzobzulwosfwkkjhnrakpxreyeyzynixkmzkzksjgwyqxeyqazwetqbsqkiwwyfihsymgkxlkwhyawupjazayisulbbbqvpqdetubdymtzetqfvemzhwzmnsmbogegfknxmguagtqoohiltlviupsuzmshqnrtmjnmuzcykhkawmcyyyzkjvhjwkqjnvcyiciysbjutzxfwegfewjyubakpdaemifvoxrdryircqullhdwrqmmgzfmjeshrwfdubvzlqcezsuvdqyfibelpciihmyaxthtbzekaosvtslqyuqxtqbeygthigrtpqhqoppgdfupusfikisxujrfgrbhqgfmqyqpbqnefmqrrijtezxxthhujppemhadtnumohljsnpeafgxycvxwdtofqdhazvgooboepxxezcsmphkwlkubmxtiuroutleymalsjtawesvqieewbunliqktkiezpshbipjliqzsuxuqjbtduasxtawseldmkuvnzsisjzpyokaxrcbyjfotbeoygymmdfhaqqawgqplarzvodapjremumscxdnnodfmwbpaavozgkauxvvfnpxxsntthcxuafomjahtyikqyonutmgsiqwirhmehidvxkbsivmnroyzpbkiayfjibgarokkhgiktykwlicpyxaspgyhvwvmeylsjfqqqnnhmhoeheiccpobrprbjxzkjxkvsrataeftrnecyzgwntpesnkjahswgwarvmvshzznktnxslkmniazwgqmvwpeqkyqnzkgwxdoitxnvkbrujhpxsrspwwjrhmxazxshsahanslklpozztyrdqwevcjyybjebadslqvsgjpkpqsvjrmbixyuubopsbhpbqlzypbpqvimoqquvyfbepfsyyymjzulnxqzxkpvqotbqdjxctwehnvetiorummcmcumlzmkgrlpuwwmepaulbuuwcsqutnrnzfeiflydpptqgzvetkwxdgcbhqisuauipsxwdnyfkrzyihzttvtylujdswmbwfbpmjoarhzowmayommviocuzhszqwsgkwazfnyvprnvppbtayladdapwgkdvsjdztmzdaazhjieodyybefabuvbsnlktmltahpabtyltpbdouxtkesgulgkgylprptcwvfcpykn\\\"\\n20\", \"\\\"vzfqqpmafndvsempwivhsfpmtwqctwfvzpllpmacwkoloywxymnsleeoedjfpmsejzvcofniqxaxvyxtvjpqbqznfbjfqtzvtdowzerwjxpzcufprwgoyddfgljpjomomkyvxxjvqtrxqafjmppnaldjndonveerwsnahwckutdssqtuaggckuejfzxlcyhrrwjlyjvzsxwdhhcusmzyqgbkzbbmeglrrhmhwpzrlichzlxkcawanmpajdcokzqudckirmuvvtisncnerdjzctadfhtpwyefwokpegwbpwcxijahsqvhmqlmczhmpakzlxiihsjcgucaxdtsvfdrfwmvskgaofcrtkiulvcyucovcexqhlbwovohkqphnmfnogmuwrvlshhxficuhoxdygatqxsnmneagciyswlejfaxsaulxhngtzqqbifppddjghmodtcqbawijstmvgcpciimnlxwdeeozedezxvoimbwnlyqdkiunduprubxlrbunlyhptfcfaqckwhxxrzyrdhjutwxjmhjlzfwaulnvgitdajmbwxjmxuxdkuotvmeyoixnbnmypnkfsrkjgfnmmwybqqkxgotnegqdpwjzutsxgkksteelpkbwlwqqztbqlzvmombzseetikglbuhsiexiqbgaurpfpvavizqclwtqfegnhfmochdbpvrezuppvxrmdkxxdsxdpxoyrvtsqcjknllpyojsbvybyhilirofvtueefpnbkathdclflxpidharqvuraaimoagkxtxhvrjopgnnaguccjehxxyaejtlggptfszgyfyqhjnewmmkcajhkupfgcsooodfjfnbogqwfqnvfoqfyymowaqvjjlnmifaecgqlipjqflwxdsoqywlozxrpfksfqffykdlmasypzlwsirswxoqrzkxqnheldktrubkoiuxplmxceicswbhvxauqxgetdxfxrmvmdcpwpgjnaduhyaryhdjtkvrtrsunmpioqfjnzncjidlboqqrswrhssokoycmrjfhsdfwdbvaoyddlnlgxzqleszzduhdruzfqymxcgavxcydmnyzyrscrtzrulgfywswilfglexwqossrjpvqslolvwzhyopfesjinpyxvbhfjfynurhgpvhadhvjrpkzxgfdfyjekjzohizcjyqvnihcildfiaxxocwmzadbwstmgkimbecrgsevpqxppiwfnfieqcxlbrcfadpuphqsqgqomrhxdeajukbtccznzvpdzviimytqztsxiffyvqwmikkdvrmtnwbgkhwcujqkudjkvpwtavfjikfqkqpophtbqsqqseyanssxaawhrhnrtluzumpyfzhstxynldrqycxyhxvadgcbclzuwpuhhwcegapzsjxkfwihzcucpanvumebeomlicoudgtlxpptaystnxekwbkabvxkusnjbtimegyvswccngwuferkacicygtqibnmpxwqlqknwdyfcbubwrtvkccixjinbodbwgwsqlcfqgasmfzvjzdzzpbvpbfbztrwetbhvimpmawkrswygkcemxhjxcpgntblobrmreaayjnredmeyssfwvzuovpgqrgrhdmmcfbrlbcfmoxdlgbshufaoztdwukuwayhlcifngxyglcptazkixoisdohuqaxqrqdxwscisrdalznhynemlzllwfwwlcohxftytvcidilgviumgcqrccgvqdjufaltpoywfuupfbzebakkrmcjzjaqfurjotsfpxpsreporlupqtrcfxytfpjcyemixjqaaekozhguawbgywohqgyxnwgitwrozbhpzctybzdxtgtwxnlomyviqighhogxmmvuiojwtscvptfjeqvpxikfwpewuzuxbghaiyfwvpbgnhjtzurdumgmkgrrappfoddjncceydcriseypfbalphrlqjrlwrswkgskdusxphtviasvfwkjmzpkvxniewyvfchlxkuitdatgonllgtdjmhyndquzvrznxrrpjkbsqqooldcqdmnrqpnexzqljtwjsoqcljwxhsxogpwwbhgrbfwteqqwbtvrthwpsiqstwifylfyyocsafdliqppexiftzjqcykakchyzqeriazvhckadvhqrvloqfdnkrjbyrjeywvmgbaszdnlohcdnnpvfcotyahjfvzdixfwxghnrzgdazvepezsyesgkxzahhszptmsdvvyrwdkjfwrqievuiqxwnikqevgtbiemchkwekotveaciguksmqqbfcccvejmlynvpebubmhqfmarajtwwebubienyehgdsfyfosjqduaoqtrymmobmohagxitumuuybfmbudsuzdmqlxzpdsufgisnuoanojoflabuelcuptynyirstqhmscgbimdqqcjmcldrfaqyfcqshzmyiapszrtwiwimyaaolioilqfopgilqpnozbwgdmvdgyhbccykmlmhpkdyiglxdokloxsideopoyffzarnbihpwiiqqsguavlggkxewnpajtrnklpwbkwwggcdkinoxzdyavyvntgmchqpcqmndwspqyyaatsyotngmqlwoclcmxgsborqtedwecigcxfeqqlpfpnmuavcbnnfksytmnwcerwqdturzynsovyugxgajxhgdljiouzminjkoiwlpjelwyrvxcbckjcghlwhcznhlnwzhvcgwgzaeebhjfsnzmvhgjgusutgunzstfvliwcndvicreskbvkxdocvqiwdtutvfftgvgzgzsstttmctrzklpfozvmtiughcaplrunygxjgshugbfozctsgazgxiqpjotgyywocvticlxyogyhrmjqtiuargimwmlorvznnsdbmhvvsmangnepicaoblfbdjaegaalpahfegurlraxyphmpqzpjgluahczftxywerbdrdxawetsszyfobgqemdghhibmbkrxaftzdhiwfdqeqddxubtwtjdxcenswhtbfpnouyhuaqiquenucsqmofdqzyiuinincliwsdedsymbllkfbmzxpojmwfdjkahrahobzltumcsicqaibsvseoukxidikfrlawzgcybzzhlsbusfapdtwawtgbwpddvijvlyksrwwvgirpzbzckfrbqzawildvdehkggfieyzwdsmtzueipbxdlaujllueoijkepsnusonuwqgsicmrjvylyzibspizcbtlfoldfymlmolujkycdljbjcamrdpmceerktgxqpmnmkqdqjoajjacdjrqwddrcaukdnfteptemxvxkvwxglzatjtjcbhixwrxtmemzvgohyucvcxkxwsnkbwfjotnjlztiwhjtjeaibcntqdjbgbixfrkxayklefrfptoivtfuwrrqqbwofegpccbtbohzngomalvcgtpzfjgunqngrqdidmbdzpvikffsenducryjyvhgrqzywikqcfgqcgayjbueukamasnwbdiumzoykbsbbgapjsiwowehqvjzotymhhpaxhptfyhdopcjevsqjeitlmbxgdrfodqsobfchwpbizczgpkejmjjotorqyyjrgifuoislcawhtysgdmkqollapcraakvvlbsfgyvbdjygrgevfaetfltrwhtxdnjesmmlvquoofpahdcuumjxkxfbpgbjabczupzhhfaraedkntysajrlcawlovtkqzukdaxkuxqgjorkeymyzzqwwkihlrukekghmnhlsldmhvnuhbyzgemttxyprstiimevblpihttefedcfjvvgosocpfsghtyehmkmlwcdmafufpmhtjylunuyehasjopcwcvxsvmjgvifbjlggtzzcypeubbsqkvmymmyirldaoibdzjazzqsdrfarvdnpdgciqmbzzkpxrznwlxnbuawsdvlzacamzefhanekcjmmmbtkyjruncrlmlqydmddrryteqtvrcuodciqjuwupagxfjixinnmkfrndxhvgrrliuxsdcojgilpxhyhbnfwbypuxkzzgfrdwjtjxdpacgjoosigwqvforbivpeqrgxubwfwxtqbbvmosritpdoiijutjiqufizzjzmdxijwydhzmmwhrmisyzgydggfsicuoihtosfqowdygjcmrzokwsxaletyfyjgfqmneispuopuxgmamicinchfmityyegpuiismbpkzmnjqggztyhnbhflqhklftsbttxvlnoccurpqkvjafcuvjpgdzpxatntpjluxvnrdquyvgfxdwapecbktvortgvimytlgilchfxbfcyqgsxwcugqsvjqehonolyutgdbogjtlptraejlinfbbcuezfebcakmqjqivcfhytfgaiiatuvogzsbfbvvlhvgtcnrzfcvneuqgbiyiyyxvlgkeotgmafrhbciqrlpjkphqzhrmofnuokfiapjhatrunligksmtmekclwhljbilcpqndsglhtmxgkuadsokjsgchngfuztyjhgdikymdxpkychefbqzkcxndkrnalyshzexrwunwcgwhkamphojmnwplckmbbtykbcjhxwhwsgsidrbnsjxikpjkiyjeciafsrokankzhuciywcoiqzrrtklfdendphydixgylwryimdgaafvwlwmrblfwsyrqzibtwvuyfgvluwurhqsyqzpfxzgnwjimrjcoykspqflqaghsmzdfngexlyeqkpbruntsaqfiekcxwcpcjvgcdkehjndiwfdcaicsdaxifzvixubtzmekvfmqtydpopganrbnwbrisihzigdszzawyphdafcdcumriuqockpgfvhpgwylgojudoyyllmxebloowjvxjouvmagajmkehltwtkutclowitsiaikgvdynemdnaiuboglgevrlnfamwrtoordkbbgjqxfvnaqodycfefgvawcsqkzkjlqqgjkwkhkihvnbswicljzchpyikqosnfrxolronoikeayeidhcpbbeltthmewgeiuqqjsuiavtmghlfeaxvxouxlcfnwrrpdfbooqfprpggigqkolnjmxjkmzlzodlhqicgcpgrzvklcslfgqpeoerzjvbqqawnequcftgjkhnzpydylehuuwdlsoxeqdtkwulczebvsjefugjxyctaiqgdlstsnlfmewxzamaxrwattjnpnromifrskhqcxylxmtzhgasionpktrokvxuiohxjdxqfzvvzkljyjrjspggwgwhrqzpliuapgdocsxbblmdbtoubbylbzwmdqdokigylibpgpxsolkaatyoixptzwpmpvcesrhwyltkjkvsdknddalbkrnewtkiqrptxysbagesezclpissqoykejjletohcvsublpvoymewzpqwkvenmpjpqwbgjonzisorjfvimieqsntyzeoisyulcmqvkubajulvusqniykqwtjoygowwxdgvrrdovlkbazrfgiojcdbiqearycppmsfqaogllorzeuzlpxvfepwbhpxpuncsepffgmflfyihoqjmhjveshrvnunjvdplpmngslpdhdxioefoinzbgirvtqycfvlaajyfhpqrnsqtmrgmtkwmhhvlfdrlixwfqdlxntwlwdwielkqbmqlizvmkoeasrcgbcnxtwhwqcbwboetevmnfdutatmhrvacmzrcvjayxfgoliecrklytobchqqgmqvyeczzhnqmqikpzlfsxnmipelerpubdubnbhxubkyrspczypjdhyrfyjrljaflysrtdoybtwlxxsyjmgazgevbsjmzclyaqjnylgouanvjzfjegwwkcwtsmykhnkdxjsiklszzslllozfcwcnbpxgkdflnuvwwkqjdouajxmtffbcjjgjnqrxzofhuiecthyxfpevotheasyplzghthsylsbhvlhtcxuyplgelgbeezansrgikwetdvleibocxjxpoemlqzemnqgkbkxetlzufuuvvjigqfeamkrlnakjheyoernhvqwtinxyltzupfrxhexjzeotgmpmneaardnjbwcdpxnqbsnlnlpwsqukbclncrawwlhkeylruyqgbxnnukuudmxbihgcoysqsmyknkxcwlepmqvxhmeuiomoyzsydylpzagiqlyifarkfcafhhflhgmxgsdinmbzbmamdjuqchvuyniqhoxgzobuolgqwoesdpjljpzuosyxlgxgzovkwyafrabiwldcteceiodkrccofwiujgqtbgbyzaryzcjgdyvbdjtwnwhonluypdsmkpwwhxkahowwcvfjslxyxdwdxpmpaiimsicvjfpyyelnsdranlfdezvegbjjbfgcwitvcnrxiajxxmvpqhkhurpdclfoeszlzaapqrifmyjmjqowkqmrngmhozmccvrpnqrwkbvvygsdokejhwqqripgtfluzbrbruorqedjvodsfmctexltwlzlipegzhlestmtcidoilkafrvhcoatpvxygmlfkozdifocsxxxitfyepneffrfytjaiuikuogckodtakvfgkpnntcdbqqeipsdwbkftzztdnwruaigyasbommhzcqrfaguwdbshpdsfnkymglivltwujdaydxkesntgfrqbdzdcspxbmjtorjiouzkmqkbvakyteoplkaadgheikvlvdsykozurhllbraqqjidbidczbxejqaljragxxyicjhohcsmcfqfwurbyzqialayezypawblrmpovmkysimjigqzkenxaqwxmggxiirppculyflhqoofhzjboflarpenlbgoamcilglfxxgkpitspaonxlxdnfttiadgnduwjzmitibilxoxxcuexhzcfckqkmyukwxinbgvzejbmffwmntdmmpzmkgodrxwrlcfbyegmmwpcaiexdpxvmiquuydycefzhkuwlewamkzpvggakaqfcjztkkzdzhqqeqfujppfbajfsypaadhwgavezduxuipsfigehzinzpyowvbsfczvhrkhzhmccnwmfgcxoxbktxwkwsrmwixadjoomdsqigexuhzvmuflnhajnkwoxwhucugfsondvrogdsbfgnlwlyannugbthciiegdsxrffcqzqqzruosffwrbakumcksfdatwbsglcjjjvcrmbugxdoncqnedljgnvgxhzpcsmowfcqamxdjieiaftihtuktlykdafhmaznmywwoofxsqywysundvyvouxemxsbwdejzmoqgdppikxbefwifbwptrjtephbzpzpfpztdtdhxybaacjbvhiwilpqlroyctaycouxnbnqdadbjzulzqbjcqcoxtypamlbxqworidhpfaljkwranvpwkhdmaijuuzqchenqfeojltlycbdmsotfgdodbophvvlggyijxebhnjeumcgujogkfszaskbbhtuysbekpiogxolupbqjmzrgyhnofewtzaxjplrmndscktixhvaemghlsgnfuhkuhxsswhunijccflsavtyawbqavacobnmfwkkqqdthqkbearlntdgnbfugavyevolwswunkmfbczyqxnkpuhwpwzypgmbalsexyytjodpdrlxwvatnuguqcbwgkzbszjfkxljnzujqcftgnyjdgiaqmnyqeokhurvnzgzjphqrjnpjwyoommkevsgjbvzvcuyajatvqbwrheancfbkkkygeegkenkphljnhxczusnucyrdjtgggmbklaectokoylltbfcbigifjwisgrwhzdvauipjkerxzmdksefbvxybvhagfpnugkloldohdryrhwjmecfrchilxxcxlbuwoqinlhsgeazferfkgfeprpedfjkhicvozwqdnhhtpoxezmkmdmyxojxdzomznwzjkzryoxgeifamgckcekkrccihpndosevccwrhmaluhqdfuoiyigovxjfqoekjkxibnddakhpjvujtwwdbednjzdjqmhslaprgcscbzrwdxngsmlcdyxewwvrtfhevwycyklhnnxvediemimfolwzrojrralzuzrhzzawhujvseivhhdcwtsesmptcguuytbiditqhgbjguhbnqevwtwfgzsrvprzjmtdxmqjgsaseqxahzxtocvtuhxqymaymmloyritrxrbbbmdocewhzstjgfjqkdsndcxgoeahnfosaefzvsimxjhiecfjnsgtjcgllfhvxtpcfecitsqbbuamwktiipaqseuexbiotvajglnnzqzbkcraejcnroiygjwmryybkdkrjvwpjubctvioarzbcosbgzinfucnizlhnbbsjmbmusyxxrtvxzysbjasstbqpyyyqqgxajbowegezgrapvxiziecpbvbqecwukqthrolhiqtrcudhgufqimxgzterbttdnomsiyycbiqsfvfxmsxgsqrezvtaawmkhxnendkivysapqviwplvwiiytsoxxqryjinrknelabyiokwhvflyjlzghazpprzqjmigosxlctflwredmdikvqnolwmvawizmefcymkhcpyagaehnftzgltqbraxoizpqfnhgnmbzrllsmmirqokqmhynqnuepkbutgqxnchappspfcodqzkigwtlaazxbmcfzbwrsxszodiyfiisktsflmqmrfoynneiamwxmhrucfahosunwlfmnauojhnxidriteheuutewpqxfcgnfqjymzqgvratjeylvzuhbxksstexwkjuphwzylheowxewvkjctsiumtqykresmpmsofnjnwrayomwfrpbawxpvcmadxnwlxjsimsngzajrrxrtiiunkmjqwtxysktblxaqdiwnydbjveplfmnzgxqzslriiksettlsnvkfyxtukiupfmqczqoyaksmilxhsrvbixvlfefxpkjgeknxstfozlnthgqdwujtumtxrgzxoenmbdewoutxghwzctucksbhaczmvnevlyioomlzvxdxdcstyyytsxsvisjdedjgzrrkxxayqosrsibolspkxtqqdgsmlmzsiwawnttjiuwpjxnkoaqgxlqfqdcyobfbiuqxuawdmmuokdcjyylfqekrmmnxcgnrkchxmmephnuwkcslgtofipalnrleetgusqxrrkybjhbwsnlokhcqfqmxmnvcmekrontesnojojprxmuokaepzllkugsbqlbehqmxzfedweqvriytyzbabciygippabexrdbcvkvrbarjbaeeohniuqmfmzbebxiksvpvtsvfumsdvskhdkdwxjpmmrutwrghzzqfeotyprdvulawllldocsfgwefctzlpvffpsbajjjxicojoxtijajpaaasyzvjvsmgktagzegocwsgxlxsyohrcneklyvdkwmgakvufzvwcbkvlowpdgyhucfmtczbvfmwakicerxqneduiaxtlcywfkhmmwgwpuelbdjiwtdikdmpxynbnujlljgucpvzwbewqkgrmnasfeuhqgbzzjrjisckasjfujertkcmzfyrjkkxldpbtodtxkryvqzsrhmcvggkucrqptwxhjgyegajfyccmuxpqpjyyeevhweekzglyqlembuofztjysnoefiqftefhfqpbawisumzcvrmaxinrmnabffdpslbaghrydxkjdcxhcpshpthqksqbmfqdazrdxsridixpoyssphqaninoitzentgktdabvvklcfhnklgwjhbozllwliiusxvxhgsqwhdncqzymyrjmiglbeqdxnrezsldygnmehdizqwqrasxtkcnivnizhtzsnefjhorkugnaogppftyifocxxcprakiqmbypvhglkzsnlwddkinwdsqwnztddrbxiavdaizcdijomqckkefwcsvlmyuytzxbb\\\"\\n10\"], \"outputs\": [\"3\", \"1\", \"4\", \"1\", \"1\", \"2\", \"8\", \"3\", \"2\", \"2\", \"4\", \"10\", \"1754\", \"251\", \"777\"], \"fn_name\": \"maxPartitionsAfterOperations\"}", "source": "lcbv5"}
|
You are given a 0-indexed string s and an integer k.
You are to perform the following partitioning operations until s is empty:
Choose the longest prefix of s containing at most k distinct characters.
Delete the prefix from s and increase the number of partitions by one. The remaining characters (if any) in s maintain their initial order.
Before the operations, you are allowed to change at most one index in s to another lowercase English letter.
Return an integer denoting the maximum number of resulting partitions after the operations by optimally choosing at most one index to change.
Example 1:
Input: s = "accca", k = 2
Output: 3
Explanation: In this example, to maximize the number of resulting partitions, s[2] can be changed to 'b'.
s becomes "acbca".
The operations can now be performed as follows until s becomes empty:
- Choose the longest prefix containing at most 2 distinct characters, "acbca".
- Delete the prefix, and s becomes "bca". The number of partitions is now 1.
- Choose the longest prefix containing at most 2 distinct characters, "bca".
- Delete the prefix, and s becomes "a". The number of partitions is now 2.
- Choose the longest prefix containing at most 2 distinct characters, "a".
- Delete the prefix, and s becomes empty. The number of partitions is now 3.
Hence, the answer is 3.
It can be shown that it is not possible to obtain more than 3 partitions.
Example 2:
Input: s = "aabaab", k = 3
Output: 1
Explanation: In this example, to maximize the number of resulting partitions we can leave s as it is.
The operations can now be performed as follows until s becomes empty:
- Choose the longest prefix containing at most 3 distinct characters, "aabaab".
- Delete the prefix, and s becomes empty. The number of partitions becomes 1.
Hence, the answer is 1.
It can be shown that it is not possible to obtain more than 1 partition.
Example 3:
Input: s = "xxyz", k = 1
Output: 4
Explanation: In this example, to maximize the number of resulting partitions, s[1] can be changed to 'a'.
s becomes "xayz".
The operations can now be performed as follows until s becomes empty:
- Choose the longest prefix containing at most 1 distinct character, "xayz".
- Delete the prefix, and s becomes "ayz". The number of partitions is now 1.
- Choose the longest prefix containing at most 1 distinct character, "ayz".
- Delete the prefix, and s becomes "yz". The number of partitions is now 2.
- Choose the longest prefix containing at most 1 distinct character, "yz".
- Delete the prefix, and s becomes "z". The number of partitions is now 3.
- Choose the longest prefix containing at most 1 distinct character, "z".
- Delete the prefix, and s becomes empty. The number of partitions is now 4.
Hence, the answer is 4.
It can be shown that it is not possible to obtain more than 4 partitions.
Constraints:
1 <= s.length <= 10^4
s consists only of lowercase English letters.
1 <= k <= 26
You will use the following starter code to write the solution to the problem and enclose your code within ```python delimiters.
```python
class Solution:
def maxPartitionsAfterOperations(self, s: str, k: int) -> int:
```
| 0
|
{"tests": "{\"inputs\": [\"[1, 2, 3, 4, 5, 6]\\n[1, 1]\", \"[1, 4, 4, 1, 3, 5, 5, 3]\\n[1, 0, -1]\", \"[81, 50]\\n[-1]\", \"[7, 57, 88]\\n[-1]\", \"[28, 53, 21]\\n[0]\", \"[5, 47, 63, 48]\\n[-1, 0]\", \"[46, 60, 80, 98, 90]\\n[0, 1]\", \"[9, 83, 77, 75, 39, 32, 68, 60]\\n[0]\", \"[73, 26, 7, 20, 30, 48, 97]\\n[-1, 1]\", \"[17, 19, 71, 21, 2, 24, 29]\\n[0, -1, 0]\", \"[88, 35, 41, 84, 38, 30, 87, 7]\\n[0, 1, 0, 1, -1, 1]\", \"[73, 34, 14, 60, 77, 97, 54, 63]\\n[-1, 1, 0, -1, -1, 0]\", \"[501399232, 959315981, 630569939, 369992778, 762747706, 678500115, 290334310, 666493456, 207228447, 367090709, 710041308, 135377803, 814213426, 969179920, 869845371, 276379138, 120760857, 852013521, 967284240, 76906837, 464555393, 865016650, 788827506, 750075661, 847293256, 74072686, 273445644, 611123245, 679977255, 717345474, 672117374, 280314168, 18176283, 651591389, 946339492, 884013286, 863214339, 121877045, 936428905, 749504839, 49112178, 961728742, 118501222, 442201631, 950793264, 180831825, 51869751, 502194993, 826181405, 198659336, 587636696, 222864939, 623098844, 210888296, 398223150, 59909422, 352052866, 429669422, 64797567, 780553664, 286945028, 289350308, 607115484, 416826628, 227986024, 665979338, 938728931, 385600482, 799076139, 408699336, 456756072, 482748621, 879865330, 493872639, 393551506, 925116932, 981007406, 454780366, 652424028, 991421291, 166830803, 484315076, 907419950, 875405057, 939199322, 153628762, 967592872, 419748504, 797841033, 533613156, 763571640, 462980381, 865162358, 906034855, 973792201, 150079861, 982936258, 499336540, 384170831, 15599924]\\n[1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1]\", \"[131844005, 503539488, 895277194, 759135098, 222859496, 417206297, 93592988, 652746849, 668575746, 426968159, 90365765, 524804995, 424162038, 852071046, 595357210, 495180102, 671676834, 876299439, 994737405, 627163327, 244830313, 602073054, 300741633, 718338014, 289606104, 39647787, 321603458, 111918550, 601078319, 225088907, 103288961, 512810211, 257054465, 258736734, 792225867, 940177318, 176181969, 463804773, 936882278, 82890317, 212577344, 883127335, 158830242, 839256780, 413346255, 235128553, 309360347, 183335816, 935094040, 716290736, 242939618, 768597219, 867126752, 588146428, 708144623, 744416831, 646490848, 591132747, 896874946, 708473731, 653644741, 988864797, 684605163, 632823994, 860471013, 156163540, 457954345, 621980039, 553883429, 973856399, 847853262, 301416141, 67641836, 343357596, 428499293, 259578322, 344728849, 561456318, 273243699, 788203584, 350552917, 808682861, 788006599, 961916298, 480628920, 117333757, 572805397, 941296324, 914575507, 789429393, 373909251, 1504179, 335023081, 404799938, 519327858, 749008948, 355046964, 375123262, 858160530, 666369522]\\n[1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1]\"], \"outputs\": [\"4\", \"2\", \"1\", \"0\", \"0\", \"0\", \"0\", \"0\", \"1\", \"0\", \"0\", \"0\", \"0\", \"0\"], \"fn_name\": \"countMatchingSubarrays\"}", "source": "lcbv5"}
|
You are given a 0-indexed integer array nums of size n, and a 0-indexed integer array pattern of size m consisting of integers -1, 0, and 1.
A subarray nums[i..j] of size m + 1 is said to match the pattern if the following conditions hold for each element pattern[k]:
nums[i + k + 1] > nums[i + k] if pattern[k] == 1.
nums[i + k + 1] == nums[i + k] if pattern[k] == 0.
nums[i + k + 1] < nums[i + k] if pattern[k] == -1.
Return the count of subarrays in nums that match the pattern.
Example 1:
Input: nums = [1,2,3,4,5,6], pattern = [1,1]
Output: 4
Explanation: The pattern [1,1] indicates that we are looking for strictly increasing subarrays of size 3. In the array nums, the subarrays [1,2,3], [2,3,4], [3,4,5], and [4,5,6] match this pattern.
Hence, there are 4 subarrays in nums that match the pattern.
Example 2:
Input: nums = [1,4,4,1,3,5,5,3], pattern = [1,0,-1]
Output: 2
Explanation: Here, the pattern [1,0,-1] indicates that we are looking for a sequence where the first number is smaller than the second, the second is equal to the third, and the third is greater than the fourth. In the array nums, the subarrays [1,4,4,1], and [3,5,5,3] match this pattern.
Hence, there are 2 subarrays in nums that match the pattern.
Constraints:
2 <= n == nums.length <= 100
1 <= nums[i] <= 10^9
1 <= m == pattern.length < n
-1 <= pattern[i] <= 1
You will use the following starter code to write the solution to the problem and enclose your code within ```python delimiters.
```python
class Solution:
def countMatchingSubarrays(self, nums: List[int], pattern: List[int]) -> int:
```
| 0.75
|
{"tests": "{\"inputs\": [\"[8, 4, 2, 30, 15]\", \"[1, 2, 3, 4, 5]\", \"[3, 16, 8, 4, 2]\", \"[29]\", \"[14]\", \"[34]\", \"[99]\", \"[206]\", \"[159]\", \"[249]\", \"[6, 31]\", \"[47, 247]\", \"[9, 148, 121]\", \"[73786976294838206463, 4294967295, 1048575, 4194303, 281474976710655, 75557863725914323419135, 3, 36028797018963967, 1180591620717411303423, 17179869183, 140737488355327, 511, 604462909807314587353087, 34359738367, 137438953471, 39614081257132168796771975167, 134217727, 309485009821345068724781055, 562949953421311, 1073741823, 1, 9007199254740991, 16383, 9444732965739290427391, 151115727451828646838271, 2361183241434822606847, 2305843009213693951, 77371252455336267181195263, 8388607, 31, 2199023255551, 4095, 4835703278458516698824703, 33554431, 4611686018427387903, 4951760157141521099596496895, 36893488147419103231, 131071, 2047, 274877906943, 68719476735, 79228162514264337593543950335, 262143, 618970019642690137449562111, 2417851639229258349412351, 4722366482869645213695, 524287, 9903520314283042199192993791, 2251799813685247, 144115188075855871, 147573952589676412927, 1023, 576460752303423487, 2097151, 8191, 9671406556917033397649407, 1208925819614629174706175, 15, 590295810358705651711, 70368744177663, 536870911, 4503599627370495, 32767, 65535, 35184372088831, 255, 72057594037927935, 18889465931478580854783, 63, 1267650600228229401496703205375, 1099511627775, 9223372036854775807, 295147905179352825855, 2147483647, 268435455, 8796093022207, 1152921504606846975, 316912650057057350374175801343, 633825300114114700748351602687, 18446744073709551615, 7, 18014398509481983, 8589934591, 16777215, 158456325028528675187087900671, 302231454903657293676543, 154742504910672534362390527, 2475880078570760549798248447, 549755813887, 1237940039285380274899124223, 37778931862957161709567, 19807040628566084398385987583, 127, 19342813113834066795298815, 17592186044415, 38685626227668133590597631, 4398046511103, 67108863, 288230376151711743, 1125899906842623]\", \"[158456325028528675187087900671, 72057594037927935, 2417851639229258349412351, 9007199254740991, 2147483647, 1, 288230376151711743, 19807040628566084398385987583, 9671406556917033397649407, 633825300114114700748351602687, 590295810358705651711, 7, 268435455, 35184372088831, 75557863725914323419135, 536870911, 4835703278458516698824703, 4503599627370495, 4095, 17179869183, 1208925819614629174706175, 524287, 34359738367, 8796093022207, 131071, 2047, 9903520314283042199192993791, 33554431, 1237940039285380274899124223, 281474976710655, 2475880078570760549798248447, 2097151, 19342813113834066795298815, 262143, 4722366482869645213695, 4194303, 1152921504606846975, 309485009821345068724781055, 18889465931478580854783, 63, 302231454903657293676543, 295147905179352825855, 562949953421311, 127, 144115188075855871, 67108863, 255, 39614081257132168796771975167, 549755813887, 4398046511103, 31, 147573952589676412927, 1180591620717411303423, 32767, 511, 576460752303423487, 151115727451828646838271, 73786976294838206463, 4611686018427387903, 68719476735, 1267650600228229401496703205375, 18014398509481983, 2361183241434822606847, 9444732965739290427391, 140737488355327, 15, 16777215, 2251799813685247, 16383, 1099511627775, 9223372036854775807, 154742504910672534362390527, 37778931862957161709567, 65535, 134217727, 4294967295, 604462909807314587353087, 4951760157141521099596496895, 2305843009213693951, 36893488147419103231, 79228162514264337593543950335, 8191, 8589934591, 1125899906842623, 618970019642690137449562111, 316912650057057350374175801343, 36028797018963967, 274877906943, 77371252455336267181195263, 137438953471, 18446744073709551615, 3, 70368744177663, 1073741823, 17592186044415, 1048575, 2199023255551, 1023, 8388607, 38685626227668133590597631]\"], \"outputs\": [\"true\", \"true\", \"false\", \"true\", \"true\", \"true\", \"true\", \"true\", \"true\", \"true\", \"true\", \"true\", \"false\", \"false\", \"false\"], \"fn_name\": \"canSortArray\"}", "source": "lcbv5"}
|
You are given a 0-indexed array of positive integers nums.
In one operation, you can swap any two adjacent elements if they have the same number of set bits. You are allowed to do this operation any number of times (including zero).
Return true if you can sort the array, else return false.
Example 1:
Input: nums = [8,4,2,30,15]
Output: true
Explanation: Let's look at the binary representation of every element. The numbers 2, 4, and 8 have one set bit each with binary representation "10", "100", and "1000" respectively. The numbers 15 and 30 have four set bits each with binary representation "1111" and "11110".
We can sort the array using 4 operations:
- Swap nums[0] with nums[1]. This operation is valid because 8 and 4 have one set bit each. The array becomes [4,8,2,30,15].
- Swap nums[1] with nums[2]. This operation is valid because 8 and 2 have one set bit each. The array becomes [4,2,8,30,15].
- Swap nums[0] with nums[1]. This operation is valid because 4 and 2 have one set bit each. The array becomes [2,4,8,30,15].
- Swap nums[3] with nums[4]. This operation is valid because 30 and 15 have four set bits each. The array becomes [2,4,8,15,30].
The array has become sorted, hence we return true.
Note that there may be other sequences of operations which also sort the array.
Example 2:
Input: nums = [1,2,3,4,5]
Output: true
Explanation: The array is already sorted, hence we return true.
Example 3:
Input: nums = [3,16,8,4,2]
Output: false
Explanation: It can be shown that it is not possible to sort the input array using any number of operations.
Constraints:
1 <= nums.length <= 100
1 <= nums[i] <= 2^8
You will use the following starter code to write the solution to the problem and enclose your code within ```python delimiters.
```python
class Solution:
def canSortArray(self, nums: List[int]) -> bool:
```
| 0.5
|
{"tests": "{\"inputs\": [\"[1, 1, 2, 2, 3, 4]\", \"[1, 1, 1, 1]\", \"[5, 9]\", \"[5, 3]\", \"[24, 32]\", \"[2, 1, 1, 2]\", \"[9, 7, 7, 9]\", \"[4, 1, 3, 2]\", \"[1, 1, 3, 2]\", \"[1, 1, 1, 1]\", \"[10, 4, 4, 6]\", \"[1, 1, 1, 2, 3, 4]\", \"[5, 84, 22, 86, 87, 78, 53, 86, 49, 6, 31, 75, 96, 86, 37, 5, 84, 1, 96, 9, 17, 34, 7, 38, 32, 91, 60, 43, 34, 94, 51, 92, 41, 46, 87, 44, 39, 35, 10, 84, 55, 96, 32, 69, 3, 30, 51, 93, 27, 66, 11, 47, 75, 25, 26, 21, 92, 32, 76, 83, 5, 82, 28, 39, 27, 67, 13, 57, 74, 27, 49, 26, 70, 19, 52, 9, 95, 21, 63, 21, 87, 35, 32, 90, 65, 91, 33, 39, 75, 42, 10, 35, 71, 49, 87, 25, 43, 24, 74, 88]\", \"[99, 51, 47, 70, 75, 71, 90, 94, 40, 87, 3, 82, 80, 22, 60, 66, 98, 74, 18, 62, 38, 77, 33, 79, 17, 11, 78, 20, 68, 34, 23, 92, 52, 86, 6, 12, 29, 30, 46, 54, 76, 14, 88, 53, 97, 91, 39, 55, 8, 5, 13, 21, 64, 42, 93, 26, 37, 31, 1, 27, 41, 73, 4, 69, 32, 45, 81, 7, 43, 50, 84, 83, 65, 61, 10, 48, 44, 19, 85, 35, 9, 58, 24, 96, 15, 2, 16, 67, 56, 89, 63, 49, 36, 25, 28, 100, 95, 57, 59, 72]\"], \"outputs\": [\"true\", \"false\", \"true\", \"true\", \"true\", \"true\", \"true\", \"true\", \"true\", \"false\", \"true\", \"false\", \"false\", \"true\"], \"fn_name\": \"isPossibleToSplit\"}", "source": "lcbv5"}
|
You are given an integer array nums of even length. You have to split the array into two parts nums1 and nums2 such that:
nums1.length == nums2.length == nums.length / 2.
nums1 should contain distinct elements.
nums2 should also contain distinct elements.
Return true if it is possible to split the array, and false otherwise.
Example 1:
Input: nums = [1,1,2,2,3,4]
Output: true
Explanation: One of the possible ways to split nums is nums1 = [1,2,3] and nums2 = [1,2,4].
Example 2:
Input: nums = [1,1,1,1]
Output: false
Explanation: The only possible way to split nums is nums1 = [1,1] and nums2 = [1,1]. Both nums1 and nums2 do not contain distinct elements. Therefore, we return false.
Constraints:
1 <= nums.length <= 100
nums.length % 2 == 0
1 <= nums[i] <= 100
You will use the following starter code to write the solution to the problem and enclose your code within ```python delimiters.
```python
class Solution:
def isPossibleToSplit(self, nums: List[int]) -> bool:
```
| 0.125
|
{"tests": "{\"inputs\": [\"3\\n3 5 10\\n4 3 3\\n2 2 6\\n\", \"3\\n3 5 10\\n4 3 3\\n2 2 3\\n\", \"2\\n4 8\\n3 1 100\\n4 10000 100\\n\", \"1\\n1\\n1 1 1\\n1 1 1\\n\", \"1\\n1328\\n1 73192516 779\\n1 468279677 682\\n\", \"1\\n1093\\n1 150127956 237\\n1 905660966 894\\n\", \"1\\n14807\\n43 583824808 729\\n15 917174828 159\\n\", \"1\\n81883\\n122 466242496 601\\n73 329962136 145\\n\", \"1\\n2000\\n1 1000000000 1000\\n1 1000000000 1000\\n\", \"2\\n73635 21285\\n95 53716031 932\\n96 616431960 280\\n\", \"2\\n29639 89817\\n69 81424660 968\\n167 134991649 635\\n\", \"100\\n58954 39221 58132 3060 25623 10982 4181 49064 43736 84365 62371 87894 44458 43175 41956 12310 64254 91429 76274 10995 97816 30126 93883 84364 6352 62715 19140 29335 80180 62362 27874 44345 48612 88045 28607 16654 7221 96520 65211 64807 86703 86613 52552 76263 94351 18291 47725 8774 29542 94643 66181 63342 61719 19130 89629 73953 157 16803 3001 53040 48643 1338 46671 4773 60906 93889 72778 67931 16678 55919 78952 78656 30049 33547 11261 77434 80951 67318 8430 67391 43993 77823 64503 11963 82346 24972 62406 43854 30661 43031 40989 55851 78228 65263 51412 77499 89178 40819 72436 43672\\n11102 1000000000 830\\n11162 166366019 1\\n\", \"100\\n53894 17107 83881 72499 20113 32342 20464 23094 37965 38545 99605 54495 175 37350 99700 42733 15901 43246 94877 84944 58481 8693 99509 66639 5306 25976 72245 97571 17338 13614 82346 83130 24265 66620 54355 29493 50576 82015 21927 96618 40911 63847 95180 16738 90041 10614 23265 17436 69875 93764 18101 99016 91064 81662 45933 54637 75351 49507 59778 98501 79539 54822 58784 24091 27778 57679 23977 18420 5807 50298 31536 56547 10873 5238 46911 93746 61009 56998 41297 98624 11360 60772 30424 3614 5471 29241 26424 32977 85724 46823 54602 21715 50812 21599 40634 53714 34003 23179 97674 57808\\n2608 450391205 969\\n2725 325822234 925\\n\", \"100\\n11933 20251 91386 38326 35702 71071 16831 74338 54255 28030 33765 80628 48113 86938 73167 3637 90102 39494 98385 37220 51183 66284 78967 30005 43870 78471 93660 8557 83964 58569 60723 18952 83060 39702 48546 76436 57158 49927 93186 51091 50533 43273 40640 37693 75673 33531 98591 13371 51166 21108 39444 95117 77764 48250 15337 65894 36877 35659 76026 56586 78641 12056 77691 62551 55293 77605 83024 78425 23919 15659 33811 74612 50908 5623 38641 60734 93579 15432 74317 93985 30200 49556 53564 85374 26674 94339 10600 77509 17884 40275 43022 17535 144 89267 51679 14660 65207 1224 94018 29221\\n4398 636075462 520\\n4434 636075462 988\\n\", \"100\\n65972 86203 11302 64714 43133 26247 84809 50171 63933 70661 70411 63569 60113 80112 13299 70340 46505 99483 37243 66399 43659 27884 62962 70114 50830 3612 96891 29120 18112 87032 53516 51265 62945 59619 90672 77537 89030 95538 68069 80175 68631 61646 58655 76879 2737 52950 10499 83609 40068 77818 53997 81912 90805 48065 24042 34987 41886 740 28446 86087 90090 39632 34368 42579 66201 89640 18009 73130 69250 68513 65609 25373 87500 59301 41090 38607 24339 27665 88779 90199 13386 55894 20222 97249 57843 53563 67978 22253 88168 16889 9425 59055 50166 63230 92427 72077 69597 12875 71170 96356\\n2882 162604618 992\\n2961 892174686 994\\n\"], \"outputs\": [\"17\\n\", \"-1\\n\", \"5\\n\", \"1\\n\", \"314102512637\\n\", \"810826112468\\n\", \"201419558760\\n\", \"319010991784\\n\", \"2000000000000\\n\", \"91364282212\\n\", \"101597505815\\n\", \"505166366019\\n\", \"720699778305\\n\", \"780464591874\\n\", \"1024036702418\\n\"], \"fn_name\": null}", "source": "lcbv5"}
|
As the factory manager of Keyence, you want to monitor several sections on a conveyor belt. There are a total of N sections you want to monitor, and the length of the i-th section is D_i meters.
There are two types of sensors to choose from, and below is some information about each sensor.
- Type-j sensor (1\leq j \leq 2): Can monitor a section of length L_j meters.
The price is C_j per sensor, and you can use at most K_j sensors of this type in total.
You can divide one section into several sections for monitoring.
It is fine if the sections monitored by the sensors overlap, or if they monitor more than the length of the section you want to monitor.
For example, when L_1=4 and L_2=2, you can use one type-1 sensor to monitor a section of length 3 meters, or use one type-1 and one type-2 sensor to monitor a section of length 5 meters.
Determine whether it is possible to monitor all N sections, and if it is possible, find the minimum total cost of the necessary sensors.
Input
The input is given from Standard Input in the following format:
N
D_1 D_2 \dots D_N
L_1 C_1 K_1
L_2 C_2 K_2
Output
If it is impossible to monitor all N sections, print -1. Otherwise, print the minimum total cost of the necessary sensors.
Constraints
- 1\leq N \leq 100
- 1\leq D_i,L_j \leq 10^5
- 1\leq C_j \leq 10^9
- 1\leq K_j \leq 10^3
- All input values are integers.
Sample Input 1
3
3 5 10
4 3 3
2 2 6
Sample Output 1
17
You can monitor all sections by using three type-1 sensors and four type-2 sensors as follows.
- Use one type-1 sensor to monitor the first section.
- Use one type-1 and one type-2 sensor to monitor the second section.
- Use one type-1 and three type-2 sensors to monitor the third section.
In this case, the total cost of the necessary sensors is 3\times 3 + 2\times 4 = 17, which is the minimum.
Sample Input 2
3
3 5 10
4 3 3
2 2 3
Sample Output 2
-1
Sample Input 3
2
4 8
3 1 100
4 10000 100
Sample Output 3
5
It is fine if one type of sensor is not used at all.
Read the inputs from stdin solve the problem and write the answer to stdout (do not directly test on the sample inputs). Enclose your code within ```python delimiters.
| 0
|
{"tests": "{\"inputs\": [\"4 5\\n1 2 3 4 5\\n6 7 8 9 10\\n11 12 13 14 15\\n16 17 18 19 20\\n1 3 2 5 4\\n11 13 12 15 14\\n6 8 7 10 9\\n16 18 17 20 19\\n\", \"2 2\\n1 1\\n1 1\\n1 1\\n1 1000000000\\n\", \"3 3\\n8 1 6\\n3 5 7\\n4 9 2\\n8 1 6\\n3 5 7\\n4 9 2\\n\", \"5 5\\n710511029 136397527 763027379 644706927 447672230\\n979861204 57882493 442931589 951053644 152300688\\n43971370 126515475 962139996 541282303 834022578\\n312523039 506696497 664922712 414720753 304621362\\n325269832 191410838 286751784 732741849 806602693\\n806602693 732741849 286751784 191410838 325269832\\n304621362 414720753 664922712 506696497 312523039\\n834022578 541282303 962139996 126515475 43971370\\n152300688 951053644 442931589 57882493 979861204\\n447672230 644706927 763027379 136397527 710511029\\n\", \"2 2\\n2 1\\n1 2\\n1 2\\n2 1\\n\", \"2 2\\n2 1\\n1 2\\n1 2\\n1 2\\n\", \"2 2\\n254208919 254208919\\n254208919 254208919\\n254208919 254208919\\n254208919 254208919\\n\", \"2 2\\n499230390 378102308\\n982788305 450344438\\n876231318 411707321\\n653563363 590784525\\n\", \"2 3\\n817686100 817686100 817686100\\n870092517 870092517 817686100\\n870092517 817686100 870092517\\n817686100 817686100 817686100\\n\", \"3 2\\n472677680 257011103\\n837159242 108282356\\n728499571 592954537\\n574707751 292193816\\n178355736 834362104\\n37342128 249908918\\n\", \"4 2\\n934191141 286715729\\n106777755 395337472\\n801612932 573117835\\n262052718 214166693\\n262052718 214166693\\n106777755 395337472\\n934191141 286715729\\n801612932 573117835\\n\", \"2 5\\n656388039 656388039 656388039 656388039 656388039\\n656388039 656388039 656388039 656388039 656388039\\n656388039 656388039 656388039 656388039 656388039\\n656388039 656388039 656388039 656388039 656388039\\n\", \"5 5\\n925234815 195202420 985293702 925234815 584979839\\n985293702 925234815 925234815 195202420 973719359\\n720510553 985293702 973719359 584979839 720510553\\n797707590 643037195 985293702 720510553 925234815\\n195202420 720510553 797707590 195202420 720510553\\n195202420 195202420 720510553 797707590 720510553\\n720510553 797707590 643037195 985293702 925234815\\n195202420 985293702 925234815 925234815 973719359\\n925234815 925234815 195202420 985293702 584979839\\n584979839 720510553 985293702 973719359 720510553\\n\", \"5 5\\n428393184 141412421 141412421 141412421 428393184\\n141412421 141412421 428393184 428393184 428393184\\n428393184 428393184 141412421 141412421 428393184\\n141412421 141412421 428393184 141412421 428393184\\n428393184 428393184 141412421 428393184 141412421\\n428393184 428393184 141412421 141412421 141412421\\n141412421 428393184 428393184 141412421 428393184\\n141412421 428393184 428393184 141412421 141412421\\n428393184 428393184 141412421 428393184 141412421\\n141412421 141412421 428393184 428393184 428393184\\n\", \"5 5\\n374880163 658612467 822885194 262520417 758392492\\n758392492 262520417 658612467 658612467 979031027\\n822885194 907152740 907152740 907152740 758392492\\n262520417 658612467 979031027 262520417 937442242\\n374880163 758392492 374880163 374880163 979031027\\n374880163 658612467 822885194 262520417 758392492\\n758392492 374880163 658612467 658612467 979031027\\n822885194 907152740 907152740 907152740 758392492\\n262520417 658612467 979031027 262520417 937442242\\n262520417 758392492 374880163 374880163 979031027\\n\", \"5 5\\n332975784 601519183 192097996 385881505 875309998\\n576958202 311665235 890210331 146980141 221794399\\n440995448 620517553 366805840 345853512 977641254\\n565246972 182676863 507026115 872981141 351163999\\n757388200 757490809 436013419 645484799 220662217\\n220662217 645484799 436013419 757490809 757388200\\n351163999 872981141 507026115 182676863 565246972\\n977641254 345853512 366805840 620517553 440995448\\n221794399 146980141 192097996 311665235 576958202\\n875309998 385881505 890210331 601519183 332975784\\n\"], \"outputs\": [\"3\\n\", \"-1\\n\", \"0\\n\", \"20\\n\", \"1\\n\", \"-1\\n\", \"0\\n\", \"-1\\n\", \"2\\n\", \"-1\\n\", \"4\\n\", \"0\\n\", \"11\\n\", \"11\\n\", \"-1\\n\", \"-1\\n\"], \"fn_name\": null}", "source": "lcbv5"}
|
You are given two grids, A and B, each with H rows and W columns.
For each pair of integers (i, j) satisfying 1 \leq i \leq H and 1 \leq j \leq W, let (i, j) denote the cell in the i-th row and j-th column. In grid A, cell (i, j) contains the integer A_{i, j}. In grid B, cell (i, j) contains the integer B_{i, j}.
You will repeat the following operation any number of times, possibly zero. In each operation, you perform one of the following:
- Choose an integer i satisfying 1 \leq i \leq H-1 and swap the i-th and (i+1)-th rows in grid A.
- Choose an integer i satisfying 1 \leq i \leq W-1 and swap the i-th and (i+1)-th columns in grid A.
Determine whether it is possible to make grid A identical to grid B by repeating the above operation. If it is possible, print the minimum number of operations required to do so.
Here, grid A is identical to grid B if and only if, for all pairs of integers (i, j) satisfying 1 \leq i \leq H and 1 \leq j \leq W, the integer written in cell (i, j) of grid A is equal to the integer written in cell (i, j) of grid B.
Input
The input is given from Standard Input in the following format:
H W
A_{1, 1} A_{1, 2} \cdots A_{1, W}
A_{2, 1} A_{2, 2} \cdots A_{2, W}
\vdots
A_{H, 1} A_{H, 2} \cdots A_{H, W}
B_{1, 1} B_{1, 2} \cdots B_{1, W}
B_{2, 1} B_{2, 2} \cdots B_{2, W}
\vdots
B_{H, 1} B_{H, 2} \cdots B_{H, W}
Output
If it is impossible to make grid A identical to grid B, output -1. Otherwise, print the minimum number of operations required to make grid A identical to grid B.
Constraints
- All input values are integers.
- 2 \leq H, W \leq 5
- 1 \leq A_{i, j}, B_{i, j} \leq 10^9
Sample Input 1
4 5
1 2 3 4 5
6 7 8 9 10
11 12 13 14 15
16 17 18 19 20
1 3 2 5 4
11 13 12 15 14
6 8 7 10 9
16 18 17 20 19
Sample Output 1
3
Swapping the fourth and fifth columns of the initial grid A yields the following grid:
1 2 3 5 4
6 7 8 10 9
11 12 13 15 14
16 17 18 20 19
Then, swapping the second and third rows yields the following grid:
1 2 3 5 4
11 12 13 15 14
6 7 8 10 9
16 17 18 20 19
Finally, swapping the second and third columns yields the following grid, which is identical to grid B:
1 3 2 5 4
11 13 12 15 14
6 8 7 10 9
16 18 17 20 19
You can make grid A identical to grid B with the three operations above and cannot do so with fewer operations, so print 3.
Sample Input 2
2 2
1 1
1 1
1 1
1 1000000000
Sample Output 2
-1
There is no way to perform the operation to make grid A match grid B, so print -1.
Sample Input 3
3 3
8 1 6
3 5 7
4 9 2
8 1 6
3 5 7
4 9 2
Sample Output 3
0
Grid A is already identical to grid B at the beginning.
Sample Input 4
5 5
710511029 136397527 763027379 644706927 447672230
979861204 57882493 442931589 951053644 152300688
43971370 126515475 962139996 541282303 834022578
312523039 506696497 664922712 414720753 304621362
325269832 191410838 286751784 732741849 806602693
806602693 732741849 286751784 191410838 325269832
304621362 414720753 664922712 506696497 312523039
834022578 541282303 962139996 126515475 43971370
152300688 951053644 442931589 57882493 979861204
447672230 644706927 763027379 136397527 710511029
Sample Output 4
20
Read the inputs from stdin solve the problem and write the answer to stdout (do not directly test on the sample inputs). Enclose your code within ```python delimiters.
| 0.625
|
{"tests": "{\"inputs\": [\"3 1\\n\", \"2 1\\n\", \"2 2\\n\", \"3 1\\n\", \"3 3\\n\", \"4 1\\n\", \"4 2\\n\", \"4 3\\n\", \"4 4\\n\", \"100 30\\n\", \"100 93\\n\", \"100 89\\n\", \"100 100\\n\"], \"outputs\": [\"2\\n1 2 \\n1 3 \\n2\\n\", \"1\\n1 2 \\n2\\n\", \"1\\n1 2 \\n1\\n\", \"2\\n1 2 \\n1 3 \\n2\\n\", \"2\\n1 2 \\n1 3 \\n1\\n\", \"2\\n2 2 4 \\n2 3 4 \\n2\\n\", \"2\\n2 2 4 \\n2 3 4 \\n1\\n\", \"2\\n2 2 4 \\n2 3 4 \\n1\\n\", \"2\\n2 2 4 \\n2 3 4 \\n1\\n\", \"7\\n50 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100 \\n50 3 4 7 8 11 12 15 16 19 20 23 24 27 28 31 32 35 36 39 40 43 44 47 48 51 52 55 56 59 60 63 64 67 68 71 72 75 76 79 80 83 84 87 88 91 92 95 96 99 100 \\n48 5 6 7 8 13 14 15 16 21 22 23 24 29 30 31 32 37 38 39 40 45 46 47 48 53 54 55 56 61 62 63 64 69 70 71 72 77 78 79 80 85 86 87 88 93 94 95 96 \\n48 9 10 11 12 13 14 15 16 25 26 27 28 29 30 31 32 41 42 43 44 45 46 47 48 57 58 59 60 61 62 63 64 73 74 75 76 77 78 79 80 89 90 91 92 93 94 95 96 \\n48 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 \\n36 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 97 98 99 100 \\n36 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 \\n1\\n\", \"7\\n50 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100 \\n50 3 4 7 8 11 12 15 16 19 20 23 24 27 28 31 32 35 36 39 40 43 44 47 48 51 52 55 56 59 60 63 64 67 68 71 72 75 76 79 80 83 84 87 88 91 92 95 96 99 100 \\n48 5 6 7 8 13 14 15 16 21 22 23 24 29 30 31 32 37 38 39 40 45 46 47 48 53 54 55 56 61 62 63 64 69 70 71 72 77 78 79 80 85 86 87 88 93 94 95 96 \\n48 9 10 11 12 13 14 15 16 25 26 27 28 29 30 31 32 41 42 43 44 45 46 47 48 57 58 59 60 61 62 63 64 73 74 75 76 77 78 79 80 89 90 91 92 93 94 95 96 \\n48 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 \\n36 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 97 98 99 100 \\n36 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 \\n1\\n\", \"7\\n50 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100 \\n50 3 4 7 8 11 12 15 16 19 20 23 24 27 28 31 32 35 36 39 40 43 44 47 48 51 52 55 56 59 60 63 64 67 68 71 72 75 76 79 80 83 84 87 88 91 92 95 96 99 100 \\n48 5 6 7 8 13 14 15 16 21 22 23 24 29 30 31 32 37 38 39 40 45 46 47 48 53 54 55 56 61 62 63 64 69 70 71 72 77 78 79 80 85 86 87 88 93 94 95 96 \\n48 9 10 11 12 13 14 15 16 25 26 27 28 29 30 31 32 41 42 43 44 45 46 47 48 57 58 59 60 61 62 63 64 73 74 75 76 77 78 79 80 89 90 91 92 93 94 95 96 \\n48 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 \\n36 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 97 98 99 100 \\n36 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 \\n1\\n\", \"7\\n50 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100 \\n50 3 4 7 8 11 12 15 16 19 20 23 24 27 28 31 32 35 36 39 40 43 44 47 48 51 52 55 56 59 60 63 64 67 68 71 72 75 76 79 80 83 84 87 88 91 92 95 96 99 100 \\n48 5 6 7 8 13 14 15 16 21 22 23 24 29 30 31 32 37 38 39 40 45 46 47 48 53 54 55 56 61 62 63 64 69 70 71 72 77 78 79 80 85 86 87 88 93 94 95 96 \\n48 9 10 11 12 13 14 15 16 25 26 27 28 29 30 31 32 41 42 43 44 45 46 47 48 57 58 59 60 61 62 63 64 73 74 75 76 77 78 79 80 89 90 91 92 93 94 95 96 \\n48 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 \\n36 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 97 98 99 100 \\n36 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 \\n2\\n\"], \"fn_name\": null}", "source": "lcbv5"}
|
This is an interactive problem (a type of problem where your program interacts with the judge program through Standard Input and Output).
There are N bottles of juice, numbered 1 to N. It has been discovered that exactly one of these bottles has gone bad. Even a small sip of the spoiled juice will cause stomach upset the next day.
Takahashi must identify the spoiled juice by the next day. To do this, he decides to call the minimum necessary number of friends and serve them some of the N bottles of juice. He can give any number of bottles to each friend, and each bottle of juice can be given to any number of friends.
Print the number of friends to call and how to distribute the juice, then receive information on whether each friend has an upset stomach the next day, and print the spoiled bottle's number.
Input/Output
This is an interactive problem (a type of problem where your program interacts with the judge program through Standard Input and Output).
Before the interaction, the judge secretly selects an integer X between 1 and N as the spoiled bottle's number. The value of X is not given to you. Also, the value of X may change during the interaction as long as it is consistent with the constraints and previous outputs.
First, the judge will give you N as input.
N
You should print the number of friends to call, M, followed by a newline.
M
Next, you should perform the following procedure to print M outputs.
For i = 1, 2, \ldots, M, the i-th output should contain the number K_i of bottles of juice you will serve to the i-th friend, and the K_i bottles' numbers in ascending order, A_{i, 1}, A_{i, 2}, \ldots, A_{i, K_i}, separated by spaces, followed by a newline.
K_i A_{i, 1} A_{i, 2} \ldots A_{i, K_i}
Then, the judge will inform you whether each friend has a stomach upset the next day by giving you a string S of length M consisting of 0 and 1.
S
For i = 1, 2, \ldots, M, the i-th friend has a stomach upset if and only if the i-th character of S is 1.
You should respond by printing the number of the spoiled juice bottle X', followed by a newline.
X'
Then, terminate the program immediately.
If the M you printed is the minimum necessary number of friends to identify the spoiled juice out of the N bottles, and the X' you printed matches the spoiled bottle's number X, then your program is considered correct.
Input/Output
This is an interactive problem (a type of problem where your program interacts with the judge program through Standard Input and Output).
Before the interaction, the judge secretly selects an integer X between 1 and N as the spoiled bottle's number. The value of X is not given to you. Also, the value of X may change during the interaction as long as it is consistent with the constraints and previous outputs.
First, the judge will give you N as input.
N
You should print the number of friends to call, M, followed by a newline.
M
Next, you should perform the following procedure to print M outputs.
For i = 1, 2, \ldots, M, the i-th output should contain the number K_i of bottles of juice you will serve to the i-th friend, and the K_i bottles' numbers in ascending order, A_{i, 1}, A_{i, 2}, \ldots, A_{i, K_i}, separated by spaces, followed by a newline.
K_i A_{i, 1} A_{i, 2} \ldots A_{i, K_i}
Then, the judge will inform you whether each friend has a stomach upset the next day by giving you a string S of length M consisting of 0 and 1.
S
For i = 1, 2, \ldots, M, the i-th friend has a stomach upset if and only if the i-th character of S is 1.
You should respond by printing the number of the spoiled juice bottle X', followed by a newline.
X'
Then, terminate the program immediately.
If the M you printed is the minimum necessary number of friends to identify the spoiled juice out of the N bottles, and the X' you printed matches the spoiled bottle's number X, then your program is considered correct.
Constraints
- N is an integer.
- 2 \leq N \leq 100
Read the inputs from stdin solve the problem and write the answer to stdout (do not directly test on the sample inputs). Enclose your code within ```python delimiters.
| 0
|
{"tests": "{\"inputs\": [\"3 4\\n1 2 5\\n2 1 -3\\n2 3 -4\\n3 1 100\\n\", \"3 2\\n1 2 0\\n2 1 0\\n\", \"5 9\\n1 2 -246288\\n4 5 -222742\\n3 1 246288\\n3 4 947824\\n5 2 -178721\\n4 3 -947824\\n5 4 756570\\n2 5 707902\\n5 1 36781\\n\", \"2 1\\n2 1 0\\n\", \"6 8\\n1 5 -4\\n2 1 -803\\n3 1 -1595\\n3 4 -5960\\n3 5 -1599\\n5 2 863633\\n2 3 -862034\\n2 4 -94503\\n\", \"20 19\\n5 2 1000000\\n1 12 1000000\\n10 14 1000000\\n3 7 1000000\\n7 17 1000000\\n13 11 1000000\\n17 1 1000000\\n8 19 1000000\\n12 4 1000000\\n2 20 1000000\\n16 13 1000000\\n4 10 1000000\\n11 6 1000000\\n20 9 1000000\\n19 15 1000000\\n14 18 1000000\\n9 3 1000000\\n18 8 1000000\\n6 5 1000000\\n\", \"20 19\\n4 19 -1000000\\n16 17 -1000000\\n1 20 -1000000\\n5 1 -1000000\\n7 10 -1000000\\n19 9 -1000000\\n10 18 -1000000\\n6 12 -1000000\\n11 2 -1000000\\n14 13 -1000000\\n15 5 -1000000\\n12 11 -1000000\\n2 16 -1000000\\n18 4 -1000000\\n3 8 -1000000\\n8 7 -1000000\\n13 3 -1000000\\n9 6 -1000000\\n17 15 -1000000\\n\", \"20 35\\n2 5 56298\\n1 3 -5979\\n12 13 -26500\\n1 15 -92762\\n12 5 -151519\\n18 10 -379\\n2 20 -814\\n8 5 445536\\n4 9 86028\\n5 2 -56298\\n10 14 -86028\\n17 10 86028\\n17 4 0\\n11 3 -276\\n5 20 -243551\\n2 15 -140\\n5 11 -7\\n20 5 243551\\n14 17 0\\n6 1 -1\\n9 14 -196\\n11 17 -169\\n14 15 0\\n15 3 20362\\n3 16 497204\\n3 9 -19890\\n8 19 -2911\\n6 9 -102767\\n19 4 -341\\n1 4 -9412\\n6 19 -326\\n16 3 -174459\\n5 8 -445536\\n13 4 -3506\\n7 12 -3091\\n\", \"20 38\\n5 18 585530\\n15 16 701301\\n16 20 432683\\n19 9 679503\\n9 1 -138951\\n11 15 455543\\n15 12 -619560\\n5 8 638549\\n16 10 326741\\n13 2 -145022\\n9 5 69552\\n4 3 -898380\\n15 11 -331111\\n13 9 -142793\\n8 5 -327527\\n9 17 -57231\\n4 8 681970\\n12 15 716887\\n9 19 -10446\\n4 6 645112\\n14 8 711527\\n5 9 -61467\\n16 15 -43333\\n8 20 456620\\n6 4 26742\\n12 7 793084\\n9 13 648469\\n8 14 121457\\n1 9 548488\\n7 12 -55460\\n20 16 662039\\n3 4 985310\\n8 4 471060\\n17 9 590861\\n18 5 58422\\n10 16 61811\\n20 8 39294\\n2 13 181323\\n\", \"20 38\\n2 11 447719\\n1 19 954933\\n8 15 -424553\\n18 15 552542\\n15 19 -667745\\n4 6 673083\\n2 14 699336\\n17 8 233989\\n15 18 -112865\\n3 4 791729\\n12 13 -193357\\n4 12 588867\\n19 15 849244\\n2 9 602174\\n15 6 855173\\n19 1 -8841\\n9 2 -302315\\n6 20 500136\\n6 15 -396427\\n10 8 931923\\n13 12 865090\\n12 16 462477\\n2 12 451903\\n16 5 -702090\\n14 2 -688608\\n4 3 10689\\n16 12 774469\\n20 6 299194\\n12 4 -181784\\n6 4 447472\\n8 10 -724890\\n15 8 605833\\n5 16 973255\\n4 7 951348\\n11 2 -273026\\n7 4 916821\\n12 2 -304230\\n8 17 939233\\n\", \"20 38\\n12 16 -303463\\n5 8 -511686\\n12 2 -339099\\n1 4 469940\\n19 15 967952\\n9 14 635045\\n2 12 781120\\n5 4 -636174\\n4 1 865062\\n1 3 823767\\n16 12 913518\\n17 6 967168\\n3 9 -14139\\n8 5 703131\\n5 19 429992\\n14 9 -600129\\n19 13 294059\\n3 1 -450235\\n6 17 447807\\n20 11 -139613\\n15 19 622889\\n9 3 115321\\n2 18 798341\\n5 18 38979\\n19 6 -206008\\n2 20 407070\\n18 5 398053\\n20 2 -202724\\n18 7 -373855\\n13 19 382318\\n18 2 -119735\\n11 20 481296\\n20 10 699206\\n7 18 405603\\n4 5 902553\\n10 20 -69724\\n6 19 390982\\n19 5 -81181\\n\", \"20 374\\n1 4 650604\\n8 19 -1181\\n1 3 645979\\n8 9 374112\\n18 12 -377137\\n14 2 376250\\n9 4 -2\\n3 16 922\\n14 16 -68\\n11 20 4728\\n20 3 254455\\n1 10 650604\\n3 2 626680\\n19 14 249513\\n9 1 372523\\n15 6 4625\\n14 8 2138\\n15 16 -49\\n18 11 0\\n15 19 377137\\n12 16 -285\\n17 1 0\\n12 19 624513\\n7 15 376264\\n9 7 372523\\n13 16 -9988\\n13 19 -206\\n8 6 374112\\n19 15 625763\\n17 3 -298\\n17 4 372749\\n5 20 377137\\n7 8 376264\\n10 4 625758\\n8 18 374112\\n13 9 375436\\n13 1 -4978\\n15 12 4625\\n11 9 4717\\n12 4 248519\\n14 7 -14\\n14 4 3738\\n18 4 0\\n18 16 -1068\\n18 9 -372523\\n18 2 0\\n8 4 1600\\n20 17 626978\\n16 2 253009\\n13 14 375436\\n10 11 625758\\n16 4 253246\\n1 12 650604\\n18 1 0\\n10 6 253246\\n3 17 626680\\n10 15 625758\\n19 13 625763\\n20 6 626978\\n11 6 4728\\n7 10 -2800\\n18 15 -3\\n15 1 377137\\n7 16 -249494\\n6 14 -5\\n12 9 624513\\n4 6 375994\\n2 20 625911\\n7 19 3741\\n10 5 248621\\n15 2 377137\\n16 13 625758\\n20 13 254455\\n7 13 828\\n7 11 376264\\n17 9 226\\n2 17 253399\\n11 15 103\\n11 10 -24\\n19 17 253240\\n5 7 377137\\n6 18 372512\\n19 7 250327\\n5 4 3025\\n4 19 3482\\n4 12 -2920\\n13 15 -156\\n7 17 376264\\n14 1 376250\\n16 3 625758\\n10 2 -153\\n8 11 374112\\n5 19 -144\\n1 5 645979\\n7 20 3752\\n2 5 253388\\n11 4 4491\\n12 14 624513\\n11 19 4717\\n10 19 -5\\n2 19 253399\\n13 8 375436\\n8 14 374112\\n12 6 624513\\n2 12 625911\\n17 6 237\\n4 8 3482\\n20 19 249841\\n3 1 626680\\n19 20 248523\\n4 7 3471\\n20 16 1220\\n13 10 375436\\n13 17 2924\\n6 8 -2\\n13 2 -69\\n14 5 3738\\n5 10 377137\\n3 5 252568\\n1 16 397358\\n15 3 -2318\\n19 4 625763\\n4 10 -37\\n19 5 248626\\n19 2 625763\\n2 3 -769\\n19 9 625763\\n6 20 372512\\n16 9 253235\\n2 11 250475\\n9 8 -1589\\n17 12 372749\\n10 7 251646\\n3 20 -298\\n9 2 372523\\n1 9 650593\\n17 14 372749\\n8 15 -810\\n2 8 251799\\n13 11 -1804\\n16 12 1245\\n2 13 253388\\n11 16 -9030\\n8 10 374112\\n11 17 4728\\n17 13 -892\\n14 10 3727\\n7 12 -248249\\n4 3 3471\\n1 13 647680\\n4 20 1882\\n4 17 375994\\n14 12 376250\\n11 8 3128\\n5 13 4625\\n3 14 250430\\n15 13 377137\\n12 11 247273\\n5 3 377137\\n13 6 2924\\n8 3 -1324\\n8 12 -6\\n17 2 372749\\n6 15 372512\\n16 15 253246\\n12 2 624513\\n5 6 377137\\n13 18 375436\\n11 5 103\\n5 9 4614\\n17 19 372749\\n5 2 -2\\n5 17 4625\\n7 4 376264\\n19 16 5\\n18 3 0\\n4 2 3471\\n12 18 624513\\n9 3 372523\\n16 6 253246\\n6 19 -9\\n8 5 -3025\\n3 9 254157\\n10 12 248621\\n6 17 -237\\n14 20 376250\\n20 12 626978\\n13 4 -558\\n20 14 254466\\n9 20 0\\n20 18 626978\\n20 8 254455\\n9 16 -4\\n3 10 922\\n4 13 558\\n14 18 376250\\n4 15 375994\\n13 7 -89\\n17 5 372749\\n12 1 251990\\n18 14 -7146\\n15 8 377137\\n16 19 0\\n12 8 624513\\n1 6 650604\\n10 17 253009\\n5 14 4625\\n14 15 376250\\n4 14 -256\\n8 16 -20010\\n19 6 625763\\n12 13 249077\\n4 18 375994\\n20 11 254455\\n10 3 253246\\n4 9 375994\\n16 5 249508\\n6 13 0\\n12 17 624513\\n10 14 625758\\n12 5 624513\\n9 10 -173003\\n9 5 -1643\\n3 18 626680\\n9 18 372523\\n3 15 249543\\n2 6 253399\\n16 11 625758\\n20 7 626978\\n6 10 372512\\n18 6 -209014\\n16 1 253235\\n1 15 645979\\n7 14 14\\n6 7 -2924\\n6 9 -11\\n15 11 -103\\n9 19 -337\\n14 19 376250\\n20 2 254466\\n19 8 625763\\n10 9 625758\\n8 2 374112\\n3 4 254168\\n12 7 248249\\n15 7 2410\\n4 16 -112\\n2 16 153\\n19 12 625763\\n5 1 4614\\n16 10 0\\n13 5 375436\\n8 7 -2152\\n17 20 372749\\n7 6 3752\\n5 18 377137\\n18 17 0\\n15 9 377137\\n12 10 -1245\\n17 8 372749\\n3 13 251244\\n10 20 253235\\n5 16 -111\\n9 12 372523\\n9 13 -2913\\n5 15 4614\\n9 11 0\\n8 17 374112\\n20 9 626978\\n4 1 -21\\n10 1 -397358\\n18 7 0\\n11 7 377240\\n15 17 377137\\n18 10 0\\n5 11 377137\\n16 8 251646\\n11 18 377240\\n4 11 3482\\n19 3 -917\\n5 12 4625\\n20 15 254229\\n15 18 377137\\n19 10 253240\\n6 4 0\\n13 20 -814\\n11 13 377240\\n17 18 372749\\n1 14 646866\\n4 5 -405\\n11 12 377240\\n14 17 3501\\n6 5 -11\\n2 9 253399\\n6 3 372512\\n14 9 3727\\n9 15 -111\\n13 12 375436\\n8 1 1600\\n17 11 372749\\n7 18 376264\\n9 6 11\\n15 14 377137\\n17 7 372749\\n15 5 4614\\n2 4 625911\\n2 18 625911\\n17 15 372749\\n7 3 376264\\n20 4 626978\\n6 1 -253246\\n10 13 253246\\n20 5 626978\\n14 13 3727\\n14 3 0\\n11 2 -37\\n19 11 625763\\n8 13 -1324\\n7 5 -229\\n17 10 372749\\n10 16 0\\n18 13 -375436\\n2 7 253388\\n19 18 625763\\n11 3 0\\n3 12 626680\\n12 15 624513\\n3 6 254168\\n11 14 4717\\n16 7 625758\\n18 8 -1\\n2 15 248774\\n7 9 376264\\n18 19 -83\\n20 10 1220\\n2 1 251799\\n7 2 3752\\n6 12 -219\\n13 3 375436\\n8 20 -1\\n1 20 650604\\n16 18 625758\\n10 18 625758\\n2 14 249661\\n3 8 254168\\n15 10 377137\\n9 17 0\\n5 8 377137\\n6 2 372512\\n11 1 377240\\n16 17 625758\\n3 19 922\\n6 16 -89\\n1 11 645876\\n15 20 -17\\n7 1 3741\\n16 14 625758\\n3 7 254168\\n14 11 376250\\n3 11 626680\\n18 20 -2\\n6 11 -101\\n18 5 -3407\\n16 20 625758\\n20 1 254466\\n2 10 253388\\n15 4 1480\\n9 14 -3727\\n17 16 -66\\n12 20 252001\\n19 1 625763\\n12 3 624513\\n10 8 625758\\n14 6 376250\\n\", \"20 380\\n7 15 -1477\\n16 5 755272\\n2 12 322329\\n16 13 755272\\n3 14 789625\\n5 17 -26\\n1 5 979038\\n12 1 258265\\n20 2 148009\\n16 15 -25582\\n17 7 322329\\n16 3 0\\n8 18 786658\\n1 17 192381\\n3 15 789625\\n15 7 322329\\n20 11 -100354\\n20 16 148009\\n8 19 -2966\\n13 14 979177\\n16 8 755272\\n4 10 42832\\n13 10 255789\\n2 11 786657\\n8 3 322330\\n13 12 514849\\n15 20 174320\\n3 9 325297\\n20 8 148009\\n2 7 322329\\n3 20 789625\\n13 8 979177\\n7 8 -565\\n15 10 31385\\n10 4 785372\\n11 10 743825\\n13 6 979177\\n9 10 723388\\n18 8 0\\n17 10 786657\\n9 14 723388\\n5 4 -67\\n17 6 786657\\n20 6 148009\\n4 16 322329\\n12 2 -192\\n1 19 514710\\n9 1 -4\\n20 4 148009\\n4 14 786657\\n13 15 256584\\n3 10 789625\\n10 11 785372\\n8 11 322330\\n4 17 0\\n18 20 0\\n12 7 258265\\n2 15 42832\\n9 20 259060\\n14 3 142438\\n12 20 110256\\n1 2 192381\\n4 8 786657\\n4 1 0\\n18 1 0\\n20 10 612337\\n5 12 63834\\n5 2 322099\\n6 11 786657\\n8 9 322330\\n15 9 63269\\n2 16 322329\\n8 7 322330\\n18 17 -445\\n14 9 63269\\n12 18 722593\\n2 17 0\\n19 20 789624\\n10 5 -1055\\n19 15 789624\\n11 2 743825\\n13 2 979177\\n6 13 0\\n11 12 743825\\n11 19 -33\\n2 18 786657\\n18 13 0\\n4 20 786657\\n3 11 45800\\n3 18 789625\\n19 1 -189414\\n9 13 723388\\n3 17 2968\\n18 4 -44\\n4 15 786657\\n7 4 -20\\n14 15 322329\\n13 9 979177\\n19 7 789624\\n6 10 786657\\n2 13 322329\\n9 11 259060\\n17 14 0\\n1 18 979038\\n18 19 -11863\\n14 17 0\\n12 14 722593\\n8 5 231\\n18 6 -18437\\n3 1 -104406\\n7 13 -23117\\n1 12 514710\\n8 4 142439\\n14 20 786657\\n8 17 1\\n12 19 258265\\n9 12 259060\\n7 14 0\\n1 10 235213\\n7 11 -10384\\n19 13 34352\\n16 11 290944\\n13 1 979177\\n18 15 0\\n9 3 -42\\n16 17 -31385\\n14 4 786657\\n18 9 -199\\n10 16 290948\\n1 3 979038\\n14 16 322329\\n16 4 290944\\n5 7 322099\\n11 13 -50113\\n17 1 31385\\n19 2 325296\\n14 12 322329\\n7 18 464328\\n6 4 31385\\n6 15 786657\\n9 4 723388\\n3 13 325297\\n17 11 322329\\n11 17 -9800\\n3 8 325297\\n20 17 -96\\n19 3 -1\\n10 8 785372\\n2 6 322329\\n16 14 290944\\n16 20 755272\\n16 10 -4\\n7 3 -200\\n2 5 230\\n17 9 322329\\n8 6 42833\\n15 17 0\\n13 3 334958\\n7 17 -14325\\n10 13 173035\\n17 3 786657\\n13 4 514849\\n11 4 743825\\n17 13 322329\\n11 3 -38\\n15 16 31385\\n13 19 979177\\n2 9 786657\\n3 7 789625\\n2 3 0\\n11 1 279497\\n19 10 145405\\n18 16 -755272\\n9 6 -17\\n20 1 -1688\\n5 18 786427\\n14 1 -2057\\n3 4 325297\\n16 12 755272\\n5 6 786427\\n7 12 464328\\n19 14 325296\\n2 10 786657\\n4 12 786657\\n7 20 0\\n2 8 0\\n18 7 -1176\\n5 11 322099\\n1 15 192381\\n14 19 786657\\n19 8 325296\\n10 15 -1\\n15 11 322329\\n13 16 514849\\n6 19 42832\\n9 15 259060\\n4 9 322329\\n19 17 2967\\n15 19 786657\\n13 18 979177\\n7 6 464328\\n16 7 290944\\n8 20 322330\\n18 2 -65\\n9 18 723388\\n6 2 322329\\n15 1 322329\\n17 20 786657\\n3 16 789625\\n6 3 42832\\n7 2 -32203\\n17 4 0\\n2 14 322329\\n19 11 789624\\n2 19 0\\n7 19 -796\\n7 9 0\\n5 10 31155\\n10 17 -3\\n4 2 0\\n19 6 789624\\n17 5 786657\\n3 2 325297\\n1 11 514710\\n17 19 322329\\n15 18 786657\\n8 16 322330\\n1 13 -139\\n8 15 322330\\n8 2 786658\\n14 18 786657\\n10 9 785372\\n12 4 258265\\n7 5 -3830\\n16 9 755272\\n9 17 -1353\\n7 16 -290944\\n15 3 786657\\n10 6 785372\\n4 11 42832\\n14 6 0\\n11 6 743825\\n4 6 322329\\n20 9 612337\\n5 19 786427\\n13 20 979177\\n4 18 786657\\n9 16 -2\\n17 12 786657\\n12 5 258265\\n16 18 755272\\n8 13 1\\n6 14 786657\\n20 7 148009\\n20 18 612337\\n4 13 786657\\n5 20 322099\\n16 6 290944\\n20 19 -4209\\n18 11 -3302\\n17 2 0\\n5 16 63834\\n7 1 -181285\\n3 5 325297\\n1 6 192381\\n5 3 786427\\n9 5 -1036\\n10 14 -1285\\n2 4 786657\\n10 3 61984\\n12 8 258265\\n15 14 322329\\n15 4 322329\\n13 17 192520\\n2 1 322329\\n20 14 -174320\\n14 8 -1\\n10 2 785372\\n17 15 322329\\n5 9 786427\\n18 5 -2\\n5 1 -9\\n18 12 -722593\\n20 12 -2\\n14 10 1285\\n1 7 514710\\n10 12 785372\\n6 9 63269\\n15 6 42832\\n17 8 786657\\n19 16 789624\\n8 1 786658\\n11 16 -11447\\n10 20 321044\\n12 10 722593\\n14 2 174320\\n20 3 -7163\\n8 14 63270\\n11 9 131488\\n10 1 785372\\n10 18 785372\\n6 20 174320\\n12 16 258265\\n9 19 -66236\\n16 19 -6620\\n6 1 -540\\n12 3 258265\\n1 14 192381\\n14 13 786657\\n8 10 1286\\n10 19 -780\\n1 9 255650\\n4 19 142438\\n15 12 64064\\n1 4 979038\\n18 10 -751\\n19 9 325296\\n19 12 789624\\n6 16 31385\\n6 12 64064\\n12 11 722593\\n20 5 612337\\n11 20 743825\\n5 8 786427\\n15 2 786657\\n6 17 0\\n15 8 0\\n10 7 785372\\n9 7 723388\\n13 5 514849\\n6 5 230\\n4 5 230\\n11 14 131488\\n17 18 786657\\n3 6 45800\\n1 20 514710\\n12 17 -20\\n20 15 612337\\n13 7 979177\\n18 14 0\\n11 18 743825\\n16 1 -31385\\n3 19 789625\\n20 13 -5157\\n7 10 0\\n11 5 743825\\n12 9 -795\\n5 15 786427\\n14 7 322329\\n1 8 514710\\n2 20 786657\\n15 13 142438\\n17 16 786657\\n15 5 230\\n6 7 322329\\n16 2 11447\\n11 15 279497\\n8 12 64065\\n19 4 325296\\n12 13 258265\\n19 18 789624\\n12 6 -14317\\n18 3 0\\n1 16 514710\\n19 5 789624\\n13 11 979177\\n12 15 722593\\n4 7 322329\\n9 8 723388\\n6 18 786657\\n14 11 322329\\n5 13 786427\\n14 5 786657\\n4 3 322329\\n5 14 -230\\n11 8 21232\\n9 2 723388\\n3 12 789625\\n6 8 142438\\n11 7 279497\\n\", \"20 380\\n12 11 886655\\n13 2 886651\\n17 3 886650\\n12 13 886637\\n17 11 886654\\n17 16 886643\\n18 5 886650\\n8 19 886653\\n10 2 886656\\n13 1 886639\\n13 14 886645\\n5 14 886653\\n1 20 886652\\n14 15 886650\\n20 8 886650\\n15 3 886639\\n9 18 886655\\n16 5 886651\\n18 17 886656\\n9 3 886644\\n2 11 886644\\n14 12 886644\\n19 10 886655\\n3 20 886655\\n10 14 886640\\n20 10 886656\\n13 4 886642\\n17 6 886651\\n12 5 886647\\n20 17 886646\\n13 10 886655\\n8 18 886654\\n5 1 886644\\n14 8 886648\\n14 7 886643\\n6 14 886636\\n7 1 886640\\n19 11 886648\\n16 9 886648\\n7 14 886641\\n9 10 886653\\n10 12 886655\\n6 8 886655\\n11 8 886638\\n7 12 886643\\n4 8 886641\\n12 6 886651\\n14 10 886649\\n11 14 886652\\n16 6 886653\\n17 8 886656\\n5 4 886641\\n2 17 886647\\n14 9 886653\\n2 20 886640\\n2 5 886637\\n17 5 886650\\n17 13 886638\\n11 16 886639\\n20 19 886655\\n10 16 886655\\n4 2 886649\\n13 20 886653\\n4 1 886649\\n4 13 886647\\n8 3 886636\\n8 1 886651\\n9 8 886655\\n14 17 886653\\n4 6 886648\\n17 9 886647\\n16 3 886641\\n4 14 886651\\n1 18 886642\\n6 7 886652\\n12 8 886652\\n13 9 886654\\n18 10 886642\\n9 6 886640\\n4 7 886640\\n1 2 886649\\n3 4 886652\\n19 5 886642\\n12 14 886655\\n6 5 886643\\n18 9 886637\\n7 9 886650\\n13 19 886652\\n4 5 886641\\n16 14 886646\\n9 1 886650\\n1 3 886652\\n5 10 886656\\n6 12 886643\\n10 15 886653\\n3 5 886654\\n18 6 886647\\n19 4 886649\\n12 19 886651\\n15 6 886644\\n15 18 886650\\n10 4 886643\\n11 5 886646\\n3 7 886655\\n14 6 886656\\n18 3 886649\\n1 9 886637\\n5 13 886648\\n15 19 886650\\n13 18 886654\\n15 9 886649\\n11 18 886652\\n17 20 886638\\n11 10 886646\\n6 11 886651\\n15 1 886648\\n8 4 886636\\n10 3 886656\\n10 5 886652\\n15 11 886638\\n11 6 886650\\n16 10 886654\\n8 9 886643\\n2 4 886641\\n17 2 886637\\n11 1 886646\\n6 20 886644\\n8 6 886652\\n19 12 886652\\n3 15 886644\\n19 9 886655\\n8 20 886652\\n17 4 886648\\n14 16 886649\\n16 18 886650\\n9 14 886639\\n14 1 886637\\n2 18 886640\\n17 1 886649\\n15 7 886655\\n3 19 886636\\n5 11 886648\\n12 9 886637\\n2 12 886654\\n12 7 886649\\n2 3 886637\\n15 12 886650\\n8 7 886636\\n3 11 886649\\n12 20 886638\\n10 9 886654\\n15 2 886656\\n18 13 886641\\n14 3 886655\\n12 15 886647\\n20 4 886653\\n1 4 886647\\n11 15 886640\\n15 5 886638\\n20 5 886643\\n18 14 886648\\n11 17 886648\\n9 2 886655\\n11 12 886639\\n11 13 886651\\n17 18 886649\\n3 8 886650\\n3 17 886656\\n11 9 886654\\n2 15 886637\\n19 16 886637\\n15 10 886640\\n14 19 886648\\n3 9 886643\\n2 1 886638\\n10 8 886653\\n3 1 886655\\n13 7 886654\\n6 10 886652\\n19 18 886636\\n12 18 886637\\n7 20 886636\\n16 2 886643\\n14 5 886649\\n16 8 886651\\n12 10 886646\\n15 16 886652\\n12 17 886641\\n7 4 886647\\n1 10 886638\\n12 16 886654\\n5 17 886646\\n9 19 886656\\n16 13 886636\\n17 14 886655\\n1 13 886637\\n2 10 886652\\n1 16 886656\\n14 13 886646\\n13 8 886648\\n11 2 886639\\n16 1 886644\\n13 3 886654\\n2 19 886639\\n2 16 886647\\n6 18 886645\\n1 17 886644\\n4 12 886641\\n18 1 886648\\n16 19 886653\\n11 3 886640\\n14 18 886648\\n8 16 886640\\n10 18 886640\\n16 17 886650\\n20 16 886636\\n3 6 886639\\n10 13 886654\\n9 20 886649\\n7 17 886654\\n10 19 886644\\n15 17 886646\\n7 19 886640\\n6 15 886653\\n18 2 886652\\n5 6 886642\\n15 13 886648\\n4 15 886646\\n10 20 886636\\n3 18 886646\\n14 11 886652\\n16 11 886651\\n12 2 886639\\n18 19 886639\\n2 7 886640\\n16 12 886653\\n20 3 886642\\n16 15 886638\\n1 5 886651\\n7 10 886639\\n2 14 886655\\n13 6 886637\\n19 13 886637\\n6 1 886651\\n13 15 886645\\n5 16 886646\\n13 17 886653\\n14 2 886649\\n6 17 886644\\n20 9 886648\\n9 16 886642\\n1 11 886642\\n9 17 886649\\n4 16 886643\\n7 6 886639\\n5 12 886646\\n19 2 886637\\n5 9 886645\\n16 20 886644\\n5 3 886655\\n11 19 886636\\n19 15 886638\\n19 14 886637\\n17 15 886639\\n9 4 886644\\n9 15 886649\\n19 17 886643\\n8 10 886650\\n8 11 886645\\n3 14 886652\\n18 15 886654\\n5 20 886645\\n6 3 886640\\n3 13 886641\\n12 3 886641\\n20 7 886646\\n9 13 886642\\n19 7 886652\\n20 15 886656\\n12 4 886645\\n14 4 886643\\n13 16 886650\\n4 17 886650\\n12 1 886653\\n17 10 886637\\n15 8 886640\\n7 3 886640\\n11 20 886636\\n18 11 886644\\n5 15 886638\\n19 1 886639\\n9 11 886640\\n1 15 886643\\n11 7 886648\\n15 14 886639\\n8 14 886639\\n20 18 886641\\n8 15 886647\\n6 4 886651\\n5 2 886638\\n18 16 886646\\n5 7 886647\\n9 12 886652\\n9 7 886637\\n4 18 886644\\n8 5 886652\\n18 4 886648\\n3 16 886641\\n1 19 886648\\n5 18 886653\\n9 5 886646\\n1 8 886655\\n6 9 886654\\n10 7 886638\\n16 4 886653\\n18 7 886645\\n20 6 886654\\n8 12 886647\\n11 4 886637\\n14 20 886653\\n7 16 886641\\n5 8 886649\\n20 12 886656\\n7 11 886646\\n16 7 886651\\n7 13 886639\\n4 10 886647\\n8 13 886648\\n13 12 886645\\n8 2 886653\\n17 12 886644\\n20 13 886652\\n4 9 886645\\n10 1 886646\\n3 10 886650\\n7 5 886644\\n10 6 886638\\n10 11 886649\\n20 14 886650\\n18 20 886646\\n20 1 886653\\n4 11 886640\\n4 3 886655\\n2 6 886638\\n10 17 886651\\n13 5 886655\\n13 11 886653\\n6 13 886653\\n4 20 886652\\n19 8 886652\\n1 14 886650\\n20 11 886653\\n8 17 886641\\n7 2 886642\\n1 12 886656\\n2 9 886641\\n2 8 886639\\n1 6 886656\\n19 6 886639\\n17 7 886651\\n4 19 886655\\n7 15 886647\\n15 4 886642\\n20 2 886643\\n3 12 886641\\n6 19 886643\\n19 3 886642\\n7 8 886646\\n3 2 886643\\n17 19 886642\\n1 7 886644\\n6 16 886642\\n7 18 886647\\n5 19 886644\\n2 13 886640\\n18 12 886652\\n15 20 886637\\n18 8 886637\\n19 20 886639\\n6 2 886656\\n\", \"20 380\\n10 20 954882\\n11 18 954885\\n10 6 954887\\n17 19 954888\\n2 12 954876\\n1 18 954892\\n13 18 954891\\n14 16 954884\\n20 4 954884\\n6 13 954885\\n8 7 954880\\n5 17 954875\\n17 13 954888\\n6 10 954890\\n9 17 954888\\n2 16 954881\\n19 13 954876\\n17 15 954889\\n1 15 954876\\n13 3 954873\\n15 19 954880\\n13 6 954886\\n11 3 954888\\n13 7 954874\\n12 2 954875\\n16 12 954878\\n12 15 954887\\n16 20 954875\\n19 3 954889\\n11 20 954874\\n18 11 954892\\n4 2 954882\\n14 15 954887\\n15 5 954881\\n17 10 954876\\n20 11 954891\\n12 17 954887\\n20 6 954886\\n10 16 954877\\n20 15 954874\\n18 16 954883\\n4 18 954889\\n10 2 954891\\n18 13 954892\\n1 12 954887\\n6 14 954884\\n9 2 954885\\n14 17 954880\\n16 17 954890\\n7 13 954888\\n18 4 954890\\n2 10 954883\\n12 11 954875\\n15 3 954887\\n19 9 954880\\n17 20 954879\\n7 16 954885\\n19 5 954874\\n6 11 954876\\n16 1 954882\\n6 12 954879\\n10 15 954878\\n11 16 954873\\n11 1 954878\\n12 1 954881\\n10 14 954890\\n17 6 954877\\n20 13 954889\\n19 15 954874\\n15 16 954889\\n16 4 954885\\n8 17 954885\\n10 3 954891\\n3 15 954882\\n14 11 954878\\n20 7 954878\\n17 9 954872\\n3 18 954887\\n14 20 954882\\n13 16 954880\\n2 17 954884\\n18 15 954886\\n5 6 954885\\n15 9 954883\\n7 8 954890\\n5 15 954873\\n7 20 954886\\n18 10 954878\\n3 20 954887\\n7 5 954883\\n16 2 954889\\n2 7 954873\\n5 3 954883\\n20 18 954889\\n9 10 954884\\n4 20 954880\\n3 9 954882\\n15 10 954889\\n15 1 954882\\n13 20 954876\\n20 5 954885\\n18 5 954880\\n1 4 954885\\n10 5 954872\\n17 8 954872\\n8 6 954880\\n7 3 954875\\n14 13 954876\\n5 13 954876\\n2 6 954887\\n17 3 954873\\n18 12 954877\\n19 20 954888\\n16 6 954881\\n4 3 954890\\n18 20 954874\\n2 9 954878\\n10 1 954881\\n17 14 954887\\n5 4 954890\\n10 4 954883\\n1 2 954874\\n4 13 954876\\n3 16 954891\\n13 19 954890\\n13 11 954877\\n8 12 954872\\n15 2 954882\\n13 17 954882\\n5 8 954892\\n12 9 954891\\n13 12 954885\\n9 18 954889\\n9 15 954879\\n4 11 954876\\n5 14 954877\\n16 7 954889\\n8 20 954885\\n15 7 954892\\n12 8 954888\\n10 7 954888\\n5 20 954886\\n2 18 954886\\n9 11 954889\\n3 12 954875\\n4 12 954884\\n6 7 954874\\n17 18 954878\\n6 9 954877\\n17 1 954874\\n12 19 954878\\n8 19 954878\\n14 4 954882\\n12 7 954877\\n2 5 954878\\n20 9 954880\\n6 20 954874\\n8 5 954874\\n13 4 954880\\n19 12 954884\\n17 5 954880\\n9 8 954886\\n6 16 954886\\n20 1 954886\\n5 18 954875\\n20 3 954874\\n9 12 954876\\n3 8 954884\\n4 1 954882\\n13 1 954889\\n7 1 954883\\n14 10 954890\\n20 19 954889\\n7 10 954879\\n2 4 954881\\n14 9 954884\\n10 13 954873\\n1 17 954881\\n14 5 954879\\n10 9 954880\\n1 13 954883\\n19 4 954878\\n9 13 954889\\n16 11 954892\\n12 6 954888\\n16 5 954878\\n1 5 954874\\n6 15 954878\\n5 2 954889\\n4 7 954873\\n19 14 954879\\n10 11 954887\\n8 4 954882\\n19 1 954874\\n3 10 954878\\n11 15 954880\\n6 1 954878\\n3 14 954886\\n6 2 954886\\n20 10 954872\\n14 18 954891\\n9 16 954873\\n11 12 954874\\n6 5 954875\\n12 18 954879\\n4 17 954878\\n16 13 954884\\n15 20 954880\\n8 13 954892\\n1 19 954891\\n17 11 954887\\n1 3 954873\\n11 7 954876\\n12 14 954890\\n20 12 954888\\n17 7 954883\\n3 5 954883\\n17 4 954887\\n20 14 954882\\n1 6 954882\\n15 12 954882\\n13 14 954891\\n3 1 954883\\n8 14 954881\\n8 10 954890\\n2 1 954889\\n2 14 954889\\n3 7 954888\\n7 4 954887\\n5 1 954876\\n2 20 954885\\n10 18 954875\\n11 5 954884\\n12 10 954885\\n3 19 954884\\n9 7 954872\\n8 3 954889\\n15 8 954875\\n5 7 954881\\n13 9 954886\\n10 17 954891\\n17 2 954884\\n11 13 954882\\n7 15 954877\\n12 13 954872\\n9 14 954891\\n8 18 954883\\n7 11 954888\\n6 18 954879\\n9 20 954879\\n18 2 954875\\n14 12 954879\\n5 19 954878\\n11 19 954874\\n7 12 954875\\n10 12 954876\\n13 15 954873\\n18 6 954885\\n13 10 954886\\n13 2 954874\\n11 2 954873\\n14 6 954883\\n14 8 954872\\n18 3 954890\\n19 8 954887\\n8 11 954883\\n18 19 954877\\n3 17 954876\\n9 1 954878\\n16 3 954878\\n20 16 954884\\n2 15 954881\\n12 3 954891\\n9 6 954873\\n11 9 954877\\n13 5 954873\\n7 6 954891\\n7 9 954880\\n1 16 954874\\n4 8 954877\\n6 3 954884\\n19 18 954891\\n11 8 954892\\n16 10 954890\\n14 19 954881\\n14 1 954881\\n19 10 954890\\n15 11 954872\\n14 7 954880\\n15 14 954889\\n1 9 954881\\n18 9 954873\\n5 10 954891\\n1 11 954883\\n8 2 954892\\n9 3 954888\\n3 6 954872\\n19 11 954873\\n1 14 954873\\n20 2 954873\\n16 18 954886\\n11 10 954874\\n3 2 954889\\n2 13 954877\\n16 9 954874\\n20 17 954879\\n7 18 954880\\n14 3 954876\\n4 15 954884\\n11 6 954886\\n3 4 954889\\n7 19 954892\\n5 11 954892\\n7 17 954891\\n11 4 954881\\n17 16 954886\\n1 7 954891\\n1 8 954873\\n18 17 954880\\n19 17 954883\\n3 11 954877\\n9 19 954878\\n12 16 954881\\n16 19 954883\\n12 4 954878\\n18 14 954891\\n19 2 954889\\n18 7 954874\\n11 17 954878\\n18 1 954889\\n15 13 954888\\n12 5 954873\\n5 12 954884\\n18 8 954875\\n4 16 954877\\n6 8 954881\\n16 14 954886\\n8 9 954876\\n6 4 954874\\n9 5 954873\\n15 4 954891\\n7 2 954883\\n6 19 954878\\n4 10 954890\\n13 8 954890\\n4 5 954883\\n15 6 954877\\n3 13 954878\\n20 8 954881\\n19 7 954872\\n10 8 954876\\n1 10 954882\\n16 8 954873\\n2 8 954881\\n4 14 954890\\n11 14 954877\\n4 19 954890\\n5 16 954890\\n4 9 954883\\n15 17 954875\\n19 6 954882\\n5 9 954875\\n8 15 954876\\n4 6 954872\\n7 14 954872\\n8 1 954883\\n12 20 954886\\n1 20 954881\\n6 17 954885\\n17 12 954875\\n2 19 954886\\n8 16 954888\\n9 4 954873\\n19 16 954885\\n10 19 954880\\n2 11 954880\\n14 2 954887\\n2 3 954883\\n15 18 954872\\n16 15 954892\\n\"], \"outputs\": [\"-2\\n\", \"No\\n\", \"-449429\\n\", \"0\\n\", \"No\\n\", \"19000000\\n\", \"-19000000\\n\", \"No\\n\", \"6345917\\n\", \"7239735\\n\", \"6449033\\n\", \"-1023116\\n\", \"-979177\\n\", \"16846104\\n\", \"18142585\\n\"], \"fn_name\": null}", "source": "lcbv5"}
|
There is a weighted simple directed graph with N vertices and M edges.
The vertices are numbered 1 to N, and the i-th edge has a weight of W_i and extends from vertex U_i to vertex V_i.
The weights can be negative, but the graph does not contain negative cycles.
Determine whether there is a walk that visits each vertex at least once. If such a walk exists, find the minimum total weight of the edges traversed.
If the same edge is traversed multiple times, the weight of that edge is added for each traversal.
Here, "a walk that visits each vertex at least once" is a sequence of vertices v_1,v_2,\dots,v_k that satisfies both of the following conditions:
- For every i (1\leq i\leq k-1), there is an edge extending from vertex v_i to vertex v_{i+1}.
- For every j\ (1\leq j\leq N), there is i (1\leq i\leq k) such that v_i=j.
Input
The input is given from Standard Input in the following format:
N M
U_1 V_1 W_1
U_2 V_2 W_2
\vdots
U_M V_M W_M
Output
If there is a walk that visits each vertex at least once, print the minimum total weight of the edges traversed. Otherwise, print No.
Constraints
- 2\leq N \leq 20
- 1\leq M \leq N(N-1)
- 1\leq U_i,V_i \leq N
- U_i \neq V_i
- (U_i,V_i) \neq (U_j,V_j) for i\neq j
- -10^6\leq W_i \leq 10^6
- The given graph does not contain negative cycles.
- All input values are integers.
Sample Input 1
3 4
1 2 5
2 1 -3
2 3 -4
3 1 100
Sample Output 1
-2
By following the vertices in the order 2\rightarrow 1\rightarrow 2\rightarrow 3, you can visit all vertices at least once, and the total weight of the edges traversed is (-3)+5+(-4)=-2.
This is the minimum.
Sample Input 2
3 2
1 2 0
2 1 0
Sample Output 2
No
There is no walk that visits all vertices at least once.
Sample Input 3
5 9
1 2 -246288
4 5 -222742
3 1 246288
3 4 947824
5 2 -178721
4 3 -947824
5 4 756570
2 5 707902
5 1 36781
Sample Output 3
-449429
Read the inputs from stdin solve the problem and write the answer to stdout (do not directly test on the sample inputs). Enclose your code within ```python delimiters.
| 0
|
{"tests": "{\"inputs\": [\"2 5\\n\", \"0 0\\n\", \"7 1\\n\", \"1 0\\n\", \"2 0\\n\", \"2 1\\n\", \"1 3\\n\", \"2 3\\n\", \"0 6\\n\", \"3 4\\n\", \"0 8\\n\", \"5 4\\n\"], \"outputs\": [\"2\\n\", \"9\\n\", \"4\\n\", \"2\\n\", \"3\\n\", \"4\\n\", \"5\\n\", \"6\\n\", \"7\\n\", \"8\\n\", \"9\\n\", \"0\\n\"], \"fn_name\": null}", "source": "lcbv5"}
|
You are given two integers A and B, each between 0 and 9, inclusive.
Print any integer between 0 and 9, inclusive, that is not equal to A + B.
Input
The input is given from Standard Input in the following format:
A B
Output
Print any integer between 0 and 9, inclusive, that is not equal to A + B.
Constraints
- 0 \leq A \leq 9
- 0 \leq B \leq 9
- A + B \leq 9
- A and B are integers.
Sample Input 1
2 5
Sample Output 1
2
When A = 2, B = 5, we have A + B = 7. Thus, printing any of 0, 1, 2, 3, 4, 5, 6, 8, 9 is correct.
Sample Input 2
0 0
Sample Output 2
9
Sample Input 3
7 1
Sample Output 3
4
Read the inputs from stdin solve the problem and write the answer to stdout (do not directly test on the sample inputs). Enclose your code within ```python delimiters.
| 0
|
{"tests": "{\"inputs\": [\"840 84 7\\n\", \"343 34 3\\n\", \"0 0 0\\n\", \"951 154 495\\n\", \"744 621 910\\n\", \"866 178 386\\n\", \"1029 1029 1029\\n\", \"0 0 343\\n\", \"915 51 4\\n\", \"596 176 27\\n\", \"339 210 90\\n\", \"359 245 60\\n\", \"546 210 21\\n\", \"343 343 0\\n\"], \"outputs\": [\"Yes\\n0 0 0 0 6 0 6 0 0\\n\", \"No\\n\", \"No\\n\", \"No\\n\", \"No\\n\", \"No\\n\", \"No\\n\", \"Yes\\n0 0 0 0 0 0 0 0 0\\n\", \"Yes\\n0 0 0 0 3 6 6 0 6\\n\", \"Yes\\n0 0 0 0 2 3 4 4 4\\n\", \"Yes\\n0 0 0 -1 -1 4 0 1 1\\n\", \"Yes\\n0 0 0 -1 2 3 -1 2 5\\n\", \"Yes\\n0 0 0 -1 0 3 5 0 -1\\n\", \"Yes\\n0 0 0 -1 -1 7 -1 -1 7\\n\"], \"fn_name\": null}", "source": "lcbv5"}
|
In a coordinate space, we want to place three cubes with a side length of 7 so that the volumes of the regions contained in exactly one, two, three cube(s) are V_1, V_2, V_3, respectively.
For three integers a, b, c, let C(a,b,c) denote the cubic region represented by (a\leq x\leq a+7) \land (b\leq y\leq b+7) \land (c\leq z\leq c+7).
Determine whether there are nine integers a_1, b_1, c_1, a_2, b_2, c_2, a_3, b_3, c_3 that satisfy all of the following conditions, and find one such tuple if it exists.
- |a_1|, |b_1|, |c_1|, |a_2|, |b_2|, |c_2|, |a_3|, |b_3|, |c_3| \leq 100
- Let C_i = C(a_i, b_i, c_i)\ (i=1,2,3).
- The volume of the region contained in exactly one of C_1, C_2, C_3 is V_1.
- The volume of the region contained in exactly two of C_1, C_2, C_3 is V_2.
- The volume of the region contained in all of C_1, C_2, C_3 is V_3.
Input
The input is given from Standard Input in the following format:
V_1 V_2 V_3
Output
If no nine integers a_1, b_1, c_1, a_2, b_2, c_2, a_3, b_3, c_3 satisfy all of the conditions in the problem statement, print No. Otherwise, print such integers in the following format. If multiple solutions exist, you may print any of them.
Yes
a_1 b_1 c_1 a_2 b_2 c_2 a_3 b_3 c_3
Constraints
- 0 \leq V_1, V_2, V_3 \leq 3 \times 7^3
- All input values are integers.
Sample Input 1
840 84 7
Sample Output 1
Yes
0 0 0 0 6 0 6 0 0
Consider the case (a_1, b_1, c_1, a_2, b_2, c_2, a_3, b_3, c_3) = (0, 0, 0, 0, 6, 0, 6, 0, 0).
The figure represents the positional relationship of C_1, C_2, and C_3, corresponding to the orange, cyan, and green cubes, respectively.
Here,
- All of |a_1|, |b_1|, |c_1|, |a_2|, |b_2|, |c_2|, |a_3|, |b_3|, |c_3| are not greater than 100.
- The region contained in all of C_1, C_2, C_3 is (6\leq x\leq 7)\land (6\leq y\leq 7) \land (0\leq z\leq 7), with a volume of (7-6)\times(7-6)\times(7-0)=7.
- The region contained in exactly two of C_1, C_2, C_3 is ((0\leq x < 6)\land (6\leq y\leq 7) \land (0\leq z\leq 7))\lor((6\leq x\leq 7)\land (0\leq y < 6) \land (0\leq z\leq 7)), with a volume of (6-0)\times(7-6)\times(7-0)\times 2=84.
- The region contained in exactly one of C_1, C_2, C_3 has a volume of 840.
Thus, all conditions are satisfied.
(a_1, b_1, c_1, a_2, b_2, c_2, a_3, b_3, c_3) = (-10, 0, 0, -10, 0, 6, -10, 6, 1) also satisfies all conditions and would be a valid output.
Sample Input 2
343 34 3
Sample Output 2
No
No nine integers a_1, b_1, c_1, a_2, b_2, c_2, a_3, b_3, c_3 satisfy all of the conditions.
Read the inputs from stdin solve the problem and write the answer to stdout (do not directly test on the sample inputs). Enclose your code within ```python delimiters.
| 0
|
{"tests": "{\"inputs\": [\"3 2 10 20\\n\", \"3 2 20 20\\n\", \"314159265358979323 4 223606797 173205080\\n\", \"1000000000000000000 5 678409449 462213765\\n\", \"1000000000000000000 4 19417779 15359224\\n\", \"1000000000000000000 2 1000000000 1000000000\\n\", \"1000000000000000000 6 1000000000 1\\n\", \"1000000000000000000 2 130683535 206738146\\n\", \"1000000000000000000 6 1 1000000000\\n\", \"84324828731963982 2 270618380 428111662\\n\", \"676105575462224593 5 91212587 62144929\\n\", \"1000000000000000000 2 333504646 527596179\\n\", \"1000000000000000000 3 470762436 469875243\\n\", \"316222891501899080 6 906216946 554597231\\n\", \"1000000000000000000 6 1 1\\n\", \"1 2 2 1\\n\", \"1000000000000000000 4 403501668 319164880\\n\", \"594688604155374934 4 529780857 419050176\\n\", \"760713016476190629 5 323538049 220432874\\n\", \"1000000000000000000 6 1000000000 1000000000\\n\", \"931356503492686568 3 179340970 179002984\\n\", \"1000000000000000000 6 957841525 586191038\\n\", \"615812229161735902 4 380558657 301017246\\n\"], \"outputs\": [\"20.000000000000000\\n\", \"32.000000000000000\\n\", \"6418410657.7408381\\n\", \"17514316337.980957\\n\", \"581674678.60634942\\n\", \"38338820718.424062\\n\", \"38.444112237638366\\n\", \"7821404130.3928607\\n\", \"24.000000000000000\\n\", \"15230823973.616135\\n\", \"2331939775.4906148\\n\", \"19960239385.275657\\n\", \"17782248938.321699\\n\", \"20437022568.848955\\n\", \"24.000000000000000\\n\", \"1.2000000000000000\\n\", \"12087206958.733502\\n\", \"15673746668.153448\\n\", \"8299986920.1098969\\n\", \"24000000000.000000\\n\", \"6765346049.1048723\\n\", \"22214240820.660535\\n\", \"11268823355.662118\\n\"], \"fn_name\": null}", "source": "lcbv5"}
|
You are given an integer N. You can perform the following two types of operations:
- Pay X yen to replace N with \displaystyle\left\lfloor\frac{N}{A}\right\rfloor.
- Pay Y yen to roll a die (dice) that shows an integer between 1 and 6, inclusive, with equal probability. Let b be the outcome of the die, and replace N with \displaystyle\left\lfloor\frac{N}{b}\right\rfloor.
Here, \lfloor s \rfloor denotes the greatest integer less than or equal to s. For example, \lfloor 3 \rfloor=3 and \lfloor 2.5 \rfloor=2.
Determine the minimum expected cost paid before N becomes 0 when optimally choosing operations.
The outcome of the die in each operation is independent of other rolls, and the choice of operation can be made after observing the results of the previous operations.
Input
The input is given from Standard Input in the following format:
N A X Y
Output
Print the answer.
Your output will be considered correct if the absolute or relative error from the true answer is at most 10^{-6}.
Constraints
- 1 \leq N \leq 10^{18}
- 2 \leq A \leq 6
- 1 \leq X, Y \leq 10^9
- All input values are integers.
Sample Input 1
3 2 10 20
Sample Output 1
20.000000000000000
The available operations are as follows:
- Pay 10 yen. Replace N with \displaystyle\left\lfloor\frac{N}{2}\right\rfloor.
- Pay 20 yen. Roll a die. Let b be the outcome, and replace N with \displaystyle\left\lfloor\frac{N}{b}\right\rfloor.
The optimal strategy is to perform the first operation twice.
Sample Input 2
3 2 20 20
Sample Output 2
32.000000000000000
The available operations are as follows:
- Pay 20 yen. Replace N with \displaystyle\left\lfloor\frac{N}{2}\right\rfloor.
- Pay 20 yen. Roll a die. Let b be the outcome, and replace N with \displaystyle\left\lfloor\frac{N}{b}\right\rfloor.
The optimal strategy is as follows:
- First, perform the second operation to roll the die.
- If the outcome is 4 or greater, then N becomes 0.
- If the outcome is 2 or 3, then N becomes 1. Now, perform the first operation to make N = 0.
- If the outcome is 1, restart from the beginning.
Sample Input 3
314159265358979323 4 223606797 173205080
Sample Output 3
6418410657.7408381
Read the inputs from stdin solve the problem and write the answer to stdout (do not directly test on the sample inputs). Enclose your code within ```python delimiters.
| 0.125
|
{"tests": "{\"inputs\": [\"0 0 3 3\\n\", \"-1 -2 1 3\\n\", \"-1000000000 -1000000000 1000000000 1000000000\\n\", \"593578395 -294607744 709130348 746175204\\n\", \"-678601079 -990141434 909949145 506736933\\n\", \"-420376129 -732520502 229097481 -243073819\\n\", \"-1 -1 0 0\\n\", \"-880976965 -698845539 -841240811 799247965\\n\", \"-706598544 47244307 -105634155 938741675\\n\", \"-691190744 -116861609 811710484 485546180\\n\", \"-470155176 -912361742 613356520 -773960622\\n\", \"-783899500 -317830601 -527458492 809390604\\n\", \"732193159 -597820905 914896137 -111527557\\n\", \"-929230299 -627268345 351001781 125422425\\n\", \"-770839702 -423993261 244950137 238497609\\n\", \"-61652596 28031419 688518481 862969889\\n\", \"-620080807 -705946951 512308373 -660949591\\n\", \"831487082 -595066332 976979640 562333390\\n\", \"-352155706 -373998982 -312914223 905871545\\n\", \"-306066545 -373037535 401042272 -215006244\\n\", \"-909441412 354830537 562133121 780454045\\n\", \"-115999220 -237739026 -29789995 608949093\\n\", \"-347229815 -995449898 664318316 648408554\\n\", \"-50494404 -97049623 897901965 31953859\\n\", \"167613753 -384539113 690525808 665282346\\n\", \"656514665 -507396307 664618976 668272152\\n\", \"-627922034 -560879852 -425448520 201579460\\n\", \"526190055 355420081 536853464 678001336\\n\"], \"outputs\": [\"10\\n\", \"11\\n\", \"4000000000000000000\\n\", \"120264501770105970\\n\", \"2377866465198604208\\n\", \"317882704110535631\\n\", \"0\\n\", \"59528474181343616\\n\", \"535758171500976836\\n\", \"905359405844864892\\n\", \"149959232259499520\\n\", \"289065742049174640\\n\", \"88847242861190344\\n\", \"963618870073901600\\n\", \"672951493845024495\\n\", \"626346691686101425\\n\", \"50954523592564800\\n\", \"168393045024869154\\n\", \"50224016887536278\\n\", \"111745319148977101\\n\", \"626336715231733518\\n\", \"72992326979041835\\n\", \"1662841943927223986\\n\", \"122346433981658599\\n\", \"548964295983877516\\n\", \"9527982236792520\\n\", \"154377815420203056\\n\", \"3439815696507667\\n\"], \"fn_name\": null}", "source": "lcbv5"}
|
The pattern of AtCoder's wallpaper can be represented on the xy-plane as follows:
-
The plane is divided by the following three types of lines:
-
x = n (where n is an integer)
-
y = n (where n is an even number)
-
x + y = n (where n is an even number)
-
Each region is painted black or white. Any two regions adjacent along one of these lines are painted in different colors.
-
The region containing (0.5, 0.5) is painted black.
The following figure shows a part of the pattern.
You are given integers A, B, C, D. Consider a rectangle whose sides are parallel to the x- and y-axes, with its bottom-left vertex at (A, B) and its top-right vertex at (C, D). Calculate the area of the regions painted black inside this rectangle, and print twice that area.
It can be proved that the output value will be an integer.
Input
The input is given from Standard Input in the following format:
A B C D
Output
Print the answer on a single line.
Constraints
- -10^9 \leq A, B, C, D \leq 10^9
- A < C and B < D.
- All input values are integers.
Sample Input 1
0 0 3 3
Sample Output 1
10
We are to find the area of the black-painted region inside the following square:
The area is 5, so print twice that value: 10.
Sample Input 2
-1 -2 1 3
Sample Output 2
11
The area is 5.5, which is not an integer, but the output value is an integer.
Sample Input 3
-1000000000 -1000000000 1000000000 1000000000
Sample Output 3
4000000000000000000
This is the case with the largest rectangle, where the output still fits into a 64-bit signed integer.
Read the inputs from stdin solve the problem and write the answer to stdout (do not directly test on the sample inputs). Enclose your code within ```python delimiters.
| 0
|
{"tests": "{\"inputs\": [\"[1, 2, 3, 4]\\n3\", \"[2, 2]\\n2\", \"[4, 3, -1]\\n2\", \"[100000000, 99999999, 99999998, 99999997, 99999996, 99999995, 99999994, 99999993, 99999992, 99999991]\\n10\", \"[3,369009,745365,1129173,1520619,1919958,2327340,2742999,3167043,3599574,4040745,4490808,4950051,5418543,5896347,6383565,6880464,7387122,7903764,8430489,8967414,9514824,10072869,10641870,11222115,11813976,12417723,13033512,13661502,14301930,14954877,15620388,16298655,16989921,17694516,18412806,19145004,19891263,20651886,21426927,22216536,23020893,23840205,24674739,25524606,26389845,27270591,28167033,29079246,30007425]\\n46\", \"[67108864,33554432,16777216,8388608,4194304,2097152,1048576,524288,262144,131072,65536,32768,16384,8192,4096,2048,1024,512,256,128,64,32,16,8,4,2,1,4782969,1594323,531441,177147,59049,19683,6561,2187,729,243,81,27,9,3,40353607,5764801,823543,117649,16807,2401,343,49,7]\\n25\", \"[13032777, 61685942, 9497687, 58215199, -19957868, -80994822, -82803055, 51532525, 96981229, 43011901, 59923753, 26537601, 67492136, -83570884, 57685185, 31499600, 36534575, -66724170, -91828854, 28165307, -49620372, 40749623, -34221492, -48337531, -38333831, -32365880, 47399424, -7774444, 55630368, -47529263, -17325682, -12090121, -64060583, 40715973, -28821797, 99809586, 91521402, 98211553, 39589417, 27678346, -49982292, -61516711, -40552442, 7715871, 81482656]\\n30\", \"[100000000, -100000000, 100000000, -100000000, 100000000, -100000000, 100000000, -100000000, 100000000, -100000000, 100000000, -100000000, 100000000, -100000000, 100000000, -100000000, 100000000, -100000000, 100000000, -100000000, 100000000, -100000000, 100000000, -100000000, 100000000]\\n9\", \"[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29]\\n9\", \"[-74734189, 46517681, 67401411, -71678642, 31014137, 99597446, 42250937, -78218996, 33342871, 25336031]\\n7\", \"[31334526, 32848186, 24863830, 94655058, 38185138, 77253119, 11724618, 85564863, -90453589, 27232706, 49150423, 92901432, 76311284, -88078583, -73879121, -28030716, 15864157, -89337929, -25628470, 34840511, -13324067, 49718941, 59912714, -37385645, -71557484, -45470977, -35517455, -18331713, -32835771, -22848607, -36728023, 29498887, 29842907, -42511374, 20749826, 26569938, 80105501, 78899304, -58310239, -95896883, -43840493, 94517504, -19407418, -20868377, -76485322, -65699788, 24699402, -42993351, 53432591, -71644687]\\n7\", \"[69621247,98882443,-76176786,6317545,-81283488,69940953,9316771,-27734967,9575160,19393030,27667783,-35415797,32430446,95633190,-60415849,20380682,-37357251,-67904335,98893803,-17116474]\\n16\", \"[74791920,83502926,82994322,64324901,55339064,92679328,89131059,83869848,8741920,461604,20929306,90864395,83783822,17289611,74314004,61266226,52491812,57881617,35565357,47377556]\\n10\", \"[28843452, -82658889, 28024895, 2020227, -27534195, 41997714, -44821600, -92218663, 38213358, 49888787, 14317456, 43022108, 83156091, 40626920, 22206172, -60693938, 96083163, -4277641, -62760313, -46808472, -89592346, 11948007, 51163, -21609887, 26552062, 17166707, -93994387, -37911505, -25992403, 47045313, -13854364, -75487140, 56845554, 72336493, -41802309, -92924713, 11471616, 77716620, -18500899, -48338519, 949085, -14969190, -16477797, -53542437, -31798720, 3230018, -35087642, -75885628, 94938466, -94805360]\\n7\", \"[87781054,87612607,52532162,89494243,7813307,8283555,48336937,11769990,96273386,9374450,72562908,68090720,64335955,11733225,69176351,61301780,27025912,25156523,38762973,96568028]\\n12\", \"[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]\\n15\", \"[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]\\n3\", \"[8051, -8450, 4437, -4640, 6699, -475, 6471, 7054, -191, -1856, 8884, -2660, 474, 5343, 7124, 7058, 6720, 2522, 3332, -303, 1495, -6021, 5250, -7348, -3006, 1187, -5141]\\n19\", \"[0, 2040816, 4081632, 6122448, 8163264, 10204080, 12244896, 14285712, 16326528, 18367344, 20408160, 22448976, 24489792, 26530608, 28571424, 30612240, 32653056, 34693872, 36734688, 38775504, 40816320, 42857136, 44897952, 46938768, 48979584, 51020400, 53061216, 55102032, 57142848, 59183664, 61224480, 63265296, 65306112, 67346928, 69387744, 71428560, 73469376, 75510192, 77551008, 79591824, 81632640, 83673456, 85714272, 87755088, 89795904, 91836720, 93877536, 95918352, 97959168, 99999984]\\n25\", \"[2714096, -87752299, 41870704, -88296063, 40344645, -16637822, 45597073, -94802376, 61018267, -62427155, 51605380, -23940335, 22584376, -15418177, 78100999, -19071090, 15637477, -6668203, 54029038, -36183161]\\n2\", \"[-45868249, 94083487, 18255574, -23318720, -48608103, -71503288, -27032105, 46845855, 64382381, 52532524, 3670998, 30012285, -47761362, 98566272, 70392765, 72942632, 69580625, 66270743, 95178395, -6046985, -75068616, -90331986, 67408066, -58031030, 4292125, -71522366, 76927853, -56548548, 40546396, 1899669, -97679532, 76486554, 3093375, -35911000, -55652986, 2246894, -38044816, -74902981, 76213635, -74627883, 92607207, -33219044, 69475307, 87939580, 1894301, -27057139, -99424145, 37760438]\\n38\", \"[6,738018,1490730,2258772,3042408,3842244,4658364,5491344,6341316,7208862,8094180,8997648,9919602,10860426,11820252,12799560,13798482,14817654,15857328,16917948,17999964,19103508,20228772,21376368,22546968,23740842,24958596,26200638,27467316,28759188,30076824,31420794,32791794,34190520,35617296,37072716,38557308,40071558,41615832,43190712,44796402,46433112,48101148,49800642,51532176,53295876,55092324,56921802,58784718,60681360]\\n28\", \"[50729612,99503496,17602790,31966232,13372079,50153456,50385174,71698340,47504392,11494184,53800036,86341847,67405255,27308886,39701633,57744370,1267328,54622528,51878660,70322819]\\n10\", \"[83112871,66651018,17955046,25736310,43362717,5750045,21577689,81645911,91032402,46042051,51584235,326652,35874916,43855127,13347500,58497081,48794022,93660942,17549215,26430109]\\n20\", \"[100000000, 99999999, 99999998, 99999997, 99999996, 99999995, 99999994, 99999993, 99999992, 99999991, 99999990, 99999989, 99999988, 99999987, 99999986, 99999985, 99999984, 99999983, 99999982, 99999981]\\n6\", \"[2,246006,496910,752786,1013762,1279948,1551454,1828436,2110982,2399316,2693558,2993942,3300640,3613766,3933442,4259696,4592656,4932556,5279494,5633522,5994678,6363102,6739028,7122528,7513792,7913044,8320394,8736004,9160062,9592750,10034184,10484602,10944108,11412852,11891048,12378822,12876346,13383746,13901098,14428528,14966126,15514010,16072380,16641300,17220904,17811360,18412850,19025600,19649778,20285440]\\n37\", \"[-74130616, -67011334, -15495753, -61534681, 69503864, -67268571, -15465209, 70859849, -83593715, 89539516, 20583740, 15582622, 33952933, 55071014, -97243336, 60259478, -17133628, 66736122, -29303586, 32498217]\\n5\", \"[34965628, 83250625, 28246824, -57158385, 41192855, 11844683, -11472735, 37273355, -4914297, -61322341, 49005332, 69998672, 9039844, 44178853, 99584176, -60654481, -71109250, 77620955, -64953795, -73160829, 1216326, -601838, 74753699, 8174597, -44232458, 65533234, -51165625, -94400965, 12103937, -95505138, -33117287, 59695089, 41289219, -9820983, 72309652, -57249414, 95731733, -89647657, -24139155, -82352707, 76905436, -76751201, -61487995, -75902628, -53067983, 7121401, -15975347, -2097604, 29400209, -92299819]\\n50\"], \"outputs\": [\"4\", \"0\", \"10\", \"1\", \"427073221\", \"817691423\", \"901671303\", \"0\", \"14806572\", \"358646265\", \"179535186\", \"627489866\", \"122777274\", \"807554832\", \"5976432\", \"0\", \"200\", \"63221450\", \"54842174\", \"639102989\", \"976956357\", \"78733672\", \"857769049\", \"405831\", \"43975\", \"273504325\", \"710272387\", \"91029\"], \"fn_name\": \"sumOfPowers\"}", "source": "lcbv5"}
|
You are given an integer array nums of length n, and a positive integer k.
The power of a subsequence is defined as the minimum absolute difference between any two elements in the subsequence.
Return the sum of powers of all subsequences of nums which have length equal to k.
Since the answer may be large, return it modulo 10^9 + 7.
Example 1:
Input: nums = [1,2,3,4], k = 3
Output: 4
Explanation:
There are 4 subsequences in nums which have length 3: [1,2,3], [1,3,4], [1,2,4], and [2,3,4]. The sum of powers is |2 - 3| + |3 - 4| + |2 - 1| + |3 - 4| = 4.
Example 2:
Input: nums = [2,2], k = 2
Output: 0
Explanation:
The only subsequence in nums which has length 2 is [2,2]. The sum of powers is |2 - 2| = 0.
Example 3:
Input: nums = [4,3,-1], k = 2
Output: 10
Explanation:
There are 3 subsequences in nums which have length 2: [4,3], [4,-1], and [3,-1]. The sum of powers is |4 - 3| + |4 - (-1)| + |3 - (-1)| = 10.
Constraints:
2 <= n == nums.length <= 50
-10^8 <= nums[i] <= 10^8
2 <= k <= n
You will use the following starter code to write the solution to the problem and enclose your code within ```python delimiters.
```python
class Solution:
def sumOfPowers(self, nums: List[int], k: int) -> int:
```
| 0.625
|
{"tests": "{\"inputs\": [\"5 0\\n2 5\\n\", \"3 1\\n4 1\\n\", \"2552608206527595 5411232866732612\\n771856005518028 7206210729152763\\n\", \"4781732879448891 183482112471753\\n4781732879448891 9644257416479985\\n\", \"6544605838412317 5090865519680273\\n3731935893323877 2278195574591833\\n\", \"0 0\\n10000000000000000 0\\n\", \"8418329510387518 3202360550160355\\n7615972582823963 2400003622596800\\n\", \"4014941784357095 6085696188357076\\n7880022861125851 2220615111588322\\n\", \"7215755183863224 5951996685971472\\n4572191670573160 5951996685971472\\n\", \"4014382622377284 7013421623561212\\n232961242787485 3232000243971411\\n\", \"9930915806195072 116116195085278\\n160682763376123 9886349237904226\\n\", \"9784209689015500 537613062202378\\n557720434281403 9764102316936474\\n\", \"10000000000000000 10000000000000000\\n10000000000000000 10000000000000000\\n\", \"7938828835684753 9587479182263189\\n26918308559601 1675568655138037\\n\", \"258486939697908 9609991118547586\\n9661505200356861 206972857888635\\n\", \"0 10000000000000000\\n0 10000000000000000\\n\", \"8751644283352116 6575476350995126\\n2361414790211682 185246857854691\\n\", \"8070073987022736 1704698409806847\\n3263696280075376 6511076116754207\\n\", \"8284987650542282 7767295753858627\\n1507692901416167 7767295753858627\\n\", \"10000000000000000 0\\n0 0\\n\", \"10000000000000000 10000000000000000\\n0 0\\n\", \"0 10000000000000000\\n10000000000000000 10000000000000000\\n\", \"1658322730453427 427544064863111\\n5414864693599393 3432727697673742\\n\", \"0 0\\n10000000000000000 10000000000000000\\n\", \"0 10000000000000000\\n10000000000000000 0\\n\", \"7469674595336959 3380784989113288\\n7289065616920729 9831704242945409\\n\", \"10000000000000000 10000000000000000\\n0 10000000000000000\\n\", \"8382605729111422 8146890158594981\\n4513003330309110 616078906857218\\n\", \"2219334934482116 5920443403095451\\n165878829991508 6183076791238851\\n\", \"0 0\\n0 10000000000000000\\n\", \"1544998523774144 8430682064042656\\n9504313523420391 471367064396410\\n\"], \"outputs\": [\"5\\n\", \"0\\n\", \"1794977862420151\\n\", \"9460775304008232\\n\", \"2812669945088440\\n\", \"5000000000000000\\n\", \"802356927563555\\n\", \"3865081076768755\\n\", \"1321781756645032\\n\", \"3781421379589801\\n\", \"9770233042818949\\n\", \"9226489254734097\\n\", \"0\\n\", \"7911910527125152\\n\", \"9403018260658952\\n\", \"0\\n\", \"6390229493140435\\n\", \"4806377706947360\\n\", \"3388647374563057\\n\", \"5000000000000000\\n\", \"10000000000000000\\n\", \"5000000000000000\\n\", \"3380862797978298\\n\", \"10000000000000000\\n\", \"10000000000000000\\n\", \"6450919253832121\\n\", \"5000000000000000\\n\", \"7530811251737763\\n\", \"1158044746317004\\n\", \"10000000000000000\\n\", \"7959314999646246\\n\"], \"fn_name\": null}", "source": "lcbv5"}
|
The coordinate plane is covered with 2\times1 tiles. The tiles are laid out according to the following rules:
- For an integer pair (i,j), the square A _ {i,j}=\lbrace(x,y)\mid i\leq x\leq i+1\wedge j\leq y\leq j+1\rbrace is contained in one tile.
- When i+j is even, A _ {i,j} and A _ {i + 1,j} are contained in the same tile.
Tiles include their boundaries, and no two different tiles share a positive area.
Near the origin, the tiles are laid out as follows:
Takahashi starts at the point (S _ x+0.5,S _ y+0.5) on the coordinate plane.
He can repeat the following move as many times as he likes:
- Choose a direction (up, down, left, or right) and a positive integer n. Move n units in that direction.
Each time he enters a tile, he pays a toll of 1.
Find the minimum toll he must pay to reach the point (T _ x+0.5,T _ y+0.5).
Input
The input is given from Standard Input in the following format:
S _ x S _ y
T _ x T _ y
Output
Print the minimum toll Takahashi must pay.
Constraints
- 0\leq S _ x\leq2\times10 ^ {16}
- 0\leq S _ y\leq2\times10 ^ {16}
- 0\leq T _ x\leq2\times10 ^ {16}
- 0\leq T _ y\leq2\times10 ^ {16}
- All input values are integers.
Sample Input 1
5 0
2 5
Sample Output 1
5
For example, Takahashi can pay a toll of 5 by moving as follows:
- Move left by 1. Pay a toll of 0.
- Move up by 1. Pay a toll of 1.
- Move left by 1. Pay a toll of 0.
- Move up by 3. Pay a toll of 3.
- Move left by 1. Pay a toll of 0.
- Move up by 1. Pay a toll of 1.
It is impossible to reduce the toll to 4 or less, so print 5.
Sample Input 2
3 1
4 1
Sample Output 2
0
There are cases where no toll needs to be paid.
Sample Input 3
2552608206527595 5411232866732612
771856005518028 7206210729152763
Sample Output 3
1794977862420151
Note that the value to be output may exceed the range of a 32-bit integer.
Read the inputs from stdin solve the problem and write the answer to stdout (do not directly test on the sample inputs). Enclose your code within ```python delimiters.
| 0
|
{"tests": "{\"inputs\": [\"363\\n\", \"101\\n\", \"3154625100\\n\", \"146659312800\\n\", \"248961081600\\n\", \"963761198400\\n\", \"936888861285\\n\", \"637822752336\\n\", \"549755813888\\n\", \"240940299600\\n\", \"442597478400\\n\", \"110649369600\\n\", \"39571817593\\n\", \"771852316660\\n\", \"607588581600\\n\", \"764197228384\\n\", \"324899807232\\n\", \"307359360000\\n\", \"293318625600\\n\", \"274877906944\\n\", \"405059054400\\n\", \"810118108800\\n\", \"823586567760\\n\", \"530767036800\\n\", \"498941766577\\n\", \"474896822400\\n\", \"642507465600\\n\", \"321253732800\\n\", \"3\\n\", \"452474573364\\n\", \"160626866400\\n\"], \"outputs\": [\"11*3*11\\n\", \"-1\\n\", \"2*57*184481*75*2\\n\", \"2*3*5*12*646646*21*5*3*2\\n\", \"2*2*2*2*3*3*3*3*5*7*121*7*5*3*3*3*3*2*2*2*2\\n\", \"2*3*5*2964*77*4692*5*3*2\\n\", \"-1\\n\", \"2*3*7*14*629926*41*7*3*2\\n\", \"2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*8*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2\\n\", \"3*5*2964*77*4692*5*3\\n\", \"2*2*2*2*2*2*3*3*3*5*7*121*7*5*3*3*3*2*2*2*2*2*2\\n\", \"2*2*2*2*2*3*3*3*5*7*121*7*5*3*3*3*2*2*2*2*2\\n\", \"39571817593\\n\", \"2*346655*1*556643*2\\n\", \"2*2*3*3*19*58*55*85*91*3*3*2*2\\n\", \"2*2*47762326774*2*2\\n\", \"2*2*2*2*2*2*182*1551*281*2*2*2*2*2*2\\n\", \"2*2*2*2*2*3*3*5*5*7*121*7*5*5*3*3*2*2*2*2*2\\n\", \"2*2*2*15*147*55*741*51*2*2*2\\n\", \"2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*4*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2\\n\", \"3*5*6188*33*8816*5*3\\n\", \"3*5*6188*66*8816*5*3\\n\", \"2*2*3*11*5987*1*7895*11*3*2*2\\n\", \"-1\\n\", \"-1\\n\", \"-1\\n\", \"2*3*5*23*969969*32*5*3*2\\n\", \"2*2964*5775*4692*2\\n\", \"3\\n\", \"3*3*11*46166164*11*3*3\\n\", \"3*5*23*969969*32*5*3\\n\"], \"fn_name\": null}", "source": "lcbv5"}
|
You are given an integer N. Print a string S that satisfies all of the following conditions. If no such string exists, print -1.
- S is a string of length between 1 and 1000, inclusive, consisting of the characters 1, 2, 3, 4, 5, 6, 7, 8, 9, and * (multiplication symbol).
- S is a palindrome.
- The first character of S is a digit.
- The value of S when evaluated as a formula equals N.
Input
The input is given from Standard Input in the following format:
N
Output
If there is a string S that satisfies the conditions exists, print such a string. Otherwise, print -1.
Constraints
- 1 \leq N \leq 10^{12}
- N is an integer.
Sample Input 1
363
Sample Output 1
11*3*11
S = 11*3*11 satisfies the conditions in the problem statement. Another string that satisfies the conditions is S= 363.
Sample Input 2
101
Sample Output 2
-1
Note that S must not contain the digit 0.
Sample Input 3
3154625100
Sample Output 3
2*57*184481*75*2
Read the inputs from stdin solve the problem and write the answer to stdout (do not directly test on the sample inputs). Enclose your code within ```python delimiters.
| 0
|
{"tests": "{\"inputs\": [\"4 8 4\\n1 5\\n3 2\\n4 1\\n5 3\\n\", \"2 1 1\\n3 2\\n3 2\\n\", \"2 100 100\\n3 2\\n3 2\\n\", \"6 364 463\\n230 381\\n154 200\\n328 407\\n339 94\\n193 10\\n115 309\\n\", \"18 10000 10000\\n5790 8778\\n9995 9908\\n9016 2300\\n2633 3650\\n2312 5582\\n8853 6097\\n8881 8620\\n6427 3925\\n9355 5240\\n5070 7050\\n4178 8133\\n6739 319\\n4533 5388\\n9299 5558\\n7720 122\\n861 7766\\n5922 1456\\n7601 8377\\n\", \"80 6376 77\\n30 10\\n10 1\\n42 4249\\n569 17\\n15 9\\n133 5786\\n644 6054\\n207 231\\n6 194\\n5218 71\\n461 63\\n35 216\\n32 88\\n2048 455\\n5 3188\\n4 2924\\n1 42\\n154 350\\n5279 24\\n50 5605\\n1587 3\\n6574 276\\n162 3173\\n129 17\\n79 1075\\n1 62\\n11 19\\n1373 1904\\n19 197\\n1193 5\\n1515 49\\n2007 3743\\n15 1\\n160 233\\n120 12\\n1374 2804\\n23 627\\n25 995\\n54 1\\n5 180\\n1754 506\\n5 19\\n3 1494\\n452 1478\\n17 9424\\n36 4397\\n2 3581\\n5066 29\\n13 7296\\n4 199\\n496 1\\n122 2817\\n1 17\\n1 261\\n1 5\\n29 15\\n46 1917\\n86 8412\\n422 590\\n2 12\\n205 511\\n573 5\\n363 366\\n713 46\\n74 1302\\n1 9\\n6 3\\n6128 2\\n198 427\\n37 5\\n3 937\\n164 874\\n143 2493\\n28 33\\n6425 2066\\n21 8\\n339 1586\\n1 8\\n1273 3\\n68 18\\n\", \"80 10000 10000\\n622 9\\n31 18\\n3000 1705\\n787 340\\n5 5\\n179 106\\n20 7\\n5311 1191\\n240 33\\n2 1887\\n141 66\\n49 908\\n15 5\\n2709 16\\n1 110\\n1976 21\\n4 68\\n32 295\\n2010 237\\n3 43\\n164 45\\n1 5082\\n5713 53\\n260 522\\n17 32\\n1 12\\n506 10\\n1967 59\\n154 2\\n14 42\\n1886 8309\\n7 12\\n195 7230\\n10 5\\n6 14\\n12 8876\\n3 12\\n57 5971\\n2917 348\\n21 31\\n1 7\\n3 250\\n1 15\\n99 156\\n1103 30\\n218 6\\n183 1\\n3 2888\\n12 1\\n292 21\\n371 8\\n8571 1263\\n2971 24\\n95 104\\n946 1506\\n5924 2\\n11 4\\n57 103\\n13 9\\n3776 86\\n1 14\\n6 19\\n47 12\\n8 7\\n1995 62\\n115 9834\\n3734 5\\n5868 61\\n11 1971\\n23 992\\n5651 6518\\n49 183\\n8212 78\\n17 1\\n208 10\\n19 51\\n2469 1105\\n497 15\\n4219 905\\n2 72\\n\", \"51 10000 4456\\n26 15\\n64 80\\n17 57\\n64 79\\n1 26\\n90 67\\n4 75\\n16 49\\n6 99\\n57 54\\n55 91\\n39 5\\n37 68\\n54 66\\n36 28\\n7 32\\n32 86\\n66 68\\n59 18\\n52 68\\n68 10\\n5 65\\n69 75\\n60 2\\n38 16\\n6 2\\n59 22\\n23 26\\n6 19\\n5 21\\n75 15\\n55 74\\n58 46\\n11 49\\n97 88\\n76 78\\n83 11\\n64 85\\n30 77\\n83 28\\n57 35\\n71 85\\n51 95\\n38 81\\n46 3\\n36 1\\n33 59\\n86 93\\n47 19\\n27 28\\n10 47\\n\", \"80 1694 7915\\n72 40\\n45 57\\n21 19\\n79 54\\n77 18\\n99 63\\n35 17\\n48 64\\n7 39\\n26 6\\n96 97\\n100 14\\n62 39\\n55 88\\n36 94\\n38 49\\n28 99\\n49 70\\n18 59\\n22 27\\n77 5\\n86 52\\n85 59\\n77 63\\n14 61\\n86 37\\n80 37\\n52 4\\n56 13\\n47 44\\n42 72\\n28 7\\n89 85\\n97 86\\n4 3\\n98 35\\n97 99\\n35 53\\n25 5\\n7 26\\n86 3\\n51 35\\n85 48\\n100 18\\n48 51\\n17 10\\n24 77\\n51 87\\n20 35\\n66 66\\n76 61\\n99 82\\n35 28\\n81 10\\n58 26\\n95 89\\n23 4\\n49 72\\n55 71\\n86 31\\n28 44\\n31 96\\n96 54\\n19 95\\n24 7\\n57 76\\n49 12\\n50 69\\n98 45\\n20 49\\n61 37\\n44 98\\n2 32\\n36 96\\n79 28\\n13 36\\n38 80\\n59 5\\n85 97\\n36 18\\n\", \"80 1920 10000\\n6 67\\n1 9\\n405 6\\n425 20\\n5 9285\\n201 16\\n1 1104\\n3 11\\n14 5391\\n876 6\\n130 367\\n79 6524\\n354 5129\\n1134 1089\\n23 1\\n77 43\\n21 41\\n257 63\\n1453 382\\n63 1\\n310 798\\n30 8536\\n94 781\\n146 19\\n61 110\\n1315 5878\\n18 142\\n2 318\\n9 138\\n1 2\\n855 5558\\n88 582\\n34 1643\\n72 2\\n8 1\\n3 392\\n179 636\\n5 18\\n68 22\\n395 262\\n5 21\\n13 4\\n1867 35\\n29 3\\n530 66\\n458 63\\n6 272\\n33 7\\n25 214\\n17 5\\n97 6245\\n28 67\\n20 7\\n240 5120\\n7 49\\n1 548\\n26 8\\n217 3474\\n508 1176\\n29 3\\n3 6996\\n108 5\\n2 674\\n1 6954\\n1471 19\\n28 9825\\n21 312\\n6 454\\n1350 9\\n39 36\\n1 224\\n257 1209\\n132 5\\n560 12\\n124 1\\n1595 2082\\n1 11\\n30 596\\n23 237\\n1 65\\n\", \"26 10000 10000\\n535 1\\n2049 754\\n336 48\\n491 3\\n71 7\\n2 26\\n233 1\\n15 6\\n3 1341\\n2269 3\\n268 565\\n149 37\\n27 113\\n36 5109\\n241 638\\n495 30\\n122 22\\n1046 2630\\n207 1509\\n1115 5\\n4520 2702\\n467 46\\n9 568\\n12 1\\n1468 5\\n1577 25\\n\", \"16 6013 7611\\n6 543\\n371 8\\n2 2636\\n1 914\\n1 2\\n83 135\\n2 117\\n115 5\\n3158 1\\n34 2\\n155 8\\n12 1\\n313 3691\\n16 626\\n441 3519\\n1217 3\\n\", \"1 10000 10000\\n1 1\\n\", \"80 10000 10000\\n94 20\\n54 3\\n9 45\\n5 62\\n65 92\\n75 15\\n57 70\\n22 15\\n13 40\\n46 54\\n81 77\\n84 57\\n64 80\\n57 20\\n58 19\\n27 29\\n86 73\\n9 47\\n60 29\\n34 68\\n64 41\\n87 24\\n26 40\\n61 8\\n91 53\\n74 52\\n63 33\\n65 96\\n81 60\\n58 75\\n97 89\\n88 19\\n91 10\\n90 55\\n52 73\\n69 5\\n64 49\\n72 92\\n95 54\\n70 100\\n23 100\\n4 93\\n85 4\\n57 79\\n84 16\\n4 73\\n5 18\\n69 13\\n85 17\\n40 61\\n66 68\\n73 34\\n46 65\\n90 60\\n70 94\\n96 63\\n72 52\\n31 49\\n45 83\\n85 17\\n84 27\\n19 70\\n54 22\\n56 90\\n72 32\\n4 99\\n64 78\\n58 50\\n24 47\\n98 46\\n2 18\\n16 50\\n46 42\\n27 52\\n43 61\\n15 31\\n22 53\\n75 62\\n93 34\\n8 94\\n\", \"64 10000 10000\\n82 66\\n46 4\\n9 49\\n96 27\\n85 55\\n13 59\\n63 39\\n91 70\\n60 34\\n11 74\\n76 45\\n77 14\\n45 43\\n9 79\\n37 40\\n82 53\\n31 95\\n17 94\\n71 65\\n90 86\\n93 4\\n72 93\\n54 21\\n32 60\\n23 82\\n81 64\\n36 65\\n71 94\\n58 75\\n56 10\\n54 29\\n74 95\\n16 26\\n83 64\\n52 15\\n40 35\\n80 62\\n74 45\\n12 45\\n7 54\\n21 20\\n11 7\\n3 13\\n52 63\\n51 91\\n25 74\\n42 43\\n81 42\\n19 30\\n29 53\\n57 3\\n1 40\\n43 38\\n71 73\\n6 89\\n78 31\\n78 19\\n52 56\\n49 47\\n61 34\\n51 18\\n30 91\\n93 23\\n3 63\\n\", \"4 9279 10000\\n504 2668\\n300 2\\n2 7\\n407 25\\n\", \"80 9251 6581\\n103 613\\n5 2\\n80 10\\n7717 113\\n422 30\\n186 35\\n51 1\\n2 140\\n344 1168\\n1 7279\\n6 349\\n65 4\\n304 108\\n18 4024\\n177 212\\n6587 2032\\n68 3\\n1031 36\\n46 10\\n3313 1101\\n7771 13\\n42 629\\n9 1310\\n9705 52\\n1832 4\\n25 1\\n6 4\\n5523 5589\\n6 56\\n2 2144\\n32 2\\n808 1\\n2 995\\n25 134\\n3608 142\\n1541 580\\n950 56\\n19 95\\n2564 1209\\n6917 47\\n287 1\\n252 1434\\n35 2056\\n5 1500\\n2 2399\\n3 4\\n5 151\\n7 2629\\n188 117\\n792 2\\n10 12\\n7 22\\n640 50\\n15 1\\n1 22\\n2 4975\\n1 15\\n763 4143\\n3445 502\\n35 6121\\n6 86\\n1 2\\n30 5\\n8 10\\n126 384\\n4 401\\n77 855\\n105 3\\n97 4009\\n1180 3907\\n5 1\\n1 359\\n552 295\\n160 1\\n2 57\\n562 38\\n1 49\\n9 162\\n3 3651\\n3 3\\n\", \"80 2762 10000\\n83 45\\n32 33\\n40 65\\n65 64\\n61 87\\n43 49\\n56 35\\n89 71\\n50 18\\n10 46\\n17 92\\n59 85\\n62 7\\n15 15\\n64 29\\n65 75\\n31 50\\n9 35\\n30 80\\n7 54\\n98 18\\n75 18\\n53 10\\n99 99\\n88 67\\n4 49\\n21 15\\n50 30\\n34 21\\n51 17\\n52 92\\n28 40\\n37 43\\n88 72\\n82 59\\n47 60\\n77 16\\n92 74\\n88 45\\n63 81\\n12 87\\n60 83\\n79 29\\n98 97\\n71 7\\n21 27\\n29 31\\n56 97\\n11 6\\n80 72\\n46 1\\n11 97\\n97 62\\n42 53\\n64 94\\n84 63\\n81 42\\n40 13\\n23 75\\n95 76\\n46 24\\n32 63\\n64 64\\n38 16\\n11 57\\n57 99\\n8 75\\n41 25\\n26 26\\n90 31\\n97 43\\n74 48\\n88 28\\n2 50\\n75 96\\n10 82\\n1 60\\n96 35\\n8 33\\n41 23\\n\", \"80 10000 9521\\n36 36\\n67 13\\n36 89\\n20 71\\n42 22\\n66 73\\n88 5\\n30 29\\n9 100\\n100 12\\n94 29\\n50 41\\n48 69\\n35 11\\n36 38\\n73 34\\n26 13\\n39 94\\n7 13\\n92 54\\n55 86\\n14 90\\n76 78\\n36 70\\n93 76\\n16 38\\n43 36\\n62 20\\n71 56\\n27 48\\n66 94\\n14 39\\n4 47\\n19 20\\n14 94\\n95 42\\n84 3\\n49 33\\n51 41\\n1 60\\n80 33\\n47 96\\n39 32\\n4 96\\n17 72\\n18 11\\n63 15\\n3 34\\n89 43\\n30 39\\n92 81\\n25 47\\n56 10\\n44 60\\n82 81\\n89 36\\n51 3\\n42 40\\n47 57\\n78 50\\n87 49\\n88 24\\n27 38\\n90 30\\n57 44\\n44 48\\n25 29\\n59 33\\n63 54\\n54 21\\n80 70\\n76 100\\n28 78\\n67 26\\n61 7\\n87 1\\n95 36\\n73 1\\n51 50\\n73 39\\n\", \"80 9875 9875\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n\", \"1 1 1\\n10000 10000\\n\", \"80 10000 10000\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n125 125\\n\", \"80 768 1885\\n1081 4\\n130 412\\n2828 3136\\n36 11\\n75 5342\\n160 19\\n1636 121\\n23 7\\n63 1561\\n5 640\\n380 3\\n9760 379\\n950 648\\n251 2\\n3643 3\\n1861 2\\n38 3008\\n26 703\\n733 1441\\n3 999\\n4360 2591\\n31 243\\n77 5096\\n8 10\\n6682 412\\n3750 7990\\n22 392\\n5389 3956\\n8 3865\\n280 346\\n2 2548\\n6 186\\n90 23\\n847 18\\n37 1\\n413 1476\\n5 6\\n2156 1980\\n124 9\\n1695 240\\n12 2\\n720 229\\n4 15\\n261 2\\n4351 149\\n298 2597\\n18 234\\n143 1\\n67 6\\n107 533\\n6 1559\\n13 333\\n1239 877\\n14 63\\n10 247\\n1658 1489\\n311 53\\n3 226\\n2 11\\n14 2812\\n9003 5\\n60 375\\n46 5\\n32 7449\\n27 432\\n825 1\\n2 527\\n98 2743\\n35 76\\n4691 1706\\n1132 1556\\n32 2\\n65 1844\\n571 5302\\n1961 6730\\n6585 169\\n1 2257\\n168 1\\n892 122\\n11 20\\n\", \"43 10000 8294\\n2516 58\\n2 965\\n6508 2004\\n8 1\\n3 5\\n5 4005\\n949 20\\n240 1\\n4 35\\n12 5204\\n7 113\\n262 6\\n98 2487\\n1878 26\\n3 11\\n27 6\\n40 2302\\n22 150\\n1 2\\n2194 1536\\n233 1\\n9 1\\n1 423\\n10 671\\n220 1036\\n1 266\\n3 189\\n6160 2612\\n11 33\\n7 26\\n719 5\\n44 2\\n2744 1\\n9864 3433\\n68 41\\n12 1\\n2671 125\\n2 120\\n2218 408\\n28 428\\n21 4165\\n131 10\\n7 50\\n\", \"80 9161 5663\\n1006 2222\\n301 4644\\n12 69\\n12 45\\n17 163\\n1464 4731\\n59 757\\n593 72\\n1 4994\\n8 1\\n2 42\\n14 7\\n3892 2123\\n3604 133\\n256 64\\n1074 1\\n300 222\\n20 29\\n6123 2643\\n4750 180\\n21 27\\n836 1388\\n4 2\\n167 77\\n6058 1\\n46 4\\n2 148\\n83 399\\n1 9\\n2430 55\\n5 826\\n12 30\\n85 83\\n7112 1546\\n424 2\\n21 3084\\n3622 142\\n78 24\\n7334 6\\n6 14\\n62 104\\n10 3632\\n431 131\\n38 643\\n966 5\\n6 3343\\n24 26\\n2 31\\n8482 316\\n7142 443\\n981 213\\n151 2466\\n10 29\\n381 2323\\n142 3600\\n1319 302\\n9102 4966\\n3 42\\n5 14\\n36 1378\\n1634 71\\n1174 36\\n2 2937\\n7 90\\n5 2\\n1098 36\\n6229 270\\n1 190\\n3063 7\\n1 2253\\n132 2\\n5682 7\\n3117 2067\\n3493 433\\n4426 2\\n1 2355\\n28 5\\n23 2533\\n2183 1098\\n3 181\\n\", \"80 1552 903\\n86 431\\n3224 1449\\n3533 549\\n30 166\\n934 371\\n11 9158\\n28 7\\n115 3461\\n178 2\\n544 2080\\n6 78\\n7828 8965\\n4270 140\\n43 1656\\n315 9\\n84 26\\n9315 1109\\n214 3\\n369 8\\n1 453\\n17 3\\n2 227\\n422 3\\n51 16\\n636 33\\n66 1170\\n149 4479\\n1 237\\n166 554\\n3 3921\\n152 1416\\n187 6\\n106 21\\n64 7857\\n44 11\\n3008 28\\n6 1082\\n7 3297\\n123 41\\n1 7330\\n1 9452\\n5 386\\n6079 12\\n55 167\\n1115 729\\n52 3\\n525 8526\\n8 1673\\n2089 69\\n13 485\\n136 1\\n1271 2\\n9 767\\n1 225\\n30 152\\n1539 4\\n232 6184\\n3375 117\\n620 9\\n5 1\\n1759 603\\n397 7521\\n1745 49\\n9503 48\\n18 52\\n39 315\\n7810 217\\n2066 1\\n5300 965\\n2922 7\\n27 2\\n1043 251\\n176 9452\\n12 1\\n783 5\\n42 1184\\n482 202\\n4 129\\n1 15\\n8982 4718\\n\", \"80 1889 10000\\n8517 4554\\n956 1523\\n2877 9544\\n2080 7273\\n1907 97\\n6097 4231\\n548 4323\\n8423 9587\\n1375 7519\\n4507 2922\\n6794 7147\\n189 8796\\n5405 9953\\n1487 6571\\n4853 9246\\n7591 3616\\n8051 2500\\n5553 2790\\n8523 2408\\n3339 7885\\n3110 5748\\n152 4008\\n9664 5526\\n5902 6015\\n9594 2575\\n264 3070\\n2537 9174\\n9364 2004\\n5653 3155\\n4005 4629\\n331 7204\\n4434 6761\\n5484 7707\\n4581 2363\\n7644 1069\\n4638 3866\\n2995 4164\\n398 8251\\n8783 1919\\n8988 9829\\n5872 4061\\n2547 835\\n3499 4630\\n7970 9734\\n4520 5810\\n8427 689\\n1316 8143\\n3172 5483\\n2064 31\\n4633 1984\\n8128 8007\\n536 1473\\n476 2402\\n2947 5743\\n3154 8700\\n8754 2436\\n3138 4360\\n2654 8442\\n2273 4491\\n3863 2721\\n3431 2494\\n495 2462\\n8081 2943\\n5117 1734\\n3647 6656\\n9435 8967\\n7735 1063\\n9449 6000\\n6576 525\\n3879 7828\\n9032 5071\\n5151 780\\n8639 8960\\n8920 6769\\n938 85\\n1252 2742\\n6496 1191\\n8787 2828\\n1040 2053\\n1582 6283\\n\", \"80 10000 605\\n38 10\\n374 66\\n2145 6\\n13 4\\n17 2\\n122 9\\n3 69\\n3 3\\n341 3\\n28 95\\n858 2\\n1 441\\n8 118\\n45 2\\n9 61\\n3 8\\n10 35\\n920 3\\n20 604\\n257 12\\n13 4\\n6 4\\n1347 3\\n1569 3\\n638 14\\n17 20\\n1 14\\n5 1\\n445 2\\n12 5\\n2 5\\n382 4\\n32 44\\n17 1\\n2 9\\n1 165\\n379 48\\n4719 1\\n8 30\\n39 13\\n1564 54\\n108 11\\n1 144\\n237 17\\n209 87\\n4355 601\\n86 15\\n1650 17\\n158 584\\n63 303\\n2471 2\\n1 123\\n1 97\\n369 22\\n173 1\\n22 560\\n786 26\\n800 75\\n1 214\\n45 2\\n160 124\\n191 21\\n19 33\\n11 9\\n8 4\\n556 14\\n5 44\\n626 21\\n683 1\\n26 2\\n3306 8\\n147 6\\n137 10\\n3 53\\n1167 179\\n231 231\\n409 375\\n8 53\\n57 330\\n2 2\\n\", \"80 6095 3812\\n6978 8593\\n4714 8422\\n8797 9536\\n3565 9466\\n6936 26\\n5359 7181\\n581 4182\\n3144 4179\\n9589 6994\\n232 1794\\n6322 6333\\n4719 4246\\n2646 2062\\n19 7147\\n770 9291\\n8397 5862\\n8617 6643\\n7611 2925\\n4274 9973\\n4064 9498\\n8873 2407\\n640 6908\\n6302 9296\\n789 4581\\n4980 717\\n1388 9613\\n531 8544\\n1864 7325\\n4952 1660\\n5550 9590\\n3184 2235\\n56 4664\\n4352 8520\\n3443 9019\\n4112 373\\n4448 2793\\n4443 7878\\n6822 7953\\n2960 3700\\n6926 54\\n2884 6220\\n8614 2830\\n3982 2349\\n2447 7396\\n1834 766\\n1215 9111\\n2743 8645\\n9856 6377\\n5353 3713\\n5343 592\\n4967 5537\\n1374 6264\\n4862 1562\\n18 3774\\n268 8293\\n3557 3607\\n645 2334\\n5173 8375\\n210 9222\\n1923 8635\\n8637 5762\\n7430 5088\\n8423 7179\\n5574 5721\\n4387 4780\\n6673 7356\\n6920 8727\\n8569 405\\n4386 7472\\n4979 4179\\n7649 1120\\n8841 3670\\n5800 3699\\n2457 7639\\n2751 5723\\n8933 7408\\n5138 2539\\n65 4031\\n8785 6124\\n8360 1816\\n\", \"80 10000 3783\\n3079 3244\\n4382 9074\\n5167 5284\\n2015 9783\\n9521 8593\\n2443 4218\\n1622 515\\n3573 120\\n9912 8481\\n7009 2589\\n1511 5410\\n4362 30\\n519 2771\\n749 7313\\n6240 6516\\n444 8928\\n5085 3131\\n5453 6234\\n3998 1503\\n1753 4386\\n6822 7550\\n4637 46\\n2877 4567\\n9484 441\\n8526 3249\\n3226 5537\\n1866 5315\\n323 8634\\n212 1641\\n546 2793\\n1508 8918\\n2026 2025\\n9636 7948\\n4721 7466\\n8966 1701\\n7184 6749\\n8667 6766\\n8276 3705\\n6253 935\\n7936 8201\\n1078 5540\\n1913 9692\\n5447 2351\\n2888 9332\\n6338 1891\\n1292 9975\\n1409 8258\\n4069 4769\\n4141 433\\n3482 8368\\n2615 7415\\n4692 4039\\n6514 209\\n8897 7979\\n8630 9937\\n1602 6073\\n6159 9802\\n1677 830\\n7917 2294\\n1963 5821\\n9986 80\\n3899 8589\\n7543 3178\\n5758 4377\\n5542 4281\\n7641 3294\\n817 8468\\n3062 6416\\n762 8984\\n9459 2725\\n5881 1495\\n8449 4120\\n2922 740\\n1110 9304\\n7532 5384\\n988 8678\\n4563 3857\\n9247 4891\\n2390 7454\\n8963 6095\\n\", \"46 10000 4870\\n9394 4314\\n9513 901\\n2687 6748\\n6614 9965\\n4222 1122\\n5748 2234\\n8311 2997\\n2193 9838\\n3172 7006\\n803 3711\\n2547 9136\\n5442 8343\\n3431 7420\\n2923 5843\\n3239 6314\\n7903 8901\\n2622 8535\\n5777 8275\\n3321 2177\\n1404 6261\\n2972 4093\\n8747 1562\\n8237 1698\\n4271 4836\\n504 9420\\n5101 4743\\n5433 3897\\n1277 8110\\n8645 9487\\n3324 246\\n3889 5524\\n5243 4258\\n7961 8389\\n3581 789\\n4619 4688\\n6477 3899\\n4025 9913\\n6134 1920\\n3179 1065\\n8697 4727\\n1051 7706\\n763 2500\\n2471 1068\\n5652 3266\\n8850 52\\n8000 6319\\n\", \"80 10000 10000\\n8546 6436\\n7158 9927\\n3186 1091\\n533 3273\\n640 7693\\n5673 3531\\n8591 3371\\n1166 1108\\n9444 5117\\n7764 8250\\n5337 5894\\n6877 5659\\n6026 6586\\n8641 2056\\n7691 2551\\n5293 7605\\n3024 8425\\n3919 5659\\n3811 4612\\n908 5623\\n8641 734\\n3579 5432\\n4317 3985\\n200 9556\\n3564 5374\\n6674 4339\\n600 7509\\n7884 275\\n3022 7535\\n144 9267\\n1679 4660\\n5207 1224\\n4018 9221\\n4898 7466\\n9696 6963\\n4645 8552\\n1479 837\\n5462 9808\\n2088 9639\\n2130 3576\\n58 7413\\n5305 2056\\n6932 260\\n1773 829\\n4134 1850\\n3159 5528\\n833 3345\\n482 3373\\n6826 9064\\n5310 2421\\n7916 8946\\n926 6956\\n3619 9332\\n6714 899\\n9617 4331\\n654 1647\\n5548 6980\\n3529 4072\\n8926 1667\\n399 5275\\n9764 509\\n1880 5321\\n7088 3933\\n127 902\\n6375 7363\\n8771 8378\\n4564 576\\n713 8563\\n8707 2891\\n2440 8306\\n4087 7775\\n6203 5929\\n8372 3386\\n8691 4963\\n1845 4064\\n6275 8956\\n8743 9495\\n8962 5061\\n4460 1000\\n2732 8418\\n\"], \"outputs\": [\"3\\n\", \"1\\n\", \"2\\n\", \"3\\n\", \"3\\n\", \"17\\n\", \"55\\n\", \"51\\n\", \"50\\n\", \"50\\n\", \"23\\n\", \"15\\n\", \"1\\n\", \"80\\n\", \"64\\n\", \"4\\n\", \"52\\n\", \"66\\n\", \"80\\n\", \"80\\n\", \"1\\n\", \"80\\n\", \"23\\n\", \"34\\n\", \"44\\n\", \"23\\n\", \"5\\n\", \"49\\n\", \"3\\n\", \"5\\n\", \"4\\n\", \"8\\n\"], \"fn_name\": null}", "source": "lcbv5"}
|
Takahashi has prepared N dishes for Snuke.
The dishes are numbered from 1 to N, and dish i has a sweetness of A_i and a saltiness of B_i.
Takahashi can arrange these dishes in any order he likes.
Snuke will eat the dishes in the order they are arranged, but if at any point the total sweetness of the dishes he has eaten so far exceeds X or the total saltiness exceeds Y, he will not eat any further dishes.
Takahashi wants Snuke to eat as many dishes as possible.
Find the maximum number of dishes Snuke will eat if Takahashi arranges the dishes optimally.
Input
The input is given from Standard Input in the following format:
N X Y
A_1 B_1
A_2 B_2
\vdots
A_N B_N
Output
Print the answer as an integer.
Constraints
- 1 \leq N \leq 80
- 1 \leq A_i, B_i \leq 10000
- 1 \leq X, Y \leq 10000
- All input values are integers.
Sample Input 1
4 8 4
1 5
3 2
4 1
5 3
Sample Output 1
3
Consider the scenario where Takahashi arranges the dishes in the order 2, 3, 1, 4.
- First, Snuke eats dish 2. The total sweetness so far is 3, and the total saltiness is 2.
- Next, Snuke eats dish 3. The total sweetness so far is 7, and the total saltiness is 3.
- Next, Snuke eats dish 1. The total sweetness so far is 8, and the total saltiness is 8.
- The total saltiness has exceeded Y=4, so Snuke will not eat any further dishes.
Thus, in this arrangement, Snuke will eat three dishes.
No matter how Takahashi arranges the dishes, Snuke will not eat all four dishes, so the answer is 3.
Sample Input 2
2 1 1
3 2
3 2
Sample Output 2
1
Sample Input 3
2 100 100
3 2
3 2
Sample Output 3
2
Sample Input 4
6 364 463
230 381
154 200
328 407
339 94
193 10
115 309
Sample Output 4
3
Read the inputs from stdin solve the problem and write the answer to stdout (do not directly test on the sample inputs). Enclose your code within ```python delimiters.
| 0
|
{"tests": "{\"inputs\": [\"3\\n2\\n[1, 3]\\n[5]\", \"2\\n2\\n[7]\\n[4]\", \"10\\n10\\n[420, 1, 597, 1, 905, 1, 261, 1, 681]\\n[101, 1, 333, 1, 502, 1, 409, 1, 787]\", \"6\\n2\\n[1,3,2,3,1]\\n[1]\", \"17\\n18\\n[781, 307, 573, 596, 536, 761, 591, 848, 858, 302, 652, 540, 770, 607, 809, 322]\\n[841, 828, 682, 480, 391, 915, 948, 736, 933, 705, 909, 717, 881, 954, 807, 297, 696]\", \"10\\n20\\n[543, 1, 831, 1, 737, 1, 241, 1, 471]\\n[69, 1, 130, 1, 259, 1, 701, 1, 324, 1, 840, 1, 265, 1, 609, 1, 299, 1, 779]\", \"5\\n3\\n[1,1,1,1]\\n[1,1]\", \"7\\n7\\n[16,8,1,10,13,3]\\n[18,2,3,12,12,15]\", \"9\\n8\\n[7,7,4,3,1,2,3,5]\\n[2,3,1,1,2,2,1]\", \"2\\n2\\n[215]\\n[215]\", \"10\\n20\\n[939, 911, 880, 751, 716, 621, 618, 328, 98]\\n[990, 967, 926, 817, 785, 721, 655, 653, 544, 350, 278, 248, 234, 206, 148, 138, 61, 52, 32]\", \"20\\n20\\n[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]\\n[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]\", \"8\\n2\\n[2,4,3,3,5,1,1]\\n[5]\", \"2\\n2\\n[832]\\n[918]\", \"1\\n7\\n[]\\n[1,2,1,1,2,1]\", \"20\\n20\\n[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]\\n[1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000]\", \"1\\n20\\n[]\\n[1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000]\", \"5\\n6\\n[3,3,3,3]\\n[5,3,5,5,1]\", \"20\\n20\\n[794, 744, 448, 293, 101, 197, 955, 51, 749, 485, 52, 511, 981, 101, 283, 149, 44, 636, 947]\\n[413, 746, 603, 720, 636, 193, 67, 928, 520, 575, 323, 838, 10, 619, 344, 810, 901, 181, 743]\", \"5\\n5\\n[527, 527, 527, 527]\\n[527, 527, 527, 527]\", \"20\\n20\\n[812, 1, 974, 1, 871, 1, 117, 1, 453, 1, 199, 1, 719, 1, 596, 1, 408, 1, 263]\\n[94, 1, 523, 1, 261, 1, 271, 1, 547, 1, 614, 1, 878, 1, 522, 1, 749, 1, 989]\", \"20\\n1\\n[1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000]\\n[]\", \"10\\n20\\n[1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000]\\n[1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000]\", \"20\\n20\\n[537, 294, 694, 235, 534, 607, 413, 356, 888, 924, 425, 91, 243, 136, 260, 941, 443, 649, 685]\\n[239, 749, 577, 940, 809, 562, 366, 824, 877, 714, 578, 698, 785, 206, 999, 199, 76, 642, 453]\", \"3\\n4\\n[21, 54]\\n[99, 4, 96]\", \"7\\n8\\n[100, 262, 33, 273, 422, 318]\\n[204, 107, 56, 189, 129, 95, 46]\", \"10\\n10\\n[891, 835, 866, 757, 791, 644, 671, 592, 591]\\n[921, 821, 822, 652, 683, 617, 584, 520, 574]\", \"1\\n1\\n[]\\n[]\", \"7\\n1\\n[4,1,3,12,9,2]\\n[]\", \"10\\n10\\n[1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000]\\n[1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000]\", \"10\\n10\\n[989, 1, 126, 1, 388, 1, 825, 1, 601]\\n[262, 1, 204, 1, 971, 1, 221, 1, 788]\", \"1\\n7\\n[]\\n[2,1,2,1,2,1]\", \"2\\n11\\n[706]\\n[46, 17, 582, 837, 668, 491, 484, 996, 421, 749]\", \"4\\n1\\n[10,5,4]\\n[]\", \"2\\n2\\n[91]\\n[986]\", \"8\\n4\\n[6,5,4,3,5,3,8]\\n[10,9,1]\", \"16\\n18\\n[210,283,5,312,42,232,67,147,296,143,346,10,191,42,314]\\n[344,31,69,4,300,263,309,167,216,253,313,36,57,145,199,152,172]\"], \"outputs\": [\"13\", \"15\", \"13988\", \"16\", \"175365\", \"24503\", \"14\", \"333\", \"134\", \"645\", \"77464\", \"399\", \"43\", \"2582\", \"8\", \"19380\", \"19000\", \"83\", \"131105\", \"12648\", \"49461\", \"19000\", \"199000\", \"160334\", \"432\", \"6366\", \"64747\", \"0\", \"31\", \"99000\", \"14167\", \"9\", \"10824\", \"19\", \"1168\", \"129\", \"34481\"], \"fn_name\": \"minimumCost\"}", "source": "lcbv5"}
|
There is an m x n cake that needs to be cut into 1 x 1 pieces.
You are given integers m, n, and two arrays:
horizontalCut of size m - 1, where horizontalCut[i] represents the cost to cut along the horizontal line i.
verticalCut of size n - 1, where verticalCut[j] represents the cost to cut along the vertical line j.
In one operation, you can choose any piece of cake that is not yet a 1 x 1 square and perform one of the following cuts:
Cut along a horizontal line i at a cost of horizontalCut[i].
Cut along a vertical line j at a cost of verticalCut[j].
After the cut, the piece of cake is divided into two distinct pieces.
The cost of a cut depends only on the initial cost of the line and does not change.
Return the minimum total cost to cut the entire cake into 1 x 1 pieces.
Example 1:
Input: m = 3, n = 2, horizontalCut = [1,3], verticalCut = [5]
Output: 13
Explanation:
Perform a cut on the vertical line 0 with cost 5, current total cost is 5.
Perform a cut on the horizontal line 0 on 3 x 1 subgrid with cost 1.
Perform a cut on the horizontal line 0 on 3 x 1 subgrid with cost 1.
Perform a cut on the horizontal line 1 on 2 x 1 subgrid with cost 3.
Perform a cut on the horizontal line 1 on 2 x 1 subgrid with cost 3.
The total cost is 5 + 1 + 1 + 3 + 3 = 13.
Example 2:
Input: m = 2, n = 2, horizontalCut = [7], verticalCut = [4]
Output: 15
Explanation:
Perform a cut on the horizontal line 0 with cost 7.
Perform a cut on the vertical line 0 on 1 x 2 subgrid with cost 4.
Perform a cut on the vertical line 0 on 1 x 2 subgrid with cost 4.
The total cost is 7 + 4 + 4 = 15.
Constraints:
1 <= m, n <= 20
horizontalCut.length == m - 1
verticalCut.length == n - 1
1 <= horizontalCut[i], verticalCut[i] <= 10^3
You will use the following starter code to write the solution to the problem and enclose your code within ```python delimiters.
```python
class Solution:
def minimumCost(self, m: int, n: int, horizontalCut: List[int], verticalCut: List[int]) -> int:
```
| 0
|