当前位置:网站首页>Test question C: question brushing statistics
Test question C: question brushing statistics
2022-07-25 03:09:00 【Leng Chi】
【 Problem description 】 Xiao Ming decided to brush the questions and prepare for the Blue Bridge Cup competition from next Monday . He plans to... Every day from Monday to Friday do a questions , Do... Every day on Saturdays and Sundays b questions . Please help Xiao Ming calculate , According to the plan, he will be in On the first few days, the number of questions is greater than or equal to n topic ?
【 Input format 】 The input line contains three integers a, b and n.
【 Output format 】 Output an integer representing the number of days .
【 The sample input 】 10 20 99
【 Sample output 】 8
【 Evaluate use case size and conventions 】 about 50% The evaluation case of ,1 ≤ a, b, n ≤ 10^6 . about 100% The evaluation case of ,1 ≤ a, b, n ≤ 10^18
#include<iostream>
using namespace std;
int main()
{
int date1=0;
long long a,b,n;
cin>>a>>b>>n;
while (n>0)
{
for(int i=1;i<=5;i++)
{
if(n<=0)
{
break;
}
n=n-a;
date1++;
}
for(int i=6;i<=7;i++)
{
if(n<=10)
{
break;;
}
n=n-b;
date1++;
}
}
cout<<date1<<endl;
return 0;
}边栏推荐
- Bgy development small example
- Preliminary foundation JVM
- mysql_ User table_ Field meaning
- If there is a segment in the encryption field, are you "bronze" or "King"?
- Brief understanding of operational amplifier
- Learning record Xi
- Read and upgrade st-link chip information and SWD burning media through STM32 stlink utility tool
- Openlayers draw deletes the last point when drawing
- Publish the project online and don't want to open a port
- mysql_ Record the executed SQL
猜你喜欢

mysql_ Master slave synchronization_ Show slave status details

Use reflection to convert RDD to dataframe

Arduino IDE for raspberry PI Pico development firmware localization installation tutorial

Dc-1-practice

PHP record

Learning record 12

Eslint error
![[Kali's sshd service is enabled]](/img/1b/180534d51049177254e30c4b783eba.png)
[Kali's sshd service is enabled]
![[stm32f103rct6] can communication](/img/24/71509bd0d74d43ce4a79b8126478ff.jpg)
[stm32f103rct6] can communication

Arduino + si5351 square wave generator
随机推荐
How is the virtual DOM different from the actual DOM?
Conceptual distinction between Po, Bo, VO, dto and POJO
[stm32f103rct6] motor PWM drive module idea and code
Hyperchain hyperblockchain Shi Xingguo was interviewed by 36 krypton: the amount of customer cooperation consulting is doubling
Use reflection to convert RDD to dataframe
Learning record 10
mysql_ Record the executed SQL
Import and export using poi
04 -- two ways of writing el and data
Recursive and non recursive methods are used to realize the first order, middle order and second order traversal of binary tree respectively
Solve ''_ Xsrf 'argument missing from post
Daily three questions 7.19
ES6 - study notes
MySQL configuration in CDH installation
JS foundation -- regular expression
Learning record XIII
JS written test question -- realize the flat function of array
Dc-1-practice
Use of stm32cubemonitor part I - data plotting and instrument display
Riotboard development board series notes (6) -- buildreoot building system image