当前位置:网站首页>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;
}边栏推荐
- JS written test question -- deep copy of object
- The difference between abstract classes and interfaces
- Backtracking to solve combinatorial problems
- # CF #807 Div.2(A - D)
- Wechat sports field reservation of the finished works of the applet graduation project (6) opening defense ppt
- Details of happens before rules
- IO (1) -io layering
- Dynamic planning of force buckle punch in summary
- Learning record Xi
- Beginners must see the markdown User Guide
猜你喜欢

Study notes of filebeat

Mid year summary and personal feelings

Nuscenes data set summary

Learning record Xi

Flume's study notes

05 - MVVM model

Wechat sports field reservation of the finished works of the applet graduation project (6) opening defense ppt

Pypi counts the number of Downloads

Learning notes - talking about the data structure and algorithm of MySQL index and the introduction of index

Technical experts from large factories: Thoughts on cloud nativity and software supply chain security
随机推荐
Daily three questions 7.16
Vscode copy synchronization plug-in expansion
Use pytest + allure to show the chart results (3)
mysql_ Record the executed SQL
Sum of "n" numbers of force deduction summary
Unified return data format
kettle_ Configure database connection_ report errors
Matlab for circular pit
Openlayers draw deletes the last point when drawing
JS written test question -- realize the flat function of array
Hyperchain hyperblockchain Shi Xingguo was interviewed by 36 krypton: the amount of customer cooperation consulting is doubling
mysql_ Backup restore_ Specify table_ Backup table_ Restore table_ innobackup
Implementation principle of virtual DOM
Nuscenes data set summary
Experiment 4 CTF practice
Technical experts from large factories: Thoughts on cloud nativity and software supply chain security
mysql_ User table_ Field meaning
Function of each layer of data warehouse
Js a simple way to store several objects in an array
JS foundation -- object static method