2098:【23CSPJ普及组】小苹果(apple)

#include<iostream>
using namespace std;
int main(){
	int n,a,b=0,d;
	cin>>n;
	int c=n;
	while(c!=0){
		a=0;
		for(int i=1;i<=c;i+=3){
			if(i==c && b==0){
				b=d+1;	
			}
			a++;
		}
		c-=a;
		d++;
	}
	cout<<d<<" "<<b;
}

  

posted @ 2024-01-21 08:53  陈若麟  阅读(99)  评论(0编辑  收藏  举报