若是凉夜已成梦

青春里 总有些事情要努力去做 总有些梦想要拼命去追。


  • 运维

  • 前端

  • 编程

  • 随笔

  • hust-oj

1584: Star

发表于 2017-10-06   |   分类于 HUSTOJ   |   阅读次数 1,253

题目描述

A board contains 48 triangular cells. In each cell is written a digit in a range from 0 through 9. Every cell belongs to two or three lines. These lines are marked by letters from A through L. See the figure below, where the cell containing digit 9 belongs to lines D, G, and I and the cell containing digit 7 belongs to lines B and I.

For each line, we can measure the largest digit on the line. Here the largest digit for line A is 5, B is 7, E is 6, H is 0, and J is 8.

Write a program that reads the largest digit for all 12 of the depicted lines and computes the smallest and the largest possible sums of all digits on the board.

输入

Every line in the input contains 12 digits, each separated by a space. The first of these digits describes the largest digit in line A, the second in line B, and so on, until the last digit denotes the largest one in line L.

输出

For each input line, print the value of the smallest and largest sums of digits possible for the given board. These two values should appear on the same line and be separated by exactly one space. If there does not exists a solution, your program must output “NO SOLUTION''.

样例输入

5 7 8 9 6 1 9 0 9 8 4 6


样例输出

40 172

参考代码

暂无

解析

暂无

hustoj

发表评论 取消回复

电子邮件地址不会被公开。 必填项已用*标注

*
*


hoxis wechat
著作权归作者所有
站点更新说明
  • 文章目录
  • 站点概览
若是凉夜已成梦

若是凉夜已成梦

青春里 总有些事情要努力去做 总有些梦想要拼命去追。

1904 日志
6 分类
12 标签
RSS
weibo github twitter facebook

友情链接

Skip Dreams孤独患者 原站点
© 2017 若是凉夜已成梦
Powered by WordPress | 已运行
Theme By NexT.Mist