Canadian Computing Competition

Similar documents
GCSE Mathematics Practice Tests: Set 1

North Carolina Standard Course of Study - Mathematics

MATH& 146 Lesson 11. Section 1.6 Categorical Data

UW-Madison's 2009 ACM-ICPC Individual Placement Test October 4th, 1:00-6:00pm, CS1350

Uses of Fractions. Fractions

EOC FINAL REVIEW Name Due Date

CPSC 121: Models of Computation. Module 1: Propositional Logic

US_Math 4 1. Operations and Algebraic Thinking 4.OA 2. Number and Operations in Base Ten 4.NBT 3. Number and Operations - Fractions 4.

Preliminaries. for the Benelux Algorithm Programming Contest. Problems

Lesson 25: Solving Problems in Two Ways Rates and Algebra

NCPC 2007 Problem A: Phone List 3. Problem A. Phone List

STUDENTS EXPERIENCES OF EQUIVALENCE RELATIONS

The unbelievable musical magic of the number 12

x) Graph the function

CHAPTER 7 BASIC GRAPHICS, EVENTS AND GLOBAL DATA

DRAFT. Proposal to modify International Standard IEC

McRuffy Press Fourth Grade Color Math Test 7

Delta College Middle School Math Competition Practice Test A 2018

Correlation to the Common Core State Standards

Mobile Math Teachers Circle The Return of the iclicker

The reduction in the number of flip-flops in a sequential circuit is referred to as the state-reduction problem.

2014 FHSPS Playoff March 15, 2014 Timber Creek High School

FINAL REVIEW m rounded to the nearest centimeter is _. Choose the correct answer, and write its number in the parentheses.

Unit Four Answer Keys

Check back at the NCTM site for additional notes and tasks next week.

Carnegie Mellon University. Invitational Programming Competition

Section 6.8 Synthesis of Sequential Logic Page 1 of 8

Unit 07 PC Form A. 1. Use pencil and paper to answer the question. Plot and label each point on the coordinate grid.

16B CSS LAYOUT WITH GRID

Copyright 2011 by Enoch Hwang, Ph.D. and Global Specialties. All rights reserved. Printed in Taiwan.

Creative Suggestions & Billboard Installation

East Central North America Regional Contest Practice Session October 28

FUNDAMENTAL MANUFACTURING PROCESSES Computer Numerical Control

Frequencies. Chapter 2. Descriptive statistics and charts

N12/5/MATSD/SP2/ENG/TZ0/XX. mathematical STUDIES. Wednesday 7 November 2012 (morning) 1 hour 30 minutes. instructions to candidates

Introduction to Digital Electronics

Figure 2: components reduce board area by 57% over 0201 components, which themselves reduced board area by 66% over 0402 types (source Murata).

SPIRE MATHS Stimulating, Practical, Interesting, Relevant, Enjoyable Maths For All

Table of Contents. Introduction...v. About the CD-ROM...vi. Standards Correlations... vii. Ratios and Proportional Relationships...

NUMB3RS Activity: Coded Messages. Episode: The Mole

AP Statistics Sec 5.1: An Exercise in Sampling: The Corn Field

abc Mark Scheme Mathematics 4301 Specification A General Certificate of Secondary Education Paper 2 Foundation 2008 examination - June series

d. Could you represent the profit for n copies in other different ways?

Bart vs. Lisa vs. Fractions

ALGEBRAIC PURE TONE COMPOSITIONS CONSTRUCTED VIA SIMILARITY

GCSE MARKING SCHEME AUTUMN 2017 GCSE MATHEMATICS NUMERACY UNIT 1 - INTERMEDIATE TIER 3310U30-1. WJEC CBAC Ltd.

Scanning Electron Microscopy (FEI Versa 3D Dual Beam)

Module 1. Ratios and Proportional Relationships Lessons 11 14

AskDrCallahan Calculus 1 Teacher s Guide

1 Boxer Billy Input File: BoxerBillyIn.txt

Functional Skills Certificate FUNCTIONAL MATHEMATICS

EBU INTERFACES FOR 625 LINE DIGITAL VIDEO SIGNALS AT THE 4:2:2 LEVEL OF CCIR RECOMMENDATION 601 CONTENTS

3/31/2014. BW: Four Minute Gridding Activity. Use a pencil! Use box # s on your grid paper.

GCSE Mathematics Practice Tests: Set 4

Applications of Mathematics

1.0 DESCRIPTION. This specification covers roll-up signs to be used in temporary traffic control zones.

Bite Size Brownies. Designed by: Jonathan Thompson George Mason University, COMPLETE Math

Musical Acoustics Lecture 16 Interval, Scales, Tuning and Temperament - I

Music-Visualization and Motion-Controlled LED Cube

Flip Flop. S-R Flip Flop. Sequential Circuits. Block diagram. Prepared by:- Anwar Bari

1 Introduction to Pitch

LED modules for illuminated signs Opto Semiconductors

Lecture 1: What we hear when we hear music

Note: Please use the actual date you accessed this material in your citation.

Title page (page 1) Archives of Suicide Research

TeeJay Publishers. Curriculum for Excellence. Course Planner - Level 1

18-551, Spring Group #4 Final Report. Get in the Game. Nick Lahr (nlahr) Bryan Murawski (bmurawsk) Chris Schnieder (cschneid)

CALIFORNIA STANDARDS TEST CSM00433 CSM01958 A B C CSM02216 A 583,000

On Figure of Merit in PAM4 Optical Transmitter Evaluation, Particularly TDECQ

Application Note AN SupIRBuck MCM Power Quad Flat No-lead (PQFN) Inspection Application Note

Digital Logic Design: An Overview & Number Systems

3.22 Finalize exact specifications of 3D printed parts.

Let's Learn About Notes

MA 15910, Lesson 5, Algebra part of text, Sections 2.3, 2.4, and 7.5 Solving Applied Problems

Cycle-7 MAMA Pulse height distribution stability: Fold Analysis Measurement

Blueline, Linefree, Accuracy Ratio, & Moving Absolute Mean Ratio Charts

Data Representation. signals can vary continuously across an infinite range of values e.g., frequencies on an old-fashioned radio with a dial

1/ 19 2/17 3/23 4/23 5/18 Total/100. Please do not write in the spaces above.

PRIOR USE APPROVAL CYCLE FOR SURVIVAL FULL COLOR LOGO

TECHNICAL SPECIFICATIONS: STICKS STONES BROKEN BONES Company: Bunk Puppets, contact :Jeff Achtem,

Package View X2-DFN Seating Plane X2-DFN1006-3

FLIP-FLOPS AND RELATED DEVICES

VISSIM TUTORIALS This document includes tutorials that provide help in using VISSIM to accomplish the six tasks listed in the table below.

CAT.5 HDMI Extender HVE-6000 HVE-7000 HVE-7004 HVE User Manual. Ver.:

Logic Problems. ϵpsilon Camp Logic Problems. 1

Grade 5 Mathematics Mid-Year Assessment REVIEW

SPECIES COUNTERPOINT

Product Guide Verizon Pennsylvania Inc. Section 35D Verizon Pennsylvania Inc. Original Sheet 1 RESIDENCE TWO-POINT MESSAGE TOLL SERVICE

Installation instructions Roxtec RM BG B systems

Units Standards Practices Days

On-Supporting Energy Balanced K-Barrier Coverage In Wireless Sensor Networks

Chapter 4 Signal Paths

WOODWINDS ~ 1 ~ Woodwinds Sessions are scheduled for April 28-30, 2019.

Time available for students to complete test: 40 minutes

Family of Christ. Child Development Center. Goals & Objectives for Kindergarten

Nintendo. January 21, 2004 Good Emulators I will place links to all of these emulators on the webpage. Mac OSX The latest version of RockNES

Normalization Methods for Two-Color Microarray Data

Laboratory Assignment 3. Digital Music Synthesis: Beethoven s Fifth Symphony Using MATLAB

American Council on Exercise Logo Usage Guidelines January 2013

Lecture 7: Music

Transcription:

Canadian Mathematics Competition An activity of The Centre for Education in Mathematics and Computing, University of Waterloo, Waterloo, Ontario Canadian Computing Competition for the Awards Tuesday, February 26, 2002

Problem J1 _ _ _ _ _ _ _ _ _ _ _ _ Most digital devices show numbers using a seven segment display. The seven segments are arranged as shown: For this problem each segment is represented by three asterisks in a line as shown above. Any digit from 0-9 can be shown by illuminating the appropriate segments. For example the digit 1 may be displayed using the two segments on the right side: The digit 4 needs four segments to display it properly: Write a program that will accept a single digit input from the user, and then display that digit using a seven segment display. You may assume that each segment is composed of three asterisks. Sample Session. User input in italics Enter a digit between 0 and 9: 9

Problem J2 AmeriCanadian Americans spell differently from Canadians. Americans write "neighbor" and "color" while Canadians write "neighbour" and "colour. Write a program to help Americans translate to Canadian. Your program should interact with the user in the following way. The user should type a word (not to exceed 64 letters) and if the word appears to use American spelling, the program should echo the Canadian spelling for the same word. If the word does not appear to use American spelling, it should be output without change. When the user types "quit!" the program should terminate. The rules for detecting American spelling are quite naive: If the word has more than four letters and has a suffix consisting of a consonant followed by "or", you may assume it is an American spelling, and that the equivalent Canadian spelling replaces the "or" by "our". Note : you should treat the letter "y" as a vowel. Keyboard input and screen output is expected. Sample session. User input in italics. Enter words to be translated: color colour for for taylor taylour quit!

Problem S1J3 The Students Council Breakfast The students council in your school wants to organize a charity breakfast, and since older students are both wiser and richer, the members of the council decide that the price of each ticket will be based on how many years you have been in the school. A first year student will buy a PINK ticket, a second year student will buy a GREEN ticket, a third year student will buy a RED ticket, and a fourth year student will buy an ORANGE ticket. Assume that all tickets are sold. Each colour of ticket is uniquely priced. Input the cost of a PINK, GREEN, RED, and ORANGE ticket (in that exact order). Input the exact amount of money to be raised by selling tickets. Output all combinations of tickets that produce exactly the desired amount to be raised. The combinations may appear in any order. Output the total number of combinations found. Output the smallest number of tickets to print to raise the desired amount so that printing cost is minimized. Keyboard input and screen output is expected. Sample Session. User input in italics. Cost of PINK tickets: 1 Cost of GREEN tickets: 2 Cost of RED tickets: 3 Cost of ORANGE tickets: 4 How much must be raised with ticket sales? 3 Combinations are # of PINK is 0 # of GREEN is 0 # of RED is 1 # of ORANGE is 0 # of PINK is 1 # of GREEN is 1 # of RED is 0 # of ORANGE is 0 # of PINK is 3 # of GREEN is 0 # of RED is 0 # of ORANGE is 0 Total combinations is 3. Minimum number of tickets to print is 1.

Problem S2J4 Fraction Action Many advanced calculators have a fraction feature that will simplify fractions for you. You are to write a program that will accept for input a non-negative integer as a numerator and a positive integer as a denominator, and output the fraction in simplest form. That is, the fraction cannot be reduced any further, and the numerator will be less than the denominator. You can assume that all input numerators and denominators will produce valid fractions. Keyboard input and screen output are expected. Sample session. User input in italics. Numerator 28 Denominator 7 4 Numerator 13 Denominator 2 3/ Numerator 0 Denominator 7 0 Numerator Denominator 10 1/2

S3J Blindfold Rose and Colin are playing a game in their backyard. Since the backyard is rectangular we can think of it as a grid with r rows and c columns. Rose and Colin place obstacles on some of the squares. The game is played as follows: Colin covers his eyes with a blindfold then Rose carries him to some grid square in the backyard. She sets him down so that he is facing north, south, east or west. Colin does not know this initial position or direction. Rose then instructs Colin to make a series of m moves through the backyard. Each move is one of: F - moves forward one grid square in the direction that he is facing, or L - turns 90 degrees counter-clockwise, remaining on the same square, or R - turns 90 degrees clockwise, remaining on the same square. After making these moves, Colin is standing at some final position. He must now figure out where he is standing. You will help him by writing a program to determine all possible final positions. Assume that Colin's initial position, final position, and all intermediate positions lie within the backyard but never in a square that contains an obstacle. You may also assume that Colin is always facing a direction that is parallel to the sides of the backyard (north, south, east, or west). The input begins with r and c (1 r 37; 1 c 80 ), each on a separate line. Next are r lines of c characters describing the backyard: a period character denotes a grid square that Colin may walk through; an X character denotes a grid square with an obstacle. Below the grid is the number m (0 m 30000) followed by m lines describing Colin's moves. Each line has a single character: F, L, or R. Your program should output the backyard grid, indicating all possible final positions with the character. Sample Input (Input file : blind.in) 2 4....XX. 3 F R F Output for Sample Input (Output file : blind.out)....xx

Problem S4 Bridge Crossing A rope bridge traverses a deep gorge. People may cross the bridge in groups, but there is a limit (M) to the size of the group. The time taken for a group to cross is determined by the slowest member. You are responsible for safety on the bridge and part of your job is to control the groups crossing. People are waiting in a queue(line), when the previous group has crossed you tell the next few people they can now cross. Groups can be of different sizes; no group can contain more than M people, and the goal is to get everyone over in the shortest time, all the time maintaining the order of the people in the queue. The first line of the input contains an integer M (1 M 20). The second line contains Q (1 Q 100), the length of the queue waiting to cross. For each person in the queue, a pair of input lines follows. The first of these is the name of the person, and the second is that person s individual time to cross the bridge. Recall that a group crossing time will be the maximum crossing time for time for any individual in the group. Your output is to list the names of the people in each group, one group per line, which will obtain the minimum overall crossing time. If several groupings yield the same overall crossing time, any such grouping may be listed. The final line of the output is to give the total crossing time for the entire queue of people. Sample input (Input file : bridge.in) 2 alice 1 bob charlie dobson 3 eric 3 Output for Sample Input (Output file : bridge.out) Total Time: 9 alice bob charlie dobson eric

Problem S Follow the Bouncing Ball Suppose you want to create a screen saver which has a ball bouncing around the edges. The action will continue until the ball hits a corner (like a pool table). At that point, the ball disappears off the screen and the screen goes black. Balls bounce off the walls according to the laws of physics. The angle of the ball as it approaches the wall (the angle of incidence) will equal the angle of the ball as it bounces away (the angle of reflection). a a Write a program which will determine how many bounces it will take before the bouncing ball will be swallowed by a corner, if at all. The screen dimensions are in the range [100, 1000] units. Consider the ball as a point on the screen. The corner pockets are units along each wall, and if a ball hits the wall at the edge of a pocket it will continue bouncing. A sample screen is shown below. 230 00 Input will consist of four integers, each on a separate line. n the width of the screen, 100 n 1000 m the height of the screen, 100 m 1000 p the initial position of the ball at the bottom of the screen, p n q the position of the ball when it bounces off the right wall, q m The output consists of an integer which indicates the number of bounces the ball makes before it disappears in a corner. Count the hit off the right wall as the first bounce. It is possible that the ball will never bounce into a corner (assuming a frictionless surface), in this case, output should be 0. Note that when the ball hits a pocket is not counted as a bounce. You do not have to program the actual animation.

Sample Input (Input file : ball.in) 300 200 200 100 Output for Sample Input (Output file : ball.out) 2

Graeme, This note was included in the contest package. Note to Canadian Computing Competition Supervisors: Please inform students writing the Senior Division of the CCC that in question S, p is the distance measured from the left side of the rectangle, and q is the distance measured from the bottom of the rectangle.