 Billiard

In a billiard table with horizontal side a inches and vertical side b inches, a ball is launched from the middle of the table. After s > 0 seconds the ball returns to the point from which it was launched, after having made m bounces off the vertical sides and n bounces off the horizontal sides of the table. Find the launching angle A (measured from the horizontal), which will be between 0 and 90 degrees inclusive, and the initial velocity of the ball.
Assume that the collisions with a side are elastic (no energy loss), and thus the velocity component of the ball parallel to each side remains unchanged. Also, assume the ball has a radius of zero. Remember that, unlike pool tables, billiard tables have no pockets.
Input
Input consists of a sequence of lines, each containing five nonnegative integers separated by whitespace. The five numbers are: a, b, s, m, and n, respectively. All numbers are positive integers not greater than 10000.
Input is terminated by a line containing five zeroes.
Output
For each input line except the last, output a line containing two real numbers (accurate to two decimal places) separated by a single space. The first number is the measure of the angle A in degrees and the second is the velocity of the ball measured in inches per second, according to the description above.
Sample Input
100 100 1 1 1
200 100 5 3 4
201 132 48 1900 156
0 0 0 0 0Sample Output
45.00 141.42
33.69 144.22
3.09 7967.81
Parallelepiped _course
20171003Description Two opposite vertices of the parallelepiped A with the edges parallel to the datume lines, have coordinates (0, 0, 0) and (u, v, w) correspondingly (0< u< 1000, 0< v< 1000, 0< w< 1000). Each of the n points of the set S is defined by its coordinates (x(i), y(i), z(i)), 1 <= i <= n <= 50. No pair of points of the set S lies on the straight line parallel to some side of the parallelepiped A. You are to find a parallelepiped G of the maximal volume such that all its sides are parallel to the edges of A, G completely lies in A (G and A may have common boundary points) and no point of S lies in G (but may lie on its side). Input The first line consists of the numbers u, v, w separated with a space. The second line contains an integer n. The third, ..., (n+2)nd line – the numbers x(i), y(i), z(i)separated with a space. The number n is written without a decimal point. All other numbers are written with not more than two digits after a decimal point (if a number is integer a decimal point may be omitted). All the input numbers are nonnegative not greater than 1000. Output One number – the volume of G with two digits after a decimal point. If the true volume has more than two digitrs after a decimal point you should round off the result to two digits after a decimal opint according to the common mathematical rules. Sample Input 1.0 1.0 1.0 1 0.5 0.5 0.5 Sample Output 0.50
End of Windless Days _course
20171017Description Jiajia went back to his little hometown for Spring Festival. Due to the poverty of the town, Jiajia was unable to see Wind or hear her voice through QQ for 5 days. You know, that was terrible to Jiajia, so he could only sleep a lot, hopping to see Wind in wonderful dreams. Finally, Jiajia was in the airport, so he will soon be able to see his honey, Wind. Again, he decided a dream another dream, to spend the boring time in the waiting room. But this time he was unable to sleep, since there was a super light hanging in the ceiling, and the light was too strong to sleep in. Luckily, Jiajia found that there are some curtains somewhere below the light, blocking some rays. The floor and curtains are rectangularshaped. The planes in which a curtain lies in are parallel to the floor, and when projected to the floor, the sides of curtains are parallel to those of the floor. Jiajia is interested in the total area on the floor covered by the light, could you write a program to do this? Jiajia would be very happy if he receives this program as a special gift, at the end of windless days. Input The first line contains a single integer n, the number of curtains. The second line contains four integers minx,miny,maxx,maxy, where minx < maxx, miny < maxy. That means the floor lies in range [minx,miny][maxx,maxy]. The floor has a height of 0. The third line contains three integers lx, ly, lh, that is the position of the super light. The following n lines each has 5 integers x1,y1,x2,y2,h, where minx < x1 < x2 < maxx, miny < y1 < y2 < maxy, 0 < h < lh. This means the curtain lies in range [x1,y1][x2,y2], the height of the curtain is h. You may assume that n<=500, every other numbers in the input do not exceed 20000 in absolute value. If two numbers differ at most 106, they are considered to be equal. Be careful that there may be many many cases. Output The output contains a single real number, the total area on the floor covered by the light. The answer should be rounded to 4 decimal places. Sample Input 2 10 10 10 10 0 0 2 0 0 5 5 1 5 5 0 0 1 Sample Output 200.0000
Frame Polygonal Line _course
20170807You are going to read a sequence of pairs of integer numbers. Each pair represents the Cartesian coordinates of a point in a 2dimentional plane. The first number is the x coordinate, while the second is that of y. The sequence represents a polygonal line. Your task is to draw a rectangle with minimal length of sides that exactly surrounds the polygonal line. The sides of the rectangle are parallel to x and yaxis, respectively. Input Input consists of several test cases. For each case, a sequence of coordinates is given. Each pair of x and y occupies a line, with x and y less than 2^31. The sequence is terminated with a pair of 0's. Note that (0, 0) will never be considered as a point on any of the polygonal lines. An empty polygonal line signals the end of input. Output For each test case, print in one line two pairs of numbers, which are the southwest and northeast corners of the surrounding rectangle. The numbers must be separated by one space as is indicated in the samples. Sample Input 12 56 23 56 13 10 0 0 12 34 0 0 0 0 Sample Output 12 10 23 56 12 34 12 34
Euclid _course
20170828Description In one of his notebooks, Euclid gave a complex procedure for solving the following problem. With computers, perhaps there is an easier way. In a 2D plane, consider a line segment AB, another point C which is not collinear with AB, and a triangle DEF. The goal is to find points G and H such that: H is on the ray AC (it may be closer to A than C or further away, but angle CAB is the same as angle HAB) ABGH is a parallelogram (AB is parallel to HG, AH is parallel to BG) The area of parallelogram ABGH is the same as the area of triangle DEF Input There will be several test cases. Each test case will consist of twelve real numbers, with no more than 3 decimal places each, on a single line. Those numbers will represent, in order: AX AY BX BY CX CY DX DY EX EY FX FY where point A is (AX,AY), point B is (BX,BY), and so on. Points A, B and C are guaranteed to NOT be collinear. Likewise, D, E and F are also guaranteed to be noncollinear. Every number is guaranteed to be in the range from 1000.0 to 1000.0 inclusive. End of the input will be signified by a line with twelve 0.0's. Output For each test case, print a single line with four decimal numbers. These represent points G and H, like this: GX GY HX HY where point G is (GX,GY) and point H is (HX,HY). Print all values rounded to 3 decimal places of precision (NOT truncated). Print a single space between numbers. Do not print any blank lines between answers. Sample Input 0 0 5 0 0 5 3 2 7 2 0 4 1.3 2.6 12.1 4.5 8.1 13.7 2.2 0.1 9.8 6.6 1.9 6.7 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 Sample Output 5.000 0.800 0.000 0.800 13.756 7.204 2.956 5.304
Tower _course
20170822Once upon a time, there was a temple. And the honor of the monks in the temple is their tower.One day, the Buddhist abbot wants to find out who is the smartest monk in the temple, so he gives the monks a problem: Calculate the area of the tower's shadow at a specific time of the day. Perhaps the mission is easy to complete with a directly measuring the shadow, but the Buddhist abbot makes it nearly impossible, he said: "Leave the shadow alone! You can only measure the tower itself!" Though all the monks are very smart, they still have no idea of this problem. So now it is your turn to solve it. The tower is formed with N floors, each floor is a hexagon, and every two adjacent floors will be linked by six congruent isosceles trapezoid (For example, floor N links to floor N1, floor 2 links to floor 1, floor 1 links to floor 0). The top of the tower, which can be regarded as floor 0, is a dot (that is, it can be treated as a hexagon with a zero side length). Then floor 1 is the floor under floor 0, floor 2 is under floor 1, floor 3 is under floor 2...floor N is under floor (N  1). Now let Ri equals to the side length of hexagon number i, Hi equals to the height of floor i (of course it's the height from the bottom), and you know the shadow's length L of a exactly vertically placed stick (Its height exactly equals to 1. We assume that sun light is parallel light, and it is perpendicular to two parallel sides of each hexagon). Now give you Ri, Hi and L, can you solve the problem? Input There are several test cases. In each case, there will be two numbers in the first line, N(integer, 1 <= N <= 150) and L(fraction, L >= 0), which represent the number of floot and the shadow's length of the stick. The next N + 1 lines describe the side length Ri and height Hi(i starts from 0 to N), each line contains only two numbers, Ri and Hi(fractions, 0.00 <= Ri, Hi < 1000.00).We guarantee that Hi > Hj(0 <= i < j <= N), R0 = 0 and Hn = 0. Output For each test case, you may output a float number S, which represents the area of the tower's shadow. Round S to 4 digits after decimal point. Sample Input 1 1.00 0.00 3.00 1.00 0.00 3 0.00 0.00 3.00 10.00 2.00 5.00 1.00 11.00 0.00 Sample Output 4.2990 314.3672
Finding Nemo _course
20170311Nemo is a naughty boy. One day he went into the deep sea all by himself. Unfortunately, he became lost and couldn't find his way home. Therefore, he sent a signal to his father, Marlin, to ask for help. After checking the map, Marlin found that the sea is like a labyrinth with walls and doors. All the walls are parallel to the Xaxis or to the Yaxis. The thickness of the walls are assumed to be zero. All the doors are opened on the walls and have a length of 1. Marlin cannot go through a wall unless there is a door on the wall. Because going through a door is dangerous (there may be some virulent medusas near the doors), Marlin wants to go through as few doors as he could to find Nemo. Figure1 shows an example of the labyrinth and the path Marlin went through to find Nemo. We assume Marlin's initial position is at (0, 0). Given the position of Nemo and the configuration of walls and doors, please write a program to calculate the minimum number of doors Marlin has to go through in order to reach Nemo. Input The input consists of several test cases. Each test case is started by two nonnegative integers M and N. M represents the number of walls in the labyrinth and N represents the number of doors. Then follow M lines, each containing four integers that describe a wall in the following format: x y d t (x, y) indicates the lowerleft point of the wall, d is the direction of the wall  0 means it's parallel to the Xaxis and 1 means that it's parallel to the Yaxis, and t gives the length of the wall. The coordinates of two ends of any wall will be in the range of [1,199]. Then there are N lines that give the description of the doors: x y d x, y, d have the same meaning as the walls. As the doors have fixed length of 1, t is omitted. The last line of each case contains two positive float numbers: f1 f2 (f1, f2) gives the position of Nemo. And it will not lie within any wall or door. A test case of M = 1 and N = 1 indicates the end of input, and should not be processed. Output For each test case, in a separate line, please output the minimum number of doors Marlin has to go through in order to rescue his son. If he can't reach Nemo, output 1. Sample Input 8 9 1 1 1 3 2 1 1 3 3 1 1 3 4 1 1 3 1 1 0 3 1 2 0 3 1 3 0 3 1 4 0 3 2 1 1 2 2 1 2 3 1 3 1 1 3 2 1 3 3 1 1 2 0 3 3 0 4 3 1 1.5 1.5 4 0 1 1 0 1 1 1 1 1 2 1 1 1 1 2 0 1 1.5 1.7 1 1 Sample Output 5 1
Game Of Logic _course
20170908This Christmas WishingBone has got some new toys which are real cool. This is one of them. On a large board there fixed many logic units and lines between them. They are called bone logic which is composed of one input, one output and a nice looking button. Only after the input becomes 1 and the button is pressed will it output 1, otherwise its output is 0. Bone logics can be interconnected in series or in parallel. A legal game board is shown below. ![](http://acm.zju.edu.cn/onlinejudge/showImage.do?name=0000%2F1445%2F1445.gif) In the figure there are 3 bone logics. The red one and the blue one is interconnected in parallel and they are together interconnected in series with the green one. All the bone logics are arranged so that their input end is on the left and output end is on the right. All the connection points are labeled from 1 to m, where 1 is the single input of the board and m is the single output of the board. Note that an nto1 connection point like point 2 in the figure uses AND logic that produces a 1 signal only if all the inputs become 1. Initially all the signals are 0 except input of the board (point 1). Your goal is to press n bone logics sequentially to turn the output of the board (point m) into 1. A bone can be pressed only if the signal comes into it become 1. And all bones will be pressed exactly once. In the example above, one way to achieve this is to press redbluegreen; another possibility is to press blueredgreen. Though it is rather easy to figure one way out, WishingBone is curious about how many ways on earth he can solve a particular board configuration. Input The first line of input is a positive integer N <= 100, which is the number of test cases. The first line of each case is two integers n and m (0 < n <= 100, 2 <= m <= n+1), which are the number of bone logics and connection points. The following n lines contains two integers li ri (0 < li, ri <= m) indicating the connection point on the left and right of bone logic i. The input board configuration is always legal, and has at least one way to achieve the goal. Output N integers which are the numbers of ways to achieve the goal on the N board configurations, one per line. Sample Input 3 3 3 1 2 1 2 2 3 3 4 1 2 2 3 3 4 4 3 1 2 1 2 2 3 1 3 Sample Output 2 1 8
Little Jumper _course
20170320Little frog Georgie likes to jump. Recently he have discovered the new playground that seems the perfect place to jump. Recently the new jumping exercise has become very popular. Two vertical walls are placed on the playground, each of which has a hole. The lower sides of the holes in the walls are on heights b1 and b2 respectively, and upper sides on heights t1 and t2. Walls are parallel and placed on distance l from each other. The jumper starts at the distance ds from the first wall. It jumps through the first hole and lands between the walls. After that from that point he jumps through the second hole. The goal is to land exactly at the distance df from the second wall. Let us describe the jump. The jumper starts from the specified point and starts moving in some chosen direction with the speed not exceeding some maximal speed v, determined by the strength of the jumper. The gravity of g forces him down, thus he moves along the parabolic trajectory. The jumper can choose different starting speeds and different directions for his first and second jump. Of course, The jumper must not attempt to pass through the wall, although it is allowed to touch it passing through the hole, this does not change the trajectory of the jump. The jumper is not allowed to pass through both holes in a single jump. Find out, what must be the maximal starting speed of the jumper so that he could fulfil the excersise. Input Input file contains one or more lines, each of which contains eight real numbers, separated by spaces and/or line feeds. They designate b1, t1, b2, t2, l, ds, df and g. All numbers are in range from 102 to 103, t1 >= b1 + 102, t2 >= b2 + 102. Input file contains at most 1000 test cases. Output For each line of the input file output the smallest possible maximal speed the jumper must have to fulfil the exercise. If it is impossible to fulfil it, output 1. Your answer must be accurate up to 104. Sample Input 0.3 1.0 0.5 0.9 1.7 1.2 2.3 9.8 0.6 0.8 0.6 0.8 2.4 0.3 1.5 0.7 Sample Output 5.2883 1.3127
Line of Sight _course
20171027Description An architect is very proud of his new home and wants to be sure it can be seen by people passing by his property line along the street. The property contains various trees, shrubs, hedges, and other obstructions that may block the view. For the purpose of this problem, model the house, property line, and obstructions as straight lines parallel to the x axis: ![](http://poj.org/images/2074_1.jpg) To satisfy the architect's need to know how visible the house is, you must write a program that accepts as input the locations of the house, property line, and surrounding obstructions and calculates the longest continuous portion of the property line from which the entire house can be seen, with no part blocked by any obstruction. Input Because each object is a line, it is represented in the input file with a left and right x coordinate followed by a single y coordinate: < x1 > < x2 > < y > Where x1, x2, and y are nonnegative real numbers. x1 < x2 An input file can describe the architecture and landscape of multiple houses. For each house, the first line will have the coordinates of the house. The second line will contain the coordinates of the property line. The third line will have a single integer that represents the number of obstructions, and the following lines will have the coordinates of the obstructions, one per line. Following the final house, a line "0 0 0" will end the file. For each house, the house will be above the property line (house y > property line y). No obstruction will overlap with the house or property line, e.g. if obstacle y = house y, you are guaranteed the entire range obstacle[x1, x2] does not intersect with house[x1, x2]. Output For each house, your program should print a line containing the length of the longest continuous segment of the property line from which the entire house can be to a precision of 2 decimal places. If there is no section of the property line where the entire house can be seen, print "No View". Sample Input 2 6 6 0 15 0 3 1 2 1 3 4 1 12 13 1 1 5 5 0 10 0 1 0 15 1 0 0 0 Sample Output 8.80 No View
Cutting a Block _course
20170107Description Carpenter Bill has a huge wooden block. The block has a shape of rectangular parallelepiped. The block is so huge that it cannot pass through the door of Bill’s house. So he decided to cut it into n smaller blocks. Bill is not a very smart guy so he wants to make all small blocks rectangular, and all of them should be equal. Write a program that would help Bill to cut his block. Input Let us introduce a coordinate system such that the edges of the block are parallel to the coordinate axes and one of the block’s corners is placed at the origin. The opposite corner of the block has coordinates (x, y, z). The first line of the input file contains four integer numbers — x, y, z and n (1 ≤ x, y, z, n ≤ 1 000). Output Output file should contain n lines each describing one small block. Each small block is described by six numbers: x1, y1, z1, x2, y2, z2, where (x1, y1, z1) are the coordinates of one corner of the block and (x2, y2, z2) are the coordinates of its opposite corner. Coordinates must be precise up to eight digits after the decimal point. Sample Input sample input #1 3 2 2 4 sample input #2 3 2 2 6 Sample Output sample output #1 0 0 0 1.5 1 2 3 0 0 1.5 1 2 0 1 0 1.5 2 2 3 1 0 1.5 2 2 sample output #2 0 0 0 1 2 1 0 0 1 1 2 2 1 0 0 3 1 1 1 0 1 3 1 2 1 1 0 3 2 1 1 1 1 3 2 2Cutting a Block
Destroying The Graph _course
20170801Description Alice and Bob play the following game. First, Alice draws some directed graph with N vertices and M arcs. After that Bob tries to destroy it. In a move he may take any vertex of the graph and remove either all arcs incoming into this vertex, or all arcs outgoing from this vertex. Alice assigns two costs to each vertex: Wi+ and Wi. If Bob removes all arcs incoming into the ith vertex he pays Wi+ dollars to Alice, and if he removes outgoing arcs he pays Wi dollars. Find out what minimal sum Bob needs to remove all arcs from the graph. Input Input file describes the graph Alice has drawn. The first line of the input file contains N and M (1 <= N <= 100, 1 <= M <= 5000). The second line contains N integer numbers specifying Wi+. The third line defines Wi in a similar way. All costs are positive and do not exceed 106 . Each of the following M lines contains two integers describing the corresponding arc of the graph. Graph may contain loops and parallel arcs. Output On the first line of the output file print W  the minimal sum Bob must have to remove all arcs from the graph. On the second line print K  the number of moves Bob needs to do it. After that print K lines that describe Bob's moves. Each line must first contain the number of the vertex and then '+' or '' character, separated by one space. Character '+' means that Bob removes all arcs incoming into the specified vertex and '' that Bob removes all arcs outgoing from the specified vertex. Sample Input 3 6 1 2 3 4 2 1 1 2 1 1 3 2 1 2 3 1 2 3 Sample Output 5 3 1 + 2  2 +
计算文件下载的下载时间问题 _course
20161107Jiajia downloads a lot, a lot more than you can even imagine. Some say that he starts downloading up to 20,000 files together. If 20,000 files try to share a limited bandwidth then it will be a big hazard and no files will be downloaded properly. That is why, he uses a download manager. If there are T files to download, the download manger uses the following policy while downloading files: 1. The download manager gives the smaller files higher priority, so it starts downloading the smallest n files at startup. If there is a tie, download manager chooses the one with less bytes remaining (for download). We assume that with at least 50 Mega Bytes/sec of bandwidth, n files can be downloaded simultaneously without any problem. 2. The available bandwidth is equally shared by the all the files that are being downloaded. When a file is completely downloaded its bandwidth is instantaneously given to the next file. If there are no more files left except the files that are being downloaded, this bandwidth is immediately shared equally by all remaining files that are being downloaded. Given the size and completed percentage of each file, your task is to intelligently simulate the behavior of the download manager to find the total time required to download all the files. 输入: The will be at most 10 test cases. Each case begins with three integers T (1 <= T <= 20000), n (1 <= n <= 2000 and 1 <= n <= T) and B (50 <= B <= 1000). Here B denotes the total bandwidth available to Jiajia (In Megabytes/sec). Please note that the download manager always downloads n files in parallel unless there are less than n files available for download. Each of next T lines contains one nonnegative floatingpoint number S (less than 20,000, containing at most 2 digits after the decimal places) and one integer P (0 <= P <= 100). These two numbers denote a file whose size is S megabyte and which has been downloaded exactly P% already. Also note that although theoretically it is not possible that the size of a file or size of its remaining part is a fraction when expressed in bytes, for simplicity please assume that such thing is possible in this problem. The last test case is followed by T=n=B=0, which should not be processed. 输出: The will be at most 10 test cases. Each case begins with three integers T (1 <= T <= 20000), n (1 <= n <= 2000 and 1 <= n <= T) and B (50 <= B <= 1000). Here B denotes the total bandwidth available to Jiajia (In Megabytes/sec). Please note that the download manager always downloads n files in parallel unless there are less than n files available for download. Each of next T lines contains one nonnegative floatingpoint number S (less than 20,000, containing at most 2 digits after the decimal places) and one integer P (0 <= P <= 100). These two numbers denote a file whose size is S megabyte and which has been downloaded exactly P% already. Also note that although theoretically it is not possible that the size of a file or size of its remaining part is a fraction when expressed in bytes, for simplicity please assume that such thing is possible in this problem. The last test case is followed by T=n=B=0, which should not be processed. 样例输入: 6 3 90 100.00 90 40.40 70 60.30 70 40.40 80 40.40 85 40.40 88 1 1 56 12.34 100 0 0 0 样例输出: Case 1: 0.66 Case 2: 0.00
Download Manager _course
20170826Problem Description Jiajia downloads a lot, a lot more than you can even imagine. Some say that he starts downloading up to 20,000 files together. If 20,000 files try to share a limited bandwidth then it will be a big hazard and no files will be downloaded properly. That is why, he uses a download manager. If there are T files to download, the download manger uses the following policy while downloading files: 1. The download manager gives the smaller files higher priority, so it starts downloading the smallest n files at startup. If there is a tie, download manager chooses the one with less bytes remaining (for download). We assume that with at least 50 Mega Bytes/sec of bandwidth, n files can be downloaded simultaneously without any problem. 2. The available bandwidth is equally shared by the all the files that are being downloaded. When a file is completely downloaded its bandwidth is instantaneously given to the next file. If there are no more files left except the files that are being downloaded, this bandwidth is immediately shared equally by all remaining files that are being downloaded. Given the size and completed percentage of each file, your task is to intelligently simulate the behavior of the download manager to find the total time required to download all the files. Input The will be at most 10 test cases. Each case begins with three integers T (1 <= T <= 20000), n (1 <= n <= 2000 and 1 <= n <= T) and B (50 <= B <= 1000). Here B denotes the total bandwidth available to Jiajia (In Megabytes/sec). Please note that the download manager always downloads n files in parallel unless there are less than n files available for download. Each of next T lines contains one nonnegative floatingpoint number S (less than 20,000, containing at most 2 digits after the decimal places) and one integer P (0 <= P <= 100). These two numbers denote a file whose size is S megabyte and which has been downloaded exactly P% already. Also note that although theoretically it is not possible that the size of a file or size of its remaining part is a fraction when expressed in bytes, for simplicity please assume that such thing is possible in this problem. The last test case is followed by T=n=B=0, which should not be processed. Output For each case, print the case number and the total time required to download all the files, expressed in hours and rounded to 2 digits after the decimal point. Print a blank line after the output of each test case. Sample Input 6 3 90 100.00 90 40.40 70 60.30 70 40.40 80 40.40 85 40.40 88 1 1 56 12.34 100 0 0 0 Sample Output Case 1: 0.66 Case 2: 0.00
Sculpture _course
20171101Problem Description Imagine a box, made of copper plate. Imagine a second one, intersecting the first one, and several others, intersecting each other (or not). That is how the sculptor Oto Boxing constructs his sculptures. In fact he does not construct that much, he only makes the design; the actual construction is contracted out to a construction company. For the calculation of the costs of construction the company needs to know the total area of copper plate involved. Parts of a box that are hidden in another box are not realized in copper, of course. (Copper is quite expensive, and prices are rising.) After construction, the total construction is plunged into a bath of chemicals. To prevent this bath from running over, the construction company wants to know the total volume of the construction. Given that a construction is a collection of boxes, you are asked to calculate the area and the volume of the construction. Some of Oto's designs are connected, others are not. Either way, we want to know the total area and the total volume. It might happen that the boxes completely enclose space that is not included in any of the boxes (see the second example below). Because the liquid cannot enter that space, its volume must be added to the total volume. Copper plate bordering this space is superfluous, of course, so it does not add to the area. Input On the first line one positive number: the number of testcases, at most 100. After that per testcase: * One line with an integer n (1 ≤ n ≤ 50): the number of boxes involved. * n lines with six positive integers x0, y0, z0, x, y, z (1 ≤ x0, y0, z0, x, y, z ≤ 500): the triple (x0, y0, z0) is the vertex of the box with the minimum values for the coordinates and the numbers x, y, z are the dimensions of the box (x, y and z dimension, respectively). All dimensions are in centimeters. The sides of the boxes are always parallel to the coordinate axes. Output Per testcase: * One line with two numbers separated by single spaces: the total amount of copper plate needed (in cm2), and the total volume (in cm3). Sample Input 2 2 1 2 3 3 4 5 6 2 3 3 4 5 7 1 1 1 5 5 1 1 1 10 5 5 1 1 1 2 1 4 8 2 1 2 4 1 8 5 2 2 1 4 8 1 5 2 4 1 8 3 3 4 1 1 1 Sample Output 188 120 250 250
Gunman _course
20170420Consider a 3D scene with OXYZ coordinate system. Axis OX points to the right, axis OY points up, and axis OZ points away from you. There is a number of rectangular windows on the scene. The plane of each window is parallel to OXY , its sides are parallel to OX and OY . All windows are situated at different depths on the scene (different coordinates z > 0). A gunman with a rifle moves along OX axis (y = 0 and z = 0). He can shoot a bullet in a straight line. His goal is to shoot a single bullet through all the windows. Just touching a window edge is enough. Your task is to determine how to make such shot. Input There are several test cases in the input. The first line of each case contains a single integer number n (2 ≤ n ≤ 100)  the number of windows on the scene. The following n lines describe the windows. Each line contains five integer numbers x 1i , y 1i , x 2i , y 2i , z i (0 < x 1i , y 1i , x 2i , y 2i , z i < 1000). Here (x 1i , y 1i , z i ) are coordinates of the bottom left corner of the window, and (x 2i , y 2i , z i ) are coordinates of the top right corner of the window (x 1i < x 2i , y 1i < y 2i ). Windows are ordered by z coordinate (z i > z i1 for 2 ≤ i ≤ n). Output Output a single word "UNSOLVABLE" if the gunman cannot reach the goal of shooting a bullet through all the windows. Otherwise, on the first line output a word "SOLUTION". On the next line output x coordinate of the point from which the gunman must fire a bullet. On the following n lines output x, y, z coordinates of the points where the bullet goes through the consecutive windows. All coordinates in the output file must be printed with six digits after decimal point. Sample Input 3 1 3 5 5 3 1 2 5 7 5 5 2 7 6 6 3 2 1 5 4 1 3 5 6 8 2 4 3 8 6 4 Sample Output SOLUTION 1.000000 2.000000 3.000000 3.000000 4.000000 5.000000 5.000000 5.000000 6.000000 6.000000 UNSOLVABLE
Carl the Ant _course
20170508Ants leave small chemical trails on the ground in order to mark paths for other ants to follow. Ordinarily these trails follow rather straight lines. But in one ant colony there is an ant named Carl, and Carl is not an ordinary ant. Carl will often zigzag for no apparent reason, sometimes crossing his own path numerous times in the process. When other ants come to an intersection, they always follow the path with the strongest scent, which is the most recent path that leads away from the intersection point. Ants are 1 centimeter long, move and burrow at 1 centimeter per second, and follow their paths exactly (bending at right angles when moving around corners). Ants cannot cross or overlap each other. If two ants meet at the exact same instant at an intersection point, the one that has been on Carl's path the longest has the right of way; otherwise, the ant that has been waiting the longest at an intersection will move first. Carl burrows up from the ground to start at the origin at time 0. He then walks his path and burrows back down into the ground at the endpoint. The rest of the ants follow at regular intervals. Given the description of Carl's path and when the other ants start the path, you are to determine how long it takes the entire set of ants to finish burrowing back into the ground. All the ants are guaranteed to finish. Input Input consists of several test cases. The first line of the input file contains a single integer indicating the number of test cases. The input for each test case starts with a single line containing three positive integers n (1 <= n <= 50), m (1 <= m <= 100), and d (1 <= d <= 100). Here, n is the number of line segments in Carl's path, m is the number of ants traveling the path (including Carl), and d is the time delay before each successive ant's emergence. Carl (who is numbered 0) starts at time 0. The next ant (ant number 1) will emerge at time d, the next at time 2d, and so on. If the burrow is blocked, the ants will emerge as soon as possible in the correct order. Each of the next n lines for the test case consists of a unique integer pair x y (100 <= x, y <= 100), which is the endpoint of a line segment of Carl's path, in the order that Carl travels. The first line starts at the origin (0,0) and the starting point of every subsequent line is the endpoint of the previous line. For simplicity, Carl always travels on line segments parallel to the axes, and no endpoints lie on any segment other than the ones which they serve as an endpoint. Output The output for each case is described as follows: Case C: Carl finished the path at time t1 The ants finished in the following order: a1 a2 a3 ... am The last ant finished the path at time t2 Here, C is the case number (starting at 1), a1 a2 a3 ... am are the ant numbers in the order that they go back underground, and t1 and t2 are the times (in seconds) at which Carl and the last ant finish going underground. You should separate consecutive cases with a single blank line. Sample Input 2 4 7 4 0 4 2 4 2 2 2 2 4 7 2 0 4 2 4 2 2 2 2 Sample Output Case 1: Carl finished the path at time 13 The ants finished in the following order: 0 2 1 3 4 5 6 The last ant finished the path at time 29 Case 2: Carl finished the path at time 13 The ants finished in the following order: 0 4 1 5 2 6 3 The last ant finished the path at time 19
 24.39MB
c++学习资料汇总
20130801包括： 高质量C++_C编程指南.pdf C+++Primer中文非扫描版.pdf C++程序员必备常识.pdf Effective C++.chm More+Exceptional+C++.chm
C++语言基础视频教程
20150301C++语言基础视频培训课程：本课与主讲者在大学开出的程序设计课程直接对接，准确把握知识点，注重教学视频与实践体系的结合，帮助初学者有效学习。本教程详细介绍C++语言中的封装、数据隐藏、继承、多态的实现等入门知识；主要包括类的声明、对象定义、构造函数和析构函数、运算符重载、继承和派生、多态性实现等。 课程需要有C语言程序设计的基础（可以利用本人开出的《C语言与程序设计》系列课学习）。学习者能够通过实践的方式，学会利用C++语言解决问题，具备进一步学习利用C++开发应用程序的基础。
 上次挂在了京东Java二面不服气， 三月之期已到，这次终于拿下offer！ 618720201020前言 这话要从三个月前说起：当时一名水友告诉我想要跳槽去京东，然后我就本着推波助澜，为粉丝打气的心态（也可能是看热闹不嫌事儿大？）就支持他一定要去，梦想一定要有，没准儿就实现了呢？ 没想到直接凉凉！ 以下为第一次京东二面凉经 京东一面凉经 object的方法，7大方法 synchronized方法讲解 synchronized方法实现原理 volatile关键字的原理 锁的分类 偏向锁讲解 NoClassDefFoundError和ClassNotFoundException的区别 追问，ClassN
 11KB
北航计组P0Logisim简单部件与状态机
20181231使用Logisim搭建一个除数为四位，原数据帧为8位的CRC校验码计算电路；一个四位运算单元ALU；一个GRF；一个Melay型有限状态机 检测串行输入字符串中的能匹配正则表达式b{1,2}{2}的子
 153.58MB
2020HW工具包.zip
20200923各位亲觉得工具包怎么样
 117B
Keil5安装包
20190523Keil5安装包，附带STM31F1、STM32F4支持包以及破解软件。
 学院 全平台OpenGL游戏技术(OSX/Windows/Android/iOS)
 下载 DeepFool论文测试代码
 学院 Java微信小程序手机数码商城 大学生毕业设计教学视频
 博客 Ubuntu18.04：mysql：ERROR 1698 (28000): Access denied for user ‘root‘@‘localhost‘
 下载 工程伦理习题答案2020
 博客 Linux：uboot启动流程分析
 下载 tensorflow+imageai环境搭建到图像预测和检测
 学院 Web全栈之成为编程小牛的十八般武艺秘籍
 下载 蓝桥杯单片机——05 独立按键.rar
 学院 在金融行业中如何使用Python加速建模运算
 学院 SkyEye智慧眼系统搭建 二
 博客 oracle 常用函数 集合运算
 博客 Servlet开发的项目——1、数据库MySQL环境搭建
 博客 朋友面试阿里云惨遭滑铁卢。幸获华为内推机会，四面喜提offer。
 学院 OpenGL进阶OSX版
 下载 大型建筑工程的共振测量
 下载 OLED控制芯片SSD1315规格书
 学院 千锋梁哥_2020最新_C语言视频教程（全家桶）
 博客 Less,Sass,Styus三者的区别
 学院 NodeRED手把手从入门到实战
 下载 麦克风阵列的理解以及语音识别相关知识.docx
 博客 CSS基础
 下载 JavaScript给url网址进行encode编码的方法
 下载 JavaScript控制两个列表框listbox左右交换数据的方法
 学院 C#之面向对象
 博客 工作中巧用了这几个设计模式重构代码，女同事直呼666
 下载 蓝桥杯单片机——04 共阳数码管的动态显示.rar
 博客 4面字节跳动拿到22Offer，入职就是30K16薪，全靠这份PDF
 学院 Kurento+openvidu+redis+mongodb集成
 博客 JDK1.7 HashMap源码解析+常见问题