Second Annual University of Oregon Programming Contest, 1998

Similar documents
4th Pui Ching Invitational Mathematics Competition. Final Event (Secondary 1)

Senior Math Circles February 10, 2010 Game Theory II

13 Searching for Pattern

1, 2,, 10. Example game. Pieces and Board: This game is played on a 1 by 10 board. The initial position is an empty board.

Problem A To and Fro (Problem appeared in the 2004/2005 Regional Competition in North America East Central.)

Caltech Harvey Mudd Mathematics Competition February 20, 2010

BMT 2018 Combinatorics Test Solutions March 18, 2018

Problem 2A Consider 101 natural numbers not exceeding 200. Prove that at least one of them is divisible by another one.

MATHEMATICS ON THE CHESSBOARD

100 IDEAS FOR USING A HUNDRED SQUARE

ENGR170 Assignment Problem Solving with Recursion Dr Michael M. Marefat

Math Circles 9 / 10 Contest Preparation I

OCTAGON 5 IN 1 GAME SET

Adversary Search. Ref: Chapter 5

Table of Contents. Table of Contents 1

CSE548, AMS542: Analysis of Algorithms, Fall 2016 Date: Sep 25. Homework #1. ( Due: Oct 10 ) Figure 1: The laser game.

The first player to construct his or her obelisk is the winner, and if a player has no legal moves, he or she immediately loses the game.

a b c d e f g h i j k l m n

Figure 1: The Game of Fifteen

ARTIFICIAL INTELLIGENCE (CS 370D)

Ian Stewart. 8 Whitefield Close Westwood Heath Coventry CV4 8GY UK

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

Problem A: Complex intersecting line segments

EXTENSION. Magic Sum Formula If a magic square of order n has entries 1, 2, 3,, n 2, then the magic sum MS is given by the formula

YourTurnMyTurn.com: chess rules. Jan Willem Schoonhoven Copyright 2018 YourTurnMyTurn.com

GENERALIZATION: RANK ORDER FILTERS

Once you get a solution draw it below, showing which three pennies you moved and where you moved them to. My Solution:

Number Fun December 3,

LEARN TO PLAY CHESS CONTENTS 1 INTRODUCTION. Terry Marris December 2004

Introduction Solvability Rules Computer Solution Implementation. Connect Four. March 9, Connect Four 1

Junior Circle Games with coins and chessboards

Winter Quarter Competition

THE ASSOCIATION OF MATHEMATICS TEACHERS OF NEW JERSEY 2018 ANNUAL WINTER CONFERENCE FOSTERING GROWTH MINDSETS IN EVERY MATH CLASSROOM

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

DELUXE 3 IN 1 GAME SET

If a pawn is still on its original square, it can move two squares or one square ahead. Pawn Movement

Week 1. 1 What Is Combinatorics?

Section 8.1. Sequences and Series

N-Queens Problem. Latin Squares Duncan Prince, Tamara Gomez February

Sudoku goes Classic. Gaming equipment and the common DOMINARI - rule. for 2 players from the age of 8 up

Conway s Soldiers. Jasper Taylor

SUDOKU1 Challenge 2013 TWINS MADNESS

arxiv: v2 [cs.ai] 15 Jul 2016

Boulder Chess. [0] Object of Game A. The Object of the Game is to fill the opposing Royal Chambers with Boulders. [1] The Board and the Pieces

STAJSIC, DAVORIN, M.A. Combinatorial Game Theory (2010) Directed by Dr. Clifford Smyth. pp.40

GPLMS Revision Programme GRADE 6 Booklet

The twenty-six pictures game.

UK JUNIOR MATHEMATICAL CHALLENGE. April 25th 2013 EXTENDED SOLUTIONS

NRP Math Challenge Club

a b c d e f g h 1 a b c d e f g h C A B B A C C X X C C X X C C A B B A C Diagram 1-2 Square names

Chess Handbook: Course One

Mathematical J o u r n e y s. Departure Points

Whole Numbers WHOLE NUMBERS PASSPORT.

Tangent: Boromean Rings. The Beer Can Game. Plan. A Take-Away Game. Mathematical Games I. Introduction to Impartial Combinatorial Games

Introduction to Spring 2009 Artificial Intelligence Final Exam

Part A. 1. How many seconds are there in sixty-two minutes? (A) 62 (B) 3602 (C) 3620 (D) 3680 (E) 3720 (C) 3 8 (A) 7 (B) 11 (C) 13 (D) 15 (E) 17

Organization Team Team ID# If each of the congruent figures has area 1, what is the area of the square?

Plan. Related courses. A Take-Away Game. Mathematical Games , (21-801) - Mathematical Games Look for it in Spring 11

CSE 573 Problem Set 1. Answers on 10/17/08

CSC Curriculum Term One Lesson Plans

Is muddled about the correspondence between multiplication and division facts, recording, for example: 3 5 = 15, so 5 15 = 3

arxiv: v1 [cs.ds] 17 Jul 2013

Grade 7/8 Math Circles Game Theory October 27/28, 2015

Introduction to Mathematical Reasoning, Saylor 111

Chapter 4 Number Theory

Travelling Integers. Materials

! Denver, CO! Demystifying Computing with Magic, continued

B1 Problem Statement Unit Pricing

A1 Problem Statement Unit Pricing

MAGIC SQUARES KATIE HAYMAKER

Arrays. Independent Part. Contents. Programming with Java Module 3. 1 Bowling Introduction Task Intermediate steps...

Chess Puzzle Mate in N-Moves Solver with Branch and Bound Algorithm

arxiv: v1 [math.co] 24 Nov 2018

Instruction: Show the class the card. Do not read the number out loud. Allow 3 seconds after reading the card.

Mind Ninja The Game of Boundless Forms

Whole Numbers. Whole Numbers. Curriculum Ready.

Problem F. Chessboard Coloring

Bouncy Dice Explosion

PARITY, SYMMETRY, AND FUN PROBLEMS 1. April 16, 2017

Fibonacci Numbers ANSWERS Lesson 1 of 10, work individually or in pairs

Binary trees. Application: AVL trees and the golden ratio. The golden ratio. φ 1=1/φ 1. φ =1+

Bouncy Dice Explosion

Representing Square Numbers. Use materials to represent square numbers. A. Calculate the number of counters in this square array.

Solution Algorithm to the Sam Loyd (n 2 1) Puzzle

18.S34 (FALL, 2007) PROBLEMS ON PROBABILITY

Probability. Misha Lavrov. ARML Practice 5/5/2013

Ivan Guo. Broken bridges There are thirteen bridges connecting the banks of River Pluvia and its six piers, as shown in the diagram below:

Tetris: A Heuristic Study

Mathematical Magic Tricks

Wordy Problems for MathyTeachers

CS431 homework 2. 8 June Question 1 (page 54, problem 2.3). Is lg n = O(n)? Is lg n = Ω(n)? Is lg n = Θ(n)?

Solutions to Part I of Game Theory

Wythoff s Game. Kimberly Hirschfeld-Cotton Oshkosh, Nebraska

Duke Math Meet Individual Round

QUIZ: Fill in the blank. Necessity is the Mother of.

Southeastern European Regional Programming Contest Bucharest, Romania Vinnytsya, Ukraine October 21, Problem A Concerts

Essentials. Week by. Week. Seeing Math. Fun with Multiplication

Analyzing Games: Solutions

A few chessboards pieces: 2 for each student, to play the role of knights.

Using Neural Network and Monte-Carlo Tree Search to Play the Game TEN

Transcription:

A Magic Magic Squares A magic square of order n is an arrangement of the n natural numbers 1,...,n in a square array such that the sums of the entries in each row, column, and each of the two diagonals are the same. For example, here is a magic square of order 3. 4 9 3 5 7 8 1 6 The sum of each row, column, and diagonal in this case is 15. This is not the only magic squares of order 3. In fact, we can generate seven others by rotations or reflections of the above: 8 3 4 1 5 9 6 7 6 1 8 7 5 3 9 4 7 6 9 5 1 4 3 8 9 4 7 5 3 6 1 8 6 7 1 5 9 8 3 4 8 1 6 3 5 7 4 9 4 3 8 9 5 1 7 6 There is a magic trick for generating a magic square of any odd order n. We illustrate the construction with the following magic square of order 5. 11 18 5 9 10 1 19 1 3 4 6 13 0 3 5 7 14 16 17 4 1 8 15 After placing the first number, 1, in the bottom row and middle column, we always try to put the next number down-right diagonally. If this seems impossible because it requires moving out of bounds, we simply consider the first row as lying below the last row and the first column as lying to the right of the last column. On the other hand, if it seems impossible because the next square is occupied, we instead move up one square. Again, by rigid motions, we can magically generate seven additional magic squares. Write a program that considers input lines, each of which is a triple of natural numbers n, r, s, with n odd and 5, and 1 r, s n with r s, and determines which of the eight magic magic squares do not place r lower or to the right of s. The output, for each of those squares, should be the subrectangle with r and s at its corners. Columns should be separated by tabs and the rectangles separated by a line space. Note that the same subrectangle could appear in more than square and, if so, it should be repeated in the output. Sample Input/Output on reverse

Sample Input 3 6 4 5 4 3 7 6 7 1 5 9 8 3 4 6 1 8 7 5 3 9 4 0 13 6 16 14 7 5 15 8 1 4 16 15 0 14 8 13 7 1 6 5 4 7 7 7 7

B Interval Inside In this problem, you are given a set {I 1, I,...,I n } of intervals on the line. The goal is to find the largest sequence I i1, I i,...,i im such that I ij is contained in I ij+1 for 1 j m 1. (The subscripts i 1,i,...,i m do not have to appear in increasing order.) The input to your program will be sets of intervals. The first line for each set will indicate the number n of intervals in the set. The following n lines will each specify a interval, namely, each of the lines will consist of a pair x, y of integers with x y, separated by a single space, representing the closed interval [x, y], i.e., the set of real numbers {r x r y}. (You may assume n 100). The output should give the length of the longest nested sequence(s), followed by the endpoints of the smallest intervals in each of the nested sequences achieving that length; these numbers should be separated by single spaces. If an interval is the smallest for more than one longest sequence, list it only once. Sample Input 3 1 3 0 3 1 1 3 4 0 0 3 0 4 0 1 1 0 1 3 3 1 1 1 3 4 0 1 1

C SuperKnights Vulcan Chess is not only more complex than the classical Earth game, but begins with a random choice of rectangular board sizes and chess pieces. The critical piece is the superknight. An A, B -superknight moves by jumping between the opposite corners of an A B rectangle, with A and B fixed at the outset (knights in Earth chess, are, 3 - superknights). The power of superknights in Vulcan chess make them the dominant piece over the squares to which they can travel (in any number of moves), which may not be the entire board. For example, in the following 4 5 board a 3, 4 -superknight placed in the upper left is considered to threaten the marked squares. Vulcan artificial intelligence researchers are fond of testing their search algorithms on the (L, W, A, B)-SuperKnights Problem. The problem asks how many mutually non-threatening A, B -superknights can be placed on an L W board. For example, the answer to the (4, 5, 3, 4)-SuperKnights Problem is 6, as is seen in the following 6 numbered regions, each of which is controllable by a single 3, 4 -superknight. 1 4 3 1 4 5 4 3 3 1 6 1 4 3 1 4 Write a program to solve the (L, W, A, B)-SuperKnights Problem. Input will be sequence of lines each giving an L, W, A, B instance, with the numbers separated by a single space. Output for each should be the maximum number n of mutually non-threatening superknights for that instance, followed by a mapping of the n regions with the integers 1,...,n. The numbers in each line of the board should be separated by tabs and the solutions to the individual problems should be separated by a space. The input numbers L, W, A, B will each be within the range 1...1. Sample Input 3 1 4 5 3 4 1 1 1 1 1 1 1 6 1 4 3 1 4 5 4 3 3 1 6 1 4 3 1 4

D Fibonacci Condensed That most famous of sequences, the Fibonacci numbers, is defined recursively by Fib(0) = 0, Fib(1) = 1, Fib(n) = Fib(n 1) + Fib(n ), for n. or in closed form by Fib(n) = φn ( φ) n 5, for n 0 where φ = 1+ 5, the Golden Section. It is tedious to write out Fib(n) for large n since the series grows so rapidly, e.g., Fib(1000) has 09 decimal digits. This problem asks only for the first and last digits and the number of digits in between. Input will be a sequence of integers, one per line. The integers will be between 7 and 10 9. For each number n, there should be one line of output listing the first digit of Fib(n), followed in braces by the number of digits between the first digit and the last digit, and then the last digit of Fib(n). Sample Input 7 1 100 1000 1{0}3 1{1}4 3{19}5 4{07}5

E Pick-Up Sticks A two-player game starts with a set of N sticks and a list, M 1,M,..., of positive integers representing legal moves. In each turn, the player selects a feasible move M i, and removes M i sticks from the set (where, of course, M i the number of sticks remaining). The winner, if there is one, is the player who removes the last stick, leaving an empty set. Write a program that determines, from a given game specification N,M 1,M,..., whether you as an expert player moving first will win, lose, or draw against an expert second player. Input will be a sequence of game specifications, one to a line, with the numbers separated by a single space. Output for each is Win, Lose, or Draw. Sample input 3 1 5 1 3 7 3 9 Lose Draw Win Draw