当前位置:网站首页>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;
}边栏推荐
- Openlayers draw deletes the last point when drawing
- Clothing ERP | ten advantages of clothing ERP for enterprises
- JS foundation -- task queue and event loop
- Daily three questions 7.19
- List type to string type
- Bgy development small example
- If there is a segment in the encryption field, are you "bronze" or "King"?
- Wechat sports field reservation of the finished works of the applet graduation project (7) mid-term inspection report
- Inheritance (prototype)
- Use pytest + allure to show the chart results (3)
猜你喜欢

mysql_ Record the executed SQL

04 -- two ways of writing el and data

Keil compile download error: no algorithm found for: 08000000h - 08001233h solution
![[Kali's sshd service is enabled]](/img/1b/180534d51049177254e30c4b783eba.png)
[Kali's sshd service is enabled]

JS foundation -- task queue and event loop

Vscode configuration, eslint+prettier combined with detailed configuration steps, standardized development
![[stm32f103rct6] can communication](/img/24/71509bd0d74d43ce4a79b8126478ff.jpg)
[stm32f103rct6] can communication

Wechat sports field reservation of the finished works of the applet graduation project (7) mid-term inspection report

JS written test question -- deep copy of object

Learning notes - talking about the data structure and algorithm of MySQL index and the introduction of index
随机推荐
Resolve the error: org.apache.ibatis.binding.bindingexception
2022-07-19: all factors of F (I): I are added up after each factor is squared. For example, f (10) = 1 square + 2 square + 5 square + 10 square = 1 + 4 + 25 + 100 = 130.
Error: tomee required to support ear/ejb deployment
Experiment 4 CTF practice
Brief understanding of operational amplifier
Common Oracle commands
TypeScript
Wechat sports field reservation of the finished works of the applet graduation project (7) mid-term inspection report
Riotboard development board series notes (VII) -- the use of framebuffer
Pypi counts the number of Downloads
Color space (1) - RGB
JS construction linked list
The difference between abstract classes and interfaces
Dynamic programming -- Digital DP
JS written test question -- browser kernel
Jenkins plug-in development -- plug-in expansion
JS written test -- regular expression
Use of stm32cubemonitor Part II - historical data storage and network access
Page performance: how to optimize pages systematically?
Reasons for not sending requests after uni app packaging