- Ribbon Gymnastics
Robert is a gymnastics coach. Unfortunately, he got four gymnastics beginners to attend the coming competition. Since the competition has a nice award, Robert will make all his effort to win the competition.
One performance requires that each of the four player should take a ribbon and rotate herself, and assume the ribbons will then straighten out. Since Robert's four players are beginners, Robert cannot control the actual rotating speeds of four players during the competition. And when two ribbons touch, they may wind, which will cause players felling down. For safety, Robert should avoid this. Four distinct points will be given as xi yi before the competition begins. Players should stand at those points when rotating.
The longer the ribbons are, the more bonus Robert will gain. After knowing the four points Robert can choose ribbons and points for each player. The length of each ribbon should be positive. So help Robert to find the maximal total lengths of the four ribbons.
There will be multiple test cases.Please process to the end of input.
Each test case contains four lines.
Each line contains two integers xi (-10^8≤xi≤10^8) and yi (-10^8≤yi≤10^8).
Output the total maximal sum of the lengths of the four ribbons. Answer having an absolute or relative error less than 1e-6 will be accepted.
Magic Bitstrings _course2017-10-16
Description A bitstring, whose length is one less than a prime, might be magic. 1001 is one such string. In order to see the magic in the string let us append a non-bit x to it, regard the new thingy as a cyclic string, and make this square matrix of bits each bit 1001 every 2nd bit 0110 every 3rd bit 0110 every 4th bit 1001 This matrix has the same number of rows as the length of the original bitstring. The m-th row of the matrix has every m-th bit of the original string starting with the m-th bit. Because the enlarged thingy has prime length, the appended x never gets used. If each row of the matrix is either the original bitstring or its complement, the original bitstring is magic. Input Each line of input (except last) contains a prime number p <= 100000. The last line contains 0 and this line should not be processed. Output For each prime number from the input produce one line of output containing the lexicographically smallest, non-constant magic bitstring of length p-1, if such a string exists, otherwise output Impossible. Sample Input 5 3 17 47 2 79 0 Sample Output 0110 01 0010111001110100 0000100001101010001101100100111010100111101111 Impossible 001001100001011010000001001111001110101010100011000011011111101001011110011011
Up and Down Sequences _course2017-10-13
Description The quality of pseudo random-number generators used in some computations, especially simulation, is a significant issue. Proposed generation algorithms are subjected to many tests to establish their quality, or, more usually, their lack of it. One of the common tests is the run test. In this test, sequences are tested for ``runs up" and ``runs down." We will examine series of data values for the ``Up" and ``Down" sequences each series contains. Within a series, an ``Up" sequence continues as long as each data-value received is not less than the previous data-value. An ``Up" sequence terminates when a data-value received is less than the previous data-value received. A ``Down" sequence continues as long as each data-value received is not greater than the previous data-value. A ``Down" sequence terminates when a data-value received is greater than the previous data-value received. An ``Up" sequence can be initiated by the termination of a ``Down" sequence and vice versa. (Sequences initiated in this manner have length one at this initiation point.) All the initial data-values are part of an ``Up" sequence, and contribute to its length, if the first deviation of the data-values is upwards. All the initial data-values are part of a ``Down" sequence, and contribute to its length, if the first deviation of the data-values is downwards. If the data-values received don't allow classification as either an ``Up" or a ``Down" sequence, the data should be considered to have neither sequence. Find the average length of both the ``Up" and the ``Down" sequences encountered for each input line in the data file. Report these average lengths as each input line is processed. Input Each of the separate series to be examined is contained on a single line of input. Each series to be analyzed consists of at least one and no more than 30 unsigned, non-zero integers. Each integer in a series has at least one digit and no more than four digits. The integers are separated from each other by a single blank character. Each of the series will be terminated by a single zero (0) digit. This terminator should not be considered as being part of the series being analyzed. The set of series to be analyzed is terminated by a single zero (0) digit as the input on a line. This terminator should not be considered to be a series, and no output should be produced in response to its encounter. Output A line with two real values is to be emitted for each input data set encountered. It must begin with the message ``Nr values = N: ", where N is the number of input data in the line; and then to continue with the average values for runs. First, the average ``Up" run length, then the average ``Down" run length. Separate these values with a space. Answers must be rounded to six digits after the decimal point. Sample Input 1 2 3 0 3 2 1 0 1 2 3 2 1 0 2 2 2 2 3 0 4 4 4 4 3 0 4 4 4 3 3 3 3 0 4 4 4 3 3 3 4 0 5 5 5 5 0 1 2 3 2 3 4 5 0 0 Sample Output Nr values = 3: 2.000000 0.000000 Nr values = 3: 0.000000 2.000000 Nr values = 5: 2.000000 2.000000 Nr values = 5: 4.000000 0.000000 Nr values = 5: 0.000000 4.000000 Nr values = 7: 0.000000 6.000000 Nr values = 7: 1.000000 5.000000 Nr values = 4: 0.000000 0.000000 Nr values = 7: 2.500000 1.000000
Calories from Fat _course2017-10-16
Description Fat contains about 9 Calories/g of food energy. Protein, sugar, and starch contain about 4 Calories/g, while alcohol contains about 7 Calories/g. Although many people consume more than 50% of their total Calories as fat, most dieticians recommend that this proportion should be 30% or less. For example, in the Nutrition Facts label to the right, we see that 3g of fat is 5% of the recommended daily intake based on a 2,000 calorie diet. A quick calculation reveals that the recommended daily intake of fat is therefore 60g; that is, 540 Calories or 27% Calories from fat. Others recommend radically different amounts of fat. Dean Ornish, for example, suggests that less than 10% of total caloric intake should be fat. On the other hand, Robert Atkins recommends the elimination of all carbohydrate with no restriction on fat. It has been estimated that the average Atkins dieter consumes 61% of Calories from fat. From a record of food eaten in one day, you are to compute the percent Calories from fat. The record consists of one line of input per food item, giving the quantity of fat, protein, sugar, starch and alcohol in each. Each quantity is an integer followed by a unit, which will be one of: g (grams), C (Calories), or % (percent Calories). Percentages will be between 0 and 99. At least one of the ingredients will be given as a non-zero quantity of grams or Calories (not percent Calories). Input Input will consist of several test cases. Each test case will have one or more lines as described above. Each test case will be terminated by a line containing '-'. An additional line containing '-' will follow the last test case. Output For each test case, print percent Calories from fat, rounded to the nearest integer. Sample Input 3g 10g 10% 0g 0g 55% 100C 0% 0g 30g - 25g 0g 0g 0g 0g - 1g 15% 20% 30% 1C - - Sample Output 53% 100% 32%
Map of Ninja House _course2017-10-17
Description An old document says that a Ninja House in Kanazawa City was in fact a defensive fortress, which was designed like a maze. Its rooms were connected by hidden doors in a complicated manner, so that any invader would become lost. Each room has at least two doors. The Ninja House can be modeled by a graph, as shown in Figure 1. A circle represents a room. Each line connecting two circles represents a door between two rooms. I decided to draw a map, since no map was available. Your mission is to help me draw a map from the record of my exploration. I started exploring by entering a single entrance that was open to the outside. The path I walked is schematically shown in Figure 2, by a line with arrows. The rules for moving between rooms are described below. After entering a room, I first open the rightmost door and move to the next room. However, if the next room has already been visited, I close the door without entering, and open the next rightmost door, and so on. When I have inspected all the doors of a room, I go back through the door I used to enter the room. I have a counter with me to memorize the distance from the first room. The counter is incremented when I enter a new room, and decremented when I go back from a room. In Figure 2, each number in parentheses is the value of the counter when I have entered the room, i.e., the distance from the first room. In contrast, the numbers not in parentheses represent the order of my visit. I take a record of my exploration. Every time I open a door, I record a single number, according to the following rules. 1. If the opposite side of the door is a new room, I record the number of doors in that room, which is a positive number. 2. If it is an already visited room, say R, I record "the distance of R from the first room" minus "the distance of the current room from the first room", which is a negative number. In the example shown in Figure 2, as the first room has three doors connecting other rooms, I initially record "3". Then when I move to the second, third, and fourth rooms, which all have three doors, I append "3 3 3" to the record. When I skip the entry from the fOurth room to the first room, the distance difference "-3" (minus three) will be appended, and so on. So, when I finish this exploration, its record is a sequence of numbers "3 3 3 3 -3 3 2 -5 3 2 -5 -3". There are several dozens of Ninja Houses in the city. Given a sequence of numbers for each of these houses, you should produce a graph for each house. Input The first line of the input is a single integer n, indicating the number of records of Ninja Houses I have visited. You can assume that n is less than 100. Each of the following n records consists of numbers recorded on one exploration and a zero as a terminator. Each record consists of one or more lines whose lengths are less than 1000 characters. Each number is delimited by a space or a newline. You can assume that the number of rooms for each Ninja House is less than 100, and the number of doors in each room is less than 100. Output For each Ninja House of m rooms, the output should consist of m lines. The i-th line of each such m lines should look as follows: i r(1) r(2)... r(ki), where r(1),... , r(ki), should be rooms adjoining room i, and ki should be the number of doors in room i. Numbers should be separated by exactly one space character. The rooms should be numbered from 1 in visited order. r(1), r(2),..., r(ki), should be in ascending order. Note that the room i may be connected to another room through more than one door. In this case, that room number should appear in r(1),...,r(ki), as many times as it is connected by different doors. Sample Input 2 3 3 3 3 -3 3 2 -5 3 2 -5 -3 0 3 5 4 -2 4 -3 -2 -2 -1 0 Sample Output 1 2 4 6 2 1 3 8 3 2 4 7 4 1 3 5 5 4 6 7 6 1 5 7 3 5 8 8 2 7 1 2 3 4 2 1 3 3 4 4 3 1 2 2 4 4 1 2 2 3
The Alphabet Game _course2017-10-15
Description Little Dara has recently learned how to write a few letters of the English alphabet (say k letters). He plays a game with his little sister Sara. He draws a grid on a piece of paper and writes p instances of each of the k letters in the grid cells. He then asks Sara to draw as many side-to-side horizontal and/or vertical bold lines over the grid lines as she wishes, such that in each rectangle containing no bold line, there would be p instances of one letter or nothing. For example, consider the sheet given in Figure 1, where Sara has drawn two bold lines creating four rectangles meeting the condition above. Sara wins if she succeeds in drawing the required lines. Dara being quite fair to Sara, wants to make sure that there would be at least one solution to each case he offers Sara. You are to write a program to help Dara decide on the possibility of drawing the right lines. !(http://poj.org/images/1231_1.jpg) Input The first line of the input file contains a single integer t (1 <= t <= 10), the number of test cases, followed by the input data for each test case. The first line of each test case consists of two integers k (1 <= k <= 26), the number of different letters, and p (1 <= p <= 10), the number of instances of each letter. Followed by the first line, there are k lines, one for each letter, each containing p pairs of integers (xi, yi) for 1 <= i <= p. A pair indicates coordinates of the cell on the paper where one instance of the letter is written. The coordinates of the upper left cell of the paper is assumed to be (1,1). Coordinates are positive integers less than or equal to 1,000,000. You may assume that no cell contains more than one letter. Output There should be one line per test case containing a single word YES or NO depending on whether the input paper can be divided successfully according to the constraints stated in the problem. Sample Input 2 3 2 6 4 8 4 4 2 2 1 2 3 2 4 3 3 1 1 3 1 5 1 2 1 4 1 6 1 2 2 4 2 8 1 Sample Output YES NO
Shredding Company _course2017-10-17
Description You have just been put in charge of developing a new shredder for the Shredding Company Although a "normal" shredder would just shred sheets of paper into little pieces so that the contents would become unreadable, this new shredder needs to have the following unusual basic characteristics. 1.The shredder takes as input a target number and a sheet of paper with a number written on it. 2.It shreds (or cuts) the sheet into pieces each of which has one or more digits on it. 3.The sum of the numbers written on each piece is the closest possible number to the target number, without going over it. For example, suppose that the target number is 50, and the sheet of paper has the number 12346. The shredder would cut the sheet into four pieces, where one piece has 1, another has 2, the third has 34, and the fourth has 6. This is because their sum 43 (= 1 + 2 + 34 + 6) is closest to the target number 50 of all possible combinations without going over 50. For example, a combination where the pieces are 1, 23, 4, and 6 is not valid, because the sum of this combination 34 (= 1 + 23 + 4 + 6) is less than the above combination's 43. The combination of 12, 34, and 6 is not valid either, because the sum 52 (= 12 + 34 + 6) is greater than the target number of 50. !(http://poj.org/images/1416_1.jpg) Figure 1. Shredding a sheet of paper having the number 12346 when the target number is 50 There are also three special rules : 1.If the target number is the same as the number on the sheet of paper, then the paper is not cut. For example, if the target number is 100 and the number on the sheet of paper is also 100, then the paper is not cut. 2.If it is not possible to make any combination whose sum is less than or equal to the target number, then error is printed on a display. For example, if the target number is 1 and the number on the sheet of paper is 123, it is not possible to make any valid combination, as the combination with the smallest possible sum is 1, 2, 3. The sum for this combination is 6, which is greater than the target number, and thus error is printed. 3.If there is more than one possible combination where the sum is closest to the target number without going over it, then rejected is printed on a display. For example, if the target number is 15, and the number on the sheet of paper is 111, then there are two possible combinations with the highest possible sum of 12: (a) 1 and 11 and (b) 11 and 1; thus rejected is printed. In order to develop such a shredder, you have decided to first make a simple program that would simulate the above characteristics and rules. Given two numbers, where the first is the target number and the second is the number on the sheet of paper to be shredded, you need to figure out how the shredder should "cut up" the second number. Input The input consists of several test cases, each on one line, as follows : tl num1 t2 num2 ... tn numn 0 0 Each test case consists of the following two positive integers, which are separated by one space : (1) the first integer (ti above) is the target number, (2) the second integer (numi above) is the number that is on the paper to be shredded. Neither integers may have a 0 as the first digit, e.g., 123 is allowed but 0123 is not. You may assume that both integers are at most 6 digits in length. A line consisting of two zeros signals the end of the input. Output For each test case in the input, the corresponding output takes one of the following three types : sum part1 part2 ... rejected error In the first type, partj and sum have the following meaning : 1.Each partj is a number on one piece of shredded paper. The order of partj corresponds to the order of the original digits on the sheet of paper. 2.sum is the sum of the numbers after being shredded, i.e., sum = part1 + part2 +... Each number should be separated by one space. The message error is printed if it is not possible to make any combination, and rejected if there is more than one possible combination. No extra characters including spaces are allowed at the beginning of each line, nor at the end of each line. Sample Input 50 12346 376 144139 927438 927438 18 3312 9 3142 25 1299 111 33333 103 862150 6 1104 0 0 Sample Output 43 1 2 34 6 283 144 139 927438 927438 18 3 3 12 error 21 1 2 9 9 rejected 103 86 2 15 0 rejected
Gondwanaland Telecom _course2017-10-11
Description Gondwanaland Telecom makes charges for calls according to distance and time of day. The basis of the charging is contained in the following schedule, where the charging step is related to the distance: Charging Step Day Rate 8am to 6pm Evening Rate 6pm to 10pm Night Rate 10pm to 8am A 0.10 0.06 0.02 B 0.25 0.15 0.05 C 0.53 0.33 0.13 D 0.87 0.47 0.17 E 1.44 0.80 0.30 All charges are in dollars per minute of the call. Calls which straddle a rate boundary are charged according to the time spent in each section. Thus a call starting at 5:58 pm and terminating at 6:04 pm will be charged for 2 minutes at the day rate and for 4 minutes at the evening rate. Calls less than a minute are not recorded and no call may last more than 24 hours. Write a program that reads call details and calculates the corresponding charges. Input Input lines will consist of the charging step (upper case letter 'A'..'E'), the number called (a string of 7 digits and a hyphen in the approved format) and the start and end times of the call, all separated by exactly one blank. Times are recorded as hours and minutes in the 24 hour clock, separated by one blank and with two digits for each number. Input will be terminated by a line consisting of a single #. Output Output will consist of the called number, the time in minutes the call spent in each of the charge categories, the charging step and the total cost in the format shown below. Sample Input A 183-5724 17 58 18 04 # Sample Output 183-5724 2 4 0 A 0.44
Generalized Palindromic Number _course2017-09-02
A number that will be the same when it is written forwards or backwards is known as a palindromic number. For example, 1234321 is a palindromic number. We call a number generalized palindromic number, if after merging all the consecutive same digits, the resulting number is a palindromic number. For example, 122111 is a generalized palindromic number. Because after merging, 122111 turns into 121 which is a palindromic number. Now you are given a positive integer N, please find the largest generalized palindromic number less than N. Input There are multiple test cases. The first line of input contains an integer T (about 5000) indicating the number of test cases. For each test case: There is only one integer N (1 <= N <= 1018). Output For each test case, output the largest generalized palindromic number less than N. Sample Input 4 12 123 1224 1122 Sample Output 11 121 1221 1121
Paint Mix _course2017-02-01
Description You are given two large pails. One of them (known as the black pail) contains B gallons of black paint. The other one (known as the white pail) contains W gallons of white paint. You will go through a number of iterations of pouring paint first from the black pail into the white pail, then from the white pail into the black pail. More specifically, in each iteration you first pour C cups of paint from the black pail into the white pail (and thoroughly mix the paint in the white pail), then pour C cups of paint from the white pail back into the black pail (and thoroughly mix the paint in the black pail). B, W, and C are positive integers; each of B and W is less than or equal to 50, and C < 16 * B (recall that 1 gallon equals 16 cups). The white pail's capacity is at least B+W. As you perform many successive iterations, the ratio of black paint to white paint in each pail will approach B/W. Although these ratios will never actually be equal to B/W one can ask: how many iterations are needed to make sure that the black-to-white paint ratio in each of the two pails differs from B/W by less than a certain tolerance. We define the tolerance to be 0.00001. Input The input consists of a number of lines. Each line contains input for one instance of the problem: three positive integers representing the values for B, W, and C, as described above. The input is terminated with a line where B = W = C = 0. Output Print one line of output for each instance. Each line of output will contain one positive integer: the smallest number of iterations required such that the black-to-white paint ratio in each of the two pails differs from B/W by less than the tolerance value. Sample Input 2 1 1 2 1 4 3 20 7 0 0 0 Sample Output 145 38 66
Bone Collector _course2017-11-24
Problem Description Many years ago , in Teddy’s hometown there was a man who was called “Bone Collector”. This man like to collect varies of bones , such as dog’s , cow’s , also he went to the grave … The bone collector had a big bag with a volume of V ,and along his trip of collecting there are a lot of bones , obviously , different bone has different value and different volume, now given the each bone’s value along his trip , can you calculate out the maximum of the total value the bone collector can get ? Input The first line contain a integer T , the number of cases. Followed by T cases , each case three lines , the first line contain two integer N , V, (N <= 1000 , V <= 1000 )representing the number of bones and the volume of his bag. And the second line contain N integers representing the value of each bone. The third line contain N integers representing the volume of each bone. Output One integer per line representing the maximum of the total value (this number will be less than 231). Sample Input 1 5 10 1 2 3 4 5 5 4 3 2 1 Sample Output 14
Description Given t, a, b positive integers not bigger than 2147483647, establish whether (t^a - 1)/(t^b -1) is an integer with less than 100 digits. Input Each line of input contains t, a, b. Output For each line of input print the formula followed by its value, or followed by "is not an integer with less than 100 digits.", whichever is appropriate. Sample Input 2 9 3 2 3 2 21 42 7 123 911 1 Sample Output (2^9-1)/(2^3-1) 73 (2^3-1)/(2^2-1) is not an integer with less than 100 digits. (21^42-1)/(21^7-1) 18952884496956715554550978627384117011154680106 (123^911-1)/(123^1-1) is not an integer with less than 100 digits.
Big Number _course2017-01-27
Description As we know, Big Number is always troublesome. But it's really important in our ACM. And today, your task is to write a program to calculate A mod B. To make the problem easier, I promise that B will be smaller than 100000. Is it too hard? No, I work it out in 10 minutes, and my program contains less than 25 lines. Input The input contains several test cases. Each test case consists of two positive integers A and B. The length of A will not exceed 1000, and B will be smaller than 100000. Process to the end of file. Output For each test case, you have to ouput the result of A mod B. Sample Input 2 3 12 7 152455856554521 3250 Sample Output 2 5 1521
Snowflake Snow Snowflakes_course2016-10-04
Description You may have heard that no two snowflakes are alike. Your task is to write a program to determine whether this is really true. Your program will read information about a collection of snowflakes, and search for a pair that may be identical. Each snowflake has six arms. For each snowflake, your program will be provided with a measurement of the length of each of the six arms. Any pair of snowflakes which have the same lengths of corresponding arms should be flagged by your program as possibly identical. Input The first line of input will contain a single integer n, 0 < n ≤ 100000, the number of snowflakes to follow. This will be followed by n lines, each describing a snowflake. Each snowflake will be described by a line containing six integers (each integer is at least 0 and less than 10000000), the lengths of the arms of the snow ake. The lengths of the arms will be given in order around the snowflake (either clockwise or counterclockwise), but they may begin with any of the six arms. For example, the same snowflake could be described as 1 2 3 4 5 6 or 4 3 2 1 6 5. Output If all of the snowflakes are distinct, your program should print the message: No two snowflakes are alike. If there is a pair of possibly identical snow akes, your program should print the message: Twin snowflakes found. Sample Input 2 1 2 3 4 5 6 4 3 2 1 6 5 Sample Output Twin snowflakes found.
The Snail _course2017-10-15
Description A snail is at the bottom of a 6-foot well and wants to climb to the top. The snail can climb 3 feet while the sun is up, but slides down 1 foot at night while sleeping. The snail has a fatigue factor of 10%, which means that on each successive day the snail climbs 10% * 3 = 0.3 feet less than it did the previous day. (The distance lost to fatigue is always 10% of the first day's climbing distance.) On what day does the snail leave the well, i.e., what is the first day during which the snail's height exceeds 6 feet? (A day consists of a period of sunlight followed by a period of darkness.) As you can see from the following table, the snail leaves the well during the third day. Day Initial Height Distance Climbed Height After Climbing Height After Sliding 1 0' 3' 3' 2' 2 2' 2.7' 4.7' 3.7' 3 3.7' 2.4' 6.1' - Your job is to solve this problem in general. Depending on the parameters of the problem, the snail will eventually either leave the well or slide back to the bottom of the well. (In other words, the snail's height will exceed the height of the well or become negative.) You must find out which happens first and on what day. Input The input contains one or more test cases, each on a line by itself. Each line contains four integers H, U, D, and F, separated by a single space. If H = 0 it signals the end of the input; otherwise, all four numbers will be between 1 and 100, inclusive. H is the height of the well in feet, U is the distance in feet that the snail can climb during the day, D is the distance in feet that the snail slides down during the night, and F is the fatigue factor expressed as a percentage. The snail never climbs a negative distance. If the fatigue factor drops the snail's climbing distance below zero, the snail does not climb at all that day. Regardless of how far the snail climbed, it always slides D feet at night. Output For each test case, output a line indicating whether the snail succeeded (left the well) or failed (slid back to the bottom) and on what day. Format the output exactly as shown in the example. Sample Input 6 3 1 10 10 2 1 50 50 5 3 14 50 6 4 1 50 6 3 1 1 1 1 1 0 0 0 0 Sample Output success on day 3 failure on day 4 failure on day 7 failure on day 68 success on day 20 failure on day 2
poker card game _course2017-10-15
Description Suppose you are given many poker cards. As you have already known, each card has points ranging from 1 to 13. Using these poker cards, you need to play a game on the cardboard in Figure 1. The game begins with a place called START. From START, you can walk to left or right to a rectangular box. Each box is labeled with an integer, which is the distance to START. !(http://poj.org/images/1339_1.jpg) Figure 1: The poker card game cardboard. To place poker cards on these boxes, you must follow the rules below: (1) If you put a card with n points on a box labeled i , you got (n ∗ i) points. (2) Once you place a card on a box b, you block the paths to the boxes behind b. For example, in Figure 2, a player places a queen on the right box of distance 1, he gets 1 ∗ 12 points but the queen also blocks the paths to boxes behind it; i.e., it is not allowed to put cards on boxes behind it anymore. !(http://poj.org/images/1339_2.jpg) Figure 2: Placing a queen. Your goal: Given a number of poker cards, find a way to place them so that you will get the minimum points. For example, suppose you have 3 cards 5, 10, and K. To get the minimum points, you can place cards like Figure 3, where the total points are 1 * 13 + 2 * 5 + 2 * 10 = 43. !(http://poj.org/images/1339_3.jpg) Figure 3: An example to place cards. Input The first line of the input file contains an integer n, n <= 10, which represents the number of test cases. In each test case, it begins with an integer m, m <= 100000, which represents the number of poker cards. Next, each card represented by its number are listed consecutively. Note that, the numbers of ace, 2, 3, ..., K are given by integers 1, 2, 3, ..., 13, respectively. The final minimum point in each test case is less than 5000000. Output List the minimum points of each test case line by line. Sample Input 3 3 5 10 13 4 3 4 5 5 5 7 7 10 11 13 Sample Output 43 34 110
Old Wine Into New Bottles _course2017-10-02
Description Wine bottles are never completely filled: a small amount of air must be left in the neck to allow for thermal expansion and contraction. If too little air is left in the bottle, the wine may expand and expel the cork; if too much air is left in the bottle, the wine may spoil. Thus each bottle has a minimum and maximum capacity. Given a certain amount of wine and a selection of bottles of various sizes, determine which bottles to use so that each is filled to between its minimum and maximum capacity and so that as much wine as possible is bottled. Input The first line of input contains two integers: the amount of wine to be bottled (in litres, between 0 and 1,000,000) and the number of sizes of bottles (between 1 and 100). For each size of bottle, one line of input follows giving the minimum and maximum capacity of each bottle in millilitres. The maximum capacity is not less than 325 ml and does not exceed 4500 ml. The minimum capacity is not less than 95% and not greater than 99% of the maximum capacity. You may assume that an unlimited number of each bottle is available. Output Your output should consist of a single integer: the amount of wine, in ml, that cannot be bottled. Sample Input 10 2 4450 4500 725 750 Sample Output 250
Problem Description A long time ago, the Egyptians figured out that a triangle with sides of length 3, 4, and 5 had a right angle as its largest angle. You must determine if other triangles have a similar property. !(http://acm.hdu.edu.cn/data/images/C384-1003-1.jpg) Input Input represents several test cases, followed by a line containing 0 0 0. Each test case has three positive integers, less than 30,000, denoting the lengths of the sides of a triangle. Output For each test case, a line containing "right" if the triangle is a right triangle, and a line containing "wrong" if the triangle is not a right triangle. Sample Input 6 8 10 25 52 60 5 12 13 0 0 0 Sample Output right wrong right
解压密码是FNF///---///666,请输入字母和数字部分中间删去. 安卓系统下的络达1562A检测软件AB153X-UT. 市场鱼龙混杂,在不拆机的情况下用此软件大致判断出是否是真1562a.
MATLAB基础入门课程，系统介绍MATLAB的基础知识。 主要从数组、运算、结构和绘图等几方面进行讲解 简单易懂，轻松入门MATLAB
ab153x-ut apk 洛达1562a蓝牙检测工具 真ut版2020-09-30
洛达官网 ab153x-ut 安卓检测软件 1562a正品检测工具 真ut版 csdn之前的那个是Repair版 无法检测 顺便建议下载ios蓝牙工具配合使用 准确鉴别1562a
- 博客 js 多级菜单渲染
- 下载 js重写alert控件(适合学习js的新手朋友)
- 学院 【数据分析】 第十一周 hadoop数据分析
- 学院 spark大数据分析与实战之kafka
- 博客 无法shell的解决方法
- 下载 USB3.0 主机控制器uPD720200在嵌入式媒体网关上的应用
- 下载 ThinkPHP连接数据库及主从数据库的设置教程
- 下载 Destoon实现多表查询示例
- 博客 mvn help:system 配置失败解决方法***
- 学院 Spark 3.0.0 Application 提交集群原理和源码详解
- 学院 saprk大数据分析与实战-zookeeper
- 学院 项目管理工具箱
- 学院 人工智能特训营---第32期
- 下载 PHP中的日期加减方法示例
- 下载 asp.net实现access数据库分页的方法
- 博客 阿里云ECS服务器租用价格表与收费标准参考
- 博客 7-2 交换最小值和最大值 (15分)
- 学院 架构师套餐/JVM/高并发/微服务/Docker等
- 学院 2020年软考网络规划设计师-论文写作套路精讲视频课程
- 下载 destoon实现调用当前栏目分类及子分类和三级分类的方法
- 博客 NOJ1326——算法实验三——推箱子
- 学院 软件测试之测试模型及方法概论
- 博客 权限及如何设计数据库
- 博客 仿新闻订阅功能，Android可拖动排序的GridView（自定义GridView）
- 下载 在JS数组特定索引处指定位置插入元素的技巧
- 博客 Python笔记
- 下载 destoon实现调用图文新闻的方法
- 下载 便携电子设备的高效电源系统
- 博客 3D小游戏(three)-Bottle物体开始动画(Tween自实现)实现
- 学院 vue-element-admin从入门到进阶实战