Economics Class Problem Code: ECOCLASS | CodeChef Solution | Python3
Alice has recently learned in her economics class that the market is said to be in equilibrium when the supply is equal to the demand.
Alice has market data for N time points in the form of two integer arrays S and D. Here, Si denotes the supply at the ith point of time and Di denotes the demand at the ith point of time, for each 1≤i≤N.
Help Alice in finding out the number of time points at which the market was in equilibrium.
Input Format
The first line of input will contain an integer T — the number of test cases. The description of T test cases follows.
Each test case contains three lines of input.
The first line of each test case contains an integer N, the length of the arrays S and D.
The second line of each test case contains N space-separated integers S1,S2,…,SN.
The third line of each test case contains N space-separated integers D1,D2,…,DN.
Output Format
For each test case, output the number of time points at which the market was in equilibrium.
Constraints
1≤T≤10
1≤N≤100
1≤Si,Di≤100 for every 1≤i≤N
Sample Input 1
2
4
1 2 3 4
2 1 3 4
4
1 1 2 2
1 2 1 1
Sample Output 1
2
1
Explanation
Test case 1: For i=3 and i=4, we have supply equal to demand, hence the market is in equilibrium.
Test case 2: For i=1, we have supply equal to demand, hence the market is in equilibrium.
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Economics Class Problem Code: ECOCLASS | CodeChef Solution | Python3», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.