当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

1668:Taxation With Representation Overdone

题目描述
In the land of Kalii lived a civilization not unlike our own. They had government, business, and technology. The only major difference was how tax rates were decided. You see, the people of Kalii loved to haggle. They haggled over everything including what percentage of their income went to the government coffers.When a Kalii family's tax contract was up they had to travel to the capital to haggle with government officals and hammer out a new deal. The contract would have a start date, an end date (for bookkeeping purposes the end day was always the 15th of the end month), and a tax rate. It was also traditional for a Kalii family to enjoy a short time period of tax free living between the end of their last contract and the start of the new one. This time period was a point to haggle over as well.
The land of Kalii was prosperous and very populous and, as a consequence, government officials were often overwhelmed with work. When a deal was agreed upon with a family, the officials would quickly write it down in shorthand and send it off to be processed. These scribbled notes had to be converted to XML format to be entered into their computer system. Sometimes the scribble was inconclusive and the family would have to be recalled to the capital for another round of haggling. This entire process was very inefficient but it was the way the people of Kalii had always done it and they were not about to change anytime soon.
Your job is to convert the scribblings of the officials into XML format.
输入解释
Input consists of multiple datasets, one per line. Each correct line contains three pieces of information:
1. Tax rate
- A tax rate always has a '%' after it if it is a whole number (i.e. 5%).
- A tax rate never has a decimal point in it.
- A tax rate may contain a fraction but its denominator must only be a 2, 4, or 8.
- A tax rate must have a numerator that is less than its denominator.
2. Contract End Date
- A contract end date is a numerical representation of the month (one or two digits) and the last two digits of the year. The month and year may be separated by a single hyphen (i.e. 12-05 or 1205 would refer to 15DEC05).
3. Contract Start Date
- A contract start date is a numerical representation of the month (one or two digits) and a two -digit day of the month. The month and day may be separated by a single hyphen (i.e. 12-05 or 1205 would refer to 05DEC03).
- A contract start date must start on or after the current date. For example, the cur rent year is 2003. If the start date is 305 it is assumed that the year the contract starts will be 2004.
Note: There may be 0 or more spaces between each of the three fields.
Note: The Kalii calendar consists of the twelve months familiar to you, but all months have 31 days.
Note: The maximum tax rate is 99.875%
输出解释
For each data set, print the correctly indented XML (4 spaces per indent level):
<Kalii Index=N>

<startdate>(start date)</startdate>
<rate>(tax rate)</rate>
<enddate>(end date)</enddate>
</Kalii>

N should be replaced by the data set number, (start date) by the start date, (tax rate) by the tax rate, and (end date) by the end date. If no output could be computed because of either bad or ambiguous data, simply print <Kalii Index=N >BAD INPUT</Kalii>, where N should be replaced by the data set number.
Note: The format for the start date is DDMMMYY. The format for the end date is 15MMMYY. Where DD is the zero-padded day of month (01-31), MMM is the month in upper-case letters (JAN, FEB, MAR, APR, MAY,JUN, JUL, AUG, SEP, OCT, NOV, DEC), and YY is the zero-padded last 2 digits of the year (00-99).
Note: The tax rate should be accurate to 3 decimal places.
输入样例
25/850812-31
6% 02110122
6.75% 2-11 4-23
输出样例

    31DEC03
    2.625
    15MAY08


    22JAN04
    6.000
    15FEB11

BAD DATA

该题目是Virtual Judge题目,来自 北京大学POJ

题目来源 Greater New York 2003

源链接: POJ-1668

最后修改于 2020-10-29T06:10:31+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
1000 10000