codeforces-scrape

Codeforces scraped problems and editorials
git clone git://git.laack.co/codeforces-scrape.git
Log | Files | Refs | README

2038L.md (2129B)


      1 Source: https://codeforces.com/problemset/problem/2038/L
      2 
      3 L. Bridge Renovation
      4 
      5 time limit per test
      6 
      7 2 seconds
      8 
      9 memory limit per test
     10 
     11 512 megabytes
     12 
     13 input
     14 
     15 standard input
     16 
     17 output
     18 
     19 standard output
     20 
     21 Recently, Monocarp started working as a director of a park located near his house. The park is quite large, so it even has a small river splitting it into several zones. Several bridges are built across this river. Three of these bridges are especially old and need to be repaired.
     22 
     23 All three bridges have the same length but differ in width. Their widths are $18$, $21$ and $25$ units, respectively.
     24 
     25 During the park renovation process, Monocarp has to replace the old planks that served as the surface of the bridges with the new ones.
     26 
     27  ![](https://espresso.codeforces.com/2a053b0325255193bac54993a1b09d9278355079.png) 
     28 
     29 Planks are sold with a standard length of $60$ units. Monocarp already knows that he needs $n$ planks for each bridge. But since the bridges have different widths, he needs $n$ planks of length $18$ for the first bridge, $n$ planks of length $21$ for the second one, and $n$ planks of length $25$ for the last one.
     30 
     31 Workers in charge of renovation have no problem with cutting planks into parts but refuse to join planks, since it creates weak spots and looks ugly.
     32 
     33 Monocarp wants to buy as few planks as possible but struggles to calculate the required number of planks. Can you help him?
     34 
     35 Input
     36 
     37 The first and only line contains a single integer $n$ ($1 \le n \le 1000$) — the number of planks required for each of the three bridges.
     38 
     39 Output
     40 
     41 Print a single integer — the minimum number of planks of standard length ($60$ units) Monocarp needs to cover all three bridges if the planks can be cut into parts.
     42 
     43 Examples
     44 
     45 Input
     46 
     47 ```
     48 1
     49 ```
     50 
     51 Output
     52 
     53 ```
     54 2
     55 ```
     56 
     57 Input
     58 
     59 ```
     60 3
     61 ```
     62 
     63 Output
     64 
     65 ```
     66 4
     67 ```
     68 
     69 Input
     70 
     71 ```
     72 1000
     73 ```
     74 
     75 Output
     76 
     77 ```
     78 1167
     79 ```
     80 
     81 Note
     82 
     83 In the first example, it is possible to cut one plank of length $60$ into three planks with lengths $25$, $18$ and $17$, and cut another plank of length $60$ into two planks with lengths $39$ and $21$. That way, Monocarp will have all the required planks.