ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1324. Extra Spaces

What algorithm is applicable for such problems?
Hi Experts,
  Can you suggest how to approach solving such problems. I am getting no clues at all. Moreover we know nothing about total  number of spaces in the text.

regards
Anupam
Re: What algorithm is applicable for such problems?
Posted by bsu.mmf.team 25 Jan 2011 20:42
If you have a group with N spaces and apply to it the operation, that changes K spaces to one, then the number of spaces will be N/K + N%K. You should output such numbers K[1], K[2], ... , K[m], that for every number N in range [1..L] a sequence of operations N := (N/K[i] + N%K[i]) for each i = 1..m will make the value N equals 1. And then you should maximize the range for N. I guess it is a school problem :)

Edited by author 25.01.2011 20:42

Edited by author 25.01.2011 20:43