编程介的小学生 2017-08-15 14:22 采纳率: 20.5%
浏览 931
已采纳

Company

Description

company pays different hourly wages for different job types. Each week the company keeps evidence of the total number of work hours for every job type and the total amount paid to all employees for that week. In different weeks different job types can be accomplished. The hourly wage for any job type in the same company remains unchanged. The hourly wage for any job type is a positive integer and the ratio between the maximum wage and the minimum wage is less than 6.

You are asked to write a program that computes the hourly wage for every job type using the data collected a period of time (one or several weeks). The number of job types is limited to 200 and the number of weeks in one data set is limited to 50.
Input

The input contains several data sets in text format.

The format for the data set is:

The number of lines for the data set;
information_for__one_or_more_weeks
The format of the information for a week is the following:
job_type1 number_of _hours1
job_type2 number_of _hours2
job_type3 number_of _hours3
... ...
. total_paid ( the dot marks the ending of info for a week)

The job type is represented as a string of characters (limited to 20). The number of hours is a positive integer (smaller than 1E5). The total paid is a positive integer (smaller than 2E10).
Output

The program should write to standard output (for every job type involved in the data set) a line containing the job type and the hourly wage. The output for a data set ends with a line containing a dot.

If the program cannot compute a unique hourly wage for every job type it will print "Incomplete data" and if it cannot compute an integer hourly wage it will print "Inconsistent data"

An example is given in the following:
Sample Input

5
job1 6
job2 5
job8 4
job10 3
. 100
13
job3 1
job2 2
. 40
job1 3
job2 1
. 100
job1 1
job3 2
job2 3
. 100
job1 1
job2 5
. 80
Sample Output

Incomplete data
.
job3 20
job2 10
job1 30
.

  • 写回答

1条回答 默认 最新

报告相同问题?

悬赏问题

  • ¥15 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题
  • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
  • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
  • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站
  • ¥50 成都蓉城足球俱乐部小程序抢票
  • ¥15 yolov7训练自己的数据集
  • ¥15 esp8266与51单片机连接问题(标签-单片机|关键词-串口)(相关搜索:51单片机|单片机|测试代码)
  • ¥15 电力市场出清matlab yalmip kkt 双层优化问题
  • ¥30 ros小车路径规划实现不了,如何解决?(操作系统-ubuntu)