Автор: | A. Klenin | Ограничение времени: | 1 сек | |
Входной файл: | input.txt | Ограничение памяти: | 256 Мб | |
Выходной файл: | output.txt |
Прямоугольная область со сторонами, параллельными осям координат, представлена координатами двух противоположных углов (x1, y1) и (x2, y2).
Ваша программа должна, находить ближайшую к данной прямоугольной области координатную ось.
Входной файл содержит четыре целых числа x1 y1 x2 y2 — координаты углов области.
Выходной файл должен содержать единственную строку:
−109 ≤ x1, y1, x2, y2 ≤ 109
№ | Входной файл (input.txt ) |
Выходной файл (output.txt ) |
---|---|---|
1 |
|
|
2 |
|
|
3 |
|
|
Author: | A. Klenin | Time limit: | 1 sec | |
Input file: | input.txt | Memory limit: | 256 Mb | |
Output file: | output.txt |
Young programmer Vasya decided to learn microprocessor design. As a first step, he designed a processor with a single integer register with initial value 0, and two instructions:
Vasya's friend Petya suggested to modify a design so that after executing jump instruction processor would replace it with a special 'no-op' instruction which does nothing.
Now, Vasya's microprocessor could do something at least a little bit interesting. Vasya wants to write an emulator to explore the possibilities.
Your program must output a value in the register after the execution of a given program for Vasya's microprocessor.
The input file contains a single string consisting of letters i and j — a program.
Output file must contain single integer — value in the register.
Program length is between 1 and 105 characters.
No. | Input file (input.txt ) |
Output file (output.txt ) |
---|---|---|
1 |
|
|
2 |
|
|
3 |
|
|
Author: | A. Klenin | Time limit: | 1 sec | |
Input file: | input.txt | Memory limit: | 256 Mb | |
Output file: | output.txt |
Young programmer Vasya works for a local government.
His first job is to automate filling of paper forms. A form is represented by a single string consisting of Latin letters, spaces and underscores ('_', ASCII 95). Substrings of underscores (known as fields) represent blank spaces left for an applicant to fill. Under each field the paper form has a small caption explaining to the applicant what data he should put over those underscores. For example:
My name is ________ nameIn computerized form, captions are represented by a single string of spaces and Latin letters. Every caption is a single word. Number of captions is guaranteed to be equal to the number of fields. However, number of spaces between captions may be arbitrary, so captions are not necessarily located directly under corresponding fields.
You program must, given the representation of a form and a value for each field caption, put corresponding value into every form field.
When filling a field with a value, additional rules must be observed:
First line of input file contains a string representing the form. Second line contains field captions. Third line contains an integer N — number of different captions. Following 2 × N lines contain N pairs of captions and corresponding values. Captions consist of Latin letters only. Values consist of Latin letters and spaces. All captions are different. Note that several fields may have the same caption.
Output file must contain a single line — a form with all fields filled in. It is guaranteed that values for all captions are present in the input. Note that spaces in the form are significant and must be preserved.
All strings have length from 1 to 1000 characters. All fields consist of at least 3 underscores. 0 ≤ N ≤ 100
No. | Input file (input.txt ) |
Output file (output.txt ) |
---|---|---|
1 |
|
|
2 |
|
|