Writing the Ruby Code
Write the Ruby code that as input data accepts a mass of three numbers (full numbers). The code must change these numbers so that they meet the following requirements:
1 . Each number should be divided into three.
2nd The sum of all three numbers should be as much as possible.
Changing a number means increasing (reduction is not permitted) any of its numbers. Increasing a number per unit means one change, that is, increasing a number by five means five changes. A total of six changes can be made for all three numbers.
For example:
1 . [110, 222, 3333] can be changed to [111, 222, 3333] - this is one change
2nd [111, 222, 33] can be replaced by [114, 333, 33] - here we have six changes
You can distribute the changes between the numbers at your own discretion. Number 9 cannot be changed.
Examples of decision
Input: [784, 4765, 5291]
Published by: [984, 6765, 6291]
Client's review of cooperation with Taras Mosiienko
Writing the Ruby CodeIt was pleasant to work with such a professional, all clearly and affordably scheduled, work on 5+, I recommend
Freelancer's review of cooperation with Arslan Myratdurdyyev
Writing the Ruby CodeEverything was good and correct.
-
759 4 0 I will be glad to help. The algorithm is clear. Yes, I understood, maximum 6 changes - guarantee the solvency of the task.
-
Либо количество изменений ограничено (и должно подаваться на вход), либо ответом будут все 9. Условие не полное?
-
Current freelance projects in the category Web Programming
Creation or adjustment of a website on OpenCartHello everyone! Preliminary situation for understanding: I ordered the development of a website from Templatemonsters. I agreed on the technical specifications in advance and purchased a template from them. In the end, the deadlines were not met, and they wrote that they could… Web Programming, Online Stores & E-commerce ∙ 2 hours 37 minutes back ∙ 8 proposals |
Development of an AI mobile application for children's fairy talesLooking for an experienced developer or team to create a mobile application with artificial intelligence that will generate short, kind, and age-appropriate fairy tales for children. A simple, beautiful, and safe product where a parent can create a personal bedtime story for… AI & Machine Learning, Web Programming ∙ 3 hours 40 minutes back ∙ 19 proposals |
Betting needs to create a bookmaker! WITH EXPERIENCEIt is necessary to develop a betting platform / bookmaker product based on a ready-made template. The main task is to adapt the template for a full-fledged bookmaker office: connect parsing of sports events and odds, implement a user personal account, balance, bets, transaction… Python, Web Programming ∙ 3 hours 46 minutes back ∙ 16 proposals |
Translator for WordPress.Need to translate a WordPress site with WooCommerce into 30 languages. A plugin for convenient automatic translation. To avoid clicking through each page for translations and each product. To make exceptions for certain phrases. To be able to edit the translation. Automatic… Web Programming, Website Development ∙ 4 hours 16 minutes back ∙ 13 proposals |
Edits for the website on OpencartThe site veselkatm.com.ua on OpenCart Version 3.0.3.8 1) Complete the cart Implement delivery methods: - Ukrposhta - Nova Poshta Install and configure modules so that everything works correctly Implement payment methods: - Cash on delivery - Bank transfer - Card payment… Content Management Systems, Web Programming ∙ 7 hours 15 minutes back ∙ 39 proposals |