A rectangular field is to be fenced. The north side is 20 meters long and the area of the field is 680 squared meters. How many

Similar documents
In how many different ways can the letters of the word 'DETAIL' be arranged in such a way that the vowels occupy only the odd positions?

2017 ACM ICPC ASIA, INDIA REGIONAL ONLINE CONTEST

Question - 1 What is the number?

2016 AMC10B Problems

Croatian Open Competition in Informatics, Contest #1 October 27, 2007

NMC Sample Problems: Grade 8

A Tale Dark and Grimm

NMC Sample Problems: Grade 8

XVIII Open Cup named after E.V. Pankratiev Stage 10, Grand Prix of Korea, Sunday, February 4, 2018

A. Incorrect! This would be the negative of the range. B. Correct! The range is the maximum data value minus the minimum data value.

TASK CESTA PŠENICA PRIPREME MRAVI SABOR STANOVI. score

08. First and second degree equations

CIS 252 Introduction to Computer Science Section M013: Exam 3 (Blue) April 26, Points Possible

Problem A. Find a Number

Simplifying Expressions

3. Mr. White does not wear white, so he is wearing the blue shirt. 4. Then Mr. Red wears a white shirt.

SENIOR HIGH MATH LEAGUE April 24, 2001 SECTION I: ONE POINT EACH

The 2016 ACM ICPC Vietnam National Programming Contest. The problem set consists of 11 problems: ICPC score distribution. Magical palindromic number

1. You have a complete bipartite graph where each part contains exactly n nodes, numbered from 0 to n - 1 inclusive.

CS 206 Introduction to Computer Science II

//If target was found, then //found == true and a[index] == target.

Student Outcomes. Lesson Notes. Classwork. Discussion (4 minutes)

Integers and Rational Numbers

1.1 - Functions, Domain, and Range

ECE15: Lab #3. Problem 1. University of California San Diego ( 1) + x4. + x8 + (1)

CMSC Theory of Algorithms Second Midterm

ACM International Collegiate Programming Contest 2013

TASK NAJBOLJIH 5 OKRET ZADAĆA KOMPIĆI FUNKCIJA RASPORED. zadaca.pas zadaca.c zadaca.cpp

Susan had $50 to spend at the carnival. She spent $12 on food and twice as much on rides. How many dollars did she have left to spend?

Math A Regents Exam 0601 Page 1

What s the Difference?

Problem Sets. GRADE 5 MODULE 5 Addition and Multiplication with Volume and Area

RBI PHASE 1 RECAP 2 ND JULY 18 QUANT NUMBER SYSTEM

Practice problems Set 2

Millionaire. Input. Output. Problem limit seconds

Lecture 5: Suffix Trees

2006 Canadian Computing Competition: Senior Division. Sponsor:

This book is licensed under a Creative Commons Attribution 3.0 License

XV Open Cup named after E.V. Pankratiev Stage 6, Grand Prix of Japan, Sunday, February 1, 2015

Intermediate Mathematics League of Eastern Massachusetts

B. Composing Of String

Problem A. Cubic Games

EASY

Teacher Guide: Introduction to Computer Science

Processing, representing and interpreting data

Problem Set 6. Part A:

Advanced Algebra I Simplifying Expressions

XVIII Open Cup named after E.V. Pankratiev Stage 7, Grand Prix of Siberia, Sunday, November 19, 2017

Prepare a stem-and-leaf graph for the following data. In your final display, you should arrange the leaves for each stem in increasing order.

Computer Science 236 Fall Nov. 11, 2010

Final. Name: TA: Section Time: Course Login: Person on Left: Person on Right: U.C. Berkeley CS170 : Algorithms, Fall 2013

Name Period Date LINEAR FUNCTIONS STUDENT PACKET 2: MULTIPLE REPRESENTATIONS 2

Problem A - Complete the sequence

XVIII Open Cup named after E.V. Pankratiev Stage 1: Grand Prix of Romania, Sunday, September 17, 2017

Integer Word Problems And Answers

Problem D: A Non-boring sequences

HMMT February 2018 February 10, 2018

Problem Set. The 37 th Annual ACM International Collegiate Programming Contest ASIA Regional - Daejeon. A. Accelerator (2 pages)

Kharagpur Site Online Problems 2013

Pacific Northwest Region Programming Contest Division 2

Glynda, the good witch of the North

ECS 10 Concepts of Computation Example Final Problems

Chapter 1 Operations With Numbers

OUTPUT: There should be one line per case, with the word possible or impossible.

2010 ACM ICPC Southeast USA Regional Programming Contest. 6 November, 2010 PROBLEMS

Introduction to Computer Science with MakeCode for Minecraft

Navigate Your Kindle (2nd Generation)

Bulgarian Math Olympiads with a Challenge Twist

ProCo 2017 Novice Division Round 1

The Number Plane THE NUMBER PLANE PASSPORT.

Written test, 25 problems / 90 minutes

TASK CSS HISTOGRAMI MOSTOVI NIZOVI. time limit 5 seconds 1 second 1 second 1 second. memory limit 256 MB 256 MB 256 MB 256 MB. points

A theme park charges $12 entry to visitors. Find the money taken if 1296 people visit the park.

CONDITION CONTROLLED LOOPS. Introduction to Programming - Python

PLU February 2013 Programming Contest. Advanced Problems

1. Alicia tosses 3 fair coins. What is the probability that she gets at 1. least 1 head? Express your answer as a common fraction.

for Middle School

Problem Set 6. Part A:

UNIVERSITY OF CALIFORNIA Department of Electrical Engineering and Computer Sciences Computer Science Division. Programming Problems

Using Genetic Algorithms to Solve the Box Stacking Problem

Solving Minesweeper Using CSP

PRE-ALGEBRA BY MYRL SHIREMAN

ACM ICPC 7th Sharif Internet Contest & Internal Selection Contest of Sharif

Pacific Northwest Region Programming Contest Division 2

Mill Hill School. 13+ Entrance Examination Mathematics. January Time: 1 hour. School: Mark: Materials required for examination

2016 ACM ICPC Southeast USA Regional Programming Contest. Division 1

Introduction to Fall 2008 Artificial Intelligence Midterm Exam

ACM ICPC Dhaka Regional Online Preliminary Contest th October 2018 You get 13 Pages 10 Problems

There are three questions on this exam. You have 2 hours to complete it. Please indent your program so that it is easy for the grader to read.

Chapter 2. The Algorithmic Foundations of. Computer Science INVITATION TO. Computer Science. Tuesday, September 10, 13

1.4 MULTIPLYING WHOLE NUMBER EXPRESSIONS

Nacre Software Services. Enhancing Employability of Fresh Grads

Problem Y A limit 1 second. Zigzag

Algebra II. Slide 1 / 179. Slide 2 / 179. Slide 3 / 179. Rational Expressions & Equations. Table of Contents

4 ' MATHCOUNTS National Competition Sprint Round Problems 1-30 DO NOT BEGIN UNTIL YOU ARE INSTRUCTED TO DO SO.

ASSIGNMENT 2. COMP-202A, Fall 2011, All Sections. Due: Monday, October 17th, 2011 (23:30)

2015 Canadian Computing Competition: Junior Division. Sponsor:

ICPC/CCPC Trial Round #2 East China Normal University, September 12, 2018

Problems Overview. The 2015 Asia ACM-ICPC Hanoi Regional Contest. Note: The input and output for all the problems are standard input and output.

Taking Apart Numbers and Shapes

Transcription:

Medallia Argentina Inter 1 minutes Question - 1 Field fencing A rectangular field is to be fenced. The north side is meters long and the area of the field is 68 squared meters. How many meters of fencing will be required, if we were to fence all but the north side? 4 68 88 18 Question - Q, R & T Q is as much younger than R as he is older than T. If the sum of the ages of R and T is 5 years, what is definitely the difference between R and Q's age? 1 year years 5 years Data inadequate None of these Question - 4 children group You have to select 4 children from a group of 6 boys and 4 girls. In how many ways can this be done such that at least 1 boy is part of the selected group (without taking the order into account)? 159 194

5 9 Question - 4 Anagram Party We are given a word and n phrases. We need to find out how many anagrams of that word exist in each phrase. 1 n 1 word 1 All words are lowercase Special character other than letters and numbers are: spaces, dot, comma. Complete a function named amountofanagrams which takes a single string (word) and an array of strings (phrases) as parameters. Return an integer array denoting the amount of anagrams in each phrase. word word is drow when dwor nothing to see here Sample Input dormitory dirty room dirtyroom room is dirty Sample Output 1 Question - 5 Climbing stairs

You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or steps. In how many distinct ways can you climb to the top? 1 n Complete a function named waystoclimb which takes a single integer (n) as a parameter. Return a single integer denoting the amount of distinct ways to climb the n stairs. Explanation Sample 1 You can climb stairs in two different ways: [1, 1] or []. Sample Input 1 Sample Output 89 Question - 6 IronMan IronMan is ready for battle! He starts his battle at location moves in 1-unit increments toward his final showdown at location n 1. Each location i has a power value, p. i If p i <, then there is an enemy at location i that he must lose p i power to beat; if p i, then he will restore p i power at location i. IronMan dies if his armor charge becomes < 1 at any point either during or after a fight, so he needs a proper initial charge to survive all possible fights in his battle traveling from location to location n 1. Help him find the minimum charge needed to survive all fights in the battle! Complete the ironman function in your editor. It has 1 parameter: an array of n integers, p, where each index i ( i < n) describes the power charge lost or gained at battle location i. If the value at some p i <, it represents the amount of charge IronMan must deplete to defeat the enemy; otherwise, it represents the amount of charge that he can restore at that location. Your function must return an integer denoting the minimum starting charge IronMan needs to survive all fights. The locked stub code in your editor reads the following input from stdin and passes it to your function: The first line contains an integer, n, denoting number of

locations IronMan will pass through. Each line i of the n subsequent lines (where i < n) contains an integer describing the amount of charge he will gain or lose at battle location i. 1 n 15 1 pi 1 Your function must return an integer denoting the minimum amount of charge IronMan will need to survive all fights in the battle. This is printed to stdout by the locked stub code in your editor. Sample Input The following argument is passed to your function: p = {-5, 4, -,, 1, -1, -6, -1,, 5} Sample output 8 The following argument is passed to your function: p = { 5,4,,, 1} Sample output 1 6 Sample Input The following argument is passed to your function: p = { 5, 4,,, 1, 1, 6, 1,, 5} Sample Output 1 Explanation Sample Case : If IronMan's initial charge < 8, then he will die somewhere in the middle of his battle. Thus, we return 8 as the minimum charge needed to survive the battle. Question - 7 Two operations You are given only two operations, ADD_1 and MULTIPLY_. You start from and using the two operations reach a number N. Find the least number of operations needed to do this. : The first line will contain an integer T that gives the number of test cases. There will be one integer N on each of the following T lines. Return an integer array denoting the minimum number of operations needed in each test case.

T 1, N 1 16 Sample Input 5 Sample Output 4 Explanation Case1: To reach 5 from. We do ADD1 then Multiply two times and then add 1 again, total 4 steps Case: To reach from. We can either do Add 1 times or Add 1, multiply and again add 1 Question - 8 Array Game Jessica has an array, numbers, consisting of n integers. She plays a game with this array where, in each move, she selects (n 1) elements and increments their values by one. For example, if n = 4, she chooses of the 4 elements during each move and increments each of their values by one. Jessica wants to know the minimum number of moves required to make all of the array's elements equal. Complete the countmoves function in your editor. It has 1 parameter: an array of integers, numbers. It must return a long integer denoting the minimum number of moves required for all elements to be equal. The locked stub code in your editor reads the following input from stdin and passes it to your function: The first line contains an integer, n, denoting the size of the numbers array. Each line i of the n subsequent lines (where i < n) contains an integer describing numbers. i 5 1 n 1 6 1 numbers i 1, where numbers i is th the i element of the numbers array. Your function must return a long integer denoting the minimum number of moves required for Jessica to make all elements of the array equal. This is printed to stdout by the locked stub code in your editor. 1

Explanation 1 Initially, numbers = [1,, ]. Jessica makes the following moves: 1. Increments the values corresponding to indices in the set {, 1}, so the array becomes [,, ].. Increments the values corresponding to indices in the set {, 1}, so the array becomes [, 4, ].. Increments the values corresponding to indices in the set {, }, so the array becomes [4, 4, 4]. Recall that the set of indices updated during each move must be of size n 1. It took a minimal three moves to make all elements in the array equal, so we return. Sample Input Sample Output Explanation Initially, numbers = [,, ]. Because all of its elements are already equal, no moves are required and we return. Question - 9 Fun with palindromes Problem Statement A palindrome is a word, phrase, number, or other sequence of characters which reads the same forward and backwards. For example: "madam" and "dad" are palindromes, but "sir" and "sad" are not. The fun score for two subsequences(not substrings), A and B, in string s is the product of their respective lengths. There are many ways to choose A and B, but your goal is to maximize the fun score. There can't be any overlap or crossover between the two subsequences. Given string s, select exactly two non-overlapping noncrossing-over palindromic subsequences, A and B, from s to maximize the fun score. Non crossing over means that given the string aababb, you can't get aaa and bbb, since the subsequences cross over.

1 < s s is composed of lowercase English characters. Complete a function named funpal which takes a single string (s) as a parameter. Return a single integer denoting the maximum possible fun score for s. Sample Input acdapmpomp Sample Output 15 axbawbaseksqke 5 Explanation Sample Case You can select A= aca and B= pmpmp. The product is * 5 = 15, so we return 15. Sample Case 1 You can select A= ababa and B= ekske. The product is 5 * 5 = 5, so we print 5. Another possible solution is A= ababa and B= ekqke which also yields the answer 5.