text
stringlengths
424
69.5k
### Prompt Construct a Cpp code solution to the problem outlined: You have N items that you want to put them into a knapsack. Item i has value vi and weight wi. You want to find a subset of items to put such that: * The total value of the items is as large as possible. * The items have combined weight at most W, th...
### Prompt Create a solution in cpp for the following problem: Sereja and Dima play a game. The rules of the game are very simple. The players have n cards in a row. Each card contains a number, all numbers on the cards are distinct. The players take turns, Sereja moves first. During his turn a player can take one ca...
### Prompt Please create a solution in cpp to the following problem: John Doe has recently found a "Free Market" in his city β€” that is the place where you can exchange some of your possessions for other things for free. John knows that his city has n items in total (each item is unique). You can bring any number of...
### Prompt Your challenge is to write a Cpp solution to the following problem: Having stayed home alone, Petya decided to watch forbidden films on the Net in secret. "What ungentlemanly behavior!" β€” you can say that, of course, but don't be too harsh on the kid. In his country films about the Martians and other extra...
### Prompt Construct a Cpp code solution to the problem outlined: Authors guessed an array a consisting of n integers; each integer is not less than 2 and not greater than 2 β‹… 10^5. You don't know the array a, but you know the array b which is formed from it with the following sequence of operations: 1. Firstly, l...
### Prompt Your challenge is to write a cpp solution to the following problem: Valera's finally decided to go on holiday! He packed up and headed for a ski resort. Valera's fancied a ski trip but he soon realized that he could get lost in this new place. Somebody gave him a useful hint: the resort has n objects (we ...
### Prompt Construct a Cpp code solution to the problem outlined: ICPC Calculator In mathematics, we usually specify the order of operations by using parentheses. For example, 7 Γ— (3 + 2) always means multiplying 7 by the result of 3 + 2 and never means adding 2 to the result of 7 Γ— 3. However, there are people who ...
### Prompt Your challenge is to write a Cpp solution to the following problem: Petya loves lucky numbers very much. Everybody knows that lucky numbers are positive integers whose decimal record contains only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not. Petya loves long ...
### Prompt Construct a Cpp code solution to the problem outlined: Twilight Sparkle once got a crystal from the Crystal Mine. A crystal of size n (n is odd; n > 1) is an n Γ— n matrix with a diamond inscribed into it. You are given an odd integer n. You need to draw a crystal of size n. The diamond cells of the matrix...
### Prompt Please create a solution in cpp to the following problem: Note that girls in Arpa’s land are really attractive. Arpa loves overnight parties. In the middle of one of these parties Mehrdad suddenly appeared. He saw n pairs of friends sitting around a table. i-th pair consisted of a boy, sitting on the ai-t...
### Prompt Construct a cpp code solution to the problem outlined: You are given two strings s and t, both consisting only of lowercase Latin letters. The substring s[l..r] is the string which is obtained by taking characters s_l, s_{l + 1}, ..., s_r without changing the order. Each of the occurrences of string a in...
### Prompt Please provide a Cpp coded solution to the problem described below: There is an integer sequence A of length N whose values are unknown. Given is an integer sequence B of length N-1 which is known to satisfy the following: B_i \geq \max(A_i, A_{i+1}) Find the maximum possible sum of the elements of A. ...
### Prompt Please provide a Cpp coded solution to the problem described below: You are given a board of size n Γ— n, where n is odd (not divisible by 2). Initially, each cell of the board contains one figure. In one move, you can select exactly one figure presented in some cell and move it to one of the cells sharing...
### Prompt Develop a solution in CPP to the problem described below: Π‘ity N. has a huge problem with roads, food and IT-infrastructure. In total the city has n junctions, some pairs of them are connected by bidirectional roads. The road network consists of n - 1 roads, you can get from any junction to any other one b...
### Prompt Please formulate a Cpp solution to the following problem: This is a simplified version of the task Toy Train. These two versions differ only in the constraints. Hacks for this version are disabled. Alice received a set of Toy Trainβ„’ from Bob. It consists of one train and a connected railway network of n s...
### Prompt Please formulate a CPP solution to the following problem: Mike has a string s consisting of only lowercase English letters. He wants to change exactly one character from the string so that the resulting one is a palindrome. A palindrome is a string that reads the same backward as forward, for example str...
### Prompt Please create a solution in cpp to the following problem: Doubly linked list is one of the fundamental data structures. A doubly linked list is a sequence of elements, each containing information about the previous and the next elements of the list. In this problem all lists have linear structure. I.e. eac...
### Prompt Construct a CPP code solution to the problem outlined: Ayush, Ashish and Vivek are busy preparing a new problem for the next Codeforces round and need help checking if their test cases are valid. Each test case consists of an integer n and two arrays a and b, of size n. If after some (possibly zero) opera...
### Prompt Please create a solution in cpp to the following problem: If the strings are consecutive, you can replace the characters with a rule to shorten the string. For example, for the string AAAA, the expression @ 4A will compress one character. Create a program that restores the character string compressed by th...
### Prompt Your challenge is to write a cpp solution to the following problem: Arkady needs your help again! This time he decided to build his own high-speed Internet exchange point. It should consist of n nodes connected with minimum possible number of wires into one network (a wire directly connects two nodes). Exa...
### Prompt Generate a cpp solution to the following problem: Furik loves writing all sorts of problems, especially such that he can't solve himself. You've got one of his problems, the one Furik gave to Rubik. And Rubik asks you to solve it. There is integer n and array a, consisting of ten integers, indexed by numb...
### Prompt Construct a Cpp code solution to the problem outlined: Several days ago you bought a new house and now you are planning to start a renovation. Since winters in your region can be very cold you need to decide how to heat rooms in your house. Your house has n rooms. In the i-th room you can install at most ...
### Prompt Your challenge is to write a cpp solution to the following problem: You are given n points on a plane. All points are different. Find the number of different groups of three points (A, B, C) such that point B is the middle of segment AC. The groups of three points are considered unordered, that is, if p...
### Prompt Generate a CPP solution to the following problem: Some natural number was written on the board. Its sum of digits was not less than k. But you were distracted a bit, and someone changed this number to n, replacing some digits with others. It's known that the length of the number didn't change. You have to...
### Prompt Construct a cpp code solution to the problem outlined: Finally Fox Ciel arrived in front of her castle! She have to type a password to enter her castle. An input device attached to her castle is a bit unusual. The input device is a 1 Γ— n rectangle divided into n square panels. They are numbered 1 to n fr...
### Prompt Construct a Cpp code solution to the problem outlined: The project of a data center of a Big Software Company consists of n computers connected by m cables. Simply speaking, each computer can be considered as a box with multiple cables going out of the box. Very Important Information is transmitted along e...
### Prompt Please formulate a Cpp solution to the following problem: Takahashi wants to be a member of some web service. He tried to register himself with the ID S, which turned out to be already used by another user. Thus, he decides to register using a string obtained by appending one character at the end of S as...
### Prompt Generate a CPP solution to the following problem: Kenkoooo found a simple connected graph. The vertices are numbered 1 through n. The i-th edge connects Vertex u_i and v_i, and has a fixed integer s_i. Kenkoooo is trying to write a positive integer in each vertex so that the following condition is satisfi...
### Prompt Develop a solution in CPP to the problem described below: In a far away kingdom young pages help to set the table for the King. As they are terribly mischievous, one needs to keep an eye on the control whether they have set everything correctly. This time the royal chef Gerasim had the impression that the ...
### Prompt Please create a solution in CPP to the following problem: This problem is different from the hard version. In this version Ujan makes exactly one exchange. You can hack this problem only if you solve both problems. After struggling and failing many times, Ujan decided to try to clean up his house again. H...
### Prompt Create a solution in cpp for the following problem: Everyone knows that hobbits love to organize all sorts of parties and celebrations. There are n hobbits living in the Shire. They decided to organize the Greatest Party (GP) that would last for several days. Next day the hobbits wrote a guest list, some n...
### Prompt Please create a solution in Cpp to the following problem: Reforms have started in Berland again! At this time, the Parliament is discussing the reform of the calendar. To make the lives of citizens of Berland more varied, it was decided to change the calendar. As more and more people are complaining that "...
### Prompt In cpp, your task is to solve the following problem: Now Serval is a junior high school student in Japari Middle School, and he is still thrilled on math as before. As a talented boy in mathematics, he likes to play with numbers. This time, he wants to play with numbers on a rooted tree. A tree is a con...
### Prompt Please formulate a Cpp solution to the following problem: A flower shop has got n bouquets, and the i-th bouquet consists of ai flowers. Vasya, the manager of the shop, decided to make large bouquets from these bouquets. Vasya thinks that a bouquet is large if it is made of two or more initial bouquets, ...
### Prompt Construct a Cpp code solution to the problem outlined: The supercomputer system L in the PCK Research Institute performs a variety of calculations upon request from external institutes, companies, universities and other entities. To use the L system, you have to reserve operation time by specifying the sta...
### Prompt Please formulate a CPP solution to the following problem: There will be a launch of a new, powerful and unusual collider very soon, which located along a straight line. n particles will be launched inside it. All of them are located in a straight line and there can not be two or more particles located in t...
### Prompt Create a solution in cpp for the following problem: Fox Ciel is playing a card game with her friend Fox Jiro. There are n piles of cards on the table. And there is a positive integer on each card. The players take turns and Ciel takes the first turn. In Ciel's turn she takes a card from the top of any non...
### Prompt Develop a solution in CPP to the problem described below: Devu is a dumb guy, his learning curve is very slow. You are supposed to teach him n subjects, the ith subject has ci chapters. When you teach him, you are supposed to teach all the chapters of a subject continuously. Let us say that his initial pe...
### Prompt Your challenge is to write a CPP solution to the following problem: You are given n positive integers a_1, …, a_n, and an integer k β‰₯ 2. Count the number of pairs i, j such that 1 ≀ i < j ≀ n, and there exists an integer x such that a_i β‹… a_j = x^k. Input The first line contains two integers n and k (2 ≀...
### Prompt Your task is to create a Cpp solution to the following problem: You are given an array a consisting of n positive integers. You pick two integer numbers l and r from 1 to n, inclusive (numbers are picked randomly, equiprobably and independently). If l > r, then you swap values of l and r. You have to calcu...
### Prompt In Cpp, your task is to solve the following problem: Limak is a little polar bear. He doesn't have many toys and thus he often plays with polynomials. He considers a polynomial valid if its degree is n and its coefficients are integers not exceeding k by the absolute value. More formally: Let a0, a1, ......
### Prompt Construct a cpp code solution to the problem outlined: Polycarp is crazy about round numbers. He especially likes the numbers divisible by 10k. In the given number of n Polycarp wants to remove the least number of digits to get a number that is divisible by 10k. For example, if k = 3, in the number 30020 ...
### Prompt In Cpp, your task is to solve the following problem: We have a tree with N vertices numbered 1 to N. The i-th edge in the tree connects Vertex u_i and Vertex v_i, and its length is w_i. Your objective is to paint each vertex in the tree white or black (it is fine to paint all vertices the same color) so th...
### Prompt Develop a solution in Cpp to the problem described below: The only difference between easy and hard versions is constraints. The BerTV channel every day broadcasts one episode of one of the k TV shows. You know the schedule for the next n days: a sequence of integers a_1, a_2, ..., a_n (1 ≀ a_i ≀ k), wher...
### Prompt In Cpp, your task is to solve the following problem: The Oak has n nesting places, numbered with integers from 1 to n. Nesting place i is home to b_i bees and w_i wasps. Some nesting places are connected by branches. We call two nesting places adjacent if there exists a branch between them. A simple path ...
### Prompt Please create a solution in cpp to the following problem: A star is a figure of the following type: an asterisk character '*' in the center of the figure and four rays (to the left, right, top, bottom) of the same positive length. The size of a star is the length of its rays. The size of a star must be a p...
### Prompt Your task is to create a cpp solution to the following problem: You are an all-powerful being and you have created a rectangular world. In fact, your world is so bland that it could be represented by a r Γ— c grid. Each cell on the grid represents a country. Each country has a dominant religion. There are o...
### Prompt Construct a CPP code solution to the problem outlined: The Smart Beaver from ABBYY started cooperating with the Ministry of Defence. Now they train soldiers to move armoured columns. The training involves testing a new type of tanks that can transmit information. To test the new type of tanks, the training...
### Prompt Please create a solution in cpp to the following problem: There are 2N squares arranged from left to right. You are given a string of length 2N representing the color of each of the squares. The color of the i-th square from the left is black if the i-th character of S is `B`, and white if that character ...
### Prompt Please formulate a Cpp solution to the following problem: There are N slimes lining up from left to right. The colors of these slimes will be given as a string S of length N consisting of lowercase English letters. The i-th slime from the left has the color that corresponds to the i-th character of S. Adj...
### Prompt Your challenge is to write a Cpp solution to the following problem: You are given an undirected connected graph with weighted edges. The length of some path between two vertices is the bitwise xor of weights of all edges belonging to this path (if some edge is traversed more than once, then it is included ...
### Prompt Generate a CPP solution to the following problem: Top-model Izabella participates in the competition. She wants to impress judges and show her mathematical skills. Her problem is following: for given string, consisting of only 0 and 1, tell if it's possible to remove some digits in such a way, that remain...
### Prompt Develop a solution in cpp to the problem described below: There are n emotes in very popular digital collectible card game (the game is pretty famous so we won't say its name). The i-th emote increases the opponent's happiness by a_i units (we all know that emotes in this game are used to make opponents ha...
### Prompt Create a solution in CPP for the following problem: Takahashi has a string S of length N consisting of lowercase English letters. On this string, he will perform the following operation K times: * Let T be the string obtained by reversing S, and U be the string obtained by concatenating S and T in this or...
### Prompt Develop a solution in CPP to the problem described below: This winter is so cold in Nvodsk! A group of n friends decided to buy k bottles of a soft drink called "Take-It-Light" to warm up a bit. Each bottle has l milliliters of the drink. Also they bought c limes and cut each of them into d slices. After t...
### Prompt Please provide a Cpp coded solution to the problem described below: The warehouse in your shop has n shoe pairs. Each pair is characterized by two integers: its price ci and its size si. We know that on this very day all numbers si are different, that is, there is no more than one pair of each size. The s...
### Prompt Create a solution in CPP for the following problem: C: Namo .. Cut problem -Defeat the mysterious giant jellyfish, codenamed "Nari"- "Nari" has a very strong vitality, so if you don't keep cutting quickly, it will be revived in a blink of an eye. We are making trial and error every day to find out how t...
### Prompt In cpp, your task is to solve the following problem: Harry Potter has a difficult homework. Given a rectangular table, consisting of n Γ— m cells. Each cell of the table contains the integer. Harry knows how to use two spells: the first spell change the sign of the integers in the selected row, the second β€”...
### Prompt Your task is to create a CPP solution to the following problem: Drazil has many friends. Some of them are happy and some of them are unhappy. Drazil wants to make all his friends become happy. So he invented the following plan. There are n boys and m girls among his friends. Let's number them from 0 to n ...
### Prompt Your challenge is to write a CPP solution to the following problem: You have n coins, each of the same value of 1. Distribute them into packets such that any amount x (1 ≀ x ≀ n) can be formed using some (possibly one or all) number of these packets. Each packet may only be used entirely or not used at a...
### Prompt Generate a Cpp solution to the following problem: Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. Const...
### Prompt Your challenge is to write a CPP solution to the following problem: Alice, Bob and Charlie are playing Card Game for Three, as below: * At first, each of the three players has a deck consisting of some number of cards. Each card has a letter `a`, `b` or `c` written on it. The orders of the cards in the de...
### Prompt Create a solution in cpp for the following problem: Eighth-grader Vova is on duty today in the class. After classes, he went into the office to wash the board, and found on it the number n. He asked what is this number and the teacher of mathematics Inna Petrovna answered Vova that n is the answer to the a...
### Prompt Develop a solution in CPP to the problem described below: Alice and Bob decided to eat some fruit. In the kitchen they found a large bag of oranges and apples. Alice immediately took an orange for herself, Bob took an apple. To make the process of sharing the remaining fruit more fun, the friends decided t...
### Prompt Please create a solution in CPP to the following problem: For two sequences S and T of length N consisting of 0 and 1, let us define f(S, T) as follows: * Consider repeating the following operation on S so that S will be equal to T. f(S, T) is the minimum possible total cost of those operations. * Change...
### Prompt Your challenge is to write a Cpp solution to the following problem: A positive integer is called composite if it can be represented as a product of two positive integers, both greater than 1. For example, the following numbers are composite: 6, 4, 120, 27. The following numbers aren't: 1, 2, 3, 17, 97. Al...
### Prompt Generate a Cpp solution to the following problem: For his computer science class, Jacob builds a model tree with sticks and balls containing n nodes in the shape of a tree. Jacob has spent ai minutes building the i-th ball in the tree. Jacob's teacher will evaluate his model and grade Jacob based on the e...
### Prompt Develop a solution in Cpp to the problem described below: There are some beautiful girls in Arpa’s land as mentioned before. Once Arpa came up with an obvious problem: Given an array and a number x, count the number of pairs of indices i, j (1 ≀ i < j ≀ n) such that <image>, where <image> is bitwise xor ...
### Prompt Develop a solution in Cpp to the problem described below: Vasya is developing his own programming language VPL (Vasya Programming Language). Right now he is busy making the system of exceptions. He thinks that the system of exceptions must function like that. The exceptions are processed by try-catch-bloc...
### Prompt Develop a solution in CPP to the problem described below: Apart from Nian, there is a daemon named Sui, which terrifies children and causes them to become sick. Parents give their children money wrapped in red packets and put them under the pillow, so that when Sui tries to approach them, it will be driven...
### Prompt Generate a Cpp solution to the following problem: You are given n Γ— m table. Each cell of the table is colored white or black. Find the number of non-empty sets of cells such that: 1. All cells in a set have the same color. 2. Every two cells in a set share row or column. Input The first line of i...
### Prompt Generate a CPP solution to the following problem: Write a program which reads three integers a, b and c, and prints "Yes" if a < b < c, otherwise "No". Constraints * 0 ≀ a, b, c ≀ 100 Input Three integers a, b and c separated by a single space are given in a line. Output Print "Yes" or "No" in a line...
### Prompt Please provide a cpp coded solution to the problem described below: Lenny is playing a game on a 3 Γ— 3 grid of lights. In the beginning of the game all lights are switched on. Pressing any of the lights will toggle it and all side-adjacent lights. The goal of the game is to switch all the lights off. We co...
### Prompt Develop a solution in cpp to the problem described below: One day, Snuke was given a permutation of length N, a_1, a_2, ..., a_N, from his friend. Find the following: <image> Constraints * 1 ≦ N ≦ 200,000 * (a_1, a_2, ..., a_N) is a permutation of (1, 2, ..., N). Input The input is given from Standar...
### Prompt Please create a solution in Cpp to the following problem: Once again Tavas started eating coffee mix without water! Keione told him that it smells awful, but he didn't stop doing that. That's why Keione told his smart friend, SaDDas to punish him! SaDDas took Tavas' headphones and told him: "If you solve t...
### Prompt Develop a solution in cpp to the problem described below: In a far away galaxy there are n inhabited planets, numbered with numbers from 1 to n. They are located at large distances from each other, that's why the communication between them was very difficult until on the planet number 1 a hyperdrive was in...
### Prompt Create a solution in cpp for the following problem: Two neighbours, Alan and Bob, live in the city, where there are three buildings only: a cinema, a shop and the house, where they live. The rest is a big asphalt square. Once they went to the cinema, and the film impressed them so deeply, that when they ...
### Prompt Your task is to create a cpp solution to the following problem: You've got two rectangular tables with sizes na Γ— ma and nb Γ— mb cells. The tables consist of zeroes and ones. We will consider the rows and columns of both tables indexed starting from 1. Then we will define the element of the first table, lo...
### Prompt Please formulate a Cpp solution to the following problem: Phoenix is picking berries in his backyard. There are n shrubs, and each shrub has a_i red berries and b_i blue berries. Each basket can contain k berries. But, Phoenix has decided that each basket may only contain berries from the same shrub or be...
### Prompt Develop a solution in cpp to the problem described below: Print a sequence a_1, a_2, ..., a_N whose length is N that satisfies the following conditions: * a_i (1 \leq i \leq N) is a prime number at most 55 555. * The values of a_1, a_2, ..., a_N are all different. * In every choice of five different integ...
### Prompt Please provide a Cpp coded solution to the problem described below: On the Literature lesson Sergei noticed an awful injustice, it seems that some students are asked more often than others. Seating in the class looks like a rectangle, where n rows with m pupils in each. The teacher asks pupils in the fo...
### Prompt Develop a solution in CPP to the problem described below: A tetromino is a figure formed by joining four squares edge to edge. We will refer to the following seven kinds of tetromino as I-, O-, T-, J-, L-, S- and Z-tetrominos, respectively: a60bcb8e9e8f22e3af51049eda063392.png Snuke has many tetrominos. ...
### Prompt Generate a cpp solution to the following problem: Note that the only difference between String Transformation 1 and String Transformation 2 is in the move Koa does. In this version the letter y Koa selects must be strictly greater alphabetically than x (read statement for better understanding). You can mak...
### Prompt Develop a solution in cpp to the problem described below: Let's solve the geometric problem Mr. A is still solving geometric problems today. It is important to be aware of floating point errors when solving geometric problems. Floating-point error is the error caused by the rounding that occurs when repr...
### Prompt Generate a Cpp solution to the following problem: You are playing a game and your goal is to maximize your expected gain. At the beginning of the game, a pawn is put, uniformly at random, at a position p\in\\{1,2,\dots, N\\}. The N positions are arranged on a circle (so that 1 is between N and 2). The gam...
### Prompt Your challenge is to write a cpp solution to the following problem: Bessie is out grazing on the farm, which consists of n fields connected by m bidirectional roads. She is currently at field 1, and will return to her home at field n at the end of the day. The Cowfederation of Barns has ordered Farmer Joh...
### Prompt In cpp, your task is to solve the following problem: You are given an undirected graph that consists of n vertices and m edges. Initially, each edge is colored either red or blue. Each turn a player picks a single vertex and switches the color of all edges incident to it. That is, all red edges with an end...
### Prompt Please create a solution in CPP to the following problem: Vasya wants to buy a new refrigerator. He believes that a refrigerator should be a rectangular parallelepiped with integer edge lengths. Vasya calculated that for daily use he will need a refrigerator with volume of at least V. Moreover, Vasya is a ...
### Prompt Create a solution in cpp for the following problem: There are n pillars aligned in a row and numbered from 1 to n. Initially each pillar contains exactly one disk. The i-th pillar contains a disk having radius a_i. You can move these disks from one pillar to another. You can take a disk from pillar i and...
### Prompt Generate a Cpp solution to the following problem: You're playing a game called Osu! Here's a simplified version of it. There are n clicks in a game. For each click there are two outcomes: correct or bad. Let us denote correct as "O", bad as "X", then the whole play can be encoded as a sequence of n charact...
### Prompt Your challenge is to write a CPP solution to the following problem: Your program fails again. This time it gets "Wrong answer on test 233" . This is the easier version of the problem. In this version 1 ≀ n ≀ 2000. You can hack this problem only if you solve and lock both problems. The problem is about a...
### Prompt Please provide a CPP coded solution to the problem described below: Little Dima has two sequences of points with integer coordinates: sequence (a1, 1), (a2, 2), ..., (an, n) and sequence (b1, 1), (b2, 2), ..., (bn, n). Now Dima wants to count the number of distinct sequences of points of length 2Β·n that c...
### Prompt Please create a solution in CPP to the following problem: Π‘ity N. has a huge problem with roads, food and IT-infrastructure. In total the city has n junctions, some pairs of them are connected by bidirectional roads. The road network consists of n - 1 roads, you can get from any junction to any other one b...
### Prompt Please formulate a cpp solution to the following problem: Little Petya learns how to write. The teacher gave pupils the task to write the letter A on the sheet of paper. It is required to check whether Petya really had written the letter A. You are given three segments on the plane. They form the letter A...
### Prompt Generate a cpp solution to the following problem: Consider a string with rings on both ends. Rings have positive integers to distinguish them. Rings on both ends of the string have different numbers a and b. Describe this as [a, b]. If there are multiple strings and the number attached to the ring of one s...
### Prompt Create a solution in CPP for the following problem: One beautiful July morning a terrible thing happened in Mainframe: a mean virus Megabyte somehow got access to the memory of his not less mean sister Hexadecimal. He loaded there a huge amount of n different natural numbers from 1 to n to obtain total con...
### Prompt Please provide a Cpp coded solution to the problem described below: Meikyokan University is very famous for its research and education in the area of computer science. This university has a computer center that has advanced and secure computing facilities including supercomputers and many personal computer...
### Prompt Please provide a cpp coded solution to the problem described below: Snuke loves colorful balls. He has a total of NΓ—K balls, K in each of his favorite N colors. The colors are numbered 1 through N. He will arrange all of the balls in a row from left to right, in arbitrary order. Then, for each of the N co...
### Prompt In cpp, your task is to solve the following problem: The Easter Rabbit laid n eggs in a circle and is about to paint them. Each egg should be painted one color out of 7: red, orange, yellow, green, blue, indigo or violet. Also, the following conditions should be satisfied: * Each of the seven colors s...
### Prompt Construct a cpp code solution to the problem outlined: "Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-piz...