Call a rectangular parallelepiped in 3-space a regular box
if its edges are parallel to the coordi-
nate axes. A regular box can be specified by giving the coordinates of the two points at the
ends of one main diagonal (a diagonal that does not lie within any face).
In this problem, you will be given some regular boxes and some points, about which you willcompile some information.
regular boxes and M
An integer N
, representing the number of regular boxes subsequently
Six integers per line, the x
coordinates of one point, followed bythe x
coordinates of a second point, these points specifying a reg-ular box.
An integer M
, representing the number of points subsequently specified.
Next (final) M
lines Three integers per line, the x
coordinates of a point.
All numbers within a line will be separated by a single space, and there will be no spaces afterthe last number in a line. All the coordinates given will be between –30,000 and 30,000, eachbox will have positive volume, and there will be no duplicate boxes or duplicate points speci-fied.
In the output specifications, the words point(s)
refer to the points and regular
boxes specified in the input.
Reports statistics about the relationships between the points and the boxes, as follows:
The greatest number of points lying within a single box.
The greatest number of boxes within which a single point lies.
The number of boxes that contain no point.
The number of points that lie within no box.
Your output should contain numbers only, without explanatory words or space characters. You
should consider a point lying on a face or edge of a box not
to be contained within that box.
20 0 0 9 9 9-1 2 4 5 -3 1132 2 20 1 90 0 0
A text file contains location information about international phone numbers. Each piece ofinformation in the file spans two consecutive lines, a CODE line (maximum length 6 charac-ters) and a NAME line (maximum length 20 characters). Here’s an example.
Using this file, the location of an international phone number can be found. The location of an
international phone number is the NAME that follows the longest
CODE in the file that is a pre-
fix of the phone number. Note that more than one CODE in the file can be a prefix of a given
number, such as is the case with the codes 33 and 331 here.
Using the above example, we would identify 349875750 to be in the Canary Islands,3387657462 in France, 3314534383 in Paris, etc.
An integer N
, representing the number of CODE, NAME pairs to follow. This
number will not exceed 200.
Lines 2 to 2N
CODE, NAME pairs as described above
An integer M
, representing the number of phone numbers you must look
up. This number will not exceed 10.
Phone numbers for which you must find locations.
locations of the phone numbers in the last M
lines of the input file,
in the same order as the numbers appeared. You may not
assume that the
location of each number can be found in the input file. If, for some phone
number, there is no prefix of the number as a CODE, put UNKNOWN as thelocation in your output.
Curez-R-Us pharmacy uses many informational or warning labels on the medications it dis-penses, such as “Take with food”, and “May cause drowsiness”. To keep track of which labelsshould be used with which medications, Curez-R-Us maintains a text file. Each line of the fileis 94 characters long. The first 55 characters of each line contain information about the medi-cation, and the remaining 39 characters hold up to 13 three-lefter codes for the labels that mustbe affixed when that medication is dispensed. Specifically, the format of a line in this file is asfollows:
The Curez-R-Us unique 5-character identifier for the medication
The brand name for the medication, right-padded with spaces
The generic name for the medication, right-padded with spaces
Thirteen three-character fields, each containing either three blanks or athree-digit label code. If a medication requires N labels, then the codesfor these labels fill the N leftmost label code fields.
No medication currently requires more than thirteen informational or warning labels.
Although Curez-R-Us recently celebrated 27 years of faultless labeling, a database engineerhas informed the pharmacy that it should reorganize the way in which its information is stored,and the pharmacy has reluctantly agreed to allow the engineer to modify its file. The engineersays that the information should be stored as follows:
First part of the file [Medications]:
A sequence of 55-character lines, the first 55 characters of each line of the original file.
Second part of the file [What label goes where?]:
A sequence of 8-character lines, each containing a 5-character medication code xxxxx fol-lowed by a three-digit label code yyy, whenever yyy specifies a required label for medicationxxxxx.
A file in the current Piliz-R-Us format.
A file in the proposed Pillz-R-Us format providing the same information. Within each part ofthe output file, the lines may be in any order.
[each line is right-padded with spaces to a length of 94 characters]:HX87APaxil Paroxetine 132439980
[The first three lines are padded with spaces to a length of 55 characters]:HX87APaxil Paroxetine
We create a cryptogram of some text if we replace each occurence of the letter A by one letterof the alphabet, each occurence of the letter B by some other letter of the alphabet, and so on.
For example, one cryptogram of “TO BE OR NOT TO BE” is “ZX OI XR AXZ ZX OI”.
Another cryptogram of the same phrase is “AB CD BE FBA AB CD”. More precisely, acryptogram of some text is the result of applying a function f
to each letter of the text, where f
is a one-to-one function with domain and range the 26 letters of the (English) alphabet. Let uscall two words “cryptoquivalent” if one is a cryptogram of the other. For example, the wordsmoon and iffy are cryptoquivalent, as are space and any five-letter word with distinct let-ters. The words all and cat, however, are not cryptoquivalent.
The object of this problem is to find the groups of cryptoquivalent words in a text.
Text containing words separated by single spaces or carriage returns, using only upper caseEnglish letters.
The same words, organized by placing cryptoquivalent words on the same line of output. Thelines of output may be in any order, but the words within a line must appear in the order inwhich they appear in the input. Each word should appear in the output exactly as many timesas it appears in the input. Your output should have no extra lines or spaces.
FOUR SCORE AND SEVEN YEARS AGO OUR FATHERS BROUGHT FORTH UNTO THIS CONTINENT
YABBA DABBA DABBA DOO SAID FRED AND ALL WAS WELL AFTER THAT
For this problem, we will number the fractions strictly between zero and one precisely as fol-lows:
1. 1/22. 1/33. 2/34. 1/45. 2/46. 3/47. 1/58. 2/59. 3/510. 4/611. 1/612. 2/613. 3/614. 4/6
and so on, the “halves” first, then the “thirds,” the “fourths,” and so on. Each fraction appearsin all of its equivalent forms (like 2/3, 4/6, 6/9, .).
Your job is to add two fractions given by their positions in this list, giving as your answer theposition of their sum in lowest terms. You may assume that the input values will correspond tofractions with denominators less than 100, and you may also assume that their sum will appearin this list.
Two integers on the same line, representing the positions of two fractions in this list.
One integer, the position in this list of the sum of the two fractions in lowest terms.
Many markup languages are in use for text formatting today, among them HTML and TEX. A
markup language provides a way to define formatted text in a readable ASCII file using tags
or codes, to denote formatting. In this problem, assume that our markup language, ACMML,
uses tags in pairs, of the form <XXX+> and <XXX>, in that order, to surround text. When these
tags surround text, they represent text formatted with whatever aftribute XXX indicates. For
example, if BOL indicates bold and ITA indicates italic, the ACMML source text
This is how ACMMLencodes <BOL+>bol<ITA+>d<BOL> a<ITA>nd <ITA+>italic<ITA> text.
This is how ACMML
and italic text.
The same formatted text can also be represented by this longer ACMML source text:
This is how ACM<BOL+><BOL>MLencodes <BOL+>bol<ITA+>d<ITA><ITA+><BOL> a<ITA>nd <ITA+><ITA+>ita<ITA>lic<ITA> text.
You will need to write a program to optimize ACMML source text.
ACMML source text defining some formatted text.
ACMML source text defining the same formatted text, but containing the smallest possiblenumber of pairs of tags.
The codes (XXX above) within the tags are always three-letter sequences.
The characters < and > appear in the input only as parts of tags. Those two characterscannot appear in formatted text.
Format aftributes do
modify white space, so that, for example, the source text
do not define the same formatted text.
This is how ACM<BOL+><MXY+><BOL><MXY>MLencodes <BOL+>bol<ITA+>d<ITA><ITA+><BOL> a<ITA>nd <ITA+><ITA+>ita<ITA>lic<ITA> text.
This is how ACMMLencodes <BOL+>bol<ITA+>d<BOL> a<ITA>nd <ITA+>italic<ITA> text.
Define a merge
of two strings to be any string formed from all the characters in both strings,interspersed, but in their original order. For example, for the strings chocolate
is a merge, but chocochilatspe
are not. This problem requires writinga program that can tell if a given string is a merge of two other given strings. For the purposesof this problem, the input strings will contain only lowercase alphabetic characters.
The input file consists of three strings A
, and C
, in that order, one string per line. The filecontains no blank lines, and the end of the input is marked by the end of the file. The strings A
will not exceed 1000 characters, and C
will not exceed 2000 characters (rest assured thatinput cases of this length will
is not a merge of A
, write a single line to the output file that reads “*** NOT AMERGE ***”. If C
is a merge, write to the output file the string C
rewriften with the charac-ters from A
in uppercase. If more than one merge is possible, string C
should be wriften witheach character of A
occurring as early as possible (examine the sample input below for suchexamples).
: You may contact the author of this problem at the following address: email@example.com
Input File 1
Output File 1
Input File 2
Output File 2
Input File 3
Output File 3
SUBSTITUTES APPENDIX A OF THE OMAC 1999 OLYMPIC MOVEMENT ANTI-DOPING CODE APPENDIX A PROHIBITED CLASSES OF SUBSTANCES AND PROHIBITED METHODS 2001-2002 1 September 2001 PROHIBITED CLASSES OF SUBSTANCES A. Stimulants Prohibited substances in class (A) include the following examples: amineptine, amiphenazole, amphetamines, bromantan, caffeine*, carphedon, cocai
Intrauterine Device and Adolescents Committee on ABSTRACT: The intrauterine device (IUD) is highly effective and widely used by Adolescent Health women throughout the world. Data support the safety of IUDs for most women, includ-ing adolescents. This document addresses the major benefits of IUD use in adolescents,a population at particular risk of unintended pregnancy. The committee