Загрузка...

Richie Rich (CHFRICH) CodeChef Complete C++ solution - June Lunch time 2021 - cpp programming

Richie Rich (CHFRICH) Problem link : https://www.codechef.com/LTIME97C/problems/CHFRICH DSA Course link: https://www.codechef.com/certification/data-structures-and-algorithms/prepare Hi, thanks for watching our video about Arrays in C++ In this video we’ll walk you through: - simple maths - solved the problem live - Solution TIMESTAMPS 0:00 Intro 1:40 Explanation begins 08:25 IDE solution ABOUT OUR CHANNEL Our channel is all about Programming. We cover lots of cool stuff such as solution to problems, concept explanation and tricks to master CP Check out our channel here: https://www.youtube.com/channel/UCqtYay7YwH8JdZxDqpVEPvg Don’t forget to subscribe! CHECK OUT OUR OTHER Playlists GeeksforGeeks playlist: https://youtube.com/playlist?list=PLDaU_TBYXoirv-848r81oHLSArcBrjIe7 Complete C++ Course playlist: https://youtube.com/playlist?list=PLDaU_TBYXoio9L1qRpTrtzK9JJAwFLMSj CodeChef Playlist: https://youtube.com/playlist?list=PLDaU_TBYXoip_JFIo0U-Nl2dNA_ZMsd2z LeetCode problems https://youtube.com/playlist?list=PLDaU_TBYXoirsirbg6feNCKk3oPRn6M7w HackerRank playlist: https://youtube.com/playlist?list=PLDaU_TBYXoirMjgzW59T_XMyT5yRZ7ht_ FIND US AT https://www.waadanibhao.wordpress.com GET IN TOUCH Contact us on hopesalivenow@gmail.com Chef aims to be the richest person in Chefland by his new restaurant franchise. Currently, his assets are worth A billion dollars and have no liabilities. He aims to increase his assets by X billion dollars per year. Also, all the richest people in Chefland are not planning to grow and maintain their current worth. To be the richest person in Chefland, he needs to be worth at least B billion dollars. How many years will it take Chef to reach his goal if his value increases by X billion dollars each year? Input The first line contains an integer T, the number of test cases. Then the test cases follow. Each test case contains a single line of input, three integers A, B, X. Output For each test case, output in a single line the answer to the problem. Constraints 1 ≤ T ≤ 21 000 100 ≤ A less than B ≤ 200 1 ≤ X ≤ 50 X divides B − A Subtasks Subtask #1 (100 points): Original constraints Sample Input 3 100 200 10 111 199 11 190 200 10 Sample Output 10 8 1 Explanation Test Case 1: Chef needs to increase his worth by 200−100=100 billion dollars and his increment per year being 10 billion dollars, so it will take him 10010=10 years to do so. Test Case 2: Chef needs to increase his worth by 199−111=88 billion dollars and his increment per year being 11 billion dollars, so it will take him 8811=8 years to do so. Test Case 3: Chef needs to increase his worth by 200−190=10 billion dollars and his increment per year being 10 billion dollars, so it will take him 1010=1 year to do so. All submissions for this problem are available. Author: daanish_adm Editorial: https://discuss.codechef.com/problems/CHFRICH Video Editorial:New! https://youtu.be/fYxwsep6GQI Tags: cakewalk, daanish_adm, ltime97, math Update this setting in edit profile Date Added: 10-06-2021 Time Limit: 0.5 secs Source Limit: 50000 Bytes Languages: CPP14, C, JAVA, PYTH 3.6, CPP17, PYTH, PYP3, CS2, ADA, PYPY, TEXT, PAS fpc, NODEJS, RUBY, PHP, GO, HASK, TCL, PERL, SCALA, LUA, kotlin, BASH, JS, LISP sbcl, rust, PAS gpc, BF, CLOJ, R, D, CAML, FORT, ASM, swift, FS, WSPC, LISP clisp, SQL, SCM guile, PERL6, ERL, CLPS, ICK, NICE, PRLG, ICON, COB, SCM chicken, PIKE, SCM qobi, ST, SQLQ, NEM Submit (Practice)

Видео Richie Rich (CHFRICH) CodeChef Complete C++ solution - June Lunch time 2021 - cpp programming автора Kotlin Реактивное Программирование
Страницу в закладки Мои закладки
Все заметки Новая заметка Страницу в заметки