COCI 2008/2009 Contest #4, 17 th January 2009 TASK MJEHURIC DATUM ROT SLIKAR TREZOR PERIODNI

Similar documents
TASK OKUPLJANJE USPON RAZINE ABECEDA STEP VODA. uspon.pas uspon.c uspon.cpp. razine.pas razine.c razine.cpp

COCI 2008/2009 Contest #3, 13 th December 2008 TASK PET KEMIJA CROSS MATRICA BST NAJKRACI

UNC Charlotte 2012 Comprehensive

Basil wants to paint the word KANGAROO. He paints one letter each day. He starts on Wednesday. On what day will he paint the last letter?

COCI 2008/2009 Contest #2, 15 th November 2008 TASK KORNISLAV RESETO PERKET SVADA SETNJA CAVLI

CROATIAN OPEN COMPETITION IN INFORMATICS. 4th round

3. Create a rectangle that is 10mm W by 4mm H and place it in the middle of the big rectangle on the edge like this:

1. Eighty percent of eighty percent of a number is 144. What is the 1. number? 2. How many diagonals does a regular pentagon have? 2.

TASK FUNGHI ZMIJA TRAKTOR ZGODAN JABUKE DIVLJAK. standard input (stdio) standard output (stdout)

COCI 2008/2009 Contest #6, 7 th March 2009 TASK BUKA BAZEN NERED CUSKIJA DOSTAVA SLICICE

TASK NOP CIJEVI ROBOTI RELJEF. standard output

USA AMC Let ABC = 24 and ABD = 20. What is the smallest possible degree measure for CBD? (A) 0 (B) 2 (C) 4 (D) 6 (E) 12

TASK ŠEĆER KOLO GITARA POŠTAR KUGLICE UPIT. kolo.pas kolo.c kolo.cpp. gitara.pas gitara.c gitara.cpp

2015 ACM ICPC Southeast USA Regional Programming Contest. Division 1

(A) $2.53 (B) $5.06 (C) $6.24 (D) $7.42 (E) $8.77

Croatian Open Competition in Informatics, contest 5 February 23, 2008

ProCo 2017 Advanced Division Round 1

4. The terms of a sequence of positive integers satisfy an+3 = an+2(an+1 + an), for n = 1, 2, 3,... If a6 = 8820, what is a7?

Problems translated from Croatian by: Paula Gombar

1. How many diagonals does a regular pentagon have? A diagonal is a 1. diagonals line segment that joins two non-adjacent vertices.

PA3 Part 2: BLM List. Workbook 3 - Patterns & Algebra, Part 2 1 BLACKLINE MASTERS

2013 ACM ICPC Southeast USA Regional Programming Contest. 2 November, Division 1

A = 5; B = 4; C = 3; B = 2; E = 1; F = 26; G = 25; H = 24;.; Y = 7; Z = 6 D

Do not duplicate or distribute without written permission from CMKC!

MATHEMATICS LEVEL 5 6 (Ε - ΣΤ Δημοτικού)

KÄNGURU DER MATHEMATIK

Taiwan International Mathematics Competition 2012 (TAIMC 2012)

(A) $2.53 (B) $5.06 (C) $6.24 (D) $7.42 (E) $8.77

The fraction 2 is read two thirds. Model each fraction shown in problems 1 and 2. Then draw a picture of each fraction.

SECTION ONE - (3 points problems)

HIGH SCHOOL MATHEMATICS CONTEST Sponsored by THE MATHEMATICS DEPARTMENT of WESTERN CAROLINA UNIVERSITY. LEVEL I TEST March 23, 2017

GROUP ROUND INSTRUCTIONS

Sixth Grade Test - Excellence in Mathematics Contest 2012

Part A (C) What is the remainder when is divided by 11? (A) 0 (B) 1 (C) 3 (D) 7 (E) 10 (A) 35 (B) 40 (C) 45 (D) 50 (E) 55

6 th Grade Exam Scoring Format: 3 points per correct response -1 each wrong response 0 for blank answers

Name: Section: Tuesday January 17 th 10.6 (1 page) Wednesday January 18 th 10.7 (1 page) Thursday January 19 th Chapter 10 Study Guide (2 pages)

Pre-Algebra. Do not open this test booklet until you have been advised to do so by the test proctor.

GRADE 1 SUPPLEMENT. December Calendar Pattern C4.1

COCI 2008/2009 Contest #5, 7 th February 2009 TASK LJESNJAK JABUKA JAGODA LUBENICA TRESNJA KRUSKA

Daniel Plotnick. November 5 th, 2017 Mock (Practice) AMC 8 Welcome!

Games with Sequential Moves. Games Of Strategy Chapter 3 Dixit, Skeath, and Reiley

UK SENIOR MATHEMATICAL CHALLENGE

The Sixth Annual West Windsor-Plainsboro Mathematics Tournament

56th UNSW School Mathematics Competition

Exploring Concepts with Cubes. A resource book

Individual Test - Grade 5

FRI Summer School Final Contest. A. Flipping Game

COCI 2008/2009 Contest #1, 18 th October 2008 TASK SKOCIMIS PTICE MRAVOJED JEZ SKAKAVAC KRTICA

7 th Grade Exam Scoring Format: 3 points per correct response -1 each wrong response 0 for blank answers

Patterns and Sequences

KENDRIYA VIDYALAYA SANGATHAN, HYDERABAD REGION

Winter Quarter Competition

The London Independent Girls Schools Consortium. Group 1. Mathematics Entrance Examination

Dragnet Abstract Test 4 Solution Booklet

APMOPS MOCK Test questions, 2 hours. No calculators used.

NATIONAL TALENT SEARCH EXAMINATION-2017, NTSE STAGE-II

(C) 7 (D) 15 2 (D) 3 5 (C) 4 7

TASK KAMPANJA MJESEC SETNJA TRAMPOLIN. mjesec.pas mjesec.c mjesec.cpp. standard input (stdin) standard output (stdout)

2009 ACM ICPC Southeast USA Regional Programming Contest. 7 November, 2009 PROBLEMS

International Contest-Game MATH KANGAROO Canada, 2007

Math Contest Preparation II

Welcome to Math! Put last night s homework on your desk and begin your warm-up (the other worksheet that you chose to save for today)

Cayley Contest (Grade 10) Thursday, February 25, 2010

Collecting and Organizing Data. The Scientific Method (part 3) Rules for making data tables: Collecting and Organizing Data

Paper B Numeracy Paper 11+ Name:... Candidate Number... Seat Number...

Draw an enlargement of this rectangle with scale factor 2 Use point A as the centre of enlargement.

If the pink gorilla eats watermelon every night, how much watermelons does he eat? One Stop Teacher Shop. Resources. Make Homework Interesting!

The Sixth Annual West Windsor-Plainsboro Mathematics Tournament

Norman Do. Continued calculation What is the sum of the following two expressions?

Modular Arithmetic and Doomsday

1. Express the reciprocal of 0.55 as a common fraction. 1.

JMG. Review Module 1 Lessons 1-20 for Mid-Module. Prepare for Endof-Unit Assessment. Assessment. Module 1. End-of-Unit Assessment.

Senior Team Maths Challenge 2015 National Final UKMT UKMT. Group Round UKMT. Instructions

Twenty-fourth Annual UNC Math Contest Final Round Solutions Jan 2016 [(3!)!] 4

2012 UPPER PRIMARY PRELIMINARY ROUND PAPER Time allowed:75 minutes INSTRUCTION AND INFORMATION

Number Theory: Modulus Math

Percentage means, a 'number over 100'. For example: 16% = 16 5% = 5 12% = 12 35% =

3301/1F. MATHEMATICS (SPECIFICATION A) 3301/1F Foundation Tier Paper 1 Non-Calculator. General Certificate of Secondary Education June 2004

You must have: Ruler graduated in centimetres and millimetres, pen, HB pencil, eraser. Tracing paper may be used.

Pascal Contest (Grade 9) Wednesday, February 22, 2006

G r a d e. 2 M a t h e M a t i c s. Blackline Masters

Coordinate Algebra 1 Common Core Diagnostic Test 1. about 1 hour and 30 minutes for Justin to arrive at work. His car travels about 30 miles per

GMAT-Arithmetic-4. Counting Methods and Probability

UNC Charlotte 2012 Algebra

April 6, 2013 RIT Competition Sprint Round Problems 1-30

The Sixth Annual West Windsor-Plainsboro Mathematics Tournament

Rubik's Magic Transforms

UKMT UKMT UKMT. Junior Kangaroo Mathematical Challenge. Tuesday 13th June 2017

HEXAGON. Singapore-Asia Pacific Mathematical Olympiad for Primary Schools (Mock Test for APMOPS 2012) Pham Van Thuan

ACM ICPC World Finals Warmup 2 At UVa Online Judge. 7 th May 2011 You get 14 Pages 10 Problems & 300 Minutes

MATHCOUNTS Chapter Competition Sprint Round Problems 1 30 DO NOT BEGIN UNTIL YOU ARE INSTRUCTED TO DO SO.

Do not open this exam until told to do so.

COCI 2017/2018. Round #1, October 14th, Tasks. Task Time limit Memory limit Score. Cezar 1 s 64 MB 50. Tetris 1 s 64 MB 80

A - B (a) 0.1 (b) 0.2 (c) 1 (d) 5 (e) 10. (a) 4 (b) 5 (c) 6 (d) 7 (e) According to the standard convention for exponentiation,

Problem Set 7: Network Flows Fall 2018

Lecture 8. Outline. 1. Modular Arithmetic. Clock Math!!! 2. Inverses for Modular Arithmetic: Greatest Common Divisor. 3. Euclid s GCD Algorithm

Canadian Mathematics Competitions. Gauss (Grades 7 & 8)

NRP Math Challenge Club

Chapters 1-3, 5, Inductive and Deductive Reasoning, Fundamental Counting Principle

Math is Cool Masters

Transcription:

TASK MJEHURIC DATUM ROT SLIKAR TREZOR PERIODNI standard standard time limit 1 second 1 second 1 second 1 second 3 seconds 5 seconds memory limit 32 MB 32 MB 32 MB 32 MB 32 MB 32 MB points 40 40 70 100 120 130 500

Task MJEHURIC Goran has five wooden pieces arranged in a sequence. There is a number between 1 and 5 inscribed on every piece, so that every number appears on exactly one of the five pieces. Goran wants to order the pieces to form the sequence 1, 2, 3, 4, 5 and does it like this: 1. If the number on the first piece is greater than the number on the second piece, swap them. 2. If the number on the second piece is greater than the number on the third piece, swap them. 3. If the number on the third piece is greater than the number on the fourth piece, swap them. 4. If the number on the fourth piece is greater than the number on the fifth piece, swap them. 5. If the pieces don't form the sequence 1, 2, 3, 4, 5, go to step 1. Write a program that, given the initial ordering of the pieces, s the ordering after each swap. The first line contains five integers separated by single spaces, the ordering of the pieces. The numbers will be between 1 and 5 (inclusive) and there will be no duplicates. The initial ordering will not be 1, 2, 3, 4, 5. After any two pieces are swapped, the ordering of the pieces, on a single line separated by spaces. 2 1 5 3 4 1 2 5 3 4 1 2 3 5 4 1 2 3 4 5 2 3 4 5 1 2 3 4 1 5 2 3 1 4 5 2 1 3 4 5 1 2 3 4 5

Task DATUM Write a program that, given a date in 2009, determines the day of week on that date. The first line contains two positive integers D and M separated by a space. The numbers will be a valid date in 2009. Output the day of the week on D. M. 2009. The should be one of the words "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" or "Sunday". 1 1 Thursday 17 1 Saturday 25 9 Friday

Task ROT Damir likes to rotate. Right now he is rotating tables of letters. He wrote an R C table onto a piece of paper. He has also chosen an angle K, a multiple of 45, and wants to rotate his table that many degrees clockwise. It turns out this task is a bit too hard for Damir, so help him out. The first line contains two integers R and C separated by a space (1 R 10, 1 C 10) the number of rows and columns in Damir's table. Each of the next R lines contains one row of Damir's table, a string of C lowercase letters. The last line contains an integer K, a multiple of 45 between 0 and 360 (inclusive). Output Damir's table rotated K degrees clockwise, like shown in the examples. The should contain the smallest number of rows necessary. Some rows may have leading spaces, but no rows may have trailing spaces. 3 5 damir marko darko 45 d m a d a m a r i r k r k o o 3 5 damir marko darko 90 dmd aaa rrm kki oor 5 5 abcde bcdef cdefg defgh efghi 315 e d f c e g b d f h a c e g i b d f h c e g d f e

Task SLIKAR Josip is a strange painter. He wants to paint a picture consisting of N N pixels, where N is a power of two (1, 2, 4, 8, 16 etc.). Each pixel will be either black or white. Josip already has an idea of how each pixel will be coloured. This would be no problem if Josip's painting process wasn't strange. He uses the following recursive process: If the picture is a single pixel, he colours it the way he intended. Otherwise, split the square into four smaller squares and then: 1. Select one of the four squares and colour it white. 2. Select one of the three remaining squares and colour it black. 3. Consider the two remaining squares as new paintings and use the same three-step process on them. Soon he noticed that it was not possible to convert all his visions to paintings with this process. Your task is to write a program that will paint a picture that differs as little as possible from the desired picture. The difference between two pictures is the number of pairs of pixels in corresponding positions that differ in colour. The first line contains an integer N (1 N 512), the size of the picture Josip would like to paint. N will be a power of 2. Each of the following N lines contains N digits 0 or 1, white and black squares in the target picture. On the first line, the smallest possible difference that can be achieved. On the next N lines, a picture that can be painted with Josip's process and achieves the smallest difference. The picture should be in the same format as in the. Note: The second part of the (the picture) may not be unique. Any correct will be accepted. SCORING In test cases worth 50% points, N will be at most 8.

Task SLIKAR 4 0001 0001 0011 1110 1 0001 0001 0011 4 6 0011 0011 0111 1101 8 01010001 10100011 01010111 1010 01010111 10100011 01010001 10100000 16 00000001 00000011 00000111 0000 0111 0011 0001 0000

Task TREZOR Mirko decided to open a new business bank vaults. A branch of the bank can be visualized in a plane, vaults being points in the plane. Mirko's branch contains exactly L (A+1+B) vaults, so that each point with integer coordinates inside the rectangle with corners (1, A) and (L, B) contains one vault. The vaults are watched by two guards one at (0, A), the other at (0, B). A guard can see a vault if there are no other vaults on the line segment connecting them. A vault is not secure if neither guard can see it, secure if only one guard can see it and super-secure if both guards can see it. Given A, B and L, the number of insecure, secure and super-secure vaults. The first line contains integers A and B separated by a space (1 A 2000, 1 B 2000). The second line contains the integer L (1 L 1 000 000 000). Output on three separate lines the numbers of insecure, secure and super-secure vaults. SCORING In test cases worth 50% of points, L will be at most 1000. In test worth another 25% of points, A and B will be at most 100 (but L can be as large as one billion). 1 1 3 2 2 5 2 3 4 0 16 8 7 11 1000000 6723409 2301730 9974861

Task PERIODNI Luka is bored in chemistry class so he is staring at a large periodic table of chemical elements hanging from a wall above the blackboard. To kill time, Luka decided to make his own table completely different from the one in the classroom. His table consists of N columns, each with some height, aligned at the bottom (see example below). After he draws the table he needs to fill it with elements. He first decided to enter the noble gases of which there are K. Luka must put them in the table so that no two noble gases are close to each other. Two squares in the table are close to each other if they are in the same column or row, and all squares between them exist. In the example below, the 'a' squares are not close, but the 'b' squares are. Write a program that, given N, K and the heights of the N columns, calculates the total number of ways for Luka to place the noble gases into the table. This number can be large, so it modulo 1 000 000 007. The first line contains the integers N and K separated by a space (1 N 500, 1 K 500), the number of columns in Luka's table and the number of noble gases. The next line contains N positive integers, separated by spaces. These are heights of the columns from left to right. The heights will be at most 1 000 000. Output the number of ways for Luka to fill his table with noble gases, modulo 1 000 000 007. SCORING In test cases worth 40% of points, all numbers in the will be less than 15. In test cases worth 70% of points, all numbers in the will be less than 100.

Task PERIODNI 3 3 2 1 3 4 1 1 2 3 4 5 2 2 3 1 2 4 3 2 999999 999999 999999 2 10 43 990979013