Tuyến xe bus T6 nối Quy Nhơn – Tây Sơn – Vĩnh Thạnh được tổ chức theo cách sau đây: Xe buýt có thể chạy không dừng theo các đoạn 1, 2, 3, …, 9 km. Với mỗi đoạn trong 9 đoạn này có giá vé cố định cho trong một bảng. Ví dụ như bảng giá vé sau: Độ dài đoạn đường đi Giá vé 1 km| 12 2 km| 19 3 km| 31 4 km| 40 5 km| 61 6 km| 65 7 km| 69 8 km| 79 9 km| 90 Một hành khách muốn đi N km bằng xe buýt (1 ≤ N ≤ 1000). Yêu cầu: Hãy viết chương trình để hành khách có thể chọn những khoảng cách dừng xe hợp lý để hành trình phải trả tiền ít nhất. Dữ liệu: Vào từ tệp văn bản BUS.INP - Dòng đầu tiên ghi số N. - Dòng thứ hai ghi 9 số nguyên dương là giá tiền tương ứng của các đoạn 1, 2, …, 9 km. Kết quả: Ghi ra tệp văn bản BUS.OUT gồm một số nguyên duy nhất là số tiền ít nhất phải trả. Ví dụ: BUS.INP 5 ______________________________________ |12| 19| 31| 40| 61| 65| 69| 79| 90| BUS.OUT 50 giúp giải bài này với mọi ngư

Các câu hỏi liên quan

ĐỀ 1 I.Choose the word whose underlined part is pronounced differently from that of the other 1. A. sandwich B. fat C. gram D. want 2. A. soda B. carrot C. kilo D. potato 3. A. cake B. cabbage C. lake D. face 4. A. danger B. range C. glass D. change 5. A. kite B. pastime C. idea D. citadel 6. A shoulder B. south C. round D. housework 7 A. nose B. color C. mother D. Monday 8 A. tea B weak C. breakfast D. cream II. Multiple choice 1) Miss Hoa has __________ hair. a. black long b. long black c. a long black d. oval black 2) Is there _________ milk for lunch? – Yes, there is. a. any b. some c. a d. an 3) _________ is my favorite drink. a. Bread b. Oranges c. Onions d. Orange juice 4) __________ do you go to the zoo? – I never go to the zoo. a. How long b. How often c. How many d. How much 5) They ____________ late for school. a. never go b. are never c. never are d. don‟t go 6) What ’s the ___________ like in the spring? – It‟s warm. a. weather b. summer c. season d. flower 7) My sister and I __________ my homework at the moment. a. do b. am doing c. are doing d. is doing 8) How often does Phong go to the movies? - _____________________. a. Twice a week b. Yes, he does. c. No, he doesn‟t d. One a week 9) We are going to stay ________ a hotel. a. at b. for c. on d. in 10) 45. Let’s __________ to the movies. a. go b. going c. play d. to go 11) - What are we going to do this weekend? ___________ having a picnic? a. let’s b. let’s go c. why don’t we d. what about III. Supply the correct form of verbs 1. What time ……………… you (go) ………………….. to school? 2. Lan ( watch ) ……………………….. T.V three times a week. 3. Nam & Ba often ( go) ………………………. fishing on Sunday. 4. We ( not go) ………………………… to school on Sunday. 5. My brother likes jogging. He ( jog) ……………………… every morning. At the moment, he ( jog)……………………….. in the park. 6. What is she doing ? -She (cook )………………………… lunch. 7 .I often ( play) ………………. soccer with my friends after school. 8 .Nga (visit) …………………………………… Hue next week. 9.They ( do ) …………………………………….. their homework tonight. 10.Nam (visit ) ………………………………… Hue this summer vacation. IV. Match the question in column A with the right answer in column B A B 1. What weather does she like? a. I go swimming 2. How often do you read? b. She is cooking dinner. 3. What is the weather like in the spring? c. She likes warm weather. 4. What is she doing? d. Good idea. 5. How do you go to school? e. No, he doesn‟t. 6. Is it cold in the winter? f. I‟m going to visit Hue. 7. What do you do when it‟s hot? g. Yes, it is. 8. Why don‟t we go to the beach? h. Three times a week. 9. Does your father play volleyball? i. I walk to school. 10.What are you going to do this summer vacation? j. It‟s warm in the spring. V. Reading Mr Hung is an engineer. He works in Da Lat. Every morning, he gets up at five o‟clock. He has some noodles for breakfast.Then he drinks a glass of orange juice. At 6.30, he goes to work by car. He has lunch at a restaurant near his factory. He finishes his work at 4.30. He goes home and has dinner with his family. In the evening, he watches television and read. Questions: a. What does Mr Hung do?............................................ b. Where does he work?. ........................................................ c. Does he eat rice for breakfast?. ................................... d. How does he go to work?........................................................................................ e. Where does he have lunch?..................................................................................... f. Does he have dinner at a foodstall?. ......................................................................... g. What does he do in the evening?. ............................ h. Does he listen to music in his free time?. .........

1) Tom, ____ sits next to me, is from Canada. A. that B. whom C. who D. whose 2) The volunteers, ____ enthusiasm was obvious, finished the work quickly. A. who B. whom C. whose D. that 3) Many scientists have claimed that ____ like music are often good at mathematics. A. children B. children who C. children whom D. whose children 4) My friend, ____ I visited last week, is taking a holiday soon. A. that B. whom C. which D. whose 5) The doctor re examining a patient ____ was taken to hospital last night. A. which B. who C. whom D. whose 6) A pacifist is a person ____ believes that all wars are wrong. A. who B. whose C. whom D. which 7) My friend, ____ hated horror film, refused to go to the cinema with me. A. whom B. which C. whose D. who READING Read the passage carefully and choose the correct answer. Between the Revolutionary period and the World War I, the United States post office was set out to improve transportation of the post office mails. From those early days to the present, the post office has helped develop and subsidize every new mode transportation in the United States. Transportation has been the most important element in mail delivery. Even when the general public had still suspected of the security of a new means of transportation, the post office experimented with inventions that offered potential for moving the mail faster, occasionally suffering embarrassment, ridicule, or even abuse in the process. As mail delivery evolved from foot to horseback, stagecoach, steamboat, railroad, automobile, and airplane, with intermediate and overlapping use of balloons, and helicopters, post office mail contracts ensured the income necessary to build the great highways, rail lines, and airways that eventually spanned the continent. By the turn of the 19th century, the U.S. Post Office had purchased a number of stagecoaches for operation on the nation’s better post roads – a post road being any road on which the mail travels – and continued to encourage new designs to improve passenger comfort and carry mail safely. 8) The passage is about ____. A. transportation of the Post Office in the US B. the Post Office in the Revolutionary period C. the Post Office in the World War I D. transportation and public ideas 9) According to the passage, the main purpose of the Post Office is ____ A. to develop transportation B. to apply new mean of transportation C. to deliver mail as safely and fast as possible D. to subsidize every new mode of transportation 10) Which means of transportation used in the Post Office is NOT referred in the passage? A. train B. car C. plane D. motorcycle 11) The Post Office ____. A. has never used helicopters in delivery D. makes no contribution to build roads B. contributes income to build highways, railroads, and airways C. has never been the first to use a new means of transportation WRITING Choose the underlined part among A, B, C or D that needs correcting. 12) The waiter whom served us yesterday was polite and friendly. A B C D 13) This class is only for people who’s first language is not Chinese. A B C D 14) The man with who I spoke in the meeting used to work here. A B C D 15) He is moving to Lang Son city, that is in the north-east of Viet Nam. A B C D 35) She asked me if I knew whom had got the job. A B C D