codeforces-scrape

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

322B.md (1163B)


      1 Source: https://codeforces.com/problemset/problem/322/B
      2 
      3 B. Ciel and Flowers
      4 
      5 time limit per test
      6 
      7 1 second
      8 
      9 memory limit per test
     10 
     11 256 megabytes
     12 
     13 input
     14 
     15 stdin
     16 
     17 output
     18 
     19 stdout
     20 
     21 Fox Ciel has some flowers: *r* red flowers, *g* green flowers and *b* blue flowers. She wants to use these flowers to make several bouquets. There are 4 types of bouquets:
     22 
     23 * To make a "red bouquet", it needs 3 red flowers.
     24 * To make a "green bouquet", it needs 3 green flowers.
     25 * To make a "blue bouquet", it needs 3 blue flowers.
     26 * To make a "mixing bouquet", it needs 1 red, 1 green and 1 blue flower.
     27 
     28 Help Fox Ciel to find the maximal number of bouquets she can make.
     29 
     30 Input
     31 
     32 The first line contains three integers *r*, *g* and *b* (0 ≤ *r*, *g*, *b* ≤ 109) — the number of red, green and blue flowers.
     33 
     34 Output
     35 
     36 Print the maximal number of bouquets Fox Ciel can make.
     37 
     38 Examples
     39 
     40 Input
     41 
     42 ```
     43 3 6 9
     44 ```
     45 
     46 Output
     47 
     48 ```
     49 6
     50 ```
     51 
     52 Input
     53 
     54 ```
     55 4 4 4
     56 ```
     57 
     58 Output
     59 
     60 ```
     61 4
     62 ```
     63 
     64 Input
     65 
     66 ```
     67 0 0 0
     68 ```
     69 
     70 Output
     71 
     72 ```
     73 0
     74 ```
     75 
     76 Note
     77 
     78 In test case 1, we can make 1 red bouquet, 2 green bouquets and 3 blue bouquets.
     79 
     80 In test case 2, we can make 1 red, 1 green, 1 blue and 1 mixing bouquet.