#include<bits/stdc++.h>
using namespace std;
int n,c,s,s1,i;
int main(){
freopen("apple.in","r",stdin);
freopen("apple.out","w",stdout);
scanf("%d",&n);
bool f=0;
while(n){
s++;
c=0;
for(i=1;i<=n;i+=3){
c++;
if(i==n&&f==0){
s1=s;
f=1;
}
}
n-=c;
}
printf("%d %d",s,s1);
return 0;
}
CSP-J-2023 第一题apple 满分代码
最新推荐文章于 2024-08-09 10:25:03 发布