ICPC World Finals archive
Every entry keeps the exact TeX write-up and C++ implementation, plus the copied statement text/PDF assets when they exist.
Contest years
Archive entries
A. A-Skew-ed Reasoning
Problem A A-Skew-ed Reasoning Time limit: 2 seconds The following is based on a true story – the names have been changed because. . . well, because you always change names in stories like this one. Professor Taylor Swift is grading a homework assignment on...
B. Blackboard Game
Problem B Blackboard Game Time limit: 1 second To help her elementary school students understand the concept of prime factorization, Aisha has invented a game for them to play on the blackboard. The rules of the game are as follows. The game is played by tw...
C. Bride of Pipe Stream
Problem C Bride of Pipe Stream Time limit: 12 seconds The story continues! For several years now, your town has been gifted with an abundance of Flubber, the adorable-but-slightly-flammable-and-toxic-and-acidic-and-sentient-and-mischievous man-made chemi- c...
D. Buggy Rover
Problem D Buggy Rover Time limit: 2 seconds The International Center for Planetary Cartography (ICPC) uses rovers to explore the surfaces of other planets. As we all know, other planets are flat surfaces which can be perfectly and evenly discretized into a...
E. Delivery Service
Problem E Delivery Service Time limit: 12 seconds The Intercity Caspian Package Company (ICPC) is starting a delivery service which will deliver pack- ages between various cities near the Caspian Sea. The company plans to hire couriers to carry packages bet...
F. Herding Cats
Problem F Herding Cats Time limit: 2 seconds You are opening a cat cafe in Baku and would like to take a promotional photograph of all the cats sitting in the front window. Unfortunately, getting cats to do what you want is a famously hard problem. But you...
G. Lava Moat
Problem G Lava Moat Time limit: 4 seconds These pesky armies of good are coming to disturb the quiet and peaceful lands of the goblins again. Building a huge wall didn’t work out that well, and so the goblins are going to turn to the tried and true staple o...
H. Score Values
Problem H Score Values Time limit: 2 seconds Ever since you arrived at your university, you have been a tireless advocate for introducing the brand-new martial-arts- plus-card-based sport of Contact Bridge to the school (and the world). Finally, after a gre...
I. Slot Machine
Problem I Slot Machine Time limit: 2 seconds Imperial Chance & Play Casino offers games using a slot machine that has n wheels arranged next to each other. Each of the wheels has n distinct symbols on it, and these symbols appear in the same order on each w...
J. Stacking Cups
Problem J Stacking Cups Time limit: 2 seconds You have a collection of n cylindrical cups, where the ith cup is 2i − 1 cm tall. The cups have increasing diameters, such that cup i fits inside cup j if and only if i < j. The base of each cup is 1 cm thick (w...
K. Treasure Map
Problem K Treasure Map Time limit: 4 seconds After years of searching you have come across Captain Blackbeard’s old map showing where his long- lost treasure is hidden, deep on the ocean floor. The map was once a hypsometric map – that is, it showed the oce...
L. Walking on Sunshine
Problem L Walking on Sunshine Time limit: 2 seconds I’m walking on sunshine, and it don’t feel good – my eyes hurt! Baku has plenty of sunshine. If you walk away from the sun, or at least perpendicular to its rays, it does not shine in your eyes. For this p...
A. Billboards
Problem A Billboards Time limit: 6 seconds Each year, the ICPC (International Collegiate Programming Con- test) has many sponsors. Since happy sponsors means happy con- test, we plan to add a long billboard on one side of the contest area, so that our lovel...
B. Bingo for the Win!
Problem B Bingo for the Win! Time limit: 1 second Bingo is a game of chance for multiple players. Each player receives a sheet with some numbers, and a game master then calls out these numbers in a random order. Players cross off the numbers that they have...
C. Citizenship
Problem C Citizenship Time limit: 4 seconds It has been a long time since you moved to a different country and you have decided it is time to become a citizen. Your new country has a strict residency requirement for all applicants. To apply, you must have b...
D. Doubles Horseback Wrestling
Problem D Doubles Horseback Wrestling Time limit: 4 seconds The Nomadic Games Exploratory Committee (NGEC) is floating the idea of a doubles horseback wrestling tournament with pairs of riders astride single horses. They have advertised a pilot tournament,...
E. Flipping Container
Problem E Flipping Container Time limit: 2 seconds A large, cuboid-shaped shipping container has been delivered to your shipping yard. Before you can open it up, you first need to move the container to a different location in your yard. Normally, you would...
F. Friendly Rivalry
Problem F Friendly Rivalry Time limit: 2 seconds The leaders of the International Coalition for Planetary Change (ICPC), a non-profit fighting for envi- ronmental awareness, are worried that their regional chapters are not doing enough to make a real impact...
G. Kindergarten
Problem G Kindergarten Time limit: 2 seconds Taking a group of kindergarten kids to the planetarium isn’t easy. You really wanted to do this, to allow every kid a chance to get into the room with the giant telescope and take a look at Jupiter. And now that...
H. Maxwell’s Demon
Problem H Maxwell’s Demon Time limit: 6 seconds Relax: No knowledge of thermodynamics is needed to solve this problem. Maxwell’s demon sits in a container of height h and width 2w. The container is divided into two adjacent chambers, each of height h and wi...
I. Steppe on It
Problem I Steppe on It Time limit: 3 seconds The gas pedal on the floor. Squealing tires. Wailing sirens. Emergency vehicles do whatever is necessary to reach their target locations as quickly as possible. Time is critical because lives often depend on it....
J. The Silk Road . . . with Robots!
Problem J The Silk Road . . . with Robots! Time limit: 5 seconds Parts of the ancient silk road passed through southern Kazakhstan. You’ve been fantasizing about a modern silk road, which has its own special features. Along your fantasy road are robots as w...
K. Tower of noiHa
Problem K Tower of noiHa Time limit: 1 second Lucas believes that at six years old, his son is ready to learn some basic algorithms. To start, he chose one of the most beautiful techniques: recursion, and to illustrate it, he picked the well- known recursio...
L. Where Am I Now?
Problem L Where Am I Now? Time limit: 5 seconds Who am I? What am I? Why am I? These are all difficult questions that have kept philosophers reliably busy over the past millennia. But when it comes to “Where am I?”, then, well, modern smartphones and GPS sa...
A. Riddle of the Sphinx
World Finals | ICPC 2023 Luxor 47th Annual hosted by ICPC World Championship...
B. Schedule
World Finals | ICPC 2023 Luxor 47th Annual hosted by ICPC World Championship AASTMT Problem B Schedule T...
C. Three Kinds of Dice
World Finals | ICPC 2023 Luxor 47th Annual hosted by ICPC World Championship AASTMT Problem C Three...
D. Carl’s Vacation
World Finals | ICPC 2023 Luxor 47th Annual hosted by ICPC World Championship AAS...
E. A Recurring Problem
World Finals | ICPC 2023 Luxor 47th Annual hosted by ICPC World Championship AASTMT Pro...
F. Tilting Tiles
World Finals | ICPC 2023 Luxor 47th Annual hosted by ICPC World Championship AASTMT Problem F Ti...
G. Turning Red
World Finals | ICPC 2023 Luxor 47th Annual hosted by ICPC World Championship AASTMT Problem G Tu...
H. Jet Lag
World Finals | ICPC 2023 Luxor 47th Annual hosted by ICPC World Championship AASTMT Problem H Jet Lag...
I. Waterworld
World Finals | ICPC 2023 Luxor 47th Annual hosted by ICPC World Championship AASTMT Problem I Wa...
J. Bridging the Gap
World Finals | ICPC 2023 Luxor 47th Annual hosted by ICPC World Championship AASTMT Proble...
K. Alea Iacta Est
World Finals | ICPC 2023 Luxor 47th Annual hosted by ICPC World Championship AASTMT Problem K Alea I...
P. Turning Red
World Finals | ICPC 2023 Luxor 46th Annual hosted by ICPC World Championship AASTMT Problem P Tu...
Q. Doing the Container Shuffle
World Finals | ICPC 2023 Luxor 46th Annual hosted by ICPC World Championship...
R. Zoo Management
World Finals | ICPC 2023 Luxor 46th Annual hosted by ICPC World Championship...
S. Bridging the Gap
World Finals | ICPC 2023 Luxor 46th Annual hosted by ICPC World Championship AASTMT Proble...
T. Carl’s Vacation
World Finals | ICPC 2023 Luxor 46th Annual hosted by ICPC World Championship AAS...
U. Toy Train Tracks
World Finals | ICPC 2023 Luxor 46th Annual hosted by ICPC World Championship...
V. Three Kinds of Dice
World Finals | ICPC 2023 Luxor 46th Annual hosted by ICPC World Championship AASTMT Problem V Three...
W. Riddle of the Sphinx
World Finals | ICPC 2023 Luxor 46th Annual hosted by ICPC World Championship...
X. Quartets
World Finals | ICPC 2023 Luxor 46th Annual hosted by ICPC World Championship...
Y. Compression
World Finals | ICPC 2023 Luxor 46th Annual hosted by ICPC World Championship AASTMT Prob...
Z. Archaeological Recovery
World Finals | ICPC 2023 Luxor 46th Annual hosted by ICPC World Championship AASTMT Problem Z Arch...
A. Crystal Crosswind
Problem A Crystal Crosswind Time limit: 5 seconds You are part of a scientific team developing a new technique to image crystal structures at the molecular level. The technique involves blowing a very fine wind over the surface of the crystal at various ang...
B. Dungeon Crawler
Problem B Dungeon Crawler Time limit: 5 seconds Alice and Bob are in charge of testing a new escape room! In this escape room, customers are trapped in a dungeon and have to explore the entire area. The dungeon consists of n rooms connected by exactly n−1 c...
C. Fair Division
Problem C Fair Division Time limit: 3 seconds After sailing the Seven Seas and raiding many ships, Cap’n Red and his crew of fellow pirates are finally ready to divide their loot. According to ancient traditions, the crew stands in a circle ordered by a str...
D. Guardians of the Gallery
Problem D Guardians of the Gallery Time limit: 5 seconds Your local art gallery is about to host an exciting new exhibition of sculptures by world-renowned artists, and the gallery expects to attract thousands of visitors. Unfortunately, the exhibition migh...
E. Hand of the Free Marked
Problem E Hand of the Free Marked Time limit: 2 seconds There is a fairly well-known mentalism trick known as the Fitch Cheney trick. From a deck of n playing cards, k are selected uniformly at random and given to an assistant while the magician is out of t...
F. Islands from the Sky
Problem F Islands from the Sky Time limit: 2 seconds You might never have heard of the island group of Iceepeecee, but that suits their inhabitants just fine. Located in a remote part of the South Pacific, they are truly off the beaten track, without any re...
G. Mosaic Browsing
Problem G Mosaic Browsing Time limit: 6 seconds The International Center for the Preservation of Ceramics (ICPC) is searching for motifs in some ancient mosaics. According to the ICPC’s definition, a mosaic is a rectangular grid where each grid square conta...
H. Prehistoric Programs
Problem H Prehistoric Programs Time limit: 6 seconds Archaeologists have discovered exciting clay tablets in deep layers of Alutila Cave. Nobody was able to decipher the script on the tablets, ex- cept for two symbols that seem to describe nested structures...
I. Spider Walk
Problem I Spider Walk Time limit: 6 seconds Charlotte the spider sits at the center of her spiderweb, which consists of a series of silken straight strands that go from the center to the outer boundary of the web. Charlotte’s web also has bridges, each of w...
J. Splitstream
Problem J Splitstream Time limit: 3 seconds A splitstream system is an acyclic network of nodes that processes finite sequences of numbers. There are two types of nodes (illustrated in Figure J.1): • A split node takes a sequence of numbers as input and dis...
K. Take On Meme
Problem K Take On Meme Time limit: 4 seconds The Internet can be so fickle. You work for a small ad agency, Mimi’s Mammoth Memes. Your ad campaigns are very cheap, and rely on the hope of producing the next hit viral meme. Unfortunately, the last four hundr...
L. Where Am I?
Problem L Where Am I? Time limit: 2 seconds Who am I? What am I? Why am I? These are all difficult questions that have kept philosophers reliably busy over the past millennia. But when it comes to “Where am I?”, then, well, modern smartphones and GPS satell...
A. Cardiology
Problem A Cardiology Time limit: 2 seconds The Great Cardoni, Master Prestidigitator, has a deck of 21 numbered cards which he uses in a trick as follows: A spectator secretly selects a number between 1 and 21, inclusive, after which Cardoni deals the 21 ca...
B. The Cost of Speed Limits
Problem B The Cost of Speed Limits Time limit: 8 seconds By the year 3031, the ICPC has become so popular that a whole new town has to be built to house all the World Finals teams. The town is beautifully designed, complete with a road network. Unfortunatel...
C. Domes
Problem C Domes Time limit: 2 seconds Saint Basil’s Cathedral is the best-known landmark of Moscow and maybe even of all of Russia. Built under Ivan the Terrible in the 16th century, the cathedral is known for its colorful domes. No visit to the city is com...
D. Gene Folding
Problem D Gene Folding Time limit: 5 seconds International Cell Processing Company (ICPC) is a world leader in the analysis of genetic sequences. A genetic sequence is a sequence of nucleotides, which in this problem is represented by a string containing on...
E. Landscape Generator
Problem E Landscape Generator Time limit: 4 seconds Interactive Creative Players Collective (ICPC) is working on a new computer game for which they want to generate realistic landscapes. One of the ICPC engineers proposed an algorithm inspired by geological...
F. Ley Lines
Problem F Ley Lines Time limit: 15 seconds In 1921, the amateur archaeologist Alfred Watkins coined the term “ley lines” to refer to straight lines between numerous places of geographical and historical interest. These lines have often been associated with...
G. Opportunity Cost
Problem G Opportunity Cost Time limit: 5 seconds As with most types of products, buying a new phone can be difficult. One of the main challenges is that there are a lot of different aspects of the phone that you might care about, such as its price, its perf...
H. QC QC
Problem H QC QC Time limit: 10 seconds Innovative Computable Quality Control (ICQC) has developed a ground-breaking new machine for per- forming, well, quality control. Thanks to its novel Deep Intelligence technology, an ICQC quality control (QC) machine c...
I. Quests
Problem I Quests Time limit: 10 seconds To relax before competing in the ICPC World Finals, you have decided to play a computer game called Quests. You have played it a number of times already, and now you want to achieve a perfect playthrough—to prepare fo...
J. ’S No Problem
Problem J ’S No Problem Time limit: 3 seconds The Yllihc Engineering and Technological Institute (YETI), located in northern Snowblovia, has two problems: snow and money. Specifically, they have too much of the former and not enough of the latter. Every win...
K. Space Walls
Problem K Space Walls Time limit: 15 seconds Place-Y Technology Corp. plans to launch a new space station soon. The company CEO is known for being obsessed with perfection. For example, he insists that all the outer surfaces of the space station are regular...
L. Sweep Stakes
Problem L Sweep Stakes Time limit: 20 seconds You may have already won! In fact, you did already win! You won your very own island, in the deepest reaches of the unexplored ocean! Well, mostly unexplored. As it happens, there was a small military base there...
M. Trailing Digits
Problem M Trailing Digits Time limit: 1 second A large shipment of doodads has just arrived, and each doodad has a suggested retail price of b cents. You’ve noticed that consumers are much more likely to purchase goods when most of the trailing digits are t...
N. What’s Our Vector, Victor?
Problem N What’s Our Vector, Victor? Time limit: 6 seconds Vector embeddings are a common tool in machine learning systems. Complex real-world concepts (for instance, words in a dictionary) are mapped onto vec- tors of real numbers. If embeddings are traine...
O. Which Planet is This?!
Problem O Which Planet is This?! Time limit: 6 seconds It’s the year 2521, and interstellar probes have reached planets in distant solar systems. The Interstellar Consortium of Planet Cartographers (ICPC) has created detailed maps of these planets, and they...
A. Azulejos
Problem A Azulejos Time limit: 10 seconds Ceramic artists Maria and João are opening a small azulejo store in Porto. Azule- jos are the beautiful ceramic tiles for which Portugal is famous. Maria and João want to create an attractive window display, but, du...
B. Beautiful Bridges
Problem B Beautiful Bridges Time limit: 10 seconds What connects us all? Well, it is often bridges. Since an- cient times, people have been building bridges for roads, for trains, for pedestrians, and as aqueducts to transport water. It is humanity’s way of...
C. Checks Post Facto
Problem C Checks Post Facto Time limit: 1 second Your university’s board game club just hosted a Checkers tournament, and you were assigned to take notes on the games. Unfortunately, while walking home, you dropped all of your papers into a puddle! Disaster...
D. Circular DNA
Problem D Circular DNA Time limit: 3 seconds You have an internship with a bioinformatics research group studying DNA. A single strand of DNA consists of many genes, which fall into different categories called gene types. Gene types are delimited by specifi...
E. Dead-End Detector
Problem E Dead-End Detector Time limit: 5 seconds The council of your home town has decided to improve road sign placement, especially for dead ends. They have given you a road map, and you must determine where to put up signs to mark the dead ends. They wa...
F. Directing Rainfall
Problem F Directing Rainfall Time limit: 15 seconds Porto and the nearby Douro Valley are famous for producing port wine. Wine lovers from all over the world come here to enjoy this sweet wine where it is made. The International Consortium of Port Connoisse...
G. First of Her Name
Problem G First of Her Name Time limit: 10 seconds In the Royal Family, names are very important! As the Royal Historian you have been charged with analyzing the patterns in the names of the Royal Ladies in the realm. There have been n Royal Ladies, for con...
H. Hobson’s Trains
Problem H Hobson’s Trains Time limit: 5 seconds Mr. Hobson has retired from running a stable and has invested in a more modern form of transport, trains. He has built a rail network with n stations. However, he has retained his commitment to free the passen...
I. Karel the Robot
Problem I Karel the Robot Time limit: 10 seconds Did you know that the word “robot” is almost 100 years old? It was first introduced in 1920, in the science-fiction theatrical play R.U.R., written by Karel Čapek. As a tribute to this Czech writer, an educa...
J. Miniature Golf
Problem J Miniature Golf Time limit: 6 seconds A group of friends has just played a round of miniature golf. Miniature golf courses consist of a number of holes. Each player takes a turn to play each hole by hitting a ball repeatedly until it drops into the...
K. Traffic Blights
Problem K Traffic Blights Time limit: 2 seconds Cars! Where do they come from? Where do they go? Nobody knows. They appear where roads have been built, as if out of nowhere. Some say that no two cars are alike. Some say that if you look closely, you can see...
A. Catch the Plane
Problem A Catch the Plane Time limit: 10 seconds Your plane to the ICPC Finals departs in a short time, and the only way to get to the airport is by bus. Unfortunately, some of the bus drivers are considering going on strike, so you do not know whether you...
B. Comma Sprinkler
Problem B Comma Sprinkler Time limit: 8 seconds As practice will tell you, the English rules for comma placement are complex, frus- trating, and often ambiguous. Many people, even the English, will, in practice, ignore them, and, apply custom rules, or, no...
C. Conquer The World
Problem C Conquer The World Time limit: 8 seconds Bwahahahahaha!!! Your nemesis, the dashingly handsome spy Waco Powers, has at last fallen to your secret volcano base’s deathtraps (or so you assume, being a little too busy to witness it firsthand). At long...
D. Gem Island
Problem D Gem Island Time limit: 3 seconds Gem Island is a tiny island in the middle of the Pacific Ocean. Until recently, it was known as one of the poorest, but also most peaceful, places on Earth. Today, it is neither poor nor peaceful. What happened? On...
E. Getting a Jump on Crime
Problem E Getting a Jump on Crime Time limit: 2 seconds Your friend Robin is a superhero. When you first found out about this, you figured “everybody needs a hobby, and this seems more exciting than stamp collecting,” but now you are really thankful that so...
F. Go with the Flow
Problem F Go with the Flow Time limit: 12 seconds In typesetting, a “river” is a string of spaces formed by gaps between words that extends down sev- eral lines of text. For instance, Figure F.1 shows several examples of rivers highlighted in red (text is i...
G. Panda Preserve
Problem G Panda Preserve Time limit: 10 seconds Last month, Sichuan province secured funding to establish the Great Panda National Park, a natural preserve for a population of more than 1 800 giant pandas. The park will be surrounded by a polygonal fence. I...
H. Single Cut of Failure
Problem H Single Cut of Failure Time limit: 6 seconds The Intrusion and Crime Prevention Company (ICPC) builds intrusion detection systems for homes and businesses. The International Collegiate Programming Contest (in a strange coincidence also known as ICP...
I. Triangles
Problem I Triangles Time limit: 6 seconds For your trip to Beijing, you have brought plenty of puzzle books, many of them containing challenges like the following: how many triangles can be found in Figure I.1? Figure I.1: Illustration of Sample Input 2. Wh...
J. Uncrossed Knight’s Tour
Problem J Uncrossed Knight’s Tour Time limit: 2 seconds A well-known puzzle is to “tour” all the squares of an 8 × 8 chessboard using a knight, which is a piece that can move only by jumping one square in one direction and two squares in an orthogonal direc...
K. Wireless is the New Fiber
Problem K Wireless is the New Fiber Time limit: 2 seconds A new type of unbounded-bandwidth wireless communication has just been tested and proved to be a suitable replacement for the existing, fiber-based communications network, which is struggling to keep...
A. Airport Construction
Rapid City event sponsor ICPC 2017 Problem A Airport Construction Time limit: 2 seconds The tropical island nation of Piconesia is famous for its beautiful beaches, lush vegetation, cocoa and coffee plantations, and wonderful weather all year round. This pa...
B. Get a Clue!
Rapid City event sponsor ICPC 2017 Problem B Get a Clue! Time limit: 4 seconds Developed in the 1940s in the United Kingdom, the game of Cluedo is one of the most popular board games in the world. The object of the game is to determine who murdered Mr. Body...
C. Mission Improbable
Rapid City event sponsor ICPC 2017 Problem C Mission Improbable Time limit: 1 second It is a sunny day in spring and you are about to meet Patrick, a close friend and former partner in crime. Patrick lost most of his money betting on programming contests, s...
D. Money for Nothing
Rapid City event sponsor ICPC 2017 Problem D Money for Nothing Time limit: 5 seconds In this problem you will be solving one of the most profound challenges of humans across the world since the beginning of time – how to make lots of money. You are a middle...
E. Need for Speed
Rapid City event sponsor ICPC 2017 Problem E Need for Speed Time limit: 1 second Sheila is a student and she drives a typical student car: it is old, slow, rusty, and falling apart. Recently, the needle on the speedometer fell off. She glued it back on, but...
F. Posterize
Rapid City event sponsor ICPC 2017 Problem F Posterize Time limit: 2 seconds Pixels in a digital picture can be represented with three integers in the range 0 to 255 that indicate the intensity of the red, green, and blue colors. To compress an image or to...
G. Replicate Replicate Rfplicbte
Rapid City event sponsor ICPC 2017 Problem G Replicate Replicate Rfplicbte Time limit: 3 seconds The owner of the Automatic Cellular Manufacturing corporation has just patented a new process for the mass production of identical parts. Her approach uses a tw...
H. Scenery
Rapid City event sponsor ICPC 2017 Problem H Scenery Time limit: 6 seconds Images by John Fowler, Carol Highsmith, and Richard Woodland You have decided to spend a day of your trip to Rapid City taking photographs of the South Dakota Badlands, which are ren...
I. Secret Chamber at Mount Rushmore
Rapid City event sponsor ICPC 2017 Problem I Secret Chamber at Mount Rushmore Time limit: 1 second By now you have probably heard that there is a spectacular stone sculp- ture featuring four famous U.S. presidents at Mount Rushmore. How- ever, very few peop...
J. Son of Pipe Stream
Rapid City event sponsor ICPC 2017 Problem J Son of Pipe Stream Time limit: 5 seconds Two years ago, you helped install the nation’s very first Flubber pipe network in your hometown, to great success. Polls show that everyone loves having their own Flubber...
K. Tarot Sham Boast
Rapid City event sponsor ICPC 2017 Problem K Tarot Sham Boast Time limit: 2 seconds Curse your rival! Every year at the annual Rock Paper Scissors tournament, you have made it to the final match. (Your Rock technique is unmatched, and your Paper cuts to the...
L. Visual Python++
Rapid City event sponsor ICPC 2017 Problem L Visual Python++ Time limit: 5 seconds In the recently proposed Visual Python++ programming language, a block of statements is represented as a rectangle of characters with top-left corner in row r1 and column c1...
A. Balanced Diet
Problem A Balanced Diet Time limit: 2 seconds Every day, Danny buys one sweet from the candy store and eats it. The store has m types of sweets, numbered from 1 to m. Danny knows that a balanced diet is important and is applying this concept to his sweet pu...
B. Branch Assignment
Problem B Branch Assignment Time limit: 3 seconds The Innovative Consumer Products Company (ICPC) is planning to start a top-secret project. This project consists of s subprojects. There will be b ≥ s branches of ICPC involved in this project and ICPC wants...
C. Ceiling Function
Problem C Ceiling Function Time limit: 5 seconds Advanced Ceiling Manufacturers (ACM) is analyzing the properties of its new series of Incredibly Collapse-Proof Ceilings (ICPCs). An ICPC consists of n layers of material, each with a different value of colla...
D. Clock Breaking
Problem D Clock Breaking Time limit: 5 seconds After numerous unfortunate freak fatalities and the lawsuits, settlements, protests, and boycotts that naturally followed, the beleaguered executives at ACME Clock Manufacturers have decided they need to finall...
E. Forever Young
Problem E Forever Young Time limit: 1 second My birthday is coming up. Alas, I am getting old and would like to feel young again. Fortunately, I have come up with an excellent way of feeling younger: if I write my age as a number in an appropriately chosen...
F. Longest Rivers
Problem F Longest Rivers Time limit: 10 seconds The Chao Phraya River System is the main river system of Thailand. Its six longest rivers listed by decreasing length are: 1. Tha Chin (765 km) 2. Nan (740 km) 3. Yom (700 km) 4. Ping (658 km) 5. Pa Sak (513 k...
G. Oil
Problem G Oil Time limit: 10 seconds A large part of the world economy depends on oil, which is why research into new methods for finding and extracting oil is still active. Profits of oil companies depend in part on how efficiently they can drill for oil....
H. Polygonal Puzzle
Problem H Polygonal Puzzle Time limit: 20 seconds During last year’s ACM ICPC World Finals in Marrakesh, one of the judges bought a pretty wooden puzzle depicting a camel and palm trees (see Figure H.1). Unlike traditional jigsaw puzzles, which are usually...
I. Road Times
Problem I Road Times Time limit: 5 seconds Ubol Narongdid is the founder of a brash new startup company called Special D-Liver-E. She wants to corner the market on overnight deliveries of organs between hospitals in the Phuket area. For scheduling purposes...
J. Spin Doctor
Problem J Spin Doctor Time limit: 5 seconds As an employee of the world’s most respected political polling corporation, you must take complex, real- world issues and simplify them down to a few numbers. It isn’t always easy. A big election is coming up and,...
K. String Theory
Problem K String Theory Time limit: 2 seconds Nested quotations are great not only for writing literature with a complex narrative structure, but also in programming languages. While it may seem necessary to use different quotation marks at different nestin...
L. Swap Space
Problem L Swap Space Time limit: 6 seconds You administer a large cluster of computers with hard drives that use various file system types to store data. You recently decided to unify the file systems to the same type. That is quite a challenge since all th...
M. What Really Happened on Mars?
Problem M What Really Happened on Mars? Time limit: 2 seconds Real-time software in the Mars Pathfinder spacecraft suffered from an issue known as priority inversion. One technique to address this issue is to use the Priority Ceiling Protocol. In this probl...
A. Amalgamated Artichokes
Problem A Amalgamated Artichokes Time limit: 5 seconds Fatima Cynara is an analyst at Amalgamated Artichokes (AA). As with any company, AA has had some very good times as well as some bad ones. Fatima does trending analysis of the stock prices for AA, and s...
B. Asteroids
Problem B Asteroids Time limit: 2 seconds The year is 2115. The asteroid communication relay system was set up a decade ago by the Asteroid Communication Ministry. It is running fine except for one small problem – there are too many asteroids! The smaller o...
C. Catering
Problem C Catering Time limit: 4 seconds Paul owns a catering company and business is booming. The com- pany has k catering teams, each in charge of one set of catering equip- ment. Every week, the company accepts n catering requests for var- ious events. F...
D. Cutting Cheese
Problem D Cutting Cheese Time limit: 3 seconds Of course you have all heard of the International Cheese Processing Company. Their machine for cutting a piece of cheese into slices of exactly the same thickness is a classic. Recently they produced a machine...
E. Evolution in Parallel
Problem E Evolution in Parallel Time limit: 2 seconds It is 2178, and alien life has been discovered on a distant planet. There seems to be only one species on the planet and they do not reproduce as animals on Earth do. Even more amazing, the genetic makeu...
F. Keyboarding
Problem F Keyboarding Time limit: 4 seconds How many keystrokes are necessary to type a text message? You may think that it is equal to the number of characters in the text, but this is correct only if one keystroke generates one character. With pocket- siz...
G. Pipe Stream
Problem G Pipe Stream Time limit: 2 seconds Your hometown has hired some contractors – including you! – to man- age its municipal pipe network. They built the network, at great ex- pense, to supply Flubber to every home in town. Unfortunately, no- body has...
H. Qanat
Problem H Qanat Time limit: 2 seconds A qanat is an irrigation system widely used to deliver water in hot, arid climates. The technology was originally developed by Persians over 2000 years ago. In Morocco, qanats are known as khettara and are still used to...
I. Ship Traffic
Problem I Ship Traffic Time limit: 3 seconds Ferries crossing the Strait of Gibraltar from Morocco to Spain must carefully navigate to avoid the heavy ship traffic along the strait. Write a program to help ferry captains find the largest gaps in strait traf...
J. Tile Cutting
Problem J Tile Cutting Time limit: 15 seconds Youssef is a Moroccan tile installer who specializes in mosaics like the one shown on the right. He has rectangular tiles of many dimensions at his disposal, and the dimensions of all his tiles are integer numbe...
K. Tours
Problem K Tours Time limit: 3 seconds The Arca Carania Mountain national park is opening up for tourist traffic. The national park has a number of sites worth seeing and roads that connect pairs of sites. The park commissioners have put together a set of ro...
L. Weather Report
Problem L Weather Report Time limit: 2 seconds You have been hired by the Association for Climatological Measurement, a scientific organization interested in tracking global weather trends over a long period of time. Of course, this is no easy task. They ha...
M. Window Manager
Problem M Window Manager Time limit: 2 seconds The past few years have seen a revolution in user interface technology. For many years, keyboards and mice were the tools used to interact with computers. But with the introduction of smart phones and tablets,...
A. Baggage
Problem A Baggage Time Limit: 1 second An airline has two flights leaving at about the same time from ICPCity, one to city B and one to city A. The airline also has n counters where passengers check their baggage. At each counter there is a pair of identica...
B. Buffed Buffet
Problem B Buffed Buffet Time Limit: 4 seconds You are buying lunch at a buffet. A number of different dishes are available, and you can mix and match them to your heart’s desire. Some of the dishes, such as dumplings and roasted potatoes, consist of pieces...
C. Crane Balancing
Problem C Crane Balancing Time Limit: 1 second Wherever there is large-scale construction, you will find cranes that do the lifting. One hardly ever thinks about what marvelous examples of engineering cranes are: a structure of (relatively) little weight th...
D. Game Strategy
Problem D Game Strategy Time Limit: 8 seconds Alice and Bob are playing a board game. The board is divided into positions labeled a, b, c, d, . . . and the players use a gamepiece to mark the current position. Each round of the game consists of two steps: 1...
E. Maze Reduction
Problem E Maze Reduction Time Limit: 2 seconds Jay runs a small carnival that has various rides and attractions. Unfortunately, times are tough. A recent roller coaster accident, flooding in the restrooms, and an unfortunate clown incident have given Jay’s...
F. Messenger
Problem F Messenger Time Limit: 4 seconds Misha needs to send packages to his friend Nadia. Both of them often travel across Russia, which is very large. So they decide to hire a messenger. Since the cost of the messenger service depends on the time it take...
G. Metal Processing Plant
Problem G Metal Processing Plant Time Limit: 4 seconds Yulia works for a metal processing plant in Eka- terinburg. This plant processes ores mined in the Ural mountains, extracting precious metals such as chalcopyrite, platinum and gold from the ores. Every...
H. Pachinko
Problem H Pachinko Time Limit: 6 seconds You have been hired by Addictive Coin Machines to help design the next hit in their line of eye-catching, coin-guzzling, just-one-more-try Pachinko machines for casinos around the world. Playing a Pachinko machine in...
I. Sensor Network
Problem I Sensor Network Time Limit: 2 seconds A wireless sensor network consists of au- tonomous sensors scattered in an environment where they monitor conditions such as temper- ature, sound, and pressure. Samantha is a researcher working on the Amazon Ca...
J. Skiing
Problem J Skiing Time Limit: 2 seconds As you know, the ACM ICPC is not the only major sporting event taking place in Russia this year. Several months ago, the 2014 Winter Olympics were held in Sochi, which is about 3 000 km from Ekaterinburg. In an increas...
K. Surveillance
Problem K Surveillance Time Limit: 4 seconds The International Corporation for Protection and Control (ICPC) develops efficient technology for, well, protection and control. Naturally, they are keen to have their own headquarters protected and controlled. V...
L. Wire Crossing
Problem L Wire Crossing Time Limit: 2 seconds Moore’s Law states that the number of transistors on a chip will double every two years. Amazingly, this law has held true for over half a century. Whenever current technology no longer allowed more growth, rese...
A. Self-Assembly
ICPC 2013 2013 World Finals St. Petersburg HOSTED BY ITMO Problem A Self-Assembly Time Limit: 3 seconds Automatic Chemical Manufacturing is experimenting with a process called self-assembly. In this pro- cess, molecules with natural affinity for each othe...
B. Hey, Better Bettor
ICPC 2013 2013 World Finals St. Petersburg HOSTED BY ITMO Problem B Hey, Better Bettor Time Limit: 4 seconds “In the casino, the cardinal rule is to keep them playing and to keep them coming back. The longer they play, the more they lose, and in the end,...
C. Surely You Congest
ICPC 2013 2013 World Finals St. Petersburg HOSTED BY ITMO Problem C Surely You Congest Time Limit: 10 seconds You are in charge of designing an advanced centralized traffic management system for smart cars. The goal is to use global information to instruc...
D. Factors
ICPC 2013 2013 World Finals St. Petersburg HOSTED BY ITMO Problem D Factors Time Limit: 2 seconds The fundamental theorem of arithmetic states that every integer greater than 1 can be uniquely repre- sented as a product of one or more primes. While unique...
E. Harvard
ICPC 2013 2013 World Finals St. Petersburg HOSTED BY ITMO Problem E Harvard Time Limit: 10 seconds The term “Harvard architecture” applies to a computer that has physically separate memories for instructions and data. The term originated with the Harvard...
F. Low Power
ICPC 2013 2013 World Finals St. Petersburg HOSTED BY ITMO Problem F Low Power Time Limit: 4 seconds You are building advanced chips for machines. Making the chips is easy, but the power supply turns out to be an issue since the available batteries have va...
G. Map Tiles
ICPC 2013 2013 World Finals St. Petersburg HOSTED BY ITMO Problem G Map Tiles Time Limit: 20 seconds Publishing maps is not an easy task. First you need some appropriate transformation to display the earth’s spherical shape in a two-dimensional plane. The...
H. Matrxka
ICPC 2013 2013 World Finals St. Petersburg HOSTED BY ITMO Problem H Matrxka Time Limit: 5 seconds Matryoshkas are sets of traditional Russian wooden dolls of decreasing size placed one inside the other. A matryoshka doll can be opened to reveal a smaller...
I. Pirate Chest
ICPC 2013 2013 World Finals St. Petersburg HOSTED BY ITMO Problem I Pirate Chest Time Limit: 15 seconds Pirate Dick finally had enough of fighting, marauding, theft, and making life miserable for many on the open seas. So he decided to retire, and he foun...
J. Pollution Solution
ICPC 2013 2013 World Finals St. Petersburg HOSTED BY ITMO Problem J Pollution Solution Time Limit: 1 second As an employee of Aqueous Contaminate Management, you must monitor the pollution that gets dumped (sometimes accidentally, sometimes purposefully)...
K. Up a Tree
ICPC 2013 2013 World Finals St. Petersburg HOSTED BY ITMO Problem K Up a Tree Time Limit: 6 seconds Anatoly Cheng McDougal is a typical student in many ways. Whenever possible he tries to cut and paste code instead of writing it from scratch. Unavoidably...
A. Asteroid Rangers
Problem A Asteroid Rangers Problem ID: asteroids The year is 2112 and humankind has conquered the solar system. The Space Ranger Corps have set up bases on any hunk of rock that is even remotely inhabitable. Your job as a member of the Asteroid Communicatio...
B. Curvy Little Bottles
Problem B Curvy Little Bottles Problem ID: bottle In her bike rides around Warsaw, Jill happened upon a shop that sold interesting glass bottles. She thought it might make an interesting project to use such bottles for measuring liquids, but this would requ...
C. Bus Tour
Problem C Bus Tour Problem ID: bustour Imagine you are a tourist in Warsaw and have booked a bus tour to see some amazing attraction just outside of town. The bus first drives around town for a while (a long while, since Warsaw is a big city) picking up peo...
D. Fibonacci Words
Problem D Fibonacci Words Problem ID: fibonacci The Fibonacci word sequence of bit strings is defined as: if n = 0 0 F (n) = 1 if n = 1 F (n − 1) + F (n − 2) if n ≥ 2 Here + denotes concatenation of strings. The first few ele...
E. Infiltration
Problem E Infiltration Problem ID: infiltration Good morning, agent W-12. Your mission, should you choose to accept it, is as follows. We are infiltrating the ever so insidious Association of Chaos and Mischief (ACM) in order to take down their command stru...
F. Keys
Problem F Keys Problem ID: keys Adam carries a bunch of keys attached to key rings, some of which may be connected to each other. The rings are common key rings, so a key can be attached to or detached from a ring by sliding along the spiral. In the same wa...
G. Minimum Cost Flow
Problem G Minimum Cost Flow Problem ID: minflow You have been hired to construct a system to transport water between two points in an old factory building using some existing components of the old plumbing. The old components consist of pipes and junctions....
H. Room Service
Problem H Room Service Problem ID: room You are working for a company designing cute, funny robot vacuum cleaners. At a high level, the robots’ behavior is divided into three modes: 1. Exploration 2. Vacuuming 3. Rampant Killing Unfortunately, while consume...
I. A Safe Bet
Problem I A Safe Bet Problem ID: safe Safe Ltd. is a company that manufactures high-quality safes. Its latest invention is an optical closure mechanism that uses a laser beam passing through a rectangular grid with several mirrors. Laser- @ @...
J. Shortest Flight Path
Problem J Shortest Flight Path Problem ID: shortest Commercial flights are statistically quite safe (in terms of number of deaths per passenger-kilometer, only going to the moon is safer). But there are still reasons for precautions and safety regulations....
K. Stacking Plates
Problem K Stacking Plates Problem ID: stacking The Plate Shipping Company is an Internet retailer that, as their name suggests, exclusively sells plates. They pride themselves in offering the widest selection of dinner plates in the universe from a large nu...
L. Takeover Wars
Problem L Takeover Wars Problem ID: takeover You are studying a takeover war between two large corporations, Takeover Incorporated and Buyout Limited. Each of these corporations controls a number of subsidiaries. The aim in this war is simply to drive the c...
A. To Add or to Multiply
Problem A To Add or to Multiply Problem ID: addmul The Industrial Computer Processor Company offers very fast, special purpose processing units tailored to customer needs. Processors of the a-C-m family (such as the 1-C-2 and the 5-C-3) have an instruction...
B. Affine Mess
Problem B Affine Mess Problem ID: affine Tess L. Ation ran into a little problem last week when she demonstrated the beta version of her new drawing software. On the screen she had an elegant demonstration design that illustrated every feature of her progra...
C. Ancient Messages
Problem C Ancient Messages Problem ID: ancient In order to understand early civilizations, archaeologists often study texts written in ancient languages. One such language, used in Egypt more than 3000 years ago, is based on characters called hieroglyphs. F...
D. Chips Challenge
Problem D Chips Challenge Problem ID: chips A prominent microprocessor company has enlisted your help to lay out some interchangeable components (widgets) on some of their computer chips. Each chip’s design is an N ×N square of slots. One slot can hold a si...
E. Coffee Central
Problem E Coffee Central Problem ID: coffee Is it just a fad or is it here to stay? You’re not sure, but the steadily increasing number of coffee shops that are opening in your hometown has certainly become quite a draw. Apparently, people have become so ad...
F. Machine Works
Problem F Machine Works Problem ID: works You are the director of Arbitrarily Complex Machines (ACM for short), a company producing advanced machinery using even more advanced machinery. The old production machinery has broken down, so you need to buy new p...
G. Magic Sticks
Problem G Magic Sticks Problem ID: magicsticks Magic was accepted by all ancient peoples as a technique to compel the help of divine powers. In a well-known story, one group of sorcerers threw their walking sticks on the floor where they magically appeared...
H. Mining Your Own Business
Problem H Mining Your Own Business Problem ID: mining John Digger is the owner of a large illudium phosdex mine. The mine is made up of a series of tunnels that meet at various large junctions. Unlike some owners, Digger actually cares about the welfare of...
I. Mummy Madness
Problem I Mummy Madness Problem ID: mummy During an excursion to the desert at the 2011 ACM-ICPC World Finals, you come across an old Egyptian tomb. Unfortunately, opening the tomb turns out to be a bad idea: all of a sudden, what was just a few moments ago...
J. Pyramids
Problem J Pyramids Problem ID: pyramids It is not too hard to build a pyramid if you have a lot of identical cubes. On a flat foundation you lay, say, 10 × 10 cubes in a square. Centered on top of that square you lay a 9 × 9 square of cubes. Continuing this...
K. Trash Removal
Problem K Trash Removal Problem ID: trash Allied Chute Manufacturers is a company that builds trash chutes. A trash chute is a hollow tube installed in buildings so that trash dropped in at the top will fall down and be collected in the basement. Designing...
A. APL Lives!
Problem A APL Lives! Problem ID: apl APL is an array programming language that uses a notation invented by Ken Iverson in 1957. In this problem we consider only a small subset of the language which we call apl (that is, small APL). Each apl expression appea...
B. Barcodes
Problem B Barcodes Problem ID: barcodes Code-11 is a barcode system for encoding characters used primarily in labeling telecommunications equipment. The characters encoded are limited to digits 0 through 9, the dash (“–”), and a special start/stop character...
C. Tracking Bio-bots
Problem C Tracking Bio-bots Problem ID: biobots The researchers at International Bio-bot Makers (IBM) have invented a new kind of Bio-bot, a robot with behavior mimicking biological organisms. The development of the new robot is at a primitive stage; they n...
D. Castles
Problem D Castles Problem ID: castles Wars have played a significant role in world history. Unlike modern wars, armies in the middle ages were principally concerned with capturing and holding castles, the private fortified residences of lords and nobles. Th...
E. Channel
Problem E Channel Problem ID: channel Joe, a former champion coder, has finally bought the farm. No, no, he’s alive and well; he merely made use of his vast programming competition winnings to purchase his ancestral farm. He hopes to retire and spend the re...
F. Contour Mapping
Problem F Contour Mapping Problem ID: contour A contour map represents the topography of a given region. Lines on a contour map represent constant elevations. For example, a contour map might contain a line that represents points with an elevation of 100 me...
G. The Islands
Problem G The Islands Problem ID: islands Wen Chen is the captain of a rescue boat. One of his important tasks is to visit a group of islands once a day to check if everything is all right. Captain Wen starts from the west-most island, makes a pass to the e...
H. Rain
Problem H Rain Problem ID: rain In recent years, hurricanes and tsunamis have shown the destructive power of water. That destructive power is not restricted to the sea, however. Heavy rain may cause floods, destroying people’s houses and fields. Using intri...
I. Robots on Ice
Problem I Robots on Ice Problem ID: robots Inspired by the ice sculptures in Harbin, the members of the programming team from Arctic University of Robotics and Automata have decided to hold their own ice festival when they return home from the contest. They...
J. Sharing Chocolate
blem J Prob S Sharing Chocolate olate Problem ID: choco d the world eveery day. It is a truly universall Chocolate in its many forrms is enjoyed by millions off people around candy, avaailable in virtuaally every counntry around thee world. i with friends....
K. Paperweight
Problem K Paperweight Problem ID: weight Your company makes artistic paperweights. Each paperweight is the union of two tetrahedra that share one face. They are clear solid glass with embedded colored flecks. One of the little flecks in each paperweight is...
A. A Careful Approach
Problem A A Careful Approach Input: approach.in If you think participating in a programming contest is stressful, imagine being an air traffic controller. With human lives at stake, an air traffic controller has to focus on tasks while working under constan...
B. My Bad
Problem B My Bad Input file: bad.in A logic circuit maps its input through various gates to its output with no feedback loops in the circuit. The input and output are an ordered set of logical values, represented here by ones and zeros. The circuits we cons...
C. The Return of Carl
Problem C The Return of Carl Input file: carl.in Carl the ant is back! When we last left him (Problem A, 2004 World Finals), Carl was a little mixed-up, always taking strange, zigzag paths when traveling. But now, Carl has straightened out his life – litera...
D. Conduit Packing
Problem D Conduit Packing Input File: conduit.in Allied Conduit Manufacturing (ACM) makes metal conduit tubes with round cross-sections that enclose many different types of wires. The circular cross-section of a wire can have a diameter up to 20 millimeters...
E. Fare and Balanced
Problem E Fare and Balanced Input: fare.in Handling traffic congestion is a difficult challenge for young urban planners. Millions of drivers, each with different goals and each making independent choices, combine to form a complex system with sometimes pre...
F. Deer-Proof Fence
Problem F Deer-Proof Fence Input: fence.in Uncle Magnus has planted some young saplings on his farm as part of his reforestation project. Unfortunately, deer like to eat tender sapling shoots and leaves, making it necessary to build protective fences around...
G. House of Cards
Problem G House of Cards Input file: game.in Axel and Birgit like to play a card game in which they build a house of cards, gaining (or losing) credits as they add cards to the house. Since they both have very steady hands, the house of cards never collapse...
H. The Ministers’ Major Mess
Problem H The Ministers’ Major Mess Input file: major.in The ministers of the remote country of Stanistan are having severe problems with their decision making. It all started a few weeks ago when a new process for deciding which bills to pass was introduce...
I. Struts and Springs
Problem I Struts and Springs Input file: springs.in Struts and springs are devices that determine the way in which rectangular windows on a screen are resized or repositioned when the enclosing window is resized. A window occupies a rectangular region of th...
J. Subway Timing
Problem J Subway Timing Input: subway.in Like most modern cities, Stockholm has a well-developed public transportation system. The heart of public transportation in Stockholm is the subway. A topological map of the subway system illustrates the different su...
K. Suffix-Replacement Grammars
Problem K Suffix-Replacement Grammars Input file: suffix.in As computer programmers, you have likely heard about regular expressions and context-free grammars. These are rich ways of generating sets of strings over a small alphabet (otherwise known as a for...
A. Air Conditioning Machinery
Problem A T Air Conditioning Machinery Input file: ducts.in You are a technician for the Air Conditioning Machinery company (ACM). Unfortunately, when you arrive at a customer site to install some air conditioning ducts, you discover that you are running lo...
B. Always an Integer
Problem B Always an Integer Input file: always.in Combinatorics is a branch of mathematics chiefly concerned with counting discrete objects. For instance, how many ways can you pick two people out of a crowd of n people? Into how many regions can you divide...
C. Conveyor Belt
Problem C Conveyor Belt Input file: belt.in Many mechanical systems work with rotating shafts connected with conveyor belts. The shafts have a variety of sizes and rotate in either a clockwise or a counterclockwise manner. The exact way in which a belt will...
D. The Hare and the Hounds
Problem D The Hare and the Hounds Input file: hounds.in A hare and hounds road rally requires contestants (the “hounds”) to identify a route of one or more roads selected by the organizer (the “hare”). Both parties move over roads that meet at various inter...
E. Huffman Codes
Problem E Huffman Codes Input file: huffman.in Dan McAmbi is a member of a crack counter-espionage team and has recently obtained the partial contents of a file containing information vital to his nation’s interests. The file had been compressed using Huffm...
F. Glenbow Museum
Problem F Glenbow Museum Input file: museum.in The famous Glenbow Museum in Calgary is Western Canada’s largest museum, with exhibits ranging from art to cultural history to mineralogy. A brand new section is being planned, devoted to brilliant computer pro...
G. Net Loss
Problem G Net Loss Input file: netloss.in Rose N. Blatt is designing an embedded neural network to place inside a cell phone. When trained by the phone’s owner, the neural network will enable the user to dictate text messages in a hands-free way. The key id...
H. Painter
Problem H Painter Input file: painter.in You probably never heard of the painter Peer. He is not well known, much to his regret. Peer was one of the inventors of monochromy, which means that each of his paintings has a single color, but in different shades....
I. Password Suspects
Problem I Password Suspects Input file: password.in You are the computer whiz for the secret organization known as the Sneaky Underground Smug Perpetrators of Evil Crimes and Thefts. The target for SUSPECT’s latest evil crime is their greatest foe, the Inde...
J. The Sky is the Limit
Problem J The Sky is the Limit Input file: skyline.in The city of Banff hired an advertising agency to promote the city’s attractions to potential visitors. One of the planned slogans stated that the mountain ranges around the city form the most beautiful s...
K. Steam Roller
Problem K Steam Roller Input file: steam.in Johnny drives a steam roller, which like all steam rollers is slow and takes a relatively long time to start moving, change direction, and brake to a full stop. Johnny has just finished his day’s work and is drivi...
No ICPC entries fit the current search and filter combination.