#include #include #include using namespace std; int n,l,ans; vectora; void D(int x,int w,string s){ l++; if(l>=s.size())return; if(s[l]=='p'){ w/=4; D(x,w,s);D(x+w,w,s); D(x+w*2,w,s);D(x+w*3,w,s); } else if(s[l]=='f')for(int k=0;k>n; while(cin>>s>>ss){ ans=0; a.clear();a.resize(1024); l=-1;D(0,1024,s); l=-1;D(0,1024,ss); for(auto&k:a)ans+=k; printf("There are %d black pixels.\n",ans); } }